jamdesk 1.1.87 → 1.1.88

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.87",
3
+ "version": "1.1.88",
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",
@@ -53,7 +53,7 @@ export const Steps = memo(function Steps({ children, titleSize = 'p' }: StepsPro
53
53
 
54
54
  let stepIndex = 0;
55
55
  return (
56
- <div className="relative my-8 space-y-0 not-prose" style={{ paddingInlineStart: 16 }}>
56
+ <div className="relative my-8 space-y-0 not-prose">
57
57
  {childrenArray.map((child) => {
58
58
  if (isStepComponent(child)) {
59
59
  const childProps = (child as any).props as StepProps;
@@ -29,16 +29,9 @@ function getItemOffset(depth: number): number {
29
29
  return 36;
30
30
  }
31
31
 
32
- const TOC_STEP_INDICATOR_INSET = 30;
33
- const TOC_STEP_INDICATOR_SIZE = 14;
34
- const TOC_STEP_LABEL_GAP = 8;
35
-
36
32
  /** Horizontal position of the vertical line based on heading depth */
37
- function getLineOffset(item: TocItem): number {
38
- if (typeof item.stepNumber === 'number') {
39
- return TOC_STEP_INDICATOR_INSET + TOC_STEP_INDICATOR_SIZE / 2;
40
- }
41
- return item.level >= 3 ? 10 : 0;
33
+ function getLineOffset(depth: number): number {
34
+ return depth >= 3 ? 10 : 0;
42
35
  }
43
36
 
44
37
  function getLinkClass(level: number, isActive: boolean): string {
@@ -206,7 +199,7 @@ export function TableOfContents({ content, className = '' }: TableOfContentsProp
206
199
  const heading = headings.find(item => item.id === href.slice(1));
207
200
  if (!heading) continue;
208
201
 
209
- const offset = getLineOffset(heading) + 0.5;
202
+ const offset = getLineOffset(heading.level) + 0.5;
210
203
  const elTop = getOffsetRelativeTo(element, container);
211
204
  items.push({ offset, top: elTop, bottom: elTop + element.clientHeight });
212
205
  }
@@ -574,13 +567,12 @@ export function TableOfContents({ content, className = '' }: TableOfContentsProp
574
567
  }
575
568
  };
576
569
 
577
- // Step entries sit under their parent heading: number aligned with
578
- // H3 text, label after the 14px circle plus an 8px gap.
579
- const startOffset = hasStepNumber
580
- ? TOC_STEP_INDICATOR_INSET + TOC_STEP_INDICATOR_SIZE + TOC_STEP_LABEL_GAP
581
- : heading.level === 3
582
- ? 30
583
- : getItemOffset(heading.level);
570
+ // 30px leaves room for the absolute-positioned 14px step circle
571
+ // (insetInlineStart: 1) + a gap. Non-step H3s use the same value
572
+ // so mixed step/non-step groups align visually.
573
+ const startOffset = heading.level === 3
574
+ ? 30
575
+ : getItemOffset(heading.level);
584
576
 
585
577
  return (
586
578
  <a
@@ -600,11 +592,11 @@ export function TableOfContents({ content, className = '' }: TableOfContentsProp
600
592
  aria-hidden="true"
601
593
  className="absolute flex items-center justify-center rounded-full text-[9px] font-medium"
602
594
  style={{
603
- insetInlineStart: TOC_STEP_INDICATOR_INSET,
595
+ insetInlineStart: 3,
604
596
  top: '50%',
605
597
  transform: 'translateY(-50%)',
606
- width: TOC_STEP_INDICATOR_SIZE,
607
- height: TOC_STEP_INDICATOR_SIZE,
598
+ width: 14,
599
+ height: 14,
608
600
  backgroundColor: isActive
609
601
  ? 'var(--color-primary)'
610
602
  : 'var(--color-bg-primary)',