jamdesk 1.1.168 → 1.1.169

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.168",
3
+ "version": "1.1.169",
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",
@@ -433,7 +433,9 @@ export function Sidebar({ config, layout = 'header-logo', tabsPosition: tabsPosi
433
433
  // Prevent body scroll when sidebar is open on mobile
434
434
  useBodyScrollLock(isOpen);
435
435
 
436
- // Toggle group expansion; if expanding, navigate to first page.
436
+ // Toggle group expansion; if expanding, navigate to first page. Top-level
437
+ // sections never visually collapse — for them the toggled key only gates
438
+ // prefetch (see renderGroupContents) while the click still navigates.
437
439
  // The router.push must run AFTER the setState commits — calling it inside the
438
440
  // updater triggers "Cannot update a component (Router) while rendering Sidebar".
439
441
  const handleGroupClick = useCallback((group: ResolvedGroup, key: string) => {
@@ -460,8 +462,11 @@ export function Sidebar({ config, layout = 'header-logo', tabsPosition: tabsPosi
460
462
  // (mounting them only while open) while an unnamed group renders them inline.
461
463
  function renderGroupContents(group: ResolvedGroup, level: number, indexPath: GroupIndexPath) {
462
464
  const isExpanded = expandedGroups.has(groupStateKey(scope, indexPath));
463
- // Closed named groups never reach here (their contents are unmounted), so a
464
- // rendered named group is always expanded; unnamed groups always prefetch.
465
+ // Top-level sections stay mounted while collapsed-in-state, so their Links
466
+ // hold prefetch until the section is seeded or clicked expanded (don't fan
467
+ // out RSC prefetches for every section on large sites). Closed NESTED named
468
+ // groups never reach here (their contents are unmounted), so a rendered
469
+ // nested named group is always expanded; unnamed groups always prefetch.
465
470
  const shouldPrefetch = !group.name || isExpanded;
466
471
 
467
472
  if (group.items) {
@@ -549,9 +554,11 @@ export function Sidebar({ config, layout = 'header-logo', tabsPosition: tabsPosi
549
554
  );
550
555
  }
551
556
 
552
- // Render a navigation group (supports nesting). Every named group — top-level
553
- // or nested is an accordion: a button carrying aria-expanded/aria-controls
554
- // toggles an addressable panel whose descendants mount only while expanded.
557
+ // Render a navigation group (supports nesting). Top-level named groups are
558
+ // permanent sections: the header never collapses, its contents stay mounted,
559
+ // and clicking it navigates to the group's first page. Nested named groups
560
+ // are accordions: a button carrying aria-expanded/aria-controls toggles an
561
+ // addressable panel whose descendants mount only while expanded.
555
562
  function renderGroup(group: ResolvedGroup, level: number = 0, indexPath: GroupIndexPath = []) {
556
563
  // Skip rendering if group has no name and no content
557
564
  if (!group.name && group.pages.length === 0 && !group.nested?.length && !group.items?.length) {
@@ -559,13 +566,38 @@ export function Sidebar({ config, layout = 'header-logo', tabsPosition: tabsPosi
559
566
  }
560
567
 
561
568
  const key = groupStateKey(scope, indexPath);
562
- const panelId = groupPanelId(scope, indexPath);
563
569
  const isExpanded = expandedGroups.has(key);
564
- const isTopLevel = level === 0;
565
- const outerClassName = isTopLevel ? 'ml-6' : level === 1 ? '' : 'ml-3';
566
- const buttonClassName = isTopLevel
567
- ? 'flex items-center gap-2 w-full min-h-8 py-1.5 mb-2 text-left text-sm font-semibold text-[var(--color-text-tertiary)] cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent)] focus-visible:ring-offset-2'
568
- : `nav-group-l1 flex items-center gap-1.5 ${layout === 'header-logo' ? 'pr-3' : 'px-3'} py-1.5 rounded-lg text-sm transition-colors w-full text-left text-[var(--color-text-tertiary)] hover:text-[var(--color-text-primary)] cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent)] focus-visible:ring-offset-2`;
570
+
571
+ if (level === 0) {
572
+ return (
573
+ <div key={key} className="ml-6">
574
+ {group.name && (
575
+ <button
576
+ type="button"
577
+ onClick={() => handleGroupClick(group, key)}
578
+ className="flex items-center justify-between w-full text-left mb-2 cursor-pointer"
579
+ >
580
+ <span className="text-sm font-semibold text-[var(--color-text-tertiary)] flex items-center gap-2">
581
+ {group.icon && (
582
+ <i className={`${getIconClass(group.icon)} text-[14px]`} aria-hidden="true" />
583
+ )}
584
+ {group.name}
585
+ {group.tag && (
586
+ <span className="px-1.5 py-0.5 text-[9px] font-semibold rounded bg-[var(--color-accent)]/15 text-[var(--color-accent)] normal-case tracking-normal">
587
+ {group.tag}
588
+ </span>
589
+ )}
590
+ </span>
591
+ </button>
592
+ )}
593
+ {renderGroupContents(group, level, indexPath)}
594
+ </div>
595
+ );
596
+ }
597
+
598
+ const panelId = groupPanelId(scope, indexPath);
599
+ const outerClassName = level === 1 ? '' : 'ml-3';
600
+ const buttonClassName = `nav-group-l1 flex items-center gap-1.5 ${layout === 'header-logo' ? 'pr-3' : 'px-3'} py-1.5 rounded-lg text-sm transition-colors w-full text-left text-[var(--color-text-tertiary)] hover:text-[var(--color-text-primary)] cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent)] focus-visible:ring-offset-2`;
569
601
 
570
602
  return (
571
603
  <div key={key} className={outerClassName}>
@@ -582,7 +614,7 @@ export function Sidebar({ config, layout = 'header-logo', tabsPosition: tabsPosi
582
614
  )}
583
615
  <span className="flex-1 min-w-0 truncate">{group.name}</span>
584
616
  {group.tag && (
585
- <span className={`${isTopLevel ? 'text-[9px]' : 'text-[10px]'} px-1.5 py-0.5 font-semibold rounded bg-[var(--color-accent)]/15 text-[var(--color-accent)]`}>
617
+ <span className="px-1.5 py-0.5 text-[10px] font-semibold rounded bg-[var(--color-accent)]/15 text-[var(--color-accent)]">
586
618
  {group.tag}
587
619
  </span>
588
620
  )}
@@ -217,57 +217,57 @@
217
217
  }
218
218
  },
219
219
  "node_modules/@fortawesome/fontawesome-common-types": {
220
- "version": "7.3.0",
221
- "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-7.3.0.tgz",
222
- "integrity": "sha512-X/vND0Y1l9fVJ9O79UgtZnXSpz4aNF3bXlDxiJAEAm6kgeSftp9wjjBPgqzazJV8YlmxfRoeXNfSCJ48sf/Hhw==",
220
+ "version": "7.3.1",
221
+ "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-7.3.1.tgz",
222
+ "integrity": "sha512-k0C0sdHmZtAo6dRDtd1Z/qcpyHbL0CKsjV8seMY/21xGhY5Wsv0XRmiI/xEEH4y2c9b1+jvgNs/3EqhV27yUEA==",
223
223
  "license": "MIT",
224
224
  "engines": {
225
225
  "node": ">=6"
226
226
  }
227
227
  },
228
228
  "node_modules/@fortawesome/fontawesome-svg-core": {
229
- "version": "7.3.0",
230
- "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-7.3.0.tgz",
231
- "integrity": "sha512-MFbTNLDWkLJwbozDvHOZ7hwyDjQcBMBattlcOQ6ZmV5YD9bBrqdl1rNtmVjQ/lzqveXXX3sMz2Ew6fAgXoxmkw==",
229
+ "version": "7.3.1",
230
+ "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-7.3.1.tgz",
231
+ "integrity": "sha512-BoxVN3PKnMbgStHhjoaky/oWdxHomDqmBVA24IA3KEmssFGeI7u9YT/BJceOjIum/t6TpPa/vcMKaVYQeIQ/3Q==",
232
232
  "license": "MIT",
233
233
  "dependencies": {
234
- "@fortawesome/fontawesome-common-types": "7.3.0"
234
+ "@fortawesome/fontawesome-common-types": "7.3.1"
235
235
  },
236
236
  "engines": {
237
237
  "node": ">=6"
238
238
  }
239
239
  },
240
240
  "node_modules/@fortawesome/free-brands-svg-icons": {
241
- "version": "7.3.0",
242
- "resolved": "https://registry.npmjs.org/@fortawesome/free-brands-svg-icons/-/free-brands-svg-icons-7.3.0.tgz",
243
- "integrity": "sha512-W6C9ZbPWpwcUycq6U90lVbvWTrEnr01Td2x5jlO8fOtvww4kqDBMSmZqXQCc6FIIJD4kTH6G1MBRExAaSXz3yg==",
241
+ "version": "7.3.1",
242
+ "resolved": "https://registry.npmjs.org/@fortawesome/free-brands-svg-icons/-/free-brands-svg-icons-7.3.1.tgz",
243
+ "integrity": "sha512-8eiNzycuFhy3mZsi5EVO8JpO3H8l7/kSCl4Gk4iUew9hJuzYFqAAD6kqgeEup3+YZ9hL+5cjjorGzrRLkYuURg==",
244
244
  "license": "(CC-BY-4.0 AND MIT)",
245
245
  "dependencies": {
246
- "@fortawesome/fontawesome-common-types": "7.3.0"
246
+ "@fortawesome/fontawesome-common-types": "7.3.1"
247
247
  },
248
248
  "engines": {
249
249
  "node": ">=6"
250
250
  }
251
251
  },
252
252
  "node_modules/@fortawesome/free-regular-svg-icons": {
253
- "version": "7.3.0",
254
- "resolved": "https://registry.npmjs.org/@fortawesome/free-regular-svg-icons/-/free-regular-svg-icons-7.3.0.tgz",
255
- "integrity": "sha512-4675NiHzJJs0dLStFpp5G1JNfMYxqFSxZ2iCaiMfHptjlc8McLG9oqcd5pFEiPiqfiV2YG25cJ9EYWIEhUvp+A==",
253
+ "version": "7.3.1",
254
+ "resolved": "https://registry.npmjs.org/@fortawesome/free-regular-svg-icons/-/free-regular-svg-icons-7.3.1.tgz",
255
+ "integrity": "sha512-q1EsmL7Q8DDnkRBUjSvrxbq7c9oVwwVjCn/xa5apKmdp65YSgzUg2y0Ltnd5aDbT6GdAQQdXql5Ha90ArqIReQ==",
256
256
  "license": "(CC-BY-4.0 AND MIT)",
257
257
  "dependencies": {
258
- "@fortawesome/fontawesome-common-types": "7.3.0"
258
+ "@fortawesome/fontawesome-common-types": "7.3.1"
259
259
  },
260
260
  "engines": {
261
261
  "node": ">=6"
262
262
  }
263
263
  },
264
264
  "node_modules/@fortawesome/free-solid-svg-icons": {
265
- "version": "7.3.0",
266
- "resolved": "https://registry.npmjs.org/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-7.3.0.tgz",
267
- "integrity": "sha512-YxI/CuwWeI3nPIoYU//vkDS+3ige/67DPZ6XwMATpYEFESzO9L8zfJOKllGRgIlpT/uebrZCcvAzp3peD7GmTw==",
265
+ "version": "7.3.1",
266
+ "resolved": "https://registry.npmjs.org/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-7.3.1.tgz",
267
+ "integrity": "sha512-v0BLa0eqg7ubvVWeNSHVBs8fWH/GJicERZoJaxJ3FE/lj67VSqzoMg9pzfZVOfLMX10y0pGwQAuxoRVVH2patg==",
268
268
  "license": "(CC-BY-4.0 AND MIT)",
269
269
  "dependencies": {
270
- "@fortawesome/fontawesome-common-types": "7.3.0"
270
+ "@fortawesome/fontawesome-common-types": "7.3.1"
271
271
  },
272
272
  "engines": {
273
273
  "node": ">=6"