@eventcatalog/core 3.0.0-beta.9 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +41 -98
- package/dist/__mocks__/astro-content.cjs +32 -0
- package/dist/__mocks__/astro-content.d.cts +13 -0
- package/dist/__mocks__/astro-content.d.ts +13 -0
- package/dist/__mocks__/astro-content.js +7 -0
- package/dist/analytics/analytics.cjs +1 -1
- package/dist/analytics/analytics.js +2 -2
- package/dist/analytics/log-build.cjs +1 -1
- package/dist/analytics/log-build.js +3 -3
- package/dist/catalog-to-astro-content-directory.cjs +2 -19
- package/dist/catalog-to-astro-content-directory.d.cts +1 -2
- package/dist/catalog-to-astro-content-directory.d.ts +1 -2
- package/dist/catalog-to-astro-content-directory.js +3 -5
- package/dist/{chunk-R2BJ7MJG.js → chunk-6Z6ARMQS.js} +1 -17
- package/dist/{chunk-A4MGWK5T.js → chunk-BYP43AAT.js} +1 -1
- package/dist/{chunk-RAJ7TGWN.js → chunk-E5Q7TZYT.js} +1 -1
- package/dist/{chunk-TT4LZO2Q.js → chunk-EKGR533N.js} +1 -1
- package/dist/{chunk-2VPX4WIJ.js → chunk-KF5PARQK.js} +1 -1
- package/dist/{chunk-TC3R47V6.js → chunk-VO5WYA44.js} +1 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.js +1 -1
- package/dist/eventcatalog.cjs +20 -64
- package/dist/eventcatalog.config.d.cts +4 -0
- package/dist/eventcatalog.config.d.ts +4 -0
- package/dist/eventcatalog.js +26 -52
- package/dist/generate.cjs +1 -1
- package/dist/generate.js +3 -3
- package/dist/utils/cli-logger.cjs +1 -1
- package/dist/utils/cli-logger.js +2 -2
- package/eventcatalog/astro.config.mjs +4 -1
- package/eventcatalog/integrations/eventcatalog-features.ts +69 -0
- package/eventcatalog/public/icons/asyncapi-black.svg +2 -0
- package/eventcatalog/public/icons/graphql-black.svg +1 -0
- package/eventcatalog/public/icons/openapi-black.svg +1 -0
- package/eventcatalog/src/components/ChatPanel/ChatPanel.tsx +994 -0
- package/eventcatalog/src/components/ChatPanel/ChatPanelButton.tsx +24 -0
- package/eventcatalog/src/components/Grids/DomainGrid.tsx +310 -173
- package/eventcatalog/src/components/Grids/MessageGrid.tsx +299 -180
- package/eventcatalog/src/components/Grids/specification-utils.ts +106 -0
- package/eventcatalog/src/components/Header.astro +25 -5
- package/eventcatalog/src/components/MDX/NodeGraph/NodeGraph.tsx +14 -3
- package/eventcatalog/src/components/SchemaExplorer/ApiAccessSection.tsx +95 -90
- package/eventcatalog/src/components/SchemaExplorer/ApiContentViewer.tsx +144 -0
- package/eventcatalog/src/components/SchemaExplorer/Pagination.tsx +34 -8
- package/eventcatalog/src/components/SchemaExplorer/SchemaContentViewer.tsx +2 -2
- package/eventcatalog/src/components/SchemaExplorer/SchemaDetailsHeader.tsx +140 -109
- package/eventcatalog/src/components/SchemaExplorer/SchemaDetailsPanel.tsx +5 -14
- package/eventcatalog/src/components/SchemaExplorer/SchemaExplorer.tsx +247 -59
- package/eventcatalog/src/components/SchemaExplorer/SchemaFilters.tsx +64 -126
- package/eventcatalog/src/components/SchemaExplorer/SchemaListItem.tsx +41 -43
- package/eventcatalog/src/components/Search/Search.astro +2 -2
- package/eventcatalog/src/components/Search/SearchDataLoader.astro +25 -0
- package/eventcatalog/src/components/SideNav/NestedSideBar/SearchBar.tsx +6 -3
- package/eventcatalog/src/components/SideNav/NestedSideBar/index.tsx +44 -16
- package/eventcatalog/src/components/SideNav/SideNav.astro +0 -15
- package/eventcatalog/src/components/Tables/Table.tsx +96 -77
- package/eventcatalog/src/components/Tables/columns/ContainersTableColumns.tsx +108 -74
- package/eventcatalog/src/components/Tables/columns/DomainTableColumns.tsx +74 -55
- package/eventcatalog/src/components/Tables/columns/FlowTableColumns.tsx +36 -36
- package/eventcatalog/src/components/Tables/columns/MessageTableColumns.tsx +110 -77
- package/eventcatalog/src/components/Tables/columns/ServiceTableColumns.tsx +105 -94
- package/eventcatalog/src/components/Tables/columns/SharedColumns.tsx +31 -26
- package/eventcatalog/src/components/Tables/columns/TeamsTableColumns.tsx +115 -215
- package/eventcatalog/src/components/Tables/columns/UserTableColumns.tsx +145 -243
- package/eventcatalog/src/content.config.ts +1 -13
- package/eventcatalog/src/enterprise/ai/chat-api.ts +360 -0
- package/eventcatalog/src/enterprise/auth/[...auth].ts +3 -0
- package/eventcatalog/src/enterprise/auth/login.astro +420 -0
- package/eventcatalog/src/enterprise/collections/index.ts +0 -1
- package/eventcatalog/src/layouts/Footer.astro +8 -5
- package/eventcatalog/src/layouts/VerticalSideBarLayout.astro +133 -117
- package/eventcatalog/src/pages/_index.astro +243 -559
- package/eventcatalog/src/pages/architecture/[type]/[id]/[version]/_index.data.ts +8 -2
- package/eventcatalog/src/pages/architecture/[type]/[id]/[version]/index.astro +9 -5
- package/eventcatalog/src/pages/directory/[type]/index.astro +6 -0
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/asyncapi/[filename].astro +19 -3
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/changelog/index.astro +7 -7
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/graphql/[filename].astro +1 -1
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/index.astro +10 -7
- package/eventcatalog/src/pages/docs/[type]/[id]/language/index.astro +194 -121
- package/eventcatalog/src/pages/docs/teams/[id]/index.astro +94 -70
- package/eventcatalog/src/pages/docs/teams/[id].mdx.ts +36 -0
- package/eventcatalog/src/pages/docs/users/[id]/index.astro +56 -45
- package/eventcatalog/src/pages/docs/users/[id].mdx.ts +36 -0
- package/eventcatalog/src/pages/schemas/explorer/_index.data.ts +178 -0
- package/eventcatalog/src/pages/schemas/explorer/index.astro +7 -157
- package/eventcatalog/src/pages/studio.astro +124 -72
- package/eventcatalog/src/remark-plugins/directives.ts +30 -9
- package/eventcatalog/src/{components/SideNav/NestedSideBar → stores/sidebar-store}/builders/container.ts +10 -1
- package/eventcatalog/src/{components/SideNav/NestedSideBar → stores/sidebar-store}/builders/domain.ts +17 -7
- package/eventcatalog/src/{components/SideNav/NestedSideBar → stores/sidebar-store}/builders/message.ts +10 -1
- package/eventcatalog/src/{components/SideNav/NestedSideBar → stores/sidebar-store}/builders/service.ts +11 -4
- package/eventcatalog/src/{components/SideNav/NestedSideBar → stores/sidebar-store}/builders/shared.ts +14 -0
- package/eventcatalog/src/stores/{sidebar-store.ts → sidebar-store/index.ts} +1 -1
- package/eventcatalog/src/utils/collections/channels.ts +0 -2
- package/eventcatalog/src/utils/collections/commands.ts +0 -2
- package/eventcatalog/src/utils/collections/containers.ts +0 -2
- package/eventcatalog/src/utils/collections/domains.ts +0 -2
- package/eventcatalog/src/utils/collections/entities.ts +0 -2
- package/eventcatalog/src/utils/collections/events.ts +0 -2
- package/eventcatalog/src/utils/collections/flows.ts +0 -2
- package/eventcatalog/src/utils/collections/queries.ts +0 -2
- package/eventcatalog/src/utils/collections/schemas.ts +45 -7
- package/eventcatalog/src/utils/collections/services.ts +0 -2
- package/eventcatalog/src/utils/feature.ts +9 -5
- package/eventcatalog/src/utils/node-graphs/services-node-graph.ts +1 -1
- package/eventcatalog/src/utils/resource-files.ts +86 -0
- package/package.json +12 -15
- package/default-files-for-collections/changelogs.md +0 -5
- package/default-files-for-collections/channels.md +0 -8
- package/default-files-for-collections/commands.md +0 -8
- package/default-files-for-collections/domains.md +0 -8
- package/default-files-for-collections/events.md +0 -8
- package/default-files-for-collections/flows.md +0 -11
- package/default-files-for-collections/queries.md +0 -8
- package/default-files-for-collections/services.md +0 -8
- package/default-files-for-collections/ubiquitousLanguages.md +0 -7
- package/eventcatalog/src/enterprise/collections/chat-prompts.ts +0 -32
- package/eventcatalog/src/enterprise/eventcatalog-chat/components/Chat.tsx +0 -60
- package/eventcatalog/src/enterprise/eventcatalog-chat/components/ChatMessage.tsx +0 -414
- package/eventcatalog/src/enterprise/eventcatalog-chat/components/ChatSidebar.tsx +0 -169
- package/eventcatalog/src/enterprise/eventcatalog-chat/components/InputModal.tsx +0 -244
- package/eventcatalog/src/enterprise/eventcatalog-chat/components/MentionInput.tsx +0 -211
- package/eventcatalog/src/enterprise/eventcatalog-chat/components/WelcomePromptArea.tsx +0 -176
- package/eventcatalog/src/enterprise/eventcatalog-chat/components/default-prompts.ts +0 -93
- package/eventcatalog/src/enterprise/eventcatalog-chat/components/hooks/ChatProvider.tsx +0 -143
- package/eventcatalog/src/enterprise/eventcatalog-chat/components/windows/ChatWindow.server.tsx +0 -387
- package/eventcatalog/src/enterprise/eventcatalog-chat/pages/api/chat.ts +0 -59
- package/eventcatalog/src/enterprise/eventcatalog-chat/pages/chat/index.astro +0 -104
- package/eventcatalog/src/enterprise/eventcatalog-chat/providers/ai-provider.ts +0 -140
- package/eventcatalog/src/enterprise/eventcatalog-chat/providers/anthropic.ts +0 -28
- package/eventcatalog/src/enterprise/eventcatalog-chat/providers/google.ts +0 -41
- package/eventcatalog/src/enterprise/eventcatalog-chat/providers/index.ts +0 -26
- package/eventcatalog/src/enterprise/eventcatalog-chat/providers/openai.ts +0 -61
- package/eventcatalog/src/enterprise/eventcatalog-chat/utils/chat-prompts.ts +0 -50
- package/eventcatalog/src/pages/auth/login.astro +0 -280
- package/eventcatalog/src/pages/chat/feature.astro +0 -179
- package/eventcatalog/src/pages/chat/index.astro +0 -10
- package/eventcatalog/src/pages/docs/_default-docs.mdx +0 -25
- package/eventcatalog/src/pages/docs/index.astro +0 -33
- package/eventcatalog/src/pages/nav-index.json.ts +0 -30
- /package/eventcatalog/src/{pages → enterprise}/auth/error.astro +0 -0
- /package/eventcatalog/src/{middleware-auth.ts → enterprise/auth/middleware/middleware-auth.ts} +0 -0
- /package/eventcatalog/src/{middleware.ts → enterprise/auth/middleware/middleware.ts} +0 -0
- /package/eventcatalog/src/{pages/unauthorized/index.astro → enterprise/auth/unauthorized.astro} +0 -0
- /package/eventcatalog/src/{pages → enterprise}/plans/index.astro +0 -0
- /package/eventcatalog/src/{components/SideNav/NestedSideBar → stores/sidebar-store}/builders/flow.ts +0 -0
- /package/eventcatalog/src/{components/SideNav/NestedSideBar/sidebar-builder.ts → stores/sidebar-store/state.ts} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createColumnHelper } from '@tanstack/react-table';
|
|
2
|
-
import {
|
|
2
|
+
import { useState } from 'react';
|
|
3
3
|
import { filterByName, filterCollectionByName } from '../filters/custom-filters';
|
|
4
4
|
import { buildUrl } from '@utils/url-builder';
|
|
5
5
|
import type { TData } from '../Table';
|
|
@@ -10,28 +10,31 @@ import { ServerIcon, BoltIcon, ChatBubbleLeftIcon, MagnifyingGlassIcon } from '@
|
|
|
10
10
|
import type { TableConfiguration } from '@types';
|
|
11
11
|
const columnHelper = createColumnHelper<TData<CollectionUserTypes>>();
|
|
12
12
|
|
|
13
|
+
const getMessageIconAndColor = (collection: string) => {
|
|
14
|
+
if (collection === 'events') return { Icon: BoltIcon, color: 'orange' };
|
|
15
|
+
if (collection === 'commands') return { Icon: ChatBubbleLeftIcon, color: 'blue' };
|
|
16
|
+
if (collection === 'queries') return { Icon: MagnifyingGlassIcon, color: 'green' };
|
|
17
|
+
return { Icon: ChatBubbleLeftIcon, color: 'gray' };
|
|
18
|
+
};
|
|
19
|
+
|
|
13
20
|
export const columns = (tableConfiguration: TableConfiguration) => [
|
|
14
21
|
columnHelper.accessor('data.name', {
|
|
15
22
|
id: 'name',
|
|
16
23
|
header: () => <span>{tableConfiguration.columns?.name?.label || 'Name'}</span>,
|
|
17
24
|
cell: (info) => {
|
|
18
|
-
const
|
|
19
|
-
const type = useMemo(() => messageRaw.collection.slice(0, -1), [messageRaw.collection]);
|
|
25
|
+
const user = info.row.original;
|
|
20
26
|
return (
|
|
21
|
-
<
|
|
22
|
-
<
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
<
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
</div>
|
|
33
|
-
</a>
|
|
34
|
-
</div>
|
|
27
|
+
<a href={buildUrl(`/docs/${user.collection}/${user.data.id}`)} className="group inline-flex items-center">
|
|
28
|
+
<span className="inline-flex items-center rounded-md border border-gray-200 bg-white hover:border-purple-300 hover:bg-purple-50 transition-colors">
|
|
29
|
+
<span className="flex items-center justify-center w-6 h-6 bg-purple-500 rounded-l-md">
|
|
30
|
+
<User className="h-3 w-3 text-white" />
|
|
31
|
+
</span>
|
|
32
|
+
<span className="px-2 py-1 text-xs text-gray-700 group-hover:text-gray-900">
|
|
33
|
+
{user.data.name}
|
|
34
|
+
{user.data.role && <span className="text-gray-400 ml-1">({user.data.role})</span>}
|
|
35
|
+
</span>
|
|
36
|
+
</span>
|
|
37
|
+
</a>
|
|
35
38
|
);
|
|
36
39
|
},
|
|
37
40
|
meta: {
|
|
@@ -41,221 +44,122 @@ export const columns = (tableConfiguration: TableConfiguration) => [
|
|
|
41
44
|
filterFn: filterByName,
|
|
42
45
|
}),
|
|
43
46
|
|
|
44
|
-
columnHelper.accessor(
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
columnHelper.accessor(
|
|
48
|
+
(row) => {
|
|
49
|
+
const events = row.data.ownedEvents || [];
|
|
50
|
+
const commands = row.data.ownedCommands || [];
|
|
51
|
+
const queries = row.data.ownedQueries || [];
|
|
52
|
+
return [...events, ...commands, ...queries];
|
|
50
53
|
},
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
54
|
+
{
|
|
55
|
+
id: 'ownedMessages',
|
|
56
|
+
header: () => <span>{tableConfiguration.columns?.ownedMessages?.label || 'Owned messages'}</span>,
|
|
57
|
+
meta: {
|
|
58
|
+
showFilter: false,
|
|
59
|
+
},
|
|
60
|
+
cell: (info) => {
|
|
61
|
+
const messages = info.getValue() as Array<
|
|
62
|
+
CollectionEntry<'events'> | CollectionEntry<'commands'> | CollectionEntry<'queries'>
|
|
63
|
+
>;
|
|
64
|
+
const [isExpanded, setIsExpanded] = useState(false);
|
|
65
|
+
|
|
66
|
+
if (messages?.length === 0 || !messages)
|
|
67
|
+
return (
|
|
68
|
+
<span className="inline-flex items-center px-2 py-1 text-xs text-gray-400 bg-gray-50 rounded-md border border-gray-100">
|
|
69
|
+
No messages
|
|
70
|
+
</span>
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
const visibleItems = isExpanded ? messages : messages.slice(0, 4);
|
|
74
|
+
const hiddenCount = messages.length - 4;
|
|
75
|
+
|
|
76
|
+
return (
|
|
77
|
+
<div className="flex flex-col gap-1.5">
|
|
78
|
+
{visibleItems.map((message, index: number) => {
|
|
79
|
+
const { Icon, color } = getMessageIconAndColor(message.collection);
|
|
80
|
+
return (
|
|
81
|
+
<a
|
|
82
|
+
key={`${message.data.id}-${index}`}
|
|
83
|
+
href={buildUrl(`/docs/${message.collection}/${message.data.id}/${message.data.version}`)}
|
|
84
|
+
className="group inline-flex items-center"
|
|
85
|
+
>
|
|
86
|
+
<span
|
|
87
|
+
className={`inline-flex items-center rounded-md border border-gray-200 bg-white hover:border-${color}-300 hover:bg-${color}-50 transition-colors`}
|
|
74
88
|
>
|
|
75
|
-
<
|
|
76
|
-
<
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
))}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
columnHelper.accessor('data.ownedCommands', {
|
|
98
|
-
id: 'ownedCommands',
|
|
99
|
-
header: () => <span>{tableConfiguration.columns?.ownedCommands?.label || 'Owned commands'}</span>,
|
|
100
|
-
meta: {
|
|
101
|
-
filterVariant: 'collection',
|
|
102
|
-
collectionFilterKey: 'ownedCommands',
|
|
103
|
-
},
|
|
104
|
-
cell: (info) => {
|
|
105
|
-
const commands = info.getValue();
|
|
106
|
-
if (commands?.length === 0 || !commands)
|
|
107
|
-
return <div className="font-light text-sm text-gray-400/60 text-left italic">User owns no commands</div>;
|
|
108
|
-
|
|
109
|
-
const isExpandable = commands?.length > 10;
|
|
110
|
-
const isOpen = isExpandable ? commands?.length < 10 : true;
|
|
111
|
-
const [isExpanded, setIsExpanded] = useState(isOpen);
|
|
112
|
-
|
|
113
|
-
return (
|
|
114
|
-
<div>
|
|
115
|
-
{isExpandable && (
|
|
116
|
-
<button onClick={() => setIsExpanded(!isExpanded)} className="mb-2 text-sm text-gray-600 hover:text-gray-900">
|
|
117
|
-
{isExpanded ? '▼' : '▶'} {commands.length} command{commands.length !== 1 ? 's' : ''}
|
|
118
|
-
</button>
|
|
119
|
-
)}
|
|
120
|
-
{isExpanded && (
|
|
121
|
-
<ul>
|
|
122
|
-
{commands.map((command: CollectionEntry<'commands'>, index: number) => (
|
|
123
|
-
<li key={`${command.data.id}-${index}`} className="py-1 group font-light ">
|
|
124
|
-
<a
|
|
125
|
-
href={buildUrl(`/docs/${command.collection}/${command.data.id}/${command.data.version}`)}
|
|
126
|
-
className="group-hover:text-primary flex space-x-1 items-center "
|
|
127
|
-
>
|
|
128
|
-
<div className={`flex items-center border border-gray-300 shadow-sm rounded-md`}>
|
|
129
|
-
<span className="flex items-center">
|
|
130
|
-
<span className={`bg-blue-500 h-full rounded-tl rounded-bl p-1`}>
|
|
131
|
-
<ChatBubbleLeftIcon className="h-4 w-4 text-white" />
|
|
132
|
-
</span>
|
|
133
|
-
<span className="leading-none px-2 group-hover:underline ">
|
|
134
|
-
{command.data.name} (v{command.data.version})
|
|
135
|
-
</span>
|
|
136
|
-
</span>
|
|
137
|
-
</div>
|
|
138
|
-
</a>
|
|
139
|
-
</li>
|
|
140
|
-
))}
|
|
141
|
-
</ul>
|
|
142
|
-
)}
|
|
143
|
-
</div>
|
|
144
|
-
);
|
|
145
|
-
|
|
146
|
-
// return commands.length;
|
|
147
|
-
},
|
|
148
|
-
footer: (info) => info.column.id,
|
|
149
|
-
filterFn: filterCollectionByName('ownedCommands'),
|
|
150
|
-
}),
|
|
151
|
-
|
|
152
|
-
columnHelper.accessor('data.ownedQueries', {
|
|
153
|
-
id: 'ownedQueries',
|
|
154
|
-
header: () => <span>{tableConfiguration.columns?.ownedQueries?.label || 'Owned queries'}</span>,
|
|
155
|
-
meta: {
|
|
156
|
-
filterVariant: 'collection',
|
|
157
|
-
collectionFilterKey: 'ownedQueries',
|
|
158
|
-
},
|
|
159
|
-
cell: (info) => {
|
|
160
|
-
const queries = info.getValue();
|
|
161
|
-
if (queries?.length === 0 || !queries)
|
|
162
|
-
return <div className="font-light text-sm text-gray-400/60 text-left italic">User owns no queries</div>;
|
|
163
|
-
|
|
164
|
-
const isExpandable = queries?.length > 10;
|
|
165
|
-
const isOpen = isExpandable ? queries?.length < 10 : true;
|
|
166
|
-
const [isExpanded, setIsExpanded] = useState(isOpen);
|
|
167
|
-
|
|
168
|
-
return (
|
|
169
|
-
<div>
|
|
170
|
-
{isExpandable && (
|
|
171
|
-
<button onClick={() => setIsExpanded(!isExpanded)} className="mb-2 text-sm text-gray-600 hover:text-gray-900">
|
|
172
|
-
{isExpanded ? '▼' : '▶'} {queries.length} query{queries.length !== 1 ? 's' : ''}
|
|
173
|
-
</button>
|
|
174
|
-
)}
|
|
175
|
-
{isExpanded && (
|
|
176
|
-
<ul>
|
|
177
|
-
{queries.map((query: CollectionEntry<'queries'>, index: number) => (
|
|
178
|
-
<li key={`${query.data.id}-${index}`} className="py-1 group font-light ">
|
|
179
|
-
<a
|
|
180
|
-
href={buildUrl(`/docs/${query.collection}/${query.data.id}/${query.data.version}`)}
|
|
181
|
-
className="group-hover:text-primary flex space-x-1 items-center "
|
|
182
|
-
>
|
|
183
|
-
<div className={`flex items-center border border-gray-300 shadow-sm rounded-md h-full`}>
|
|
184
|
-
<span className="flex items-center">
|
|
185
|
-
<span className={`bg-green-500 flex rounded-tl rounded-bl p-1 h-full`}>
|
|
186
|
-
<MagnifyingGlassIcon className="h-4 w-4 text-white" />
|
|
187
|
-
</span>
|
|
188
|
-
<span className="leading-none px-2 group-hover:underline ">
|
|
189
|
-
{query.data.name} (v{query.data.version})
|
|
190
|
-
</span>
|
|
191
|
-
</span>
|
|
192
|
-
</div>
|
|
193
|
-
</a>
|
|
194
|
-
</li>
|
|
195
|
-
))}
|
|
196
|
-
</ul>
|
|
197
|
-
)}
|
|
198
|
-
</div>
|
|
199
|
-
);
|
|
200
|
-
|
|
201
|
-
// return commands.length;
|
|
202
|
-
},
|
|
203
|
-
footer: (info) => info.column.id,
|
|
204
|
-
filterFn: filterCollectionByName('ownedCommands'),
|
|
205
|
-
}),
|
|
89
|
+
<span className={`flex items-center justify-center w-6 h-6 bg-${color}-500 rounded-l-md`}>
|
|
90
|
+
<Icon 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
|
+
{message.data.name}
|
|
94
|
+
<span className="text-gray-400 ml-1">v{message.data.version}</span>
|
|
95
|
+
</span>
|
|
96
|
+
</span>
|
|
97
|
+
</a>
|
|
98
|
+
);
|
|
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>
|
|
106
|
+
);
|
|
107
|
+
},
|
|
108
|
+
}
|
|
109
|
+
),
|
|
206
110
|
|
|
207
111
|
columnHelper.accessor('data.ownedServices', {
|
|
208
112
|
id: 'ownedServices',
|
|
209
|
-
header: () => <span>{tableConfiguration.columns?.ownedServices?.label || 'Owned
|
|
113
|
+
header: () => <span>{tableConfiguration.columns?.ownedServices?.label || 'Owned services'}</span>,
|
|
210
114
|
meta: {
|
|
211
115
|
filterVariant: 'collection',
|
|
212
116
|
collectionFilterKey: 'ownedServices',
|
|
213
117
|
},
|
|
214
118
|
cell: (info) => {
|
|
215
119
|
const services = info.getValue();
|
|
120
|
+
const [isExpanded, setIsExpanded] = useState(false);
|
|
121
|
+
|
|
216
122
|
if (services?.length === 0 || !services)
|
|
217
|
-
return
|
|
123
|
+
return (
|
|
124
|
+
<span className="inline-flex items-center px-2 py-1 text-xs text-gray-400 bg-gray-50 rounded-md border border-gray-100">
|
|
125
|
+
No services
|
|
126
|
+
</span>
|
|
127
|
+
);
|
|
218
128
|
|
|
219
|
-
const
|
|
220
|
-
const
|
|
221
|
-
const [isExpanded, setIsExpanded] = useState(isOpen);
|
|
129
|
+
const visibleItems = isExpanded ? services : services.slice(0, 4);
|
|
130
|
+
const hiddenCount = services.length - 4;
|
|
222
131
|
|
|
223
132
|
return (
|
|
224
|
-
<div>
|
|
225
|
-
{
|
|
226
|
-
<
|
|
227
|
-
{
|
|
133
|
+
<div className="flex flex-col gap-1.5">
|
|
134
|
+
{visibleItems.map((service: CollectionEntry<'services'>, index: number) => (
|
|
135
|
+
<a
|
|
136
|
+
key={`${service.data.id}-${index}`}
|
|
137
|
+
href={buildUrl(`/docs/${service.collection}/${service.data.id}/${service.data.version}`)}
|
|
138
|
+
className="group inline-flex items-center"
|
|
139
|
+
>
|
|
140
|
+
<span className="inline-flex items-center rounded-md border border-gray-200 bg-white hover:border-pink-300 hover:bg-pink-50 transition-colors">
|
|
141
|
+
<span className="flex items-center justify-center w-6 h-6 bg-pink-500 rounded-l-md">
|
|
142
|
+
<ServerIcon className="h-3 w-3 text-white" />
|
|
143
|
+
</span>
|
|
144
|
+
<span className="px-2 py-1 text-xs text-gray-700 group-hover:text-gray-900">
|
|
145
|
+
{service.data.name}
|
|
146
|
+
<span className="text-gray-400 ml-1">v{service.data.version}</span>
|
|
147
|
+
</span>
|
|
148
|
+
</span>
|
|
149
|
+
</a>
|
|
150
|
+
))}
|
|
151
|
+
{hiddenCount > 0 && (
|
|
152
|
+
<button onClick={() => setIsExpanded(!isExpanded)} className="text-xs text-gray-500 hover:text-gray-700 text-left">
|
|
153
|
+
{isExpanded ? 'Show less' : `+${hiddenCount} more`}
|
|
228
154
|
</button>
|
|
229
155
|
)}
|
|
230
|
-
{isExpanded && (
|
|
231
|
-
<ul>
|
|
232
|
-
{services.map((service: CollectionEntry<'services'>, index: number) => (
|
|
233
|
-
<li key={`${service.data.id}-${index}`} className="py-1 group font-light ">
|
|
234
|
-
<a
|
|
235
|
-
href={buildUrl(`/docs/${service.collection}/${service.data.id}/${service.data.version}`)}
|
|
236
|
-
className="group-hover:text-primary flex space-x-1 items-center "
|
|
237
|
-
>
|
|
238
|
-
<div className={`flex items-center border border-gray-300 shadow-sm rounded-md`}>
|
|
239
|
-
<span className="flex items-center">
|
|
240
|
-
<span className={`bg-green-500 h-full rounded-tl rounded-bl p-1`}>
|
|
241
|
-
<ServerIcon className="h-4 w-4 text-white" />
|
|
242
|
-
</span>
|
|
243
|
-
<span className="leading-none px-2 group-hover:underline ">
|
|
244
|
-
{service.data.name} (v{service.data.version})
|
|
245
|
-
</span>
|
|
246
|
-
</span>
|
|
247
|
-
</div>
|
|
248
|
-
</a>
|
|
249
|
-
</li>
|
|
250
|
-
))}
|
|
251
|
-
</ul>
|
|
252
|
-
)}
|
|
253
156
|
</div>
|
|
254
157
|
);
|
|
255
158
|
},
|
|
256
159
|
footer: (info) => info.column.id,
|
|
257
160
|
filterFn: filterCollectionByName('ownedServices'),
|
|
258
161
|
}),
|
|
162
|
+
|
|
259
163
|
columnHelper.accessor('data.associatedTeams', {
|
|
260
164
|
id: 'associatedTeams',
|
|
261
165
|
header: () => <span>{tableConfiguration.columns?.associatedTeams?.label || 'Teams'}</span>,
|
|
@@ -266,58 +170,56 @@ export const columns = (tableConfiguration: TableConfiguration) => [
|
|
|
266
170
|
},
|
|
267
171
|
cell: (info) => {
|
|
268
172
|
const teams = info.getValue();
|
|
269
|
-
|
|
270
|
-
const isExpandable = teams?.length > 10;
|
|
271
|
-
const isOpen = isExpandable ? teams?.length < 10 : true;
|
|
272
|
-
const [isExpanded, setIsExpanded] = useState(isOpen);
|
|
173
|
+
const [isExpanded, setIsExpanded] = useState(false);
|
|
273
174
|
|
|
274
175
|
if (teams?.length === 0 || !teams)
|
|
275
|
-
return
|
|
176
|
+
return (
|
|
177
|
+
<span className="inline-flex items-center px-2 py-1 text-xs text-gray-400 bg-gray-50 rounded-md border border-gray-100">
|
|
178
|
+
No teams
|
|
179
|
+
</span>
|
|
180
|
+
);
|
|
181
|
+
|
|
182
|
+
const visibleItems = isExpanded ? teams : teams.slice(0, 4);
|
|
183
|
+
const hiddenCount = teams.length - 4;
|
|
276
184
|
|
|
277
185
|
return (
|
|
278
|
-
<div>
|
|
279
|
-
{
|
|
280
|
-
<
|
|
281
|
-
{
|
|
186
|
+
<div className="flex flex-col gap-1.5">
|
|
187
|
+
{visibleItems.map((team: CollectionEntry<'teams'>, index: number) => (
|
|
188
|
+
<a
|
|
189
|
+
key={`${team.data.id}-${index}`}
|
|
190
|
+
href={buildUrl(`/docs/teams/${team.data.id}`)}
|
|
191
|
+
className="group inline-flex items-center"
|
|
192
|
+
>
|
|
193
|
+
<span className="inline-flex items-center rounded-md border border-gray-200 bg-white hover:border-pink-300 hover:bg-pink-50 transition-colors">
|
|
194
|
+
<span className="flex items-center justify-center w-6 h-6 bg-pink-500 rounded-l-md">
|
|
195
|
+
<Users className="h-3 w-3 text-white" />
|
|
196
|
+
</span>
|
|
197
|
+
<span className="px-2 py-1 text-xs text-gray-700 group-hover:text-gray-900">{team.data.name}</span>
|
|
198
|
+
</span>
|
|
199
|
+
</a>
|
|
200
|
+
))}
|
|
201
|
+
{hiddenCount > 0 && (
|
|
202
|
+
<button onClick={() => setIsExpanded(!isExpanded)} className="text-xs text-gray-500 hover:text-gray-700 text-left">
|
|
203
|
+
{isExpanded ? 'Show less' : `+${hiddenCount} more`}
|
|
282
204
|
</button>
|
|
283
205
|
)}
|
|
284
|
-
{isExpanded && (
|
|
285
|
-
<ul>
|
|
286
|
-
{teams.map((team: CollectionEntry<'teams'>, index: number) => (
|
|
287
|
-
<li key={`${team.data.id}-${index}`} className="py-1 group font-light ">
|
|
288
|
-
<a
|
|
289
|
-
href={buildUrl(`/docs/teams/${team.data.id}`)}
|
|
290
|
-
className="group-hover:text-primary flex space-x-1 items-center "
|
|
291
|
-
>
|
|
292
|
-
<div className={`flex items-center border border-gray-300 shadow-sm rounded-md`}>
|
|
293
|
-
<span className="flex items-center">
|
|
294
|
-
<span className={`bg-pink-500 h-full rounded-tl rounded-bl p-1`}>
|
|
295
|
-
<Users className="h-4 w-4 text-white" />
|
|
296
|
-
</span>
|
|
297
|
-
<span className="leading-none px-2 group-hover:underline ">{team.data.name}</span>
|
|
298
|
-
</span>
|
|
299
|
-
</div>
|
|
300
|
-
</a>
|
|
301
|
-
</li>
|
|
302
|
-
))}
|
|
303
|
-
</ul>
|
|
304
|
-
)}
|
|
305
206
|
</div>
|
|
306
207
|
);
|
|
307
208
|
},
|
|
308
209
|
footer: (info) => info.column.id,
|
|
309
210
|
filterFn: filterCollectionByName('associatedTeams'),
|
|
310
211
|
}),
|
|
212
|
+
|
|
311
213
|
columnHelper.accessor('data.name', {
|
|
312
214
|
header: () => <span>{tableConfiguration.columns?.actions?.label || 'Actions'}</span>,
|
|
313
215
|
cell: (info) => {
|
|
314
|
-
const
|
|
216
|
+
const item = info.row.original;
|
|
315
217
|
return (
|
|
316
218
|
<a
|
|
317
|
-
className="hover:
|
|
318
|
-
href={buildUrl(`/docs/${
|
|
219
|
+
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"
|
|
220
|
+
href={buildUrl(`/docs/${item.collection}/${item.data.id}`)}
|
|
319
221
|
>
|
|
320
|
-
View
|
|
222
|
+
View profile
|
|
321
223
|
</a>
|
|
322
224
|
);
|
|
323
225
|
},
|
|
@@ -7,7 +7,7 @@ import fs from 'fs';
|
|
|
7
7
|
import path from 'path';
|
|
8
8
|
|
|
9
9
|
// Enterprise Collections
|
|
10
|
-
import {
|
|
10
|
+
import { customPagesSchema } from './enterprise/collections';
|
|
11
11
|
|
|
12
12
|
export const projectDirBase = (() => {
|
|
13
13
|
if (process.platform === 'win32') {
|
|
@@ -91,8 +91,6 @@ const changelogs = defineCollection({
|
|
|
91
91
|
catalog: z
|
|
92
92
|
.object({
|
|
93
93
|
path: z.string(),
|
|
94
|
-
absoluteFilePath: z.string(),
|
|
95
|
-
astroContentFilePath: z.string(),
|
|
96
94
|
filePath: z.string(),
|
|
97
95
|
publicPath: z.string(),
|
|
98
96
|
type: z.string(),
|
|
@@ -196,7 +194,6 @@ const baseSchema = z.object({
|
|
|
196
194
|
.object({
|
|
197
195
|
path: z.string(),
|
|
198
196
|
filePath: z.string(),
|
|
199
|
-
astroContentFilePath: z.string(),
|
|
200
197
|
publicPath: z.string(),
|
|
201
198
|
type: z.string(),
|
|
202
199
|
})
|
|
@@ -469,14 +466,6 @@ const customPages = defineCollection({
|
|
|
469
466
|
schema: customPagesSchema,
|
|
470
467
|
});
|
|
471
468
|
|
|
472
|
-
const chatPrompts = defineCollection({
|
|
473
|
-
loader: glob({
|
|
474
|
-
pattern: ['chat-prompts/*.(md|mdx)', 'chat-prompts/**/*.@(md|mdx)'],
|
|
475
|
-
base: projectDirBase,
|
|
476
|
-
}),
|
|
477
|
-
schema: chatPromptsSchema,
|
|
478
|
-
});
|
|
479
|
-
|
|
480
469
|
const domains = defineCollection({
|
|
481
470
|
loader: glob({
|
|
482
471
|
pattern: [
|
|
@@ -722,7 +711,6 @@ export const collections = {
|
|
|
722
711
|
|
|
723
712
|
// EventCatalog Pro Collections
|
|
724
713
|
customPages,
|
|
725
|
-
chatPrompts,
|
|
726
714
|
|
|
727
715
|
// EventCatalog Studio Collections
|
|
728
716
|
designs,
|