@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
@@ -1,11 +1,17 @@
1
1
  import { createColumnHelper } from '@tanstack/react-table';
2
2
  import { useEffect, useMemo, useRef, useState } from 'react';
3
3
  import { DocumentTextIcon, MapIcon } from '@heroicons/react/24/solid';
4
- import { ArrowDownIcon, ArrowUpIcon, EllipsisVerticalIcon, StarIcon } from '@heroicons/react/24/outline';
4
+ import {
5
+ ArrowDownIcon,
6
+ ArrowTopRightOnSquareIcon,
7
+ ArrowUpIcon,
8
+ EllipsisVerticalIcon,
9
+ StarIcon,
10
+ } from '@heroicons/react/24/outline';
5
11
  import { buildUrl } from '@utils/url-builder';
6
12
  import { getColorAndIconForCollection } from '@utils/collections/icons';
7
13
  import { getCollectionTextColorClass } from '@utils/collection-colors';
8
- import { getBadgeReactStyle } from '@utils/badge-styles';
14
+ import { getBadgeHref, getBadgeReactStyle } from '@utils/badge-styles';
9
15
  import { isIconPath, resolveIconUrl } from '@utils/icon';
10
16
  import { useStore } from '@nanostores/react';
11
17
  import { favoritesStore, toggleFavorite, type FavoriteItem } from '../../../stores/favorites-store';
@@ -15,7 +21,11 @@ import type { TableConfiguration } from '@types';
15
21
  const columnHelper = createColumnHelper<DiscoverTableData>();
16
22
 
17
23
  // Badge cell component (proper React component to use hooks)
