for-humanity 0.4.3 → 0.5.0

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.
Files changed (79) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.md +5 -5
  3. package/dist/browser.js +39 -0
  4. package/dist/cli.css +372 -299
  5. package/dist/cli.js +1125 -301
  6. package/package.json +8 -11
  7. package/src/component/widget/{shell → cursor-face}/_constant/cursor-face.ts +5 -0
  8. package/src/component/widget/cursor-face/wg-cursor-face.css +15 -0
  9. package/src/component/widget/cursor-face/wg-cursor-face.tsx +153 -0
  10. package/src/component/widget/navigation/_constant/navigation-data-schema.ts +35 -0
  11. package/src/component/widget/navigation/_constant/navigation.ts +9 -0
  12. package/src/component/widget/navigation/_function/restore-navigation-scroll.ts +59 -0
  13. package/src/{content → component/widget/navigation/_function}/to-doc-groups/_to-doc-branches.ts +2 -2
  14. package/src/{content → component/widget/navigation/_function}/to-doc-groups/_to-doc-group-branches.ts +3 -3
  15. package/src/{content → component/widget/navigation/_function}/to-doc-groups/to-doc-groups.ts +1 -1
  16. package/src/component/widget/navigation/_function/to-navigation-branch-id.ts +6 -0
  17. package/src/component/widget/navigation/_function/to-navigation-data/_to-navigation-document.ts +14 -0
  18. package/src/component/widget/navigation/_function/to-navigation-data/_to-navigation-group.ts +14 -0
  19. package/src/component/widget/navigation/_function/to-navigation-data/to-navigation-data.ts +25 -0
  20. package/src/component/widget/navigation/_function/to-navigation-json.ts +8 -0
  21. package/src/component/widget/{shell → navigation}/_function/to-toc-groups.ts +2 -2
  22. package/src/{type → component/widget/navigation/_type}/doc-group.ts +1 -1
  23. package/src/component/widget/navigation/_type/navigation-data.ts +83 -0
  24. package/src/component/widget/navigation/_type/navigation-focus-snapshot.ts +21 -0
  25. package/src/component/widget/navigation/_wg-navigation-branch-toggle.css +28 -0
  26. package/src/component/widget/navigation/_wg-navigation-branch-toggle.tsx +48 -0
  27. package/src/component/widget/{shell/_wg-shell-nav-list.css → navigation/_wg-navigation-nav-list.css} +24 -16
  28. package/src/component/widget/navigation/_wg-navigation-nav-list.tsx +106 -0
  29. package/src/component/widget/{shell/_wg-shell-nav.css → navigation/_wg-navigation-nav.css} +9 -3
  30. package/src/component/widget/navigation/_wg-navigation-nav.tsx +43 -0
  31. package/src/component/widget/navigation/_wg-navigation-scroll.tsx +117 -0
  32. package/src/component/widget/{shell/_wg-shell-toc.css → navigation/_wg-navigation-toc.css} +43 -26
  33. package/src/component/widget/navigation/_wg-navigation-toc.tsx +155 -0
  34. package/src/component/widget/navigation/wg-navigation.css +282 -0
  35. package/src/component/widget/navigation/wg-navigation.tsx +479 -0
  36. package/src/component/widget/prose/_function/rehype-sections/rehype-sections.ts +1 -1
  37. package/src/component/widget/shell/wg-shell.css +13 -309
  38. package/src/component/widget/shell/wg-shell.tsx +16 -75
  39. package/src/component/widget/shell-controls/wg-shell-controls.css +4 -0
  40. package/src/component/widget/shell-controls/wg-shell-controls.tsx +170 -0
  41. package/src/constant/asset.ts +0 -5
  42. package/src/entry/browser/browser.tsx +22 -0
  43. package/src/{app.tsx → entry/cli/_function/create-app.tsx} +6 -6
  44. package/src/{content → entry/cli/_function/create-processor}/create-processor.ts +3 -3
  45. package/src/{content → entry/cli/_function}/read-docs.ts +1 -1
  46. package/src/{content → entry/cli/_function}/read-home.ts +1 -1
  47. package/src/{content/read-docs.test.ts → entry/cli/cli.test.ts} +105 -30
  48. package/src/{cli.ts → entry/cli/cli.ts} +10 -11
  49. package/src/store/navigation/_constant/tree.ts +6 -0
  50. package/src/store/navigation/create-navigation-stores.test.ts +92 -0
  51. package/src/store/navigation/create-navigation-stores.ts +73 -0
  52. package/src/store/navigation/navigation-state.ts +46 -0
  53. package/src/store/navigation/navigation-storage.ts +14 -0
  54. package/src/store/navigation/to-navigation-scroll-state.ts +42 -0
  55. package/src/store/navigation/to-navigation-tree-state.ts +19 -0
  56. package/src/store/navigation/use-navigation-tree-store.ts +12 -0
  57. package/src/style/token.css +4 -2
  58. package/src/type/doc-content.ts +1 -1
  59. package/src/type/doc-file-data.ts +1 -1
  60. package/src/{component/widget/shell/_type → type}/doc-outline.ts +1 -1
  61. package/src/type/site-assets.ts +2 -2
  62. package/dist/client.js +0 -6
  63. package/src/client.ts +0 -335
  64. package/src/component/widget/shell/_constant/navigation.ts +0 -9
  65. package/src/component/widget/shell/_function/bind-mobile-navigation.ts +0 -140
  66. package/src/component/widget/shell/_function/bind-navigation-scroll.ts +0 -123
  67. package/src/component/widget/shell/_wg-shell-nav-list.tsx +0 -87
  68. package/src/component/widget/shell/_wg-shell-nav.tsx +0 -49
  69. package/src/component/widget/shell/_wg-shell-toc.tsx +0 -57
  70. /package/src/{constant → component/widget/navigation/_constant}/locale.ts +0 -0
  71. /package/src/component/widget/{shell → navigation}/_constant/reading-line.ts +0 -0
  72. /package/src/{type → component/widget/navigation/_type}/doc-branch.ts +0 -0
  73. /package/src/component/widget/{shell → navigation}/_type/toc-group.ts +0 -0
  74. /package/src/{constant → entry/cli/_constant}/cli.ts +0 -0
  75. /package/src/{dev.ts → entry/cli/_function/create-dev-app.ts} +0 -0
  76. /package/src/{content/rehype-assets.ts → entry/cli/_function/create-processor/_rehype-assets.ts} +0 -0
  77. /package/src/{content/rehype-heading-ids.ts → entry/cli/_function/create-processor/_rehype-heading-ids.ts} +0 -0
  78. /package/src/{content/remark-report.ts → entry/cli/_function/create-processor/_remark-report.ts} +0 -0
  79. /package/src/{component/widget/prose/_type → type}/doc-section.ts +0 -0
