+
{title && (
-
+
{title}
{badge && }
diff --git a/www/packages/docs-ui/src/components/ChildDocs/index.tsx b/www/packages/docs-ui/src/components/ChildDocs/index.tsx
index e237852c48..ec33520709 100644
--- a/www/packages/docs-ui/src/components/ChildDocs/index.tsx
+++ b/www/packages/docs-ui/src/components/ChildDocs/index.tsx
@@ -10,6 +10,7 @@ type ChildDocsProps = {
hideItems?: string[]
showItems?: string[]
hideTitle?: boolean
+ childLevel?: number
}
export const ChildDocs = ({
@@ -18,6 +19,7 @@ export const ChildDocs = ({
showItems,
type = "sidebar",
hideTitle = false,
+ childLevel = 1,
}: ChildDocsProps) => {
const { currentItems, getActiveItem } = useSidebar()
const filterType = useMemo(() => {
@@ -79,6 +81,32 @@ export const ChildDocs = ({
}
}, [currentItems, type, getActiveItem, filterItems])
+ const getChildrenForLevel = (
+ item: SidebarItemType,
+ currentLevel = 1
+ ): SidebarItemType[] | undefined => {
+ if (currentLevel === childLevel) {
+ return item.children
+ }
+ if (!item.children) {
+ return
+ }
+
+ const childrenResult: SidebarItemType[] = []
+
+ item.children.forEach((child) => {
+ const childChildren = getChildrenForLevel(child, currentLevel + 1)
+
+ if (!childChildren) {
+ return
+ }
+
+ childrenResult.push(...childChildren)
+ })
+
+ return childrenResult
+ }
+
const getTopLevelElms = (items?: SidebarItemType[]) => (
items?.map((item, key) => {
- const HeadingComponent = item.children?.length
+ const itemChildren = getChildrenForLevel(item)
+ const HeadingComponent = itemChildren?.length
? MDXComponents["h2"]
: undefined
@@ -104,7 +133,7 @@ export const ChildDocs = ({
{!hideTitle && {item.title}}
({
+ itemChildren?.map((childItem) => ({
title: childItem.title,
href: childItem.path,
showLinkIcon: false,
diff --git a/www/utils/packages/typedoc-generate-references/src/constants/merger-custom-options/core-flows.ts b/www/utils/packages/typedoc-generate-references/src/constants/merger-custom-options/core-flows.ts
index 3e36900b75..cd675aaebd 100644
--- a/www/utils/packages/typedoc-generate-references/src/constants/merger-custom-options/core-flows.ts
+++ b/www/utils/packages/typedoc-generate-references/src/constants/merger-custom-options/core-flows.ts
@@ -11,42 +11,7 @@ const coreFlowsOptions: FormattingOptionsType = {
workflowDiagramComponent: "WorkflowDiagram",
mdxImports: [`import { TypeList, WorkflowDiagram } from "docs-ui"`],
},
- "^modules/core_flows/page\\.mdx": {
- reflectionDescription:
- "This section of the documentation provides a reference to Medusa's workflows and steps that you can use in your customizations.",
- reflectionGroups: {
- Namespaces: true,
- Enumerations: false,
- Classes: false,
- Interfaces: false,
- "Type Aliases": false,
- Variables: false,
- "Enumeration Members": false,
- Functions: false,
- },
- hideTocHeaders: true,
- frontmatterData: {
- slug: "/references/medusa-workflows",
- },
- reflectionTitle: {
- fullReplacement: "Medusa Workflows API Reference",
- },
- },
- "^core_flows/.*/.*(Workflows|Steps)/page\\.mdx": {
- expandMembers: false,
- reflectionGroups: {
- Variables: false,
- Properties: false,
- "Type Literals": false,
- },
- sections: {
- ...baseSectionsOptions,
- member_getterSetter: false,
- members_categories: false,
- },
- hideTocHeaders: true,
- },
- "^core_flows/.*Workflows/functions/.*/page\\.mdx": {
+ "^core_flows/.*/functions/.*Workflow/page\\.mdx": {
reflectionDescription:
"This documentation provides a reference to the `{{alias}}`. It belongs to the `@medusajs/core-flows` package.",
frontmatterData: {
@@ -59,7 +24,7 @@ const coreFlowsOptions: FormattingOptionsType = {
suffix: "- Medusa Workflows API Reference",
},
},
- "^core_flows/.*Steps/functions/.*/page\\.mdx": {
+ "^core_flows/.*/functions/.*Step/page\\.mdx": {
reflectionDescription:
"This documentation provides a reference to the `{{alias}}`. It belongs to the `@medusajs/core-flows` package.",
frontmatterData: {