jamdesk 1.1.83 → 1.1.84
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jamdesk",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.84",
|
|
4
4
|
"description": "CLI for Jamdesk — build, preview, and deploy documentation sites from MDX. Dev server with hot reload, 50+ components, OpenAPI support, AI search, and Mintlify migration",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jamdesk",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { ReactNode, Children, cloneElement, isValidElement, memo } from 'react';
|
|
4
4
|
import { getIconClass } from '@/lib/icon-utils';
|
|
5
5
|
import { useStepSlug } from './StepSlugContext';
|
|
6
6
|
|
|
@@ -32,32 +32,10 @@ function isStepComponent(child: unknown): boolean {
|
|
|
32
32
|
);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
// Non-Step element children render as plain text inside <Steps> with no step
|
|
36
|
-
// circle/number — surface them in dev so authors notice the silent fallback.
|
|
37
|
-
function warnAboutNonStepChildren(childrenArray: readonly unknown[]): void {
|
|
38
|
-
if (process.env.NODE_ENV === 'production') return;
|
|
39
|
-
const offenders = childrenArray.filter(
|
|
40
|
-
(c): c is ReactElement => isValidElement(c) && !isStepComponent(c),
|
|
41
|
-
);
|
|
42
|
-
if (offenders.length === 0) return;
|
|
43
|
-
const labels = offenders.map((c) => {
|
|
44
|
-
const t = c.type;
|
|
45
|
-
if (typeof t === 'string') return `<${t}>`;
|
|
46
|
-
const named = t as { displayName?: string; name?: string };
|
|
47
|
-
return named?.displayName ?? named?.name ?? 'Component';
|
|
48
|
-
});
|
|
49
|
-
console.warn(
|
|
50
|
-
`<Steps> received non-<Step> children: ${labels.join(', ')}. ` +
|
|
51
|
-
'Wrap each step in `<Step title="…">…</Step>` so it renders as a numbered ' +
|
|
52
|
-
'step. Markdown headings inside <Steps> render as plain text.',
|
|
53
|
-
);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
35
|
export const Steps = memo(function Steps({ children, titleSize = 'p' }: StepsProps) {
|
|
57
36
|
const childrenArray = Children.toArray(children);
|
|
58
37
|
const stepChildren = childrenArray.filter(isStepComponent);
|
|
59
38
|
const totalSteps = stepChildren.length;
|
|
60
|
-
warnAboutNonStepChildren(childrenArray);
|
|
61
39
|
|
|
62
40
|
let stepIndex = 0;
|
|
63
41
|
return (
|