@eventcatalog/core 3.14.5 → 3.15.0-beta.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/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/{chunk-Q3SQOTXP.js → chunk-4JTLFCQ7.js} +1 -1
- package/dist/{chunk-ECUL7YIZ.js → chunk-7RPTQBIY.js} +1 -1
- package/dist/{chunk-RBUQ5MZG.js → chunk-CVH4LGYA.js} +1 -1
- package/dist/{chunk-ZE5IIIEX.js → chunk-FRILQLHV.js} +1 -1
- package/dist/{chunk-HAM2SCXV.js → chunk-VUARMJ2E.js} +1 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.js +1 -1
- package/dist/eventcatalog.cjs +1 -1
- package/dist/eventcatalog.js +5 -5
- 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/src/components/SideNav/NestedSideBar/index.tsx +56 -10
- package/eventcatalog/src/content.config.ts +53 -0
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/[docType]/[docId]/[docVersion]/_index.data.ts +85 -0
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/[docType]/[docId]/[docVersion]/index.astro +195 -0
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/[docType]/[docId]/_index.data.ts +86 -0
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/[docType]/[docId]/index.astro +195 -0
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/asyncapi/[filename].astro +22 -1
- package/eventcatalog/src/stores/sidebar-store/builders/container.ts +9 -0
- package/eventcatalog/src/stores/sidebar-store/builders/data-product.ts +15 -9
- package/eventcatalog/src/stores/sidebar-store/builders/domain.ts +9 -0
- package/eventcatalog/src/stores/sidebar-store/builders/flow.ts +13 -4
- package/eventcatalog/src/stores/sidebar-store/builders/message.ts +9 -0
- package/eventcatalog/src/stores/sidebar-store/builders/service.ts +9 -0
- package/eventcatalog/src/stores/sidebar-store/builders/shared.ts +82 -0
- package/eventcatalog/src/stores/sidebar-store/state.ts +27 -2
- package/eventcatalog/src/utils/collections/data-products.ts +6 -2
- package/eventcatalog/src/utils/collections/resource-docs.ts +601 -0
- package/eventcatalog/src/utils/feature.ts +1 -0
- package/package.json +3 -3
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
log_build_default
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-VUARMJ2E.js";
|
|
4
|
+
import "../chunk-7RPTQBIY.js";
|
|
5
5
|
import "../chunk-4UVFXLPI.js";
|
|
6
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-FRILQLHV.js";
|
|
7
7
|
import "../chunk-5T63CXKU.js";
|
|
8
8
|
export {
|
|
9
9
|
log_build_default as default
|
package/dist/constants.cjs
CHANGED
package/dist/constants.js
CHANGED
package/dist/eventcatalog.cjs
CHANGED
|
@@ -115,7 +115,7 @@ var verifyRequiredFieldsAreInCatalogConfigFile = async (projectDirectory) => {
|
|
|
115
115
|
var import_picocolors = __toESM(require("picocolors"), 1);
|
|
116
116
|
|
|
117
117
|
// package.json
|
|
118
|
-
var version = "3.
|
|
118
|
+
var version = "3.15.0-beta.0";
|
|
119
119
|
|
|
120
120
|
// src/constants.ts
|
|
121
121
|
var VERSION = version;
|
package/dist/eventcatalog.js
CHANGED
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
} from "./chunk-PLNJC7NZ.js";
|
|
7
7
|
import {
|
|
8
8
|
log_build_default
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-VUARMJ2E.js";
|
|
10
|
+
import "./chunk-7RPTQBIY.js";
|
|
11
11
|
import "./chunk-4UVFXLPI.js";
|
|
12
12
|
import {
|
|
13
13
|
runMigrations
|
|
@@ -22,13 +22,13 @@ import {
|
|
|
22
22
|
} from "./chunk-3KXCGYET.js";
|
|
23
23
|
import {
|
|
24
24
|
generate
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-CVH4LGYA.js";
|
|
26
26
|
import {
|
|
27
27
|
logger
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-4JTLFCQ7.js";
|
|
29
29
|
import {
|
|
30
30
|
VERSION
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-FRILQLHV.js";
|
|
32
32
|
import {
|
|
33
33
|
getEventCatalogConfigFile,
|
|
34
34
|
verifyRequiredFieldsAreInCatalogConfigFile
|
package/dist/generate.cjs
CHANGED
package/dist/generate.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
generate
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-CVH4LGYA.js";
|
|
4
|
+
import "./chunk-4JTLFCQ7.js";
|
|
5
|
+
import "./chunk-FRILQLHV.js";
|
|
6
6
|
import "./chunk-5T63CXKU.js";
|
|
7
7
|
export {
|
|
8
8
|
generate
|
package/dist/utils/cli-logger.js
CHANGED
|
@@ -723,6 +723,7 @@ export default function NestedSideBar() {
|
|
|
723
723
|
const renderGroup = (group: NavNode, groupKey: string | null, index: number) => {
|
|
724
724
|
// Get optional icon for group
|
|
725
725
|
const GroupIcon = group.icon ? (LucideIcons as unknown as Record<string, LucideIcons.LucideIcon>)[group.icon] : null;
|
|
726
|
+
const isSubtleGroup = group.subtle === true;
|
|
726
727
|
|
|
727
728
|
// Get visible children
|
|
728
729
|
const visibleChildren =
|
|
@@ -730,43 +731,82 @@ export default function NestedSideBar() {
|
|
|
730
731
|
const child = resolveRef(childRef);
|
|
731
732
|
return child && isVisible(child);
|
|
732
733
|
}) ?? [];
|
|
734
|
+
const shouldFlattenSubtleChildren =
|
|
735
|
+
!isSubtleGroup &&
|
|
736
|
+
visibleChildren.length > 0 &&
|
|
737
|
+
visibleChildren.every((childRef) => {
|
|
738
|
+
const child = resolveRef(childRef);
|
|
739
|
+
return !!child && isGroup(child) && child.subtle === true;
|
|
740
|
+
});
|
|
733
741
|
|
|
734
742
|
const groupId = groupKey || `group-${index}`;
|
|
735
|
-
const isCollapsed = collapsedSections.has(groupId);
|
|
736
743
|
const canCollapse = visibleChildren.length > 3;
|
|
744
|
+
const isCollapsed = collapsedSections.has(groupId);
|
|
737
745
|
|
|
738
746
|
const headerContent = (
|
|
739
747
|
<>
|
|
740
748
|
<div className="flex items-center gap-2">
|
|
741
749
|
{GroupIcon && (
|
|
742
|
-
<span
|
|
743
|
-
|
|
750
|
+
<span
|
|
751
|
+
className={cn(
|
|
752
|
+
'flex items-center justify-center',
|
|
753
|
+
isSubtleGroup
|
|
754
|
+
? 'w-4 h-4 text-[rgb(var(--ec-content-text-muted))]'
|
|
755
|
+
: 'w-5 h-5 rounded bg-[rgb(var(--ec-group-icon-bg))] text-[rgb(var(--ec-group-icon-text))]'
|
|
756
|
+
)}
|
|
757
|
+
>
|
|
758
|
+
<GroupIcon className={cn(isSubtleGroup ? 'w-3 h-3' : 'w-3 h-3')} />
|
|
744
759
|
</span>
|
|
745
760
|
)}
|
|
746
|
-
<span
|
|
761
|
+
<span
|
|
762
|
+
className={cn(
|
|
763
|
+
'tracking-tight',
|
|
764
|
+
isSubtleGroup
|
|
765
|
+
? 'text-[12px] text-[rgb(var(--ec-content-text-muted))] font-medium'
|
|
766
|
+
: 'text-[13px] text-[rgb(var(--ec-content-text))] font-semibold'
|
|
767
|
+
)}
|
|
768
|
+
>
|
|
769
|
+
{group.title}
|
|
770
|
+
</span>
|
|
747
771
|
</div>
|
|
748
772
|
{canCollapse && (
|
|
749
773
|
<ChevronDown
|
|
750
|
-
className={cn(
|
|
774
|
+
className={cn(
|
|
775
|
+
isSubtleGroup ? 'w-3.5 h-3.5' : 'w-4 h-4',
|
|
776
|
+
'text-[rgb(var(--ec-icon-color))] transition-transform',
|
|
777
|
+
isCollapsed && '-rotate-90'
|
|
778
|
+
)}
|
|
751
779
|
/>
|
|
752
780
|
)}
|
|
753
781
|
</>
|
|
754
782
|
);
|
|
755
783
|
|
|
756
784
|
return (
|
|
757
|
-
<div key={`group-${groupKey || index}`} className=
|
|
785
|
+
<div key={`group-${groupKey || index}`} className={cn(isSubtleGroup ? 'mb-3 last:mb-1' : 'mb-5 last:mb-2')}>
|
|
758
786
|
{canCollapse ? (
|
|
759
787
|
<button
|
|
760
788
|
onClick={() => toggleSectionCollapse(groupId)}
|
|
761
|
-
className=
|
|
789
|
+
className={cn(
|
|
790
|
+
'flex items-center justify-between w-full rounded-md transition-colors cursor-pointer',
|
|
791
|
+
isSubtleGroup
|
|
792
|
+
? 'px-1.5 py-1 hover:bg-[rgb(var(--ec-content-hover))]/60'
|
|
793
|
+
: 'px-2 py-1.5 hover:bg-[rgb(var(--ec-content-hover))]'
|
|
794
|
+
)}
|
|
762
795
|
>
|
|
763
796
|
{headerContent}
|
|
764
797
|
</button>
|
|
765
798
|
) : (
|
|
766
|
-
<div className=
|
|
799
|
+
<div className={cn('flex items-center justify-between', isSubtleGroup ? 'px-1.5 py-1' : 'px-2 py-1.5')}>
|
|
800
|
+
{headerContent}
|
|
801
|
+
</div>
|
|
767
802
|
)}
|
|
768
803
|
{!isCollapsed && (
|
|
769
|
-
<div
|
|
804
|
+
<div
|
|
805
|
+
className={cn(
|
|
806
|
+
'flex flex-col gap-0.5 border-[rgb(var(--ec-content-border))]',
|
|
807
|
+
isSubtleGroup ? 'border-l ml-3 mt-0.5' : shouldFlattenSubtleChildren ? 'mt-1' : 'border-l ml-4 mt-1'
|
|
808
|
+
)}
|
|
809
|
+
>
|
|
770
810
|
{visibleChildren.map((childRef, childIndex) => {
|
|
771
811
|
const child = resolveRef(childRef);
|
|
772
812
|
if (!child) return null;
|
|
@@ -780,7 +820,13 @@ export default function NestedSideBar() {
|
|
|
780
820
|
return (
|
|
781
821
|
<div
|
|
782
822
|
key={`nested-group-${childKey || childIndex}`}
|
|
783
|
-
className=
|
|
823
|
+
className={cn(
|
|
824
|
+
child.subtle
|
|
825
|
+
? shouldFlattenSubtleChildren
|
|
826
|
+
? 'ml-5 mt-0.5'
|
|
827
|
+
: 'ml-1.5 mt-1 pl-1.5'
|
|
828
|
+
: 'ml-3 mt-1.5 pl-3 border-l border-[rgb(var(--ec-content-border))]'
|
|
829
|
+
)}
|
|
784
830
|
>
|
|
785
831
|
{renderGroup(child, childKey, childIndex)}
|
|
786
832
|
</div>
|
|
@@ -511,6 +511,57 @@ const customPages = defineCollection({
|
|
|
511
511
|
schema: customPagesSchema,
|
|
512
512
|
});
|
|
513
513
|
|
|
514
|
+
const resourceDocs = defineCollection({
|
|
515
|
+
loader: glob({
|
|
516
|
+
// Resource-level docs are restricted to known resource paths.
|
|
517
|
+
// This avoids scanning external docs such as node_modules/**/docs.
|
|
518
|
+
pattern: [
|
|
519
|
+
'{events,commands,queries,services,flows,containers,channels,entities,data-products}/*/docs/**/*.@(md|mdx)',
|
|
520
|
+
'{events,commands,queries,services,flows,containers,channels,entities,data-products}/*/versioned/*/docs/**/*.@(md|mdx)',
|
|
521
|
+
'domains/*/docs/**/*.@(md|mdx)',
|
|
522
|
+
'domains/*/versioned/*/docs/**/*.@(md|mdx)',
|
|
523
|
+
'domains/*/subdomains/*/docs/**/*.@(md|mdx)',
|
|
524
|
+
'domains/*/subdomains/*/versioned/*/docs/**/*.@(md|mdx)',
|
|
525
|
+
],
|
|
526
|
+
base: projectDirBase,
|
|
527
|
+
}),
|
|
528
|
+
schema: z.object({
|
|
529
|
+
id: z.string().optional(),
|
|
530
|
+
type: z.string().optional(),
|
|
531
|
+
version: z.string().optional(),
|
|
532
|
+
order: z.number().optional(),
|
|
533
|
+
badges: z.array(badge).optional(),
|
|
534
|
+
title: z.string().optional(),
|
|
535
|
+
summary: z.string().optional(),
|
|
536
|
+
slug: z.string().optional(),
|
|
537
|
+
hidden: z.boolean().optional(),
|
|
538
|
+
}),
|
|
539
|
+
});
|
|
540
|
+
|
|
541
|
+
const resourceDocCategories = defineCollection({
|
|
542
|
+
loader: glob({
|
|
543
|
+
pattern: [
|
|
544
|
+
'{events,commands,queries,services,flows,containers,channels,entities,data-products}/*/docs/**/category.json',
|
|
545
|
+
'{events,commands,queries,services,flows,containers,channels,entities,data-products}/*/docs/**/_category_.json',
|
|
546
|
+
'{events,commands,queries,services,flows,containers,channels,entities,data-products}/*/versioned/*/docs/**/category.json',
|
|
547
|
+
'{events,commands,queries,services,flows,containers,channels,entities,data-products}/*/versioned/*/docs/**/_category_.json',
|
|
548
|
+
'domains/*/docs/**/category.json',
|
|
549
|
+
'domains/*/docs/**/_category_.json',
|
|
550
|
+
'domains/*/versioned/*/docs/**/category.json',
|
|
551
|
+
'domains/*/versioned/*/docs/**/_category_.json',
|
|
552
|
+
'domains/*/subdomains/*/docs/**/category.json',
|
|
553
|
+
'domains/*/subdomains/*/docs/**/_category_.json',
|
|
554
|
+
'domains/*/subdomains/*/versioned/*/docs/**/category.json',
|
|
555
|
+
'domains/*/subdomains/*/versioned/*/docs/**/_category_.json',
|
|
556
|
+
],
|
|
557
|
+
base: projectDirBase,
|
|
558
|
+
}),
|
|
559
|
+
schema: z.object({
|
|
560
|
+
label: z.string().optional(),
|
|
561
|
+
position: z.number().optional(),
|
|
562
|
+
}),
|
|
563
|
+
});
|
|
564
|
+
|
|
514
565
|
const domains = defineCollection({
|
|
515
566
|
loader: glob({
|
|
516
567
|
pattern: [
|
|
@@ -778,6 +829,8 @@ export const collections = {
|
|
|
778
829
|
|
|
779
830
|
// EventCatalog Pro Collections
|
|
780
831
|
customPages,
|
|
832
|
+
resourceDocs,
|
|
833
|
+
resourceDocCategories,
|
|
781
834
|
|
|
782
835
|
// EventCatalog Studio Collections
|
|
783
836
|
designs,
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { isSSR, isResourceDocsEnabled } from '@utils/feature';
|
|
2
|
+
import { HybridPage } from '@utils/page-loaders/hybrid-page';
|
|
3
|
+
import { getResourceDocs, getResourceDocsForResource, type ResourceCollection } from '@utils/collections/resource-docs';
|
|
4
|
+
|
|
5
|
+
const supportedResourceCollections = new Set<ResourceCollection>([
|
|
6
|
+
'domains',
|
|
7
|
+
'services',
|
|
8
|
+
'events',
|
|
9
|
+
'commands',
|
|
10
|
+
'queries',
|
|
11
|
+
'flows',
|
|
12
|
+
'containers',
|
|
13
|
+
'channels',
|
|
14
|
+
'entities',
|
|
15
|
+
'data-products',
|
|
16
|
+
]);
|
|
17
|
+
|
|
18
|
+
export class Page extends HybridPage {
|
|
19
|
+
static async getStaticPaths() {
|
|
20
|
+
if (isSSR() || !isResourceDocsEnabled()) {
|
|
21
|
+
return [];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const docs = await getResourceDocs();
|
|
25
|
+
|
|
26
|
+
return docs.map((doc) => ({
|
|
27
|
+
params: {
|
|
28
|
+
type: doc.data.resourceCollection,
|
|
29
|
+
id: doc.data.resourceId,
|
|
30
|
+
version: doc.data.resourceVersion,
|
|
31
|
+
docType: doc.data.type,
|
|
32
|
+
docId: doc.data.id,
|
|
33
|
+
docVersion: doc.data.version,
|
|
34
|
+
},
|
|
35
|
+
props: {},
|
|
36
|
+
}));
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
protected static async fetchData(params: any) {
|
|
40
|
+
if (!isResourceDocsEnabled()) {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const decodeParam = (value: string) => {
|
|
45
|
+
try {
|
|
46
|
+
return decodeURIComponent(value);
|
|
47
|
+
} catch {
|
|
48
|
+
return value;
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const type = decodeParam(params.type);
|
|
53
|
+
const id = decodeParam(params.id);
|
|
54
|
+
const version = decodeParam(params.version);
|
|
55
|
+
const docType = decodeParam(params.docType);
|
|
56
|
+
const docId = decodeParam(params.docId);
|
|
57
|
+
const docVersion = decodeParam(params.docVersion);
|
|
58
|
+
if (!type || !id || !version || !docType || !docId || !docVersion) {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if (!supportedResourceCollections.has(type as ResourceCollection)) {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const docsForResource = await getResourceDocsForResource(type as ResourceCollection, id, version);
|
|
67
|
+
const doc = docsForResource.find(
|
|
68
|
+
(resourceDoc) =>
|
|
69
|
+
resourceDoc.data.type === docType && resourceDoc.data.id === docId && resourceDoc.data.version === docVersion
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
if (!doc) {
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return doc;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
protected static createNotFoundResponse(): Response {
|
|
80
|
+
return new Response(null, {
|
|
81
|
+
status: 404,
|
|
82
|
+
statusText: 'Resource documentation not found',
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
}
|
package/eventcatalog/src/pages/docs/[type]/[id]/[version]/[docType]/[docId]/[docVersion]/index.astro
ADDED
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { render } from 'astro:content';
|
|
3
|
+
|
|
4
|
+
import VerticalSideBarLayout from '@layouts/VerticalSideBarLayout.astro';
|
|
5
|
+
import components from '@components/MDX/components';
|
|
6
|
+
import { buildUrl } from '@utils/url-builder';
|
|
7
|
+
import { AlignLeftIcon, HistoryIcon } from 'lucide-react';
|
|
8
|
+
import { isResourceDocsEnabled } from '@utils/feature';
|
|
9
|
+
import { getIcon } from '@utils/badges';
|
|
10
|
+
import { collectionToResourceMap } from '@utils/collections/util';
|
|
11
|
+
|
|
12
|
+
import { Page } from './_index.data';
|
|
13
|
+
|
|
14
|
+
export const prerender = Page.prerender;
|
|
15
|
+
export const getStaticPaths = Page.getStaticPaths;
|
|
16
|
+
|
|
17
|
+
if (!isResourceDocsEnabled()) {
|
|
18
|
+
return Astro.redirect(buildUrl('/docs/custom/feature'));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const props = await Page.getData(Astro);
|
|
22
|
+
const { Content, headings } = await render(props);
|
|
23
|
+
|
|
24
|
+
const title = props.data.title || props.data.id;
|
|
25
|
+
const pageTitle = `${title} | ${props.data.resourceId}`;
|
|
26
|
+
const versions = props.data.versions || [props.data.version];
|
|
27
|
+
const badges = (props.data.badges || []).map((badge: any) => ({
|
|
28
|
+
...badge,
|
|
29
|
+
iconComponent: badge.icon ? getIcon(badge.icon) : null,
|
|
30
|
+
}));
|
|
31
|
+
|
|
32
|
+
const docsBasePath = `/docs/${props.data.resourceCollection}/${props.data.resourceId}/${props.data.resourceVersion}/${encodeURIComponent(props.data.type)}/${encodeURIComponent(props.data.id)}`;
|
|
33
|
+
const singularResourceName =
|
|
34
|
+
collectionToResourceMap[props.data.resourceCollection as keyof typeof collectionToResourceMap] ??
|
|
35
|
+
props.data.resourceCollection.slice(0, props.data.resourceCollection.length - 1);
|
|
36
|
+
|
|
37
|
+
const pagefindAttributes =
|
|
38
|
+
props.data.version === props.data.latestVersion
|
|
39
|
+
? {
|
|
40
|
+
'data-pagefind-body': '',
|
|
41
|
+
'data-pagefind-meta': `title:${pageTitle}`,
|
|
42
|
+
}
|
|
43
|
+
: {};
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
<VerticalSideBarLayout title={pageTitle} description={props.data.summary}>
|
|
47
|
+
<main class="flex docs-layout h-full bg-[rgb(var(--ec-page-bg))]" {...pagefindAttributes}>
|
|
48
|
+
<div class="flex docs-layout w-full pl-16">
|
|
49
|
+
<div class="w-full lg:mr-2 pr-8 overflow-y-auto py-8 bg-[rgb(var(--ec-page-bg))]">
|
|
50
|
+
<div class="border-b border-[rgb(var(--ec-page-border))] pb-4">
|
|
51
|
+
<p class="text-xs uppercase tracking-wide text-[rgb(var(--ec-page-text-muted))]">
|
|
52
|
+
<a
|
|
53
|
+
href={buildUrl(`/docs/${props.data.resourceCollection}/${props.data.resourceId}/${props.data.resourceVersion}`)}
|
|
54
|
+
class="hover:underline"
|
|
55
|
+
>
|
|
56
|
+
{singularResourceName}: {props.data.resourceId}
|
|
57
|
+
</a>
|
|
58
|
+
</p>
|
|
59
|
+
<div class="flex items-center gap-2 pt-1">
|
|
60
|
+
<h2 id="doc-page-header" class="text-2xl md:text-4xl font-bold text-[rgb(var(--ec-page-text))]">{title}</h2>
|
|
61
|
+
<span
|
|
62
|
+
class="text-xs rounded-md px-2 py-1 bg-[rgb(var(--ec-content-hover))] text-[rgb(var(--ec-page-text-muted))] border border-[rgb(var(--ec-page-border))]"
|
|
63
|
+
>
|
|
64
|
+
v{props.data.version}
|
|
65
|
+
{props.data.version === props.data.latestVersion && ' (latest)'}
|
|
66
|
+
</span>
|
|
67
|
+
</div>
|
|
68
|
+
{
|
|
69
|
+
props.data.summary && (
|
|
70
|
+
<p class="text-lg pt-2 text-[rgb(var(--ec-page-text-muted))] font-light">{props.data.summary}</p>
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
{
|
|
74
|
+
badges.length > 0 && (
|
|
75
|
+
<div class="flex flex-wrap gap-3 pt-4">
|
|
76
|
+
{badges.map((badge: any) => (
|
|
77
|
+
<span
|
|
78
|
+
class={`
|
|
79
|
+
inline-flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm font-medium
|
|
80
|
+
bg-[rgb(var(--ec-content-hover))] border border-[rgb(var(--ec-page-border))]
|
|
81
|
+
text-[rgb(var(--ec-page-text))]
|
|
82
|
+
`}
|
|
83
|
+
>
|
|
84
|
+
{badge.iconComponent && (
|
|
85
|
+
<badge.iconComponent className="w-4 h-4 flex-shrink-0 text-[rgb(var(--ec-icon-color))]" />
|
|
86
|
+
)}
|
|
87
|
+
<span>{badge.content}</span>
|
|
88
|
+
</span>
|
|
89
|
+
))}
|
|
90
|
+
</div>
|
|
91
|
+
)
|
|
92
|
+
}
|
|
93
|
+
</div>
|
|
94
|
+
<div data-pagefind-ignore>
|
|
95
|
+
{
|
|
96
|
+
props.data.version !== props.data.latestVersion && (
|
|
97
|
+
<div class="rounded-md bg-[rgb(var(--ec-accent-subtle))] p-4 not-prose my-4">
|
|
98
|
+
<div class="flex">
|
|
99
|
+
<div class="flex-shrink-0">
|
|
100
|
+
<svg class="h-5 w-5 text-[rgb(var(--ec-accent))]" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
|
|
101
|
+
<path
|
|
102
|
+
fill-rule="evenodd"
|
|
103
|
+
d="M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495zM10 5a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0v-3.5A.75.75 0 0110 5zm0 9a1 1 0 100-2 1 1 0 000 2z"
|
|
104
|
+
clip-rule="evenodd"
|
|
105
|
+
/>
|
|
106
|
+
</svg>
|
|
107
|
+
</div>
|
|
108
|
+
<div class="ml-3">
|
|
109
|
+
<h3 class="text-sm font-medium text-[rgb(var(--ec-accent-text))]">New version found</h3>
|
|
110
|
+
<div class="mt-2 text-sm text-[rgb(var(--ec-accent-text))]">
|
|
111
|
+
<p>
|
|
112
|
+
You are looking at a previous version of the {singularResourceName} doc <strong>{title}</strong>.{' '}
|
|
113
|
+
<a
|
|
114
|
+
class="underline hover:text-primary block pt-2"
|
|
115
|
+
href={buildUrl(`${docsBasePath}/${props.data.latestVersion}`)}
|
|
116
|
+
>
|
|
117
|
+
The latest version of this doc is <span>v{props.data.latestVersion}</span> →
|
|
118
|
+
</a>
|
|
119
|
+
</p>
|
|
120
|
+
</div>
|
|
121
|
+
</div>
|
|
122
|
+
</div>
|
|
123
|
+
</div>
|
|
124
|
+
)
|
|
125
|
+
}
|
|
126
|
+
</div>
|
|
127
|
+
<div class="prose py-8 max-w-none">
|
|
128
|
+
<Content components={components(props)} />
|
|
129
|
+
</div>
|
|
130
|
+
</div>
|
|
131
|
+
<aside class="hidden lg:block sticky top-0 pb-10 w-80 overflow-y-auto border-l border-[rgb(var(--ec-page-border))] py-2">
|
|
132
|
+
<div class="sticky top-28 left-0 h-full overflow-y-auto px-6 py-4">
|
|
133
|
+
<h3 class="text-sm text-[rgb(var(--ec-page-text))] font-semibold capitalize flex items-center gap-2">
|
|
134
|
+
<AlignLeftIcon className="w-4 h-4" />
|
|
135
|
+
On this page
|
|
136
|
+
</h3>
|
|
137
|
+
<nav class="space-y-1 text-sm py-4">
|
|
138
|
+
{
|
|
139
|
+
headings.map((heading) => {
|
|
140
|
+
if (heading.depth > 3) {
|
|
141
|
+
return null;
|
|
142
|
+
}
|
|
143
|
+
return (
|
|
144
|
+
<a
|
|
145
|
+
href={`#${heading.slug}`}
|
|
146
|
+
class={`block text-[12px] py-0.5 ${heading.depth === 1 ? 'font-light' : ''} text-[rgb(var(--ec-page-text-muted))] hover:text-[rgb(var(--ec-page-text))]`}
|
|
147
|
+
style={`padding-left: ${(heading.depth - 1) * 8}px`}
|
|
148
|
+
>
|
|
149
|
+
{heading.text}
|
|
150
|
+
</a>
|
|
151
|
+
);
|
|
152
|
+
})
|
|
153
|
+
}
|
|
154
|
+
</nav>
|
|
155
|
+
<div class="space-y-2 pb-4">
|
|
156
|
+
<span class="text-xs text-[rgb(var(--ec-page-text))] font-semibold capitalize">Versions ({versions.length})</span>
|
|
157
|
+
<ul role="list" class="space-y-2">
|
|
158
|
+
{
|
|
159
|
+
versions.map((version: string) => (
|
|
160
|
+
<li class="version-item rounded-md px-1 group w-full">
|
|
161
|
+
<a class="flex items-center space-x-2" href={buildUrl(`${docsBasePath}/${encodeURIComponent(version)}`)}>
|
|
162
|
+
<HistoryIcon
|
|
163
|
+
className="h-4 w-4 text-[rgb(var(--ec-page-text-muted))] group-hover:text-[rgb(var(--ec-accent-text))]"
|
|
164
|
+
strokeWidth={1}
|
|
165
|
+
/>
|
|
166
|
+
<span
|
|
167
|
+
class={`font-light text-xs text-[rgb(var(--ec-page-text))] group-hover:text-[rgb(var(--ec-accent-text))] ${
|
|
168
|
+
version === props.data.version ? 'underline' : ''
|
|
169
|
+
}`}
|
|
170
|
+
>
|
|
171
|
+
{version === props.data.latestVersion ? `v${version} (latest)` : `v${version}`}
|
|
172
|
+
</span>
|
|
173
|
+
</a>
|
|
174
|
+
</li>
|
|
175
|
+
))
|
|
176
|
+
}
|
|
177
|
+
</ul>
|
|
178
|
+
<div class="border-b border-[rgb(var(--ec-page-border))] pt-2"></div>
|
|
179
|
+
</div>
|
|
180
|
+
</div>
|
|
181
|
+
</aside>
|
|
182
|
+
</div>
|
|
183
|
+
</main>
|
|
184
|
+
</VerticalSideBarLayout>
|
|
185
|
+
|
|
186
|
+
<style is:global>
|
|
187
|
+
.docs-layout .prose {
|
|
188
|
+
max-width: none;
|
|
189
|
+
overflow: auto;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.version-item:hover {
|
|
193
|
+
background: linear-gradient(to left, rgb(var(--ec-accent-gradient-from)), rgb(var(--ec-accent-gradient-to)));
|
|
194
|
+
}
|
|
195
|
+
</style>
|