18
- const BadgesCell = ({ badges }: { badges: Array<{ content: string; backgroundColor?: string; textColor?: string }> }) => {
24
+ const BadgesCell = ({
25
+ badges,
26
+ }: {
27
+ badges: Array<{ content: string; backgroundColor?: string; textColor?: string; url?: string }>;
28
+ }) => {
19
29
  const [isExpanded, setIsExpanded] = useState(false);
20
30
 
21
31
  if (!badges || badges.length === 0) return <span className="text-xs text-[rgb(var(--ec-icon-color))]">-</span>;
@@ -25,16 +35,28 @@ const BadgesCell = ({ badges }: { badges: Array<{ content: string; backgroundCol
25
35
 
26
36
  return (
27
37
  <div className="flex flex-col gap-1 items-start">
28
- {visibleItems.map((badge, index) => (
29
- <span
30
- key={`${badge.content}-${index}`}
31
- className="inline-flex items-center px-2 py-0.5 text-[11px] font-normal rounded-md max-w-[140px] truncate border border-[rgb(var(--ec-page-border))] text-[rgb(var(--ec-page-text-muted))] bg-transparent"
32
- style={getBadgeReactStyle(badge)}
33
- title={badge.content}
34
- >
35
- {badge.content}
36
- </span>
37
- ))}
38
+ {visibleItems.map((badge, index) => {
39
+ const href = getBadgeHref(badge);
40
+ const className =
41
+ 'inline-flex items-center px-2 py-0.5 text-[11px] font-normal rounded-md max-w-[140px] truncate border border-[rgb(var(--ec-page-border))] text-[rgb(var(--ec-page-text-muted))] bg-transparent';
42
+
43
+ return href ? (
44
+ <a
45
+ key={`${badge.content}-${index}`}
46
+ href={href}
47
+ className={className}
48
+ style={getBadgeReactStyle(badge)}
49
+ title={badge.content}
50
+ >
51
+ <span className="truncate">{badge.content}</span>
52
+ <ArrowTopRightOnSquareIcon className="ml-1 h-3 w-3 shrink-0 opacity-70" aria-hidden="true" />
53
+ </a>
54
+ ) : (
55
+ <span key={`${badge.content}-${index}`} className={className} style={getBadgeReactStyle(badge)} title={badge.content}>
56
+ {badge.content}
57
+ </span>
58
+ );
59
+ })}
38
60
  {hiddenCount > 0 && (
39
61
  <button onClick={() => setIsExpanded(!isExpanded)} className="text-xs text-[rgb(var(--ec-accent))] hover:underline">
40
62
  {isExpanded ? 'less' : `+${hiddenCount}`}
@@ -58,6 +58,7 @@ export type TData<T extends TCollectionTypes> = {
58
58
  backgroundColor: string;
59
59
  textColor: string;
60
60
  icon: any; // Where is it defined?
61
+ url?: string;
61
62
  }>;
62
63
  // ---------------------------------------------------------------------------
63
64
  // Domains
@@ -1,6 +1,7 @@
1
1
  import { createColumnHelper } from '@tanstack/react-table';
2
2
  import { useState } from 'react';
3
- import { getBadgeReactStyle } from '@utils/badge-styles';
3
+ import { ArrowTopRightOnSquareIcon } from '@heroicons/react/20/solid';
4
+ import { getBadgeHref, getBadgeReactStyle } from '@utils/badge-styles';
4
5
  import { filterByBadge } from '../filters/custom-filters';
5
6
  import type { TCollectionTypes, TData } from '../Table';
6
7
  import type { TableConfiguration } from '@types';
@@ -24,16 +25,28 @@ export const createBadgesColumn = <T extends { data: Pick<TData<U>['data'], 'bad
24
25
 
25
26
  return (
26
27
  <div className="flex flex-wrap gap-1 items-center">
27
- {visibleItems.map((badge, index) => (
28
- <span
29
- key={`${badge.id}-${index}`}
30
- className="inline-flex items-center px-2 py-0.5 text-xs font-medium rounded-md border border-[rgb(var(--ec-accent)/0.5)] text-[rgb(var(--ec-page-text))] bg-transparent"
31
- style={getBadgeReactStyle(badge)}
32
- title={badge.content}
33
- >
34
- {badge.content}
35
- </span>
36
- ))}
28
+ {visibleItems.map((badge, index) => {
29
+ const href = getBadgeHref(badge);
30
+ const className =
31
+ 'inline-flex items-center px-2 py-0.5 text-xs font-medium rounded-md border border-[rgb(var(--ec-accent)/0.5)] text-[rgb(var(--ec-page-text))] bg-transparent';
32
+
33
+ return href ? (
34
+ <a
35
+ key={`${badge.id}-${index}`}
36
+ href={href}
37
+ className={className}
38
+ style={getBadgeReactStyle(badge)}
39
+ title={badge.content}
40
+ >
41
+ <span>{badge.content}</span>
42
+ <ArrowTopRightOnSquareIcon className="ml-1 h-3 w-3 shrink-0 opacity-70" aria-hidden="true" />
43
+ </a>
44
+ ) : (
45
+ <span key={`${badge.id}-${index}`} className={className} style={getBadgeReactStyle(badge)} title={badge.content}>
46
+ {badge.content}
47
+ </span>
48
+ );
49
+ })}
37
50
  {hiddenCount > 0 && (
38
51
  <button onClick={() => setIsExpanded(!isExpanded)} className="text-xs text-[rgb(var(--ec-accent))] hover:underline">
39
52
  {isExpanded ? 'less' : `+${hiddenCount}`}
@@ -6,6 +6,7 @@ export const badge = z.object({
6
6
  backgroundColor: z.string(),
7
7
  textColor: z.string(),
8
8
  icon: z.string().optional(),
9
+ url: z.string().optional(),
9
10
  });
10
11
 
11
12
  // Create a union type for owners
@@ -5,6 +5,7 @@ import config from '@config';
5
5
  import { AlignLeftIcon, UserIcon, UsersIcon } from 'lucide-react';
6
6
 
7
7
  import mdxComponents from '@components/MDX/components';
8
+ import Badge from '@components/Badge.astro';
8
9
 
9
10
  import { getOwner } from '@utils/collections/owners';
10
11
  import { buildUrl, buildEditUrlForResource } from '@utils/url-builder';
@@ -117,24 +118,7 @@ const editUrl =
117
118
  badges && badges.length > 0 && (
118
119
  <div class="flex flex-wrap gap-3 py-2">
119
120
  {badges.map((badge: any) => {
120
- return (
121
- <a href={badge.url || '#'}>
122
- <span
123
- id={badge.id || ''}
124
- class={`
125
- inline-flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm font-medium
126
- bg-[rgb(var(--ec-content-hover))] border border-[rgb(var(--ec-page-border))]
127
- text-[rgb(var(--ec-page-text))]
128
- shadow-xs
129
- ${badge.class ? badge.class : ''}
130
- `}
131
- >
132
- {badge.icon && <badge.icon className="w-4 h-4 flex-shrink-0 text-[rgb(var(--ec-icon-color))]" />}
133
- {badge.iconURL && <img src={badge.iconURL} class="w-4 h-4 flex-shrink-0 opacity-80" alt="" />}
134
- <span>{badge.content}</span>
135
- </span>
136
- </a>
137
- );
121
+ return <Badge badge={badge} />;
138
122
  })}
139
123
  </div>
140
124
  )