package/dist/cli.css CHANGED
@@ -295,13 +295,55 @@
295
295
  }
296
296
  }
297
297
 
298
- /* src/component/widget/shell/_wg-shell-nav-list.css */
299
- .wg_shellNavList__root {
298
+ /* src/component/widget/cursor-face/wg-cursor-face.css */
299
+ .wg_cursorFace__root {
300
+ position: fixed;
301
+ top: 0;
302
+ left: 0;
303
+ z-index: var(--app-z-index-popper);
304
+ visibility: hidden;
305
+ pointer-events: none;
306
+ user-select: none;
307
+ image-rendering: pixelated;
308
+ }
309
+ .wg_cursorFace__root--visible {
310
+ visibility: visible;
311
+ }
312
+
313
+ /* src/component/widget/navigation/_wg-navigation-branch-toggle.css */
314
+ .wg_navigationBranchToggle__root {
315
+ position: absolute;
316
+ top: 0;
317
+ right: 0;
318
+ width: var(--app-size-tree-toggle);
319
+ height: calc(var(--app-font-size-dense) * var(--app-line-height-tight) + var(--app-space-tree-row) * 2);
320
+ padding: 0;
321
+ border: 0;
322
+ background: transparent;
323
+ color: var(--app-color-border-soft);
324
+ font-family: var(--app-font-mono);
325
+ font-size: var(--app-font-size-body);
326
+ line-height: 1;
327
+ cursor: pointer;
328
+ &:hover {
329
+ background: var(--app-color-accent-soft);
330
+ color: var(--app-color-text-strong);
331
+ }
332
+ &:focus-visible {
333
+ background: var(--app-color-accent-soft);
334
+ color: var(--app-color-text-strong);
335
+ outline: var(--app-outline-focus);
336
+ outline-offset: calc(0px - var(--app-outline-focus-offset));
337
+ }
338
+ }
339
+
340
+ /* src/component/widget/navigation/_wg-navigation-nav-list.css */
341
+ .wg_navigationNavList__root {
300
342
  margin: 0 0 0 var(--app-space-tree-inset);
301
343
  padding: 0;
302
344
  list-style: none;
303
345
  }
304
- .wg_shellNavList__branch {
346
+ .wg_navigationNavList__branch {
305
347
  position: relative;
306
348
  display: block;
307
349
  padding: var(--app-space-tree-row) 0 var(--app-space-tree-row) calc(var(--app-space-tree-indent) + var(--app-space-inline));
@@ -319,7 +361,7 @@
319
361
  pointer-events: none;
320
362
  }
321
363
  }
322
- .wg_shellNavList__link {
364
+ .wg_navigationNavList__link {
323
365
  position: relative;
324
366
  display: block;
325
367
  padding: var(--app-space-tree-row) 0 var(--app-space-tree-row) calc(var(--app-space-tree-indent) + var(--app-space-inline));
@@ -351,16 +393,22 @@
351
393
  border-top-color: currentcolor;
352
394
  }
353
395
  }
354
- .wg_shellNavList__link--active {
396
+ .wg_navigationNavList__link--active {
355
397
  color: var(--app-color-link);
356
398
  font-weight: var(--app-font-weight-active);
357
399
  &::before {
358
400
  border-top-color: currentcolor;
359
401
  }
360
402
  }
361
- .wg_shellNavList__item {
403
+ .wg_navigationNavList__item {
362
404
  display: flow-root;
363
405
  position: relative;
406
+ &:has(> .wg_navigationBranchToggle__root) > .wg_navigationNavList__link {
407
+ padding-inline-end: calc(var(--app-size-tree-toggle) + var(--app-space-inline));
408
+ }
409
+ &:has(> .wg_navigationBranchToggle__root) > .wg_navigationNavList__branch {
410
+ padding-inline-end: calc(var(--app-size-tree-toggle) + var(--app-space-inline));
411
+ }
364
412
  &::before {
365
413
  position: absolute;
366
414
  top: 0;
@@ -389,90 +437,99 @@
389
437
  &:where(:has(:focus-visible))::after {
390
438
  border-left-color: var(--app-color-link);
391
439
  }
392
- &:where(:has(~ .wg_shellNavList__item:hover))::before {
440
+ &:where(:has(~ .wg_navigationNavList__item:hover))::before {
393
441
  border-left-color: var(--app-color-link);
394
442
  }
395
- &:where(:has(~ .wg_shellNavList__item :focus-visible))::before {
443
+ &:where(:has(~ .wg_navigationNavList__item :focus-visible))::before {
396
444
  border-left-color: var(--app-color-link);
397
445
  }
398
- & > .wg_shellNavList__root {
446
+ & > .wg_navigationNavList__root {
399
447
  margin-left: var(--app-space-tree-indent);
400
448
  }
401
- &:where(:hover) > .wg_shellNavList__branch::before {
449
+ &:where(:hover) > .wg_navigationNavList__branch::before {
402
450
  border-top-color: var(--app-color-link);
403
451
  }
404
- &:where(:has(:focus-visible)) > .wg_shellNavList__branch::before {
452
+ &:where(:has(:focus-visible)) > .wg_navigationNavList__branch::before {
405
453
  border-top-color: var(--app-color-link);
406
454
  }
407
- &:where(:hover) > .wg_shellNavList__link::before {
455
+ &:where(:hover) > .wg_navigationNavList__link::before {
408
456
  border-top-color: var(--app-color-link);
409
457
  }
410
- &:where(:has(:focus-visible)) > .wg_shellNavList__link::before {
458
+ &:where(:has(:focus-visible)) > .wg_navigationNavList__link::before {
411
459
  border-top-color: var(--app-color-link);
412
460
  }
413
461
  }
414
- .wg_shellNavList__item--trail {
462
+ .wg_navigationNavList__item--trail {
415
463
  &::before {
416
464
  border-left-color: var(--app-color-link);
417
465
  }
418
466
  }
419
- .wg_shellNavList__item--current {
467
+ .wg_navigationNavList__item--current {
420
468
  &::after {
421
469
  border-left-color: var(--app-color-link);
422
470
  }
423
- & > .wg_shellNavList__branch::before {
471
+ & > .wg_navigationNavList__branch::before {
424
472
  border-top-color: var(--app-color-link);
425
473
  }
426
- & > .wg_shellNavList__link::before {
474
+ & > .wg_navigationNavList__link::before {
427
475
  border-top-color: var(--app-color-link);
428
476
  }
429
477
  }
430
478
 
431
- /* src/component/widget/shell/_wg-shell-nav.css */
432
- .wg_shellNav__root {
479
+ /* src/component/widget/navigation/_wg-navigation-nav.css */
480
+ .wg_navigationNav__root {
433
481
  font-size: var(--app-font-size-dense);
434
482
  line-height: var(--app-line-height-tight);
435
483
  }
436
- .wg_shellNav__docs {
484
+ .wg_navigationNav__docs {
437
485
  display: flex;
438
486
  flex-direction: column;
439
487
  gap: var(--app-space-stack);
440
488
  }
441
- .wg_shellNav__group {
489
+ .wg_navigationNav__group {
490
+ padding-inline-end: calc(var(--app-size-tree-toggle) + var(--app-space-inline));
442
491
  margin: 0 0 4px;
443
492
  color: var(--app-color-text-muted);
444
493
  font-size: var(--app-font-size-group);
445
494
  line-height: calc(var(--app-font-size-dense) * var(--app-line-height-tight));
446
495
  text-box: trim-start cap alphabetic;
447
496
  }
497
+ .wg_navigationNav__docGroup {
498
+ position: relative;
499
+ }
448
500
 
449
- /* src/component/widget/shell/_wg-shell-toc.css */
450
- .wg_shellToc__root {
451
- margin-top: var(--app-space-group);
452
- padding-top: var(--app-space-group);
453
- border-top: 1px solid var(--app-color-border-soft);
501
+ /* src/component/widget/navigation/_wg-navigation-toc.css */
502
+ .wg_navigationToc__root {
454
503
  font-size: var(--app-font-size-dense);
455
504
  line-height: var(--app-line-height-tight);
456
505
  }
457
- .wg_shellToc__label {
506
+ .wg_navigationToc__label {
458
507
  margin-bottom: var(--app-space-inline);
459
508
  color: var(--app-color-text-muted);
460
509
  font-size: var(--app-font-size-label);
461
510
  font-weight: var(--app-font-weight-strong);
462
511
  letter-spacing: var(--app-letter-spacing-label);
463
512
  }
464
- .wg_shellToc__group {
465
- margin: var(--app-space-stack) 0 4px;
513
+ .wg_navigationToc__group {
514
+ margin: 0 0 4px;
515
+ padding-inline-end: calc(var(--app-size-tree-toggle) + var(--app-space-inline));
466
516
  color: var(--app-color-text-muted);
467
517
  font-size: var(--app-font-size-group);
468
518
  line-height: calc(var(--app-font-size-dense) * var(--app-line-height-tight));
469
519
  }
470
- .wg_shellToc__list {
520
+ .wg_navigationToc__groupSection {
521
+ position: relative;
522
+ display: flow-root;
523
+ }
524
+ .wg_navigationToc__groupSection--named {
525
+ margin-top: var(--app-space-stack);
526
+ }
527
+ .wg_navigationToc__list {
471
528
  margin: 0 0 0 var(--app-space-tree-inset);
472
529
  padding: 0;
473
530
  list-style: none;
474
531
  }
475
- .wg_shellToc__link {
532
+ .wg_navigationToc__link {
476
533
  position: relative;
477
534
  display: block;
478
535
  padding: var(--app-space-tree-row) 0 var(--app-space-tree-row) calc(var(--app-space-tree-indent) + var(--app-space-inline));
@@ -505,16 +562,19 @@
505
562
  border-top-color: currentcolor;
506
563
  }
507
564
  }
508
- .wg_shellToc__link--active {
565
+ .wg_navigationToc__link--active {
509
566
  color: var(--app-color-text-strong);
510
567
  font-weight: var(--app-font-weight-active);
511
568
  &::before {
512
569
  border-top-color: currentcolor;
513
570
  }
514
571
  }
515
- .wg_shellToc__item {
572
+ .wg_navigationToc__item {
516
573
  display: flow-root;
517
574
  position: relative;
575
+ &:has(> .wg_navigationBranchToggle__root) > .wg_navigationToc__link {
576
+ padding-inline-end: calc(var(--app-size-tree-toggle) + var(--app-space-inline));
577
+ }
518
578
  &::before {
519
579
  position: absolute;
520
580
  top: 0;
@@ -543,35 +603,38 @@
543
603
  &:where(:has(:focus-visible))::after {
544
604
  border-left-color: var(--app-color-text-strong);
545
605
  }
546
- &:where(:has(~ .wg_shellToc__item:hover))::before {
606
+ &:where(:has(~ .wg_navigationToc__item:hover))::before {
547
607
  border-left-color: var(--app-color-text-strong);
548
608
  }
549
- &:where(:has(~ .wg_shellToc__item :focus-visible))::before {
609
+ &:where(:has(~ .wg_navigationToc__item :focus-visible))::before {
550
610
  border-left-color: var(--app-color-text-strong);
551
611
  }
552
- &:where(:hover) > .wg_shellToc__link::before {
612
+ &:where(:hover) > .wg_navigationToc__link::before {
553
613
  border-top-color: var(--app-color-text-strong);
554
614
  }
555
- &:where(:has(:focus-visible)) > .wg_shellToc__link::before {
615
+ &:where(:has(:focus-visible)) > .wg_navigationToc__link::before {
556
616
  border-top-color: var(--app-color-text-strong);
557
617
  }
558
618
  }
559
- .wg_shellToc__item--trail {
619
+ .wg_navigationToc__item--trail {
560
620
  &::before {
561
621
  border-left-color: var(--app-color-text-strong);
562
622
  }
563
623
  }
564
- .wg_shellToc__item--current {
624
+ .wg_navigationToc__item--current {
565
625
  &::after {
566
626
  border-left-color: var(--app-color-text-strong);
567
627
  }
628
+ & > .wg_navigationToc__link::before {
629
+ border-top-color: var(--app-color-text-strong);
630
+ }
568
631
  }
569
- .wg_shellToc__sub {
632
+ .wg_navigationToc__sub {
570
633
  margin: var(--app-space-tree-row) 0 4px var(--app-space-tree-indent);
571
634
  padding: 0;
572
635
  list-style: none;
573
636
  }
574
- .wg_shellToc__subItem {
637
+ .wg_navigationToc__subItem {
575
638
  position: relative;
576
639
  &::before {
577
640
  position: absolute;
@@ -601,24 +664,24 @@
601
664
  &:where(:has(:focus-visible))::after {
602
665
  border-left-color: var(--app-color-text-strong);
603
666
  }
604
- &:where(:has(~ .wg_shellToc__subItem:hover))::before {
667
+ &:where(:has(~ .wg_navigationToc__subItem:hover))::before {
605
668
  border-left-color: var(--app-color-text-strong);
606
669
  }
607
- &:where(:has(~ .wg_shellToc__subItem :focus-visible))::before {
670
+ &:where(:has(~ .wg_navigationToc__subItem :focus-visible))::before {
608
671
  border-left-color: var(--app-color-text-strong);
609
672
  }
610
673
  }
611
- .wg_shellToc__subItem--trail {
674
+ .wg_navigationToc__subItem--trail {
612
675
  &::before {
613
676
  border-left-color: var(--app-color-text-strong);
614
677
  }
615
678
  }
616
- .wg_shellToc__subItem--current {
679
+ .wg_navigationToc__subItem--current {
617
680
  &::after {
618
681
  border-left-color: var(--app-color-text-strong);
619
682
  }
620
683
  }
621
- .wg_shellToc__subLink {
684
+ .wg_navigationToc__subLink {
622
685
  position: relative;
623
686
  display: block;
624
687
  padding: var(--app-space-tree-row) 0 var(--app-space-tree-row) calc(var(--app-space-tree-indent) + var(--app-space-inline));
@@ -651,7 +714,7 @@
651
714
  border-top-color: currentcolor;
652
715
  }
653
716
  }
654
- .wg_shellToc__subLink--active {
717
+ .wg_navigationToc__subLink--active {
655
718
  color: var(--app-color-text-strong);
656
719
  font-weight: var(--app-font-weight-active);
657
720
  &::before {
@@ -659,6 +722,259 @@
659
722
  }
660
723
  }
661
724
 
725
+ /* src/component/widget/navigation/wg-navigation.css */
726
+ .wg_navigation__brandRow {
727
+ display: flex;
728
+ position: sticky;
729
+ top: 0;
730
+ z-index: var(--app-z-index-sticky);
731
+ align-self: start;
732
+ min-width: 0;
733
+ height: var(--app-size-brand);
734
+ padding-block: var(--app-space-page-top) var(--app-space-group);
735
+ background: var(--app-color-ground);
736
+ gap: var(--app-space-inline);
737
+ align-items: start;
738
+ }
739
+ .wg_navigation__brand {
740
+ display: block;
741
+ flex: 1;
742
+ min-width: 0;
743
+ overflow: hidden;
744
+ color: var(--app-color-text-strong);
745
+ font-family: var(--app-font-brand);
746
+ font-size: var(--app-font-size-title);
747
+ font-weight: var(--app-font-weight-mark);
748
+ line-height: var(--app-line-height-title);
749
+ letter-spacing: var(--app-letter-spacing-brand);
750
+ text-decoration: none;
751
+ text-overflow: ellipsis;
752
+ white-space: nowrap;
753
+ &:hover {
754
+ text-decoration: underline;
755
+ }
756
+ &:focus-visible {
757
+ outline: none;
758
+ text-decoration: underline;
759
+ }
760
+ }
761
+ .wg_navigation__menuIcon {
762
+ width: 20px;
763
+ height: 20px;
764
+ fill: none;
765
+ stroke: currentcolor;
766
+ stroke-linecap: round;
767
+ stroke-width: 1.5;
768
+ }
769
+ .wg_navigation__menuToggle {
770
+ display: none;
771
+ align-items: center;
772
+ justify-content: center;
773
+ flex: none;
774
+ width: var(--app-size-menu-button);
775
+ height: var(--app-size-menu-button);
776
+ padding: 0;
777
+ border: 0;
778
+ border-radius: var(--app-radius-box);
779
+ background: transparent;
780
+ color: var(--app-color-text-strong);
781
+ cursor: pointer;
782
+ &:hover {
783
+ background: var(--app-color-accent-soft);
784
+ }
785
+ &:focus-visible {
786
+ outline: var(--app-outline-focus);
787
+ outline-offset: var(--app-outline-focus-offset);
788
+ }
789
+ }
790
+ .wg_navigation__menuToggle--visible {
791
+ display: flex;
792
+ }
793
+ .wg_navigation__sidebar {
794
+ grid-area: nav;
795
+ position: sticky;
796
+ top: 0;
797
+ align-self: start;
798
+ min-width: 0;
799
+ height: 100dvh;
800
+ margin-inline-end: var(--app-space-sidebar-gap);
801
+ }
802
+ .wg_navigation__documents {
803
+ flex: 1;
804
+ min-height: 0;
805
+ }
806
+ .wg_navigation__outline {
807
+ display: flex;
808
+ flex-direction: column;
809
+ flex: 1;
810
+ min-height: 0;
811
+ &:where(:has(.wg_navigation__headings:empty)) {
812
+ display: none;
813
+ }
814
+ }
815
+ .wg_navigation__headings {
816
+ flex: 1;
817
+ min-height: 0;
818
+ }
819
+ .wg_navigation__navigation {
820
+ display: flex;
821
+ flex-direction: column;
822
+ height: calc(100dvh - var(--app-size-brand));
823
+ min-width: 0;
824
+ min-height: 0;
825
+ }
826
+ .wg_navigation__tocRail {
827
+ grid-area: outline;
828
+ position: sticky;
829
+ top: 0;
830
+ align-self: start;
831
+ min-width: 0;
832
+ height: 100dvh;
833
+ margin-inline-start: var(--app-space-sidebar-gap);
834
+ padding-top: var(--app-size-brand);
835
+ & > .wg_navigation__outline {
836
+ height: 100%;
837
+ }
838
+ &:where(:has(.wg_navigation__headings:empty)) {
839
+ display: none;
840
+ }
841
+ }
842
+ .wg_navigation__scroll {
843
+ overflow-y: auto;
844
+ overscroll-behavior-y: contain;
845
+ scroll-padding-block: var(--app-size-navigation-fade);
846
+ }
847
+ .wg_navigation__scroll--ready {
848
+ scrollbar-width: none;
849
+ }
850
+ .wg_navigation__scroll--above {
851
+ mask-image:
852
+ linear-gradient(
853
+ to bottom,
854
+ transparent,
855
+ #000 var(--app-size-navigation-fade));
856
+ }
857
+ .wg_navigation__scroll--below {
858
+ mask-image:
859
+ linear-gradient(
860
+ to bottom,
861
+ #000 calc(100% - var(--app-size-navigation-fade)),
862
+ transparent);
863
+ }
864
+ .wg_navigation__scroll--above.wg_navigation__scroll--below {
865
+ mask-image:
866
+ linear-gradient(
867
+ to bottom,
868
+ transparent,
869
+ #000 var(--app-size-navigation-fade),
870
+ #000 calc(100% - var(--app-size-navigation-fade)),
871
+ transparent);
872
+ }
873
+ .wg_navigation__drawer {
874
+ position: fixed;
875
+ inset: 0 auto 0 0;
876
+ width: min(var(--app-size-drawer), calc(100% - var(--app-space-gutter) * 2));
877
+ max-width: none;
878
+ height: 100dvh;
879
+ max-height: 100dvh;
880
+ margin: 0;
881
+ padding: 0 var(--app-space-gutter) var(--app-space-group);
882
+ border: 0;
883
+ border-right: 1px solid var(--app-color-border-layout);
884
+ background: var(--app-color-ground);
885
+ color: var(--app-color-text);
886
+ overflow: hidden;
887
+ &::backdrop {
888
+ background: var(--app-color-backdrop);
889
+ }
890
+ }
891
+ .wg_navigation__drawerHeader {
892
+ display: flex;
893
+ align-items: center;
894
+ justify-content: space-between;
895
+ gap: var(--app-space-inline);
896
+ min-height: var(--app-size-mobile-header);
897
+ margin-bottom: var(--app-space-block);
898
+ background: var(--app-color-ground);
899
+ }
900
+ .wg_navigation__drawerTitle {
901
+ margin: 0;
902
+ font-size: var(--app-font-size-part);
903
+ font-weight: var(--app-font-weight-strong);
904
+ }
905
+ .wg_navigation__drawerClose {
906
+ display: flex;
907
+ align-items: center;
908
+ justify-content: center;
909
+ flex: none;
910
+ width: var(--app-size-menu-button);
911
+ height: var(--app-size-menu-button);
912
+ padding: 0;
913
+ border: 0;
914
+ border-radius: var(--app-radius-box);
915
+ background: transparent;
916
+ color: var(--app-color-text-strong);
917
+ cursor: pointer;
918
+ &:hover {
919
+ background: var(--app-color-accent-soft);
920
+ }
921
+ &:focus-visible {
922
+ outline: var(--app-outline-focus);
923
+ outline-offset: var(--app-outline-focus-offset);
924
+ }
925
+ }
926
+ .wg_navigation__drawerContent {
927
+ min-width: 0;
928
+ height: calc(100% - var(--app-size-mobile-header) - var(--app-space-block));
929
+ & > .wg_navigation__navigation {
930
+ height: 100%;
931
+ }
932
+ }
933
+ @media (forced-colors: active) {
934
+ .wg_navigation__scroll {
935
+ mask-image: none;
936
+ scrollbar-width: thin;
937
+ scrollbar-color: auto;
938
+ }
939
+ }
940
+ @media (width < 1536px) {
941
+ .wg_navigation__tocRail {
942
+ display: none;
943
+ }
944
+ }
945
+ @media (width < 1024px) {
946
+ .wg_navigation__sidebar {
947
+ position: static;
948
+ height: auto;
949
+ margin-block-end: var(--app-space-block);
950
+ margin-inline-end: 0;
951
+ border-bottom: 1px solid var(--app-color-border-layout);
952
+ }
953
+ .wg_navigation__sidebar > .wg_navigation__navigation {
954
+ height: auto;
955
+ }
956
+ .wg_navigation__sidebar > .wg_navigation__navigation > .wg_navigation__documents {
957
+ max-height: none;
958
+ }
959
+ .wg_navigation__sidebar--navigationReady {
960
+ position: sticky;
961
+ top: 0;
962
+ z-index: var(--app-z-index-sticky);
963
+ background: var(--app-color-ground);
964
+ }
965
+ .wg_navigation__brandRow {
966
+ position: static;
967
+ height: var(--app-size-mobile-header);
968
+ padding-block: 0;
969
+ align-items: center;
970
+ }
971
+ }
972
+
973
+ /* src/component/widget/shell-controls/wg-shell-controls.css */
974
+ .wg_shellControls__navigation {
975
+ display: contents;
976
+ }
977
+
662
978
  /* src/style/base.css */
663
979
  * {
664
980
  box-sizing: border-box;
@@ -747,13 +1063,15 @@
747
1063
  --app-space-gutter: 28px;
748
1064
  --app-space-column: 32px;
749
1065
  --app-space-sidebar-gap: 32px;
750
- --app-size-sidebar: 200px;
1066
+ --app-size-sidebar: 240px;
751
1067
  --app-size-main: 900px;
752
1068
  --app-size-page: calc(var(--app-size-main) + (var(--app-size-sidebar) + var(--app-space-sidebar-gap) + var(--app-space-gutter)) * 2);
753
1069
  --app-size-brand: calc(var(--app-font-size-title) * var(--app-line-height-title) + var(--app-space-page-top) + var(--app-space-group));
754
1070
  --app-size-mobile-header: 56px;
755
1071
  --app-size-menu-button: 44px;
756
1072
  --app-size-drawer: 320px;
1073
+ --app-size-navigation-fade: 28px;
1074
+ --app-size-tree-toggle: 24px;
757
1075
  --app-space-anchor: 80px;
758
1076
  --app-radius-pill: 0;
759
1077
  --app-radius-card: 0;
@@ -797,7 +1115,7 @@
797
1115
  max-width: var(--app-size-page);
798
1116
  margin: 0 auto;
799
1117
  padding: 0 var(--app-space-gutter);
800
- grid-template: "nav main ." 1fr / calc(var(--app-size-sidebar) + var(--app-space-sidebar-gap)) minmax(0, var(--app-size-main)) minmax(0, 1fr);
1118
+ grid-template: "nav main outline" 1fr / calc(var(--app-size-sidebar) + var(--app-space-sidebar-gap)) minmax(0, var(--app-size-main)) calc(var(--app-size-sidebar) + var(--app-space-sidebar-gap));
801
1119
  background: var(--app-color-ground);
802
1120
  color: var(--app-color-text);
803
1121
  font-family: var(--app-font-sans);
@@ -811,107 +1129,8 @@
811
1129
  .wg_shell__root--drawerOpen {
812
1130
  overflow: hidden;
813
1131
  }
814
- .wg_shell__brandRow {
815
- display: flex;
816
- position: sticky;
817
- top: 0;
818
- z-index: var(--app-z-index-sticky);
819
- align-self: start;
820
- min-width: 0;
821
- height: var(--app-size-brand);
822
- padding-block: var(--app-space-page-top) var(--app-space-group);
823
- background: var(--app-color-ground);
824
- gap: var(--app-space-inline);
825
- align-items: start;
826
- }
827
- .wg_shell__brand {
828
- display: block;
829
- flex: 1;
830
- min-width: 0;
831
- overflow: hidden;
832
- color: var(--app-color-text-strong);
833
- font-family: var(--app-font-brand);
834
- font-size: var(--app-font-size-title);
835
- font-weight: var(--app-font-weight-mark);
836
- line-height: var(--app-line-height-title);
837
- letter-spacing: var(--app-letter-spacing-brand);
838
- text-decoration: none;
839
- text-overflow: ellipsis;
840
- white-space: nowrap;
841
- &:hover {
842
- text-decoration: underline;
843
- }
844
- &:focus-visible {
845
- outline: none;
846
- text-decoration: underline;
847
- }
848
- }
849
- .wg_shell__menuIcon {
850
- width: 20px;
851
- height: 20px;
852
- fill: none;
853
- stroke: currentcolor;
854
- stroke-linecap: round;
855
- stroke-width: 1.5;
856
- }
857
- .wg_shell__menuToggle {
858
- display: none;
859
- align-items: center;
860
- justify-content: center;
861
- flex: none;
862
- width: var(--app-size-menu-button);
863
- height: var(--app-size-menu-button);
864
- padding: 0;
865
- border: 0;
866
- border-radius: var(--app-radius-box);
867
- background: transparent;
868
- color: var(--app-color-text-strong);
869
- cursor: pointer;
870
- &:hover {
871
- background: var(--app-color-accent-soft);
872
- }
873
- &:focus-visible {
874
- outline: var(--app-outline-focus);
875
- outline-offset: var(--app-outline-focus-offset);
876
- }
877
- }
878
- .wg_shell__menuToggle--visible {
879
- display: flex;
880
- }
881
- .wg_shell__sidebar {
882
- grid-area: nav;
883
- position: sticky;
884
- top: 0;
885
- align-self: start;
886
- min-width: 0;
887
- min-height: 100vh;
888
- max-height: 100vh;
889
- margin-inline-end: var(--app-space-sidebar-gap);
890
- overflow-y: auto;
891
- overscroll-behavior-y: contain;
892
- scrollbar-gutter: stable;
893
- scrollbar-width: auto;
894
- scrollbar-color: auto;
895
- scroll-padding-block: var(--app-size-brand) var(--app-space-block);
896
- &::-webkit-scrollbar {
897
- width: 3px;
898
- }
899
- &::-webkit-scrollbar-track {
900
- background: transparent;
901
- }
902
- &::-webkit-scrollbar-thumb {
903
- border-radius: 3px;
904
- background: transparent;
905
- }
906
- &:hover::-webkit-scrollbar-thumb {
907
- background: var(--app-color-border-soft);
908
- }
909
- &:focus-within::-webkit-scrollbar-thumb {
910
- background: var(--app-color-border-soft);
911
- }
912
- }
913
- .wg_shell__navigation {
914
- min-width: 0;
1132
+ .wg_shell__browserRoot {
1133
+ display: contents;
915
1134
  }
916
1135
  .wg_shell__main {
917
1136
  grid-area: main;
@@ -921,134 +1140,9 @@
921
1140
  padding-block: var(--app-size-brand) calc(100vh - var(--app-space-anchor));
922
1141
  padding-inline: var(--app-space-column);
923
1142
  }
924
- .wg_shell__drawer {
925
- position: fixed;
926
- inset: 0 auto 0 0;
927
- width: min(var(--app-size-drawer), calc(100% - var(--app-space-gutter) * 2));
928
- max-width: none;
929
- height: 100dvh;
930
- max-height: 100dvh;
931
- margin: 0;
932
- padding: 0 var(--app-space-gutter) var(--app-space-group);
933
- border: 0;
934
- border-right: 1px solid var(--app-color-border-layout);
935
- background: var(--app-color-ground);
936
- color: var(--app-color-text);
937
- scrollbar-gutter: stable;
938
- scrollbar-width: auto;
939
- scrollbar-color: auto;
940
- overscroll-behavior: contain;
941
- scroll-padding-block: var(--app-size-mobile-header) var(--app-space-group);
942
- &::-webkit-scrollbar {
943
- width: 3px;
944
- }
945
- &::-webkit-scrollbar-track {
946
- background: transparent;
947
- }
948
- &::-webkit-scrollbar-thumb {
949
- border-radius: 3px;
950
- background: transparent;
951
- }
952
- &:hover::-webkit-scrollbar-thumb {
953
- background: var(--app-color-border-soft);
954
- }
955
- &:focus-within::-webkit-scrollbar-thumb {
956
- background: var(--app-color-border-soft);
957
- }
958
- &::backdrop {
959
- background: var(--app-color-backdrop);
960
- }
961
- }
962
- .wg_shell__drawerHeader {
963
- position: sticky;
964
- top: 0;
965
- z-index: var(--app-z-index-sticky);
966
- display: flex;
967
- align-items: center;
968
- justify-content: space-between;
969
- gap: var(--app-space-inline);
970
- min-height: var(--app-size-mobile-header);
971
- margin-bottom: var(--app-space-block);
972
- background: var(--app-color-ground);
973
- }
974
- .wg_shell__drawerTitle {
975
- margin: 0;
976
- font-size: var(--app-font-size-part);
977
- font-weight: var(--app-font-weight-strong);
978
- }
979
- .wg_shell__drawerClose {
980
- display: flex;
981
- align-items: center;
982
- justify-content: center;
983
- flex: none;
984
- width: var(--app-size-menu-button);
985
- height: var(--app-size-menu-button);
986
- padding: 0;
987
- border: 0;
988
- border-radius: var(--app-radius-box);
989
- background: transparent;
990
- color: var(--app-color-text-strong);
991
- cursor: pointer;
992
- &:hover {
993
- background: var(--app-color-accent-soft);
994
- }
995
- &:focus-visible {
996
- outline: var(--app-outline-focus);
997
- outline-offset: var(--app-outline-focus-offset);
998
- }
999
- }
1000
- .wg_shell__drawerContent {
1001
- min-width: 0;
1002
- }
1003
- .wg_shell__cursorFace {
1004
- position: fixed;
1005
- top: 0;
1006
- left: 0;
1007
- z-index: var(--app-z-index-popper);
1008
- visibility: hidden;
1009
- pointer-events: none;
1010
- user-select: none;
1011
- image-rendering: pixelated;
1012
- }
1013
- .wg_shell__cursorFace--visible {
1014
- visibility: visible;
1015
- }
1016
- @supports not selector(::-webkit-scrollbar) {
1017
- .wg_shell__sidebar {
1018
- scrollbar-width: thin;
1019
- scrollbar-color: transparent transparent;
1020
- &:hover {
1021
- scrollbar-color: var(--app-color-border-soft) transparent;
1022
- }
1023
- &:focus-within {
1024
- scrollbar-color: var(--app-color-border-soft) transparent;
1025
- }
1026
- }
1027
- .wg_shell__drawer {
1028
- scrollbar-width: thin;
1029
- scrollbar-color: var(--app-color-border-soft) transparent;
1030
- }
1031
- }
1032
- @media (forced-colors: active) {
1033
- .wg_shell__sidebar {
1034
- scrollbar-width: thin;
1035
- scrollbar-color: auto;
1036
- &:hover {
1037
- scrollbar-color: auto;
1038
- }
1039
- &:focus-within {
1040
- scrollbar-color: auto;
1041
- }
1042
- }
1043
- .wg_shell__drawer {
1044
- scrollbar-width: thin;
1045
- scrollbar-color: auto;
1046
- &:hover {
1047
- scrollbar-color: auto;
1048
- }
1049
- &:focus-within {
1050
- scrollbar-color: auto;
1051
- }
1143
+ @media (width < 1536px) {
1144
+ .wg_shell__root {
1145
+ grid-template: "nav main ." 1fr / calc(var(--app-size-sidebar) + var(--app-space-sidebar-gap)) minmax(0, var(--app-size-main)) minmax(0, 1fr);
1052
1146
  }
1053
1147
  }
1054
1148
  @media (width < 1024px) {
@@ -1056,27 +1150,6 @@
1056
1150
  max-width: calc(var(--app-size-main) + var(--app-space-gutter) * 2);
1057
1151
  grid-template: "nav" auto "main" 1fr / minmax(0, 1fr);
1058
1152
  }
1059
- .wg_shell__sidebar {
1060
- position: static;
1061
- min-height: 0;
1062
- max-height: none;
1063
- overflow-y: visible;
1064
- margin-block-end: var(--app-space-block);
1065
- margin-inline-end: 0;
1066
- border-bottom: 1px solid var(--app-color-border-layout);
1067
- }
1068
- .wg_shell__sidebar--navigationReady {
1069
- position: sticky;
1070
- top: 0;
1071
- z-index: var(--app-z-index-sticky);
1072
- background: var(--app-color-ground);
1073
- }
1074
- .wg_shell__brandRow {
1075
- position: static;
1076
- height: var(--app-size-mobile-header);
1077
- padding-block: 0;
1078
- align-items: center;
1079
- }
1080
1153
  .wg_shell__main {
1081
1154
  padding-block-start: var(--app-space-page-top);
1082
1155
  padding-inline: 0;