docs: enhance how references are generated (#5805)
* adjusted configurations * enhancements to tool and configurations * change reference in docs * fixed issue in workflows reference * added project name * more optimizations * fix context error * added a types reference * resolved missing types * fix reference reflection types not having children * add an expand url parameter * added new option to the README * added details about new option
This commit is contained in:
@@ -19,11 +19,13 @@ import IconFlagMini from "../../../theme/Icon/FlagMini"
|
||||
type ParameterTypesItemsProps = {
|
||||
parameters: Parameter[]
|
||||
level?: number
|
||||
expandUrl?: string
|
||||
}
|
||||
|
||||
const ParameterTypesItems = ({
|
||||
parameters,
|
||||
level = 1,
|
||||
expandUrl,
|
||||
}: ParameterTypesItemsProps) => {
|
||||
function getGroupName() {
|
||||
switch (level) {
|
||||
@@ -154,7 +156,7 @@ const ParameterTypesItems = ({
|
||||
{parameter.expandable && (
|
||||
<ExpandableNotice
|
||||
type="method"
|
||||
link="https://docs.medusajs.com/js-client/overview#expanding-fields"
|
||||
link={expandUrl || "#"}
|
||||
badgeClassName="!p-0 leading-none"
|
||||
badgeContent={<ArrowsPointingOutMini />}
|
||||
/>
|
||||
@@ -181,6 +183,7 @@ const ParameterTypesItems = ({
|
||||
<ParameterTypesItems
|
||||
parameters={parameter.children}
|
||||
level={level + 1}
|
||||
expandUrl={expandUrl}
|
||||
/>
|
||||
)}
|
||||
</Details>
|
||||
|
||||
@@ -15,6 +15,7 @@ export type Parameter = {
|
||||
|
||||
type ParameterTypesType = {
|
||||
parameters: Parameter[]
|
||||
expandUrl?: string
|
||||
} & React.HTMLAttributes<HTMLDivElement>
|
||||
|
||||
const ParameterTypes = ({
|
||||
@@ -27,7 +28,10 @@ const ParameterTypes = ({
|
||||
className={clsx("bg-docs-bg-surface shadow-card-rest rounded", className)}
|
||||
{...props}
|
||||
>
|
||||
<ParameterTypesItems parameters={parameters} />
|
||||
<ParameterTypesItems
|
||||
parameters={parameters}
|
||||
expandUrl={props.expandUrl}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user