@eventcatalog/core 2.26.1 → 2.28.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.
Files changed (37) 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-TOTPAQ4C.js → chunk-KGWJTMWU.js} +1 -1
  6. package/dist/{chunk-M7ERKXSB.js → chunk-KYGD25IE.js} +1 -1
  7. package/dist/{chunk-JCGLXXSE.js → chunk-RCPEAVRY.js} +1 -1
  8. package/dist/constants.cjs +1 -1
  9. package/dist/constants.js +1 -1
  10. package/dist/eventcatalog.cjs +1 -1
  11. package/dist/eventcatalog.config.d.cts +1 -4
  12. package/dist/eventcatalog.config.d.ts +1 -4
  13. package/dist/eventcatalog.js +3 -3
  14. package/eventcatalog/astro.config.mjs +0 -3
  15. package/eventcatalog/public/logo.svg +14 -0
  16. package/eventcatalog/src/components/Grids/DomainGrid.tsx +233 -0
  17. package/eventcatalog/src/components/Grids/MessageGrid.tsx +457 -0
  18. package/eventcatalog/src/components/Grids/ServiceGrid.tsx +362 -0
  19. package/eventcatalog/src/components/Grids/components.tsx +170 -0
  20. package/eventcatalog/src/components/Grids/utils.tsx +38 -0
  21. package/eventcatalog/src/components/SideNav/ListViewSideBar/components/CollapsibleGroup.tsx +46 -0
  22. package/eventcatalog/src/components/SideNav/ListViewSideBar/components/MessageList.tsx +31 -0
  23. package/eventcatalog/src/components/SideNav/ListViewSideBar/index.tsx +390 -0
  24. package/eventcatalog/src/components/SideNav/ListViewSideBar/types.ts +48 -0
  25. package/eventcatalog/src/components/SideNav/ListViewSideBar/utils.ts +103 -0
  26. package/eventcatalog/src/components/SideNav/SideNav.astro +8 -7
  27. package/eventcatalog/src/layouts/VerticalSideBarLayout.astro +34 -22
  28. package/eventcatalog/src/pages/architecture/[type]/index.astro +14 -0
  29. package/eventcatalog/src/pages/architecture/architecture.astro +81 -0
  30. package/eventcatalog/src/pages/architecture/docs/[type]/index.astro +14 -0
  31. package/eventcatalog/src/pages/index.astro +237 -72
  32. package/eventcatalog/src/utils/url-builder.ts +20 -0
  33. package/eventcatalog/tailwind.config.mjs +11 -0
  34. package/package.json +2 -1
  35. package/eventcatalog/src/components/SideNav/CatalogResourcesSideBar/getCatalogResources.ts +0 -65
  36. package/eventcatalog/src/components/SideNav/CatalogResourcesSideBar/index.tsx +0 -138
  37. package/eventcatalog/src/components/SideNav/CatalogResourcesSideBar/styles.css +0 -8
@@ -1,138 +0,0 @@
1
- import React, { useState, useEffect, useMemo } from 'react';
2
- import debounce from 'lodash.debounce';
3
- import { ChevronDownIcon, ChevronUpIcon } from '@heroicons/react/24/outline';
4
- import './styles.css';
5
- import { getIconForCollection as getIconForCollectionOriginal } from '@utils/collections/icons';
6
-
7
- const STORAGE_KEY = 'EventCatalog:catalogSidebarCollapsedGroups';
8
-
9
- interface CatalogResourcesSideBarProps {
10
- resources: any;
11
- currentPath: string;
12
- }
13
-
14
- const CatalogResourcesSideBar: React.FC<CatalogResourcesSideBarProps> = ({ resources, currentPath }) => {
15
- if (typeof window === 'undefined') {
16
- return null;
17
- }
18
-
19
- const [data, setData] = useState(resources);
20
- const [searchQuery, setSearchQuery] = useState('');
21
- const [isInitialized, setIsInitialized] = useState(false);
22
- const [collapsedGroups, setCollapsedGroups] = useState<{ [key: string]: boolean }>(() => {
23
- if (typeof window !== 'undefined') {
24
- const saved = window.localStorage.getItem(STORAGE_KEY);
25
- setIsInitialized(true);
26
- return saved ? JSON.parse(saved) : {};
27
- }
28
- return {};
29
- });
30
- const decodedCurrentPath = decodeURIComponent(currentPath);
31
-
32
- useEffect(() => {
33
- if (typeof window !== 'undefined') {
34
- window.localStorage.setItem(STORAGE_KEY, JSON.stringify(collapsedGroups));
35
- }
36
- }, [collapsedGroups]);
37
-
38
- const handleSearch = (e: React.ChangeEvent<HTMLInputElement>) => {
39
- setSearchQuery(e.target.value);
40
- };
41
-
42
- const debouncedHandleSearch = useMemo(() => debounce(handleSearch, 300), []);
43
-
44
- useEffect(() => {
45
- return () => {
46
- debouncedHandleSearch.cancel();
47
- };
48
- }, [debouncedHandleSearch]);
49
-
50
- const toggleGroupCollapse = (group: string) => {
51
- setCollapsedGroups((prev) => ({
52
- ...prev,
53
- [group]: !prev[group],
54
- }));
55
- };
56
-
57
- const filteredData = useMemo(() => {
58
- if (!searchQuery) return data;
59
-
60
- const lowercasedQuery = searchQuery.toLowerCase();
61
- const filterCollection = (collection: any[]) =>
62
- collection.filter((item) => item.label.toLowerCase().includes(lowercasedQuery));
63
-
64
- return Object.keys(data).reduce((acc, key) => {
65
- const filteredCollection = filterCollection(data[key]);
66
- if (filteredCollection.length > 0) {
67
- acc[key] = filteredCollection;
68
- }
69
- return acc;
70
- }, {} as any);
71
- }, [searchQuery, data]);
72
-
73
- const getIconForCollection = useMemo(() => getIconForCollectionOriginal, []);
74
-
75
- if (!isInitialized) return null;
76
-
77
- return (
78
- <nav className="space-y-6 text-black px-5 py-4 ">
79
- <div className="space-y-2">
80
- <div className="mb-4 px-1">
81
- <input
82
- type="text"
83
- placeholder="Filter catalog..."
84
- className="w-full font-light px-3 py-1 text-sm text-gray-600 border border-purple-300 rounded-md focus:outline-none focus:ring-2 focus:ring-purple-500"
85
- onChange={debouncedHandleSearch}
86
- />
87
- </div>
88
-
89
- {Object.keys(filteredData).length === 0 ? (
90
- <div className="px-2 text-gray-400 dark:text-gray-200 text-sm">No results found</div>
91
- ) : (
92
- Object.keys(filteredData).map((key) => {
93
- const collection = filteredData[key];
94
- if (collection[0] && collection[0].visible === false) return null;
95
- const isCollapsed = collapsedGroups[key];
96
-
97
- return (
98
- <ul className="w-full space-y-1.5 pb-2 pl-1 text-black" key={key}>
99
- <li
100
- className="font capitalize cursor-pointer flex items-center ml-1 text-[14px]"
101
- onClick={() => toggleGroupCollapse(key)}
102
- >
103
- <span className="">{`${key} (${collection.length})`}</span>
104
- <span className="ml-2 block">
105
- {isCollapsed ? <ChevronDownIcon className="w-3 h-3" /> : <ChevronUpIcon className="w-3 h-3" />}
106
- </span>
107
- </li>
108
- {!isCollapsed &&
109
- collection.map((item: any) => {
110
- const Icon = getIconForCollection(item.collection);
111
- return (
112
- <li
113
- className={`w-full has-tooltip text-md xl:text-sm space-y-2 scroll-m-20 rounded-md text-black hover:bg-gradient-to-l hover:from-purple-500 hover:to-purple-700 hover:text-white ${decodedCurrentPath.includes(item.href) ? ' bg-gradient-to-l from-purple-500 to-purple-700 font-normal text-white ' : 'font-thin'}`}
114
- id={item.href}
115
- key={item.href}
116
- >
117
- <a className={`flex px-1 justify-start items-center w-full rounded-md `} href={`${item.href}`}>
118
- <Icon className="w-3 mr-2" />
119
- <span className="block truncate !whitespace-normal">{item.label}</span>
120
- {/* {item.label.length > 2 && (
121
- <span className="tooltip rounded relative shadow-lg p-1 font-normal text-xs bg-white text-black ml-[30px] mt-12">
122
- {item.label}
123
- </span>
124
- )} */}
125
- </a>
126
- </li>
127
- );
128
- })}
129
- </ul>
130
- );
131
- })
132
- )}
133
- </div>
134
- </nav>
135
- );
136
- };
137
-
138
- export default CatalogResourcesSideBar;
@@ -1,8 +0,0 @@
1
- .tooltip {
2
- visibility: hidden;
3
- position: absolute;
4
- }
5
- .has-tooltip:hover .tooltip {
6
- visibility: visible;
7
- z-index: 100;
8
- }