@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
@@ -15,6 +15,7 @@ import Admonition from '@components/MDX/Admonition';
15
15
  import VersionList from '@components/Lists/VersionList.astro';
16
16
  import CopyAsMarkdown from '@components/CopyAsMarkdown';
17
17
  import FavoriteButton from '@components/FavoriteButton';
18
+ import Badge from '@components/Badge.astro';
18
19
  import { shouldRenderSideBarSection } from '@stores/sidebar-store/builders/shared';
19
20
 
20
21
  import {
@@ -34,7 +35,6 @@ import { getSpecificationsForService } from '@utils/collections/services';
34
35
  import { resourceToCollectionMap, collectionToResourceMap, getDeprecatedDetails } from '@utils/collections/util';
35
36
  import { getSchemasFromResource } from '@utils/collections/schemas';
36
37
  import { getIcon } from '@utils/badges';
37
- import { getBadgeStyle } from '@utils/badge-styles';
38
38
  import { buildUrl, buildEditUrlForResource } from '@utils/url-builder';
39
39
  import { isIconPath, resolveIconUrl } from '@utils/icon';
40
40
  import {
@@ -377,23 +377,7 @@ if (!hasCurrentFlowEmbed && !hasCurrentPageNodeGraph) {
377
377
  badges && (
378
378
  <div class="flex flex-wrap gap-3 pt-6 pb-2">
379
379
  {badges.map((badge: any) => {
380
- return (
381
- <span
382
- id={badge.id || ''}
383
- class={`
384
- inline-flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm font-medium
385
- ${badge.backgroundColor ? 'bg-[rgb(var(--ec-content-hover))]' : 'bg-transparent'} border border-[rgb(var(--ec-page-border))]
386
- text-[rgb(var(--ec-page-text))]
387
- shadow-xs
388
- ${badge.class ? badge.class : ''}
389
- `}
390
- style={getBadgeStyle(badge)}
391
- >
392
- {badge.icon && <badge.icon className="w-4 h-4 flex-shrink-0" />}
393
- {badge.iconURL && <img src={badge.iconURL} class="w-4 h-4 flex-shrink-0 opacity-80" alt="" />}
394
- <span>{badge.content}</span>
395
- </span>
396
- );
380
+ return <Badge badge={badge} />;
397
381
  })}
398
382
  </div>
399
383
  )
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  import RectangleGroupIcon from '@heroicons/react/24/outline/RectangleGroupIcon';
3
+ import Badge from '@components/Badge.astro';
3
4
  import Footer from '@layouts/Footer.astro';
4
5
  import VerticalSideBarLayout from '@layouts/VerticalSideBarLayout.astro';
5
6
  import { buildUrl } from '@utils/url-builder';
@@ -80,17 +81,7 @@ const badges = [
80
81
  badges && badges.length > 0 && (
81
82
  <div class="flex flex-wrap gap-3 py-4">
82
83
  {badges.map((badge: any) => {
83
- return (
84
- <span
85
- class="inline-flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm font-medium
86
- bg-[rgb(var(--ec-content-hover))] border border-[rgb(var(--ec-page-border))]
87
- text-[rgb(var(--ec-page-text))] shadow-xs"
88
- >
89
- {badge.icon && <badge.icon className="w-4 h-4 flex-shrink-0 text-[rgb(var(--ec-icon-color))]" />}
90
- {badge.iconURL && <img src={badge.iconURL} class="w-4 h-4 flex-shrink-0 opacity-80" alt="" />}
91
- <span>{badge.content}</span>
92
- </span>
93
- );
84
+ return <Badge badge={badge} />;
94
85
  })}
95
86
  </div>
96
87
  )
@@ -1,8 +1,23 @@
1
+ import { buildUrl } from './url-builder';
2
+
1
3
  type BadgeColorKind = 'background' | 'text';
2
4
 
3
5
  type Badge = {
4
6
  backgroundColor?: string;
5
7
  textColor?: string;
8
+ url?: string;
9
+ };
10
+
11
+ const URL_SCHEME_PATTERN = /^[a-z][a-z\d+\-.]*:/i;
12
+ const PROTOCOL_RELATIVE_URL_PATTERN = /^\/\//;
13
+ const SAFE_BADGE_URL_SCHEMES = new Set(['http:', 'https:', 'mailto:', 'tel:']);
14
+
15
+ const isAlreadyBasePrefixed = (url: string) => {
16
+ const baseUrl = import.meta.env.BASE_URL;
17
+ if (!baseUrl || baseUrl === '/') return false;
18
+
19
+ const normalizedBaseUrl = baseUrl.endsWith('/') ? baseUrl.slice(0, -1) : baseUrl;
20
+ return url === normalizedBaseUrl || url.startsWith(`${normalizedBaseUrl}/`);
6
21
  };
7
22
 
8
23
  const NAMED_BADGE_COLOR_KEYS = new Set([
@@ -204,3 +219,19 @@ export const getBadgeReactStyle = (badge: Badge) => {
204
219
  ...(color ? { color } : {}),
205
220
  };
206
221
  };
222
+
223
+ export const getBadgeHref = (badge: Badge) => {
224
+ if (!badge.url) return undefined;
225
+
226
+ const url = badge.url.trim();
227
+ if (!url) return undefined;
228
+ if (url.startsWith('#') || url.startsWith('?') || PROTOCOL_RELATIVE_URL_PATTERN.test(url)) return url;
229
+
230
+ const scheme = URL_SCHEME_PATTERN.exec(url)?.[0].toLowerCase();
231
+ if (scheme) return SAFE_BADGE_URL_SCHEMES.has(scheme) ? url : undefined;
232
+
233
+ if (isAlreadyBasePrefixed(url)) return url;
234
+ if (url.startsWith('/')) return buildUrl(url);
235
+
236
+ return url;
237
+ };
@@ -0,0 +1,41 @@
1
+ export type SidebarVisibilityConfig = {
2
+ id: string;
3
+ visible: boolean;
4
+ };
5
+
6
+ export type SidebarConfigurableItem = {
7
+ id: string;
8
+ aliases?: string[];
9
+ visible?: boolean;
10
+ };
11
+
12
+ const getVisibilityOption = <T extends SidebarConfigurableItem>(
13
+ item: T,
14
+ configuration: SidebarVisibilityConfig[]
15
+ ): SidebarVisibilityConfig | undefined => {
16
+ const exactMatch = configuration.find((option) => option.id === item.id);
17
+
18
+ if (exactMatch) {
19
+ return exactMatch;
20
+ }
21
+
22
+ return configuration.find((option) => item.aliases?.includes(option.id));
23
+ };
24
+
25
+ export const isSidebarItemVisible = <T extends SidebarConfigurableItem>(
26
+ item: T,
27
+ configuration: SidebarVisibilityConfig[] = []
28
+ ): boolean => {
29
+ const visibilityOption = getVisibilityOption(item, configuration);
30
+
31
+ if (visibilityOption) {
32
+ return visibilityOption.visible;
33
+ }
34
+
35
+ return item.visible ?? true;
36
+ };
37
+
38
+ export const filterSidebarItems = <T extends SidebarConfigurableItem>(
39
+ items: T[],
40
+ configuration: SidebarVisibilityConfig[] = []
41
+ ): T[] => items.filter((item) => isSidebarItemVisible(item, configuration));
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  },
8
8
  "license": "SEE LICENSE IN LICENSE",
9
9
  "type": "module",
10
- "version": "3.39.4",
10
+ "version": "3.39.6",
11
11
  "publishConfig": {
12
12
  "access": "public"
13
13
  },
@@ -106,9 +106,9 @@
106
106
  "update-notifier": "^7.3.1",
107
107
  "uuid": "^10.0.0",
108
108
  "zod": "^4.3.6",
109
- "@eventcatalog/sdk": "2.21.1",
110
- "@eventcatalog/visualiser": "^3.21.0",
111
- "@eventcatalog/linter": "1.0.23"
109
+ "@eventcatalog/sdk": "2.21.2",
110
+ "@eventcatalog/linter": "1.0.24",
111
+ "@eventcatalog/visualiser": "^3.21.0"
112
112
  },
113
113
  "devDependencies": {
114
114
  "@astrojs/check": "^0.9.9",