@eventcatalog/core 3.0.0-beta.24 → 3.0.0-beta.26

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 (61) 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/catalog-to-astro-content-directory.cjs +2 -19
  6. package/dist/catalog-to-astro-content-directory.d.cts +1 -2
  7. package/dist/catalog-to-astro-content-directory.d.ts +1 -2
  8. package/dist/catalog-to-astro-content-directory.js +3 -5
  9. package/dist/{chunk-4UUGLZEP.js → chunk-3YJD7KVJ.js} +1 -1
  10. package/dist/{chunk-ZQX7H4YO.js → chunk-5TB5SKXE.js} +1 -1
  11. package/dist/{chunk-7KD4X5PQ.js → chunk-6VKMP3FH.js} +1 -1
  12. package/dist/{chunk-R2BJ7MJG.js → chunk-6Z6ARMQS.js} +1 -17
  13. package/dist/{chunk-HQW2RZD2.js → chunk-MZTNQHMI.js} +1 -1
  14. package/dist/{chunk-6A3FVZJI.js → chunk-WQFW32XA.js} +1 -1
  15. package/dist/constants.cjs +1 -1
  16. package/dist/constants.js +1 -1
  17. package/dist/eventcatalog.cjs +1 -18
  18. package/dist/eventcatalog.js +7 -10
  19. package/dist/generate.cjs +1 -1
  20. package/dist/generate.js +3 -3
  21. package/dist/utils/cli-logger.cjs +1 -1
  22. package/dist/utils/cli-logger.js +2 -2
  23. package/eventcatalog/src/components/SchemaExplorer/ApiAccessSection.tsx +95 -90
  24. package/eventcatalog/src/components/SchemaExplorer/ApiContentViewer.tsx +144 -0
  25. package/eventcatalog/src/components/SchemaExplorer/Pagination.tsx +34 -8
  26. package/eventcatalog/src/components/SchemaExplorer/SchemaContentViewer.tsx +2 -2
  27. package/eventcatalog/src/components/SchemaExplorer/SchemaDetailsHeader.tsx +140 -109
  28. package/eventcatalog/src/components/SchemaExplorer/SchemaDetailsPanel.tsx +5 -14
  29. package/eventcatalog/src/components/SchemaExplorer/SchemaExplorer.tsx +247 -59
  30. package/eventcatalog/src/components/SchemaExplorer/SchemaFilters.tsx +64 -126
  31. package/eventcatalog/src/components/SchemaExplorer/SchemaListItem.tsx +41 -43
  32. package/eventcatalog/src/components/Search/SearchDataLoader.astro +25 -0
  33. package/eventcatalog/src/components/SideNav/NestedSideBar/SearchBar.tsx +1 -1
  34. package/eventcatalog/src/components/SideNav/NestedSideBar/index.tsx +43 -16
  35. package/eventcatalog/src/components/SideNav/SideNav.astro +0 -15
  36. package/eventcatalog/src/components/Tables/Table.tsx +96 -77
  37. package/eventcatalog/src/components/Tables/columns/ContainersTableColumns.tsx +108 -74
  38. package/eventcatalog/src/components/Tables/columns/DomainTableColumns.tsx +74 -55
  39. package/eventcatalog/src/components/Tables/columns/FlowTableColumns.tsx +36 -36
  40. package/eventcatalog/src/components/Tables/columns/MessageTableColumns.tsx +110 -77
  41. package/eventcatalog/src/components/Tables/columns/ServiceTableColumns.tsx +105 -94
  42. package/eventcatalog/src/components/Tables/columns/SharedColumns.tsx +31 -26
  43. package/eventcatalog/src/components/Tables/columns/TeamsTableColumns.tsx +115 -215
  44. package/eventcatalog/src/components/Tables/columns/UserTableColumns.tsx +145 -243
  45. package/eventcatalog/src/layouts/VerticalSideBarLayout.astro +5 -2
  46. package/eventcatalog/src/pages/_index.astro +239 -554
  47. package/eventcatalog/src/pages/directory/[type]/index.astro +6 -0
  48. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/index.astro +1 -1
  49. package/eventcatalog/src/pages/docs/[type]/[id]/language/index.astro +194 -121
  50. package/eventcatalog/src/pages/docs/teams/[id]/index.astro +94 -70
  51. package/eventcatalog/src/pages/docs/users/[id]/index.astro +56 -45
  52. package/eventcatalog/src/pages/studio.astro +124 -72
  53. package/eventcatalog/src/stores/{sidebar-store.ts → sidebar-store/index.ts} +1 -1
  54. package/package.json +1 -1
  55. /package/eventcatalog/src/{components/SideNav/NestedSideBar → stores/sidebar-store}/builders/container.ts +0 -0
  56. /package/eventcatalog/src/{components/SideNav/NestedSideBar → stores/sidebar-store}/builders/domain.ts +0 -0
  57. /package/eventcatalog/src/{components/SideNav/NestedSideBar → stores/sidebar-store}/builders/flow.ts +0 -0
  58. /package/eventcatalog/src/{components/SideNav/NestedSideBar → stores/sidebar-store}/builders/message.ts +0 -0
  59. /package/eventcatalog/src/{components/SideNav/NestedSideBar → stores/sidebar-store}/builders/service.ts +0 -0
  60. /package/eventcatalog/src/{components/SideNav/NestedSideBar → stores/sidebar-store}/builders/shared.ts +0 -0
  61. /package/eventcatalog/src/{components/SideNav/NestedSideBar/sidebar-builder.ts → stores/sidebar-store/state.ts} +0 -0
@@ -1,4 +1,5 @@
1
1
  import { createColumnHelper } from '@tanstack/react-table';
2
+ import { useState } from 'react';
2
3
  import { filterByName } from '../filters/custom-filters';
3
4
  import { buildUrl } from '@utils/url-builder';
4
5
  import { ServerIcon } from '@heroicons/react/24/solid';
@@ -15,25 +16,21 @@ export const columns = (tableConfiguration: TableConfiguration) => [
15
16
  header: () => <span>{tableConfiguration.columns?.name?.label || 'Storage'}</span>,
16
17
  cell: (info) => {
17
18
  const containerRaw = info.row.original;
18
- const color = 'blue';
19
19
  return (
20
- <div className=" group ">
21
- <a
22
- href={buildUrl(`/docs/${containerRaw.collection}/${containerRaw.data.id}/${containerRaw.data.version}`)}
23
- className={`group-hover:text-${color}-500 flex space-x-1 items-center`}
24
- >
25
- <div className={`flex items-center border border-gray-300 shadow-sm rounded-md group-hover:border-${color}-400`}>
26
- <span className="flex items-center">
27
- <span className={`bg-${color}-500 group-hover:bg-${color}-600 h-full rounded-tl rounded-bl p-1`}>
28
- <DatabaseIcon className="h-4 w-4 text-white" />
29
- </span>
30
- <span className="leading-none px-2 group-hover:underline group-hover:text-primary font-light">
31
- {containerRaw.data.name} (v{containerRaw.data.version})
32
- </span>
33
- </span>
34
- </div>
35
- </a>
36
- </div>
20
+ <a
21
+ href={buildUrl(`/docs/${containerRaw.collection}/${containerRaw.data.id}/${containerRaw.data.version}`)}
22
+ className="group inline-flex items-center"
23
+ >
24
+ <span className="inline-flex items-center rounded-md border border-gray-200 bg-white hover:border-blue-300 hover:bg-blue-50 transition-colors">
25
+ <span className="flex items-center justify-center w-6 h-6 bg-blue-500 rounded-l-md">
26
+ <DatabaseIcon className="h-3 w-3 text-white" />
27
+ </span>
28
+ <span className="px-2 py-1 text-xs text-gray-700 group-hover:text-gray-900">
29
+ {containerRaw.data.name}
30
+ <span className="text-gray-400 ml-1">v{containerRaw.data.version}</span>
31
+ </span>
32
+ </span>
33
+ </a>
37
34
  );
38
35
  },
39
36
  footer: (info) => info.column.id,
@@ -45,7 +42,14 @@ export const columns = (tableConfiguration: TableConfiguration) => [
45
42
  columnHelper.accessor('data.summary', {
46
43
  id: 'summary',
47
44
  header: () => <span>{tableConfiguration.columns?.summary?.label || 'Summary'}</span>,
48
- cell: (info) => <span className="font-light ">{info.renderValue()}</span>,
45
+ cell: (info) => {
46
+ const summary = info.renderValue() as string;
47
+ return (
48
+ <span className="text-sm text-gray-600 line-clamp-2" title={summary || ''}>
49
+ {summary}
50
+ </span>
51
+ );
52
+ },
49
53
  footer: (info) => info.column.id,
50
54
  meta: {
51
55
  showFilter: false,
@@ -61,32 +65,43 @@ export const columns = (tableConfiguration: TableConfiguration) => [
61
65
  },
62
66
  cell: (info) => {
63
67
  const services = info.getValue();
68
+ const [isExpanded, setIsExpanded] = useState(false);
69
+
64
70
  if (services?.length === 0 || !services)
65
- return <div className="font-light text-sm text-gray-400/60 text-left italic">No services documented</div>;
71
+ return (
72
+ <span className="inline-flex items-center px-2 py-1 text-xs text-gray-400 bg-gray-50 rounded-md border border-gray-100">
73
+ No services
74
+ </span>
75
+ );
76
+
77
+ const visibleItems = isExpanded ? services : services.slice(0, 4);
78
+ const hiddenCount = services.length - 4;
79
+
66
80
  return (
67
- <ul className="">
68
- {services.map((service, index) => {
69
- return (
70
- <li className="py-2 group flex items-center space-x-2" key={`${service.data.id}-${index}`}>
71
- <a
72
- href={buildUrl(`/docs/${service.collection}/${service.data.id}/${service.data.version}`)}
73
- className="group-hover:text-primary flex space-x-1 items-center "
74
- >
75
- <div className="flex items-center border border-gray-300 shadow-sm rounded-md">
76
- <span className="flex items-center">
77
- <span className="bg-pink-500 h-full rounded-tl rounded-bl p-1">
78
- <ServerIcon className="h-4 w-4 text-white" />
79
- </span>
80
- <span className="font-light leading-none px-2 group-hover:underline">
81
- {service.data.name} (v{service.data.version})
82
- </span>
83
- </span>{' '}
84
- </div>
85
- </a>
86
- </li>
87
- );
88
- })}
89
- </ul>
81
+ <div className="flex flex-col gap-1.5">
82
+ {visibleItems.map((service, index) => (
83
+ <a
84
+ key={`${service.data.id}-${index}`}
85
+ href={buildUrl(`/docs/${service.collection}/${service.data.id}/${service.data.version}`)}
86
+ className="group inline-flex items-center"
87
+ >
88
+ <span className="inline-flex items-center rounded-md border border-gray-200 bg-white hover:border-pink-300 hover:bg-pink-50 transition-colors">
89
+ <span className="flex items-center justify-center w-6 h-6 bg-pink-500 rounded-l-md">
90
+ <ServerIcon className="h-3 w-3 text-white" />
91
+ </span>
92
+ <span className="px-2 py-1 text-xs text-gray-700 group-hover:text-gray-900">
93
+ {service.data.name}
94
+ <span className="text-gray-400 ml-1">v{service.data.version}</span>
95
+ </span>
96
+ </span>
97
+ </a>
98
+ ))}
99
+ {hiddenCount > 0 && (
100
+ <button onClick={() => setIsExpanded(!isExpanded)} className="text-xs text-gray-500 hover:text-gray-700 text-left">
101
+ {isExpanded ? 'Show less' : `+${hiddenCount} more`}
102
+ </button>
103
+ )}
104
+ </div>
90
105
  );
91
106
  },
92
107
  footer: (info) => info.column.id,
@@ -101,32 +116,43 @@ export const columns = (tableConfiguration: TableConfiguration) => [
101
116
  },
102
117
  cell: (info) => {
103
118
  const services = info.getValue();
119
+ const [isExpanded, setIsExpanded] = useState(false);
120
+
104
121
  if (services?.length === 0 || !services)
105
- return <div className="font-light text-sm text-gray-400/60 text-left italic">No services documented</div>;
122
+ return (
123
+ <span className="inline-flex items-center px-2 py-1 text-xs text-gray-400 bg-gray-50 rounded-md border border-gray-100">
124
+ No services
125
+ </span>
126
+ );
127
+
128
+ const visibleItems = isExpanded ? services : services.slice(0, 4);
129
+ const hiddenCount = services.length - 4;
130
+
106
131
  return (
107
- <ul className="">
108
- {services.map((service, index) => {
109
- return (
110
- <li className="py-2 group flex items-center space-x-2" key={`${service.data.id}-${index}`}>
111
- <a
112
- href={buildUrl(`/docs/${service.collection}/${service.data.id}/${service.data.version}`)}
113
- className="group-hover:text-primary flex space-x-1 items-center "
114
- >
115
- <div className="flex items-center border border-gray-300 shadow-sm rounded-md">
116
- <span className="flex items-center">
117
- <span className="bg-pink-500 h-full rounded-tl rounded-bl p-1">
118
- <ServerIcon className="h-4 w-4 text-white" />
119
- </span>
120
- <span className="font-light leading-none px-2 group-hover:underline">
121
- {service.data.name} (v{service.data.version})
122
- </span>
123
- </span>{' '}
124
- </div>
125
- </a>
126
- </li>
127
- );
128
- })}
129
- </ul>
132
+ <div className="flex flex-col gap-1.5">
133
+ {visibleItems.map((service, index) => (
134
+ <a
135
+ key={`${service.data.id}-${index}`}
136
+ href={buildUrl(`/docs/${service.collection}/${service.data.id}/${service.data.version}`)}
137
+ className="group inline-flex items-center"
138
+ >
139
+ <span className="inline-flex items-center rounded-md border border-gray-200 bg-white hover:border-pink-300 hover:bg-pink-50 transition-colors">
140
+ <span className="flex items-center justify-center w-6 h-6 bg-pink-500 rounded-l-md">
141
+ <ServerIcon className="h-3 w-3 text-white" />
142
+ </span>
143
+ <span className="px-2 py-1 text-xs text-gray-700 group-hover:text-gray-900">
144
+ {service.data.name}
145
+ <span className="text-gray-400 ml-1">v{service.data.version}</span>
146
+ </span>
147
+ </span>
148
+ </a>
149
+ ))}
150
+ {hiddenCount > 0 && (
151
+ <button onClick={() => setIsExpanded(!isExpanded)} className="text-xs text-gray-500 hover:text-gray-700 text-left">
152
+ {isExpanded ? 'Show less' : `+${hiddenCount} more`}
153
+ </button>
154
+ )}
155
+ </div>
130
156
  );
131
157
  },
132
158
  footer: (info) => info.column.id,
@@ -136,14 +162,22 @@ export const columns = (tableConfiguration: TableConfiguration) => [
136
162
  columnHelper.accessor('data.name', {
137
163
  header: () => <span>{tableConfiguration.columns?.actions?.label || 'Actions'}</span>,
138
164
  cell: (info) => {
139
- const container = info.row.original;
165
+ const item = info.row.original;
140
166
  return (
141
- <a
142
- className="hover:text-primary hover:underline px-4 font-light"
143
- href={buildUrl(`/visualiser/${container.collection}/${container.data.id}/${container.data.version}`)}
144
- >
145
- Visualiser &rarr;
146
- </a>
167
+ <div className="flex items-center gap-2">
168
+ <a
169
+ className="inline-flex items-center px-2.5 py-1 text-xs font-medium text-gray-600 bg-gray-50 border border-gray-200 rounded-md hover:bg-gray-100 hover:text-gray-900 transition-colors whitespace-nowrap"
170
+ href={buildUrl(`/docs/${item.collection}/${item.data.id}/${item.data.version}`)}
171
+ >
172
+ Docs
173
+ </a>
174
+ <a
175
+ className="inline-flex items-center px-2.5 py-1 text-xs font-medium text-gray-600 bg-gray-50 border border-gray-200 rounded-md hover:bg-gray-100 hover:text-gray-900 transition-colors whitespace-nowrap"
176
+ href={buildUrl(`/visualiser/${item.collection}/${item.data.id}/${item.data.version}`)}
177
+ >
178
+ Visualiser
179
+ </a>
180
+ </div>
147
181
  );
148
182
  },
149
183
  id: 'actions',
@@ -1,5 +1,6 @@
1
1
  import { ServerIcon, RectangleGroupIcon } from '@heroicons/react/20/solid';
2
2
  import { createColumnHelper } from '@tanstack/react-table';
3
+ import { useState } from 'react';
3
4
  import { filterByName, filterCollectionByName } from '../filters/custom-filters';
4
5
  import { buildUrl } from '@utils/url-builder';
5
6
  import { createBadgesColumn } from './SharedColumns';
@@ -14,25 +15,21 @@ export const columns = (tableConfiguration: TableConfiguration) => [
14
15
  header: () => <span>{tableConfiguration.columns?.name?.label || 'Domain'}</span>,
15
16
  cell: (info) => {
16
17
  const messageRaw = info.row.original;
17
- const color = 'yellow';
18
18
  return (
19
- <div className=" group ">
20
- <a
21
- href={buildUrl(`/docs/${messageRaw.collection}/${messageRaw.data.id}/${messageRaw.data.version}`)}
22
- className={`group-hover:text-${color}-500 flex space-x-1 items-center`}
23
- >
24
- <div className={`flex items-center border border-gray-300 shadow-sm rounded-md group-hover:border-${color}-400`}>
25
- <span className="flex items-center">
26
- <span className={`bg-${color}-500 group-hover:bg-${color}-600 h-full rounded-tl rounded-bl p-1`}>
27
- <RectangleGroupIcon className="h-4 w-4 text-white" />
28
- </span>
29
- <span className="leading-none px-2 group-hover:underline group-hover:text-primary font-light">
30
- {messageRaw.data.name} (v{messageRaw.data.version})
31
- </span>
32
- </span>
33
- </div>
34
- </a>
35
- </div>
19
+ <a
20
+ href={buildUrl(`/docs/${messageRaw.collection}/${messageRaw.data.id}/${messageRaw.data.version}`)}
21
+ className="group inline-flex items-center"
22
+ >
23
+ <span className="inline-flex items-center rounded-md border border-gray-200 bg-white hover:border-yellow-300 hover:bg-yellow-50 transition-colors">
24
+ <span className="flex items-center justify-center w-6 h-6 bg-yellow-500 rounded-l-md">
25
+ <RectangleGroupIcon className="h-3 w-3 text-white" />
26
+ </span>
27
+ <span className="px-2 py-1 text-xs text-gray-700 group-hover:text-gray-900">
28
+ {messageRaw.data.name}
29
+ <span className="text-gray-400 ml-1">v{messageRaw.data.version}</span>
30
+ </span>
31
+ </span>
32
+ </a>
36
33
  );
37
34
  },
38
35
  footer: (info) => info.column.id,
@@ -44,11 +41,16 @@ export const columns = (tableConfiguration: TableConfiguration) => [
44
41
  columnHelper.accessor('data.summary', {
45
42
  id: 'summary',
46
43
  header: () => <span>{tableConfiguration.columns?.summary?.label || 'Summary'}</span>,
47
- cell: (info) => (
48
- <span className="font-light ">
49
- {info.renderValue()} {info.row.original.data.draft ? ' (Draft)' : ''}
50
- </span>
51
- ),
44
+ cell: (info) => {
45
+ const summary = info.renderValue() as string;
46
+ const isDraft = info.row.original.data.draft;
47
+ const displayText = `${summary || ''}${isDraft ? ' (Draft)' : ''}`;
48
+ return (
49
+ <span className="text-sm text-gray-600 line-clamp-2" title={displayText}>
50
+ {displayText}
51
+ </span>
52
+ );
53
+ },
52
54
  footer: (info) => info.column.id,
53
55
  meta: {
54
56
  showFilter: false,
@@ -64,34 +66,43 @@ export const columns = (tableConfiguration: TableConfiguration) => [
64
66
  },
65
67
  cell: (info) => {
66
68
  const services = info.getValue();
69
+ const [isExpanded, setIsExpanded] = useState(false);
70
+
67
71
  if (services?.length === 0 || !services)
68
- return <div className="text-sm text-gray-400/80 text-left italic">Domain has no services.</div>;
72
+ return (
73
+ <span className="inline-flex items-center px-2 py-1 text-xs text-gray-400 bg-gray-50 rounded-md border border-gray-100">
74
+ No services
75
+ </span>
76
+ );
77
+
78
+ const visibleItems = isExpanded ? services : services.slice(0, 4);
79
+ const hiddenCount = services.length - 4;
69
80
 
70
81
  return (
71
- <ul>
72
- {services.map((consumer) => {
73
- const color = 'pink';
74
- return (
75
- <li key={consumer.data.id} className="py-1 group ">
76
- <a
77
- href={buildUrl(`/docs/${consumer.collection}/${consumer.data.id}/${consumer.data.version}`)}
78
- className="group-hover:text-primary flex space-x-1 items-center "
79
- >
80
- <div className={`flex items-center border border-gray-300 rounded-md`}>
81
- <span className="flex items-center">
82
- <span className={`bg-${color}-500 h-full rounded-tl rounded-bl p-1`}>
83
- <ServerIcon className="h-4 w-4 text-white" />
84
- </span>
85
- <span className="leading-none px-2 group-hover:underline font-light ">
86
- {consumer.data.name} (v{consumer.data.version})
87
- </span>
88
- </span>
89
- </div>
90
- </a>
91
- </li>
92
- );
93
- })}
94
- </ul>
82
+ <div className="flex flex-col gap-1.5">
83
+ {visibleItems.map((service, index) => (
84
+ <a
85
+ key={`${service.data.id}-${index}`}
86
+ href={buildUrl(`/docs/${service.collection}/${service.data.id}/${service.data.version}`)}
87
+ className="group inline-flex items-center"
88
+ >
89
+ <span className="inline-flex items-center rounded-md border border-gray-200 bg-white hover:border-pink-300 hover:bg-pink-50 transition-colors">
90
+ <span className="flex items-center justify-center w-6 h-6 bg-pink-500 rounded-l-md">
91
+ <ServerIcon className="h-3 w-3 text-white" />
92
+ </span>
93
+ <span className="px-2 py-1 text-xs text-gray-700 group-hover:text-gray-900">
94
+ {service.data.name}
95
+ <span className="text-gray-400 ml-1">v{service.data.version}</span>
96
+ </span>
97
+ </span>
98
+ </a>
99
+ ))}
100
+ {hiddenCount > 0 && (
101
+ <button onClick={() => setIsExpanded(!isExpanded)} className="text-xs text-gray-500 hover:text-gray-700 text-left">
102
+ {isExpanded ? 'Show less' : `+${hiddenCount} more`}
103
+ </button>
104
+ )}
105
+ </div>
95
106
  );
96
107
  },
97
108
  filterFn: filterCollectionByName('services'),
@@ -101,14 +112,22 @@ export const columns = (tableConfiguration: TableConfiguration) => [
101
112
  id: 'actions',
102
113
  header: () => <span>{tableConfiguration.columns?.actions?.label || 'Actions'}</span>,
103
114
  cell: (info) => {
104
- const domain = info.row.original;
115
+ const item = info.row.original;
105
116
  return (
106
- <a
107
- className="hover:text-primary hover:underline px-4 font-light"
108
- href={buildUrl(`/visualiser/${domain.collection}/${domain.data.id}/${domain.data.version}`)}
109
- >
110
- Visualiser &rarr;
111
- </a>
117
+ <div className="flex items-center gap-2">
118
+ <a
119
+ className="inline-flex items-center px-2.5 py-1 text-xs font-medium text-gray-600 bg-gray-50 border border-gray-200 rounded-md hover:bg-gray-100 hover:text-gray-900 transition-colors whitespace-nowrap"
120
+ href={buildUrl(`/docs/${item.collection}/${item.data.id}/${item.data.version}`)}
121
+ >
122
+ Docs
123
+ </a>
124
+ <a
125
+ className="inline-flex items-center px-2.5 py-1 text-xs font-medium text-gray-600 bg-gray-50 border border-gray-200 rounded-md hover:bg-gray-100 hover:text-gray-900 transition-colors whitespace-nowrap"
126
+ href={buildUrl(`/visualiser/${item.collection}/${item.data.id}/${item.data.version}`)}
127
+ >
128
+ Visualiser
129
+ </a>
130
+ </div>
112
131
  );
113
132
  },
114
133
  meta: {
@@ -14,25 +14,21 @@ export const columns = (tableConfiguration: TableConfiguration) => [
14
14
  header: () => <span>{tableConfiguration.columns?.name?.label || 'Flow'}</span>,
15
15
  cell: (info) => {
16
16
  const flowRaw = info.row.original;
17
- const color = 'teal';
18
17
  return (
19
- <div className=" group ">
20
- <a
21
- href={buildUrl(`/docs/${flowRaw.collection}/${flowRaw.data.id}/${flowRaw.data.version}`)}
22
- className={`group-hover:text-${color}-500 flex space-x-1 items-center`}
23
- >
24
- <div className={`flex items-center border border-gray-300 shadow-sm rounded-md group-hover:border-${color}-400`}>
25
- <span className="flex items-center">
26
- <span className={`bg-${color}-500 group-hover:bg-${color}-600 h-full rounded-tl rounded-bl p-1`}>
27
- <QueueListIcon className="h-4 w-4 text-white" />
28
- </span>
29
- <span className="leading-none px-2 group-hover:underline group-hover:text-primary font-light">
30
- {flowRaw.data.name} (v{flowRaw.data.version})
31
- </span>
32
- </span>
33
- </div>
34
- </a>
35
- </div>
18
+ <a
19
+ href={buildUrl(`/docs/${flowRaw.collection}/${flowRaw.data.id}/${flowRaw.data.version}`)}
20
+ className="group inline-flex items-center"
21
+ >
22
+ <span className="inline-flex items-center rounded-md border border-gray-200 bg-white hover:border-teal-300 hover:bg-teal-50 transition-colors">
23
+ <span className="flex items-center justify-center w-6 h-6 bg-teal-500 rounded-l-md">
24
+ <QueueListIcon className="h-3 w-3 text-white" />
25
+ </span>
26
+ <span className="px-2 py-1 text-xs text-gray-700 group-hover:text-gray-900">
27
+ {flowRaw.data.name}
28
+ <span className="text-gray-400 ml-1">v{flowRaw.data.version}</span>
29
+ </span>
30
+ </span>
31
+ </a>
36
32
  );
37
33
  },
38
34
  footer: (info) => info.column.id,
@@ -41,22 +37,18 @@ export const columns = (tableConfiguration: TableConfiguration) => [
41
37
  },
42
38
  filterFn: filterByName,
43
39
  }),
44
- columnHelper.accessor('data.version', {
45
- id: 'version',
46
- header: () => <span>{tableConfiguration.columns?.version?.label || 'Version'}</span>,
40
+ columnHelper.accessor('data.summary', {
41
+ id: 'summary',
42
+ header: () => <span>{tableConfiguration.columns?.summary?.label || 'Summary'}</span>,
47
43
  cell: (info) => {
48
- const service = info.row.original;
44
+ const summary = info.renderValue() as string;
49
45
  return (
50
- <div className="text-left font-light">{`v${info.getValue()} ${service.data.latestVersion === service.data.version ? '(latest)' : ''}`}</div>
46
+ <span className="text-sm text-gray-600 line-clamp-2" title={summary || ''}>
47
+ {summary}
48
+ </span>
51
49
  );
52
50
  },
53
51
  footer: (info) => info.column.id,
54
- }),
55
- columnHelper.accessor('data.summary', {
56
- id: 'summary',
57
- header: () => <span>{tableConfiguration.columns?.summary?.label || 'Summary'}</span>,
58
- cell: (info) => <span className="font-light ">{info.renderValue()}</span>,
59
- footer: (info) => info.column.id,
60
52
  meta: {
61
53
  showFilter: false,
62
54
  className: 'max-w-md',
@@ -67,14 +59,22 @@ export const columns = (tableConfiguration: TableConfiguration) => [
67
59
  id: 'actions',
68
60
  header: () => <span>{tableConfiguration.columns?.actions?.label || 'Actions'}</span>,
69
61
  cell: (info) => {
70
- const domain = info.row.original;
62
+ const item = info.row.original;
71
63
  return (
72
- <a
73
- className="hover:text-primary hover:underline px-4 font-light"
74
- href={buildUrl(`/visualiser/${domain.collection}/${domain.data.id}/${domain.data.version}`)}
75
- >
76
- Visualiser &rarr;
77
- </a>
64
+ <div className="flex items-center gap-2">
65
+ <a
66
+ className="inline-flex items-center px-2.5 py-1 text-xs font-medium text-gray-600 bg-gray-50 border border-gray-200 rounded-md hover:bg-gray-100 hover:text-gray-900 transition-colors whitespace-nowrap"
67
+ href={buildUrl(`/docs/${item.collection}/${item.data.id}/${item.data.version}`)}
68
+ >
69
+ Docs
70
+ </a>
71
+ <a
72
+ className="inline-flex items-center px-2.5 py-1 text-xs font-medium text-gray-600 bg-gray-50 border border-gray-200 rounded-md hover:bg-gray-100 hover:text-gray-900 transition-colors whitespace-nowrap"
73
+ href={buildUrl(`/visualiser/${item.collection}/${item.data.id}/${item.data.version}`)}
74
+ >
75
+ Visualiser
76
+ </a>
77
+ </div>
78
78
  );
79
79
  },
80
80
  meta: {