@commentray/render 0.3.3 → 0.3.5

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.
@@ -170,16 +170,9 @@ function renderToolbarDocHubHtml(opts) {
170
170
  const toolbarDocHubHtml = "";
171
171
  const navAttr = escapeHtml(nav ?? "");
172
172
  const navRailDocumentedHtml = showDocumentedTree
173
- ? `<details class="nav-rail__doc-hub" id="documented-files-hub" data-nav-json-url="${navAttr}">
174
- <summary class="nav-rail__doc-hub-summary" title="Comment-rayed files" aria-label="Comment-rayed files"><span class="nav-rail__doc-hub-summary__caption">Comment-rayed files</span><span class="nav-rail__doc-hub-summary__glyph" aria-hidden="true">${TOOLBAR_ICON_TREE_SVG}</span></summary>
175
- <div class="nav-rail__doc-hub-inner">
176
- <div class="nav-rail__doc-hub-filter-row">
177
- <label class="nav-rail__doc-hub-filter-label" for="documented-files-filter">Filter</label>
178
- <input type="search" id="documented-files-filter" class="nav-rail__doc-hub-filter" placeholder="Filter by path…" autocomplete="off" spellcheck="false" />
179
- </div>
180
- <div id="documented-files-tree" class="documented-files-tree" role="tree"></div>
181
- </div>
182
- </details>`
173
+ ? loadNavRailDocHubTemplate()
174
+ .replaceAll("__NAV_JSON_URL__", navAttr)
175
+ .replaceAll("__TREE_ICON_SVG__", TOOLBAR_ICON_TREE_SVG)
183
176
  : "";
184
177
  return { toolbarDocHubHtml, navRailDocumentedHtml };
185
178
  }
@@ -322,1713 +315,50 @@ const TOOLBAR_SHARE_LINK_HTML = ` <button type="button" id="commentray-
322
315
  const TOOLBAR_HELP_TOUR_HTML = ` <button type="button" id="commentray-help-tour" class="toolbar-theme__trigger toolbar-help-tour-btn" aria-label="Restart onboarding walkthrough" title="Restart onboarding walkthrough">${TOOLBAR_ICON_HELP_TOUR_SVG}</button>
323
316
  `;
324
317
  const CODE_BROWSER_INTRO_STYLES = loadCodeBrowserIntroStyles();
325
- const CODE_BROWSER_STYLES = `
326
- :root {
327
- --cr-control-h: 32px;
328
- --cr-control-radius: 8px;
329
- --cr-icon-inner: 18px;
330
- --cr-label-caps-fs: 10px;
331
- --cr-label-caps-track: 0.06em;
332
- --cr-ui-fs: 12px;
333
- /** Matches code/doc pane horizontal padding so pair-context rows line up with pane content (e.g. line nums). */
334
- --cr-pane-inline-pad: 12px;
335
- }
336
- :root:is(:not([data-commentray-theme]), [data-commentray-theme="system"]) {
337
- color-scheme: light dark;
338
- }
339
- :root[data-commentray-theme="light"] {
340
- color-scheme: light;
341
- }
342
- :root[data-commentray-theme="dark"] {
343
- color-scheme: dark;
344
- }
345
- * { box-sizing: border-box; }
346
- html { background: Canvas; color: CanvasText; }
347
- body {
348
- margin: 0;
349
- font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
350
- background: Canvas;
351
- color: CanvasText;
352
- }
353
- .skip-link {
354
- position: absolute;
355
- left: -9999px;
356
- top: 0;
357
- z-index: 10000;
358
- padding: 8px 16px;
359
- margin: 0;
360
- font: inherit;
361
- font-size: 14px;
362
- text-decoration: none;
363
- border-radius: 8px;
364
- border: 1px solid color-mix(in oklab, CanvasText 25%, Canvas);
365
- background: Canvas;
366
- color: CanvasText;
367
- }
368
- .skip-link:focus {
369
- left: 12px;
370
- top: 8px;
371
- outline: 2px solid color-mix(in oklab, CanvasText 45%, Canvas);
372
- outline-offset: 2px;
373
- }
374
- .skip-link:focus:not(:focus-visible) {
375
- left: -9999px;
376
- top: 0;
377
- outline: none;
378
- }
379
- .skip-link:focus-visible {
380
- left: 12px;
381
- top: 8px;
382
- outline: 2px solid color-mix(in oklab, CanvasText 45%, Canvas);
383
- outline-offset: 2px;
384
- }
385
- .sr-only {
386
- position: absolute;
387
- width: 1px;
388
- height: 1px;
389
- padding: 0;
390
- margin: -1px;
391
- overflow: hidden;
392
- clip: rect(0, 0, 0, 0);
393
- white-space: nowrap;
394
- border: 0;
395
- }
396
- .app {
397
- display: flex;
398
- flex-direction: column;
399
- align-items: stretch;
400
- height: 100vh;
401
- width: 100%;
402
- overflow: hidden;
403
- }
404
- .app__chrome {
405
- flex: 0 0 auto;
406
- display: flex;
407
- flex-direction: column;
408
- gap: 8px;
409
- padding: 8px 12px 10px;
410
- border-bottom: 1px solid color-mix(in oklab, CanvasText 15%, Canvas);
411
- background: color-mix(in oklab, CanvasText 4%, Canvas);
412
- max-height: min(40vh, 420px);
413
- min-height: 0;
414
- overflow: auto;
415
- }
416
- .chrome__search-row {
417
- display: flex;
418
- flex-direction: row;
419
- align-items: center;
420
- gap: 10px;
421
- flex-wrap: nowrap;
422
- }
423
- .chrome__search-row input[type="search"] {
424
- flex: 1 1 auto;
425
- min-width: 140px;
426
- min-height: var(--cr-control-h);
427
- padding: 0 12px;
428
- font: inherit;
429
- font-size: var(--cr-ui-fs);
430
- line-height: 1.25;
431
- border-radius: var(--cr-control-radius);
432
- border: 1px solid color-mix(in oklab, CanvasText 25%, Canvas);
433
- background: Canvas;
434
- color: CanvasText;
435
- }
436
- .chrome__search-row #search-clear {
437
- flex: 0 0 auto;
438
- display: inline-flex;
439
- align-items: center;
440
- justify-content: center;
441
- min-height: var(--cr-control-h);
442
- padding: 0 12px;
443
- font: inherit;
444
- font-size: var(--cr-ui-fs);
445
- font-weight: 500;
446
- border-radius: var(--cr-control-radius);
447
- cursor: pointer;
448
- border: 1px solid color-mix(in oklab, CanvasText 25%, Canvas);
449
- background: color-mix(in oklab, CanvasText 6%, Canvas);
450
- color: CanvasText;
451
- white-space: nowrap;
452
- }
453
- .chrome__search-row #search-clear:hover {
454
- background: color-mix(in oklab, CanvasText 11%, Canvas);
455
- }
456
- .chrome__search-row input[type="search"]:focus-visible,
457
- .chrome__search-row #search-clear:focus-visible {
458
- outline: 2px solid color-mix(in oklab, CanvasText 45%, Canvas);
459
- outline-offset: 2px;
460
- }
461
- .chrome__search-label {
462
- flex: 0 0 auto;
463
- display: inline-flex;
464
- flex-direction: row;
465
- align-items: center;
466
- gap: 6px;
467
- white-space: nowrap;
468
- cursor: default;
469
- user-select: none;
470
- }
471
- /* Wide viewports: same legible caps word as historic Pages shell (icon hidden). */
472
- .chrome__search-label__glyph {
473
- display: none;
474
- }
475
- .nav-rail__search-label {
476
- font-size: var(--cr-label-caps-fs);
477
- font-weight: 700;
478
- letter-spacing: var(--cr-label-caps-track);
479
- text-transform: uppercase;
480
- opacity: 0.78;
481
- }
482
- .nav-rail__doc-hub {
483
- position: relative;
484
- flex: 0 0 auto;
485
- align-self: center;
486
- display: block;
487
- border: 1px solid color-mix(in oklab, CanvasText 16%, Canvas);
488
- border-radius: var(--cr-control-radius);
489
- background: Canvas;
490
- overflow: visible;
491
- }
492
- .nav-rail__doc-hub-summary {
493
- cursor: pointer;
494
- font-size: var(--cr-ui-fs);
495
- font-weight: 500;
496
- color: color-mix(in oklab, CanvasText 88%, Canvas);
497
- padding: 0 12px;
498
- min-height: var(--cr-control-h);
499
- display: inline-flex;
500
- flex-direction: row;
501
- align-items: center;
502
- justify-content: flex-start;
503
- gap: 8px;
504
- box-sizing: border-box;
505
- list-style: none;
506
- user-select: none;
507
- line-height: 1.25;
508
- }
509
- .nav-rail__doc-hub-summary:hover {
510
- background: color-mix(in oklab, CanvasText 6%, Canvas);
511
- }
512
- .nav-rail__doc-hub-summary__caption {
513
- white-space: nowrap;
514
- }
515
- .nav-rail__doc-hub-summary__glyph {
516
- display: none;
517
- }
518
- .nav-rail__doc-hub-summary svg {
519
- display: block;
520
- flex: 0 0 auto;
521
- }
522
- .nav-rail__doc-hub-summary::-webkit-details-marker { display: none; }
523
- .nav-rail__doc-hub-inner {
524
- position: absolute;
525
- left: 0;
526
- top: calc(100% + 4px);
527
- z-index: 60;
528
- min-width: min(280px, 78vw);
529
- max-width: min(440px, 94vw);
530
- max-height: min(52vh, 400px);
531
- display: flex;
532
- flex-direction: column;
533
- gap: 8px;
534
- overflow: hidden;
535
- padding: 8px 10px;
536
- font-size: 12px;
537
- border: 1px solid color-mix(in oklab, CanvasText 16%, Canvas);
538
- border-radius: 8px;
539
- background: Canvas;
540
- box-shadow: 0 8px 28px color-mix(in oklab, CanvasText 12%, transparent);
541
- }
542
- .nav-rail__doc-hub-filter-row {
543
- flex: 0 0 auto;
544
- }
545
- .nav-rail__doc-hub-filter-label {
546
- display: block;
547
- font-size: var(--cr-label-caps-fs);
548
- font-weight: 700;
549
- letter-spacing: var(--cr-label-caps-track);
550
- text-transform: uppercase;
551
- opacity: 0.78;
552
- margin-bottom: 4px;
553
- }
554
- .nav-rail__doc-hub-filter {
555
- width: 100%;
556
- box-sizing: border-box;
557
- font: inherit;
558
- font-size: 12px;
559
- padding: 4px 8px;
560
- border-radius: 6px;
561
- border: 1px solid color-mix(in oklab, CanvasText 22%, Canvas);
562
- background: color-mix(in oklab, CanvasText 4%, Canvas);
563
- color: CanvasText;
564
- }
565
- .nav-rail__doc-hub-filter:focus {
566
- outline: 2px solid color-mix(in oklab, CanvasText 40%, Canvas);
567
- outline-offset: 1px;
568
- }
569
- .nav-rail__doc-hub-hint {
570
- margin: 0 0 8px;
571
- opacity: 0.78;
572
- line-height: 1.4;
573
- font-size: 12px;
574
- }
575
- .app__main {
576
- flex: 1 1 auto;
577
- min-width: 0;
578
- min-height: 0;
579
- display: flex;
580
- flex-direction: column;
581
- }
582
- .app__footer {
583
- flex: 0 0 auto;
584
- padding: 6px 12px 10px;
585
- border-top: 1px solid color-mix(in oklab, CanvasText 12%, Canvas);
586
- background: color-mix(in oklab, CanvasText 3%, Canvas);
587
- font-size: 11px;
588
- line-height: 1.4;
589
- color: color-mix(in oklab, CanvasText 72%, Canvas);
590
- }
591
- .app__footer-line { margin: 0; }
592
- .app__footer time { font-variant-numeric: tabular-nums; }
593
- .toolbar {
594
- position: relative;
595
- display: flex;
596
- flex-wrap: wrap;
597
- align-items: center;
598
- gap: 10px 14px;
599
- padding: 8px 12px;
600
- border-bottom: 1px solid color-mix(in oklab, CanvasText 18%, Canvas);
601
- background: color-mix(in oklab, CanvasText 4%, Canvas);
602
- font-size: var(--cr-ui-fs);
603
- flex: 0 0 auto;
604
- min-width: 0;
605
- }
606
- .toolbar__primary {
607
- display: flex;
608
- flex-direction: row;
609
- flex-wrap: wrap;
610
- align-items: center;
611
- gap: 10px 14px;
612
- flex: 1 1 auto;
613
- min-width: 0;
614
- }
615
- .toolbar__primary-main {
616
- display: flex;
617
- flex-direction: row;
618
- flex-wrap: wrap;
619
- align-items: center;
620
- gap: 10px 14px;
621
- flex: 0 1 auto;
622
- min-width: 0;
623
- }
624
- .toolbar__primary-trail {
625
- display: flex;
626
- flex-direction: row;
627
- flex-wrap: wrap;
628
- align-items: center;
629
- justify-content: flex-end;
630
- gap: 6px;
631
- margin-left: auto;
632
- min-width: 0;
633
- }
634
- .toolbar__end {
635
- display: flex;
636
- flex-wrap: wrap;
637
- align-items: center;
638
- justify-content: flex-end;
639
- gap: 10px 14px;
640
- min-width: 0;
641
- }
642
- .toolbar-github {
643
- display: inline-flex; align-items: center; justify-content: center;
644
- width: var(--cr-control-h);
645
- height: var(--cr-control-h);
646
- border-radius: var(--cr-control-radius);
647
- border: 1px solid color-mix(in oklab, CanvasText 22%, Canvas);
648
- background: color-mix(in oklab, CanvasText 6%, Canvas);
649
- color: CanvasText;
650
- }
651
- .toolbar-github svg {
652
- width: var(--cr-icon-inner);
653
- height: var(--cr-icon-inner);
654
- display: block;
655
- }
656
- .toolbar-github:hover { background: color-mix(in oklab, CanvasText 11%, Canvas); }
657
- .toolbar-github:focus-visible { outline: 2px solid color-mix(in oklab, CanvasText 45%, Canvas); outline-offset: 2px; }
658
- .app__footer-attribution {
659
- margin: 0;
660
- color: color-mix(in oklab, CanvasText 88%, Canvas);
661
- }
662
- .app__footer-attribution a {
663
- color: inherit;
664
- font-weight: 600;
665
- text-decoration: underline;
666
- text-underline-offset: 2px;
667
- }
668
- .app__footer-attribution__version { font-weight: 600; }
669
- .app__footer-attribution__sha {
670
- font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
671
- font-size: 0.95em;
672
- font-weight: 500;
673
- padding: 0 2px;
674
- word-break: break-all;
675
- }
676
- .toolbar label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
677
- .toolbar label[hidden] { display: none !important; }
678
- .toolbar-wrap-lines {
679
- position: relative;
680
- margin: 0;
681
- min-height: var(--cr-control-h);
682
- padding: 0 12px 0 10px;
683
- border-radius: var(--cr-control-radius);
684
- border: 1px solid color-mix(in oklab, CanvasText 16%, Canvas);
685
- background: Canvas;
686
- display: inline-flex;
687
- flex-direction: row;
688
- align-items: center;
689
- justify-content: flex-start;
690
- gap: 8px;
691
- font-size: var(--cr-ui-fs);
692
- font-weight: 500;
693
- color: color-mix(in oklab, CanvasText 88%, Canvas);
694
- cursor: pointer;
695
- }
696
- .toolbar-wrap-lines:hover {
697
- background: color-mix(in oklab, CanvasText 6%, Canvas);
698
- }
699
- .toolbar-wrap-lines__input {
700
- position: absolute;
701
- width: 1px;
702
- height: 1px;
703
- padding: 0;
704
- margin: -1px;
705
- overflow: hidden;
706
- clip: rect(0, 0, 0, 0);
707
- white-space: nowrap;
708
- border: 0;
709
- opacity: 0;
710
- }
711
- /** Visible tick box: the real input is visually hidden for a11y; unchecked looked like an empty box with no mark when on. */
712
- .toolbar-wrap-lines__box {
713
- flex: 0 0 auto;
714
- width: 16px;
715
- height: 16px;
716
- box-sizing: border-box;
717
- border: 1.5px solid color-mix(in oklab, CanvasText 38%, Canvas);
718
- border-radius: 3px;
719
- background: Canvas;
720
- display: inline-flex;
721
- align-items: center;
722
- justify-content: center;
723
- color: CanvasText;
724
- }
725
- .toolbar-wrap-lines:has(.toolbar-wrap-lines__input:checked) .toolbar-wrap-lines__box {
726
- border-color: color-mix(in oklab, CanvasText 52%, Canvas);
727
- background: color-mix(in oklab, CanvasText 6%, Canvas);
728
- }
729
- .toolbar-wrap-lines__box::after {
730
- content: "";
731
- display: none;
732
- width: 4px;
733
- height: 9px;
734
- margin-top: -2px;
735
- border: solid currentColor;
736
- border-width: 0 2px 2px 0;
737
- transform: rotate(45deg);
738
- }
739
- .toolbar-wrap-lines:has(.toolbar-wrap-lines__input:checked) .toolbar-wrap-lines__box::after {
740
- display: block;
741
- }
742
- .toolbar-wrap-lines__face {
743
- display: none;
744
- align-items: center;
745
- justify-content: center;
746
- min-height: var(--cr-control-h);
747
- min-width: var(--cr-control-h);
748
- color: color-mix(in oklab, CanvasText 82%, Canvas);
749
- }
750
- .toolbar-wrap-lines__caption {
751
- white-space: nowrap;
752
- }
753
- .toolbar-wrap-lines:has(.toolbar-wrap-lines__input:checked) {
754
- color: CanvasText;
755
- background: color-mix(in oklab, CanvasText 10%, Canvas);
756
- }
757
- .toolbar-wrap-lines:has(.toolbar-wrap-lines__input:checked) .toolbar-wrap-lines__caption {
758
- color: CanvasText;
759
- }
760
- .toolbar-wrap-lines:has(.toolbar-wrap-lines__input:checked) .toolbar-wrap-lines__face {
761
- color: CanvasText;
762
- background: color-mix(in oklab, CanvasText 10%, Canvas);
763
- border-radius: calc(var(--cr-control-radius) - 1px);
764
- }
765
- .toolbar-wrap-lines:has(.toolbar-wrap-lines__input:focus-visible) {
766
- outline: 2px solid color-mix(in oklab, CanvasText 45%, Canvas);
767
- outline-offset: 2px;
768
- }
769
- .toolbar-icon-btn {
770
- display: none;
771
- align-items: center;
772
- justify-content: center;
773
- width: var(--cr-control-h);
774
- height: var(--cr-control-h);
775
- padding: 0;
776
- margin: 0;
777
- border-radius: var(--cr-control-radius);
778
- border: 1px solid color-mix(in oklab, CanvasText 22%, Canvas);
779
- background: color-mix(in oklab, CanvasText 6%, Canvas);
780
- color: CanvasText;
781
- cursor: pointer;
782
- flex: 0 0 auto;
783
- }
784
- .toolbar-icon-btn svg {
785
- display: block;
786
- flex: 0 0 auto;
787
- }
788
- .toolbar-icon-btn:hover {
789
- background: color-mix(in oklab, CanvasText 14%, Canvas);
790
- border-color: color-mix(in oklab, CanvasText 34%, Canvas);
791
- }
792
- .toolbar-icon-btn:focus-visible {
793
- outline: 2px solid color-mix(in oklab, CanvasText 45%, Canvas);
794
- outline-offset: 2px;
795
- }
796
- .toolbar-source-render-toggle {
797
- position: relative;
798
- margin: 0;
799
- min-height: var(--cr-control-h);
800
- padding: 0 12px 0 10px;
801
- border-radius: var(--cr-control-radius);
802
- border: 1px solid color-mix(in oklab, CanvasText 16%, Canvas);
803
- background: Canvas;
804
- display: inline-flex;
805
- flex-direction: row;
806
- align-items: center;
807
- justify-content: flex-start;
808
- gap: 8px;
809
- font-size: var(--cr-ui-fs);
810
- font-weight: 500;
811
- color: color-mix(in oklab, CanvasText 88%, Canvas);
812
- cursor: pointer;
813
- }
814
- .toolbar-source-render-toggle:hover {
815
- background: color-mix(in oklab, CanvasText 6%, Canvas);
816
- }
817
- .toolbar-source-render-toggle__box {
818
- flex: 0 0 auto;
819
- width: 16px;
820
- height: 16px;
821
- box-sizing: border-box;
822
- border: 1.5px solid color-mix(in oklab, CanvasText 38%, Canvas);
823
- border-radius: 3px;
824
- background: Canvas;
825
- display: inline-flex;
826
- align-items: center;
827
- justify-content: center;
828
- color: CanvasText;
829
- }
830
- .toolbar-source-render-toggle[aria-pressed="true"] .toolbar-source-render-toggle__box {
831
- border-color: color-mix(in oklab, CanvasText 52%, Canvas);
832
- background: color-mix(in oklab, CanvasText 6%, Canvas);
833
- }
834
- .toolbar-source-render-toggle__box::after {
835
- content: "";
836
- display: none;
837
- width: 4px;
838
- height: 9px;
839
- margin-top: -2px;
840
- border: solid currentColor;
841
- border-width: 0 2px 2px 0;
842
- transform: rotate(45deg);
843
- }
844
- .toolbar-source-render-toggle[aria-pressed="true"] .toolbar-source-render-toggle__box::after {
845
- display: block;
846
- }
847
- .toolbar-source-render-toggle__face {
848
- display: none;
849
- align-items: center;
850
- justify-content: center;
851
- min-height: var(--cr-control-h);
852
- min-width: var(--cr-control-h);
853
- color: color-mix(in oklab, CanvasText 82%, Canvas);
854
- }
855
- .toolbar-source-render-toggle__caption {
856
- white-space: nowrap;
857
- }
858
- .toolbar-source-render-toggle[aria-pressed="true"] {
859
- color: CanvasText;
860
- background: color-mix(in oklab, CanvasText 10%, Canvas);
861
- }
862
- .toolbar-source-render-toggle:focus-visible {
863
- outline: 2px solid color-mix(in oklab, CanvasText 45%, Canvas);
864
- outline-offset: 2px;
865
- }
866
- .toolbar-icon-btn--source-markdown {
867
- display: inline-flex;
868
- }
869
- ${CODE_BROWSER_INTRO_STYLES}
870
- .toolbar label input:focus-visible {
871
- outline: 2px solid color-mix(in oklab, CanvasText 45%, Canvas);
872
- outline-offset: 2px;
873
- }
874
- .toolbar .toolbar-theme {
875
- position: relative;
876
- display: inline-flex;
877
- align-items: center;
878
- margin: 0;
879
- padding: 0;
880
- min-width: 0;
881
- border: 0;
882
- }
883
- .toolbar-theme__trigger {
884
- display: inline-flex;
885
- align-items: center;
886
- justify-content: center;
887
- width: var(--cr-control-h);
888
- height: var(--cr-control-h);
889
- padding: 0;
890
- margin: 0;
891
- border-radius: var(--cr-control-radius);
892
- border: 1px solid color-mix(in oklab, CanvasText 22%, Canvas);
893
- background: color-mix(in oklab, CanvasText 6%, Canvas);
894
- color: CanvasText;
895
- cursor: pointer;
896
- }
897
- .toolbar-theme__trigger:hover {
898
- background: color-mix(in oklab, CanvasText 14%, Canvas);
899
- border-color: color-mix(in oklab, CanvasText 34%, Canvas);
900
- }
901
- .toolbar-theme__trigger:active {
902
- background: color-mix(in oklab, CanvasText 18%, Canvas);
903
- }
904
- .toolbar-theme__trigger:focus-visible {
905
- outline: 2px solid color-mix(in oklab, CanvasText 45%, Canvas);
906
- outline-offset: 2px;
907
- }
908
- .toolbar-theme__trigger svg {
909
- width: var(--cr-icon-inner);
910
- height: var(--cr-icon-inner);
911
- display: block;
912
- flex: 0 0 auto;
913
- }
914
- .toolbar-share-link-btn[data-copied="true"] {
915
- background: color-mix(in oklab, #2ea043 24%, Canvas);
916
- border-color: color-mix(in oklab, #2ea043 48%, CanvasText);
917
- }
918
- .toolbar-theme__trigger .toolbar-theme__icon {
919
- display: none;
920
- flex: 0 0 auto;
921
- }
922
- .toolbar-theme__trigger[data-commentray-trigger-mode="system"] .toolbar-theme__icon--system,
923
- .toolbar-theme__trigger[data-commentray-trigger-mode="light"] .toolbar-theme__icon--light,
924
- .toolbar-theme__trigger[data-commentray-trigger-mode="dark"] .toolbar-theme__icon--dark {
925
- display: block;
926
- }
927
- .toolbar-theme__menu {
928
- position: absolute;
929
- left: 0;
930
- top: calc(100% + 4px);
931
- z-index: 80;
932
- min-width: 148px;
933
- padding: 4px;
934
- margin: 0;
935
- list-style: none;
936
- border-radius: 8px;
937
- border: 1px solid color-mix(in oklab, CanvasText 16%, Canvas);
938
- background: Canvas;
939
- color: CanvasText;
940
- box-shadow: 0 8px 28px color-mix(in oklab, CanvasText 12%, transparent);
941
- }
942
- .toolbar-theme__menu[hidden] {
943
- display: none !important;
944
- }
945
- .toolbar-theme__menuitem {
946
- display: block;
947
- width: 100%;
948
- margin: 0;
949
- padding: 8px 10px;
950
- border: 0;
951
- border-radius: 6px;
952
- font: inherit;
953
- font-size: var(--cr-ui-fs);
954
- font-weight: 500;
955
- text-align: left;
956
- cursor: pointer;
957
- color: CanvasText;
958
- background: transparent;
959
- }
960
- .toolbar-theme__menuitem:hover {
961
- background: color-mix(in oklab, CanvasText 8%, Canvas);
962
- }
963
- .toolbar-theme__menuitem:focus-visible {
964
- outline: 2px solid color-mix(in oklab, CanvasText 45%, Canvas);
965
- outline-offset: 0;
966
- }
967
- .toolbar-theme__menuitem[aria-checked="true"] {
968
- background: color-mix(in oklab, CanvasText 10%, Canvas);
969
- font-weight: 500;
970
- }
971
- .toolbar .file-path {
972
- font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
973
- font-size: var(--cr-ui-fs);
974
- font-weight: 500;
975
- display: inline-flex; align-items: baseline; gap: 0; margin-right: 4px;
976
- max-width: 60vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
977
- }
978
- .toolbar .file-path__dir {
979
- color: color-mix(in oklab, CanvasText 55%, Canvas);
980
- }
981
- .toolbar .file-path__dir--root { letter-spacing: 0; }
982
- .toolbar .file-path__base {
983
- color: CanvasText;
984
- font-weight: 500;
985
- }
986
- .toolbar .file-path--title { font-weight: 500; }
987
- .toolbar-related {
988
- display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px;
989
- max-width: min(520px, 90vw);
990
- font-size: var(--cr-ui-fs);
991
- line-height: 1.35;
992
- color: color-mix(in oklab, CanvasText 88%, Canvas);
993
- }
994
- .toolbar-related__prefix { font-weight: 500; opacity: 0.88; white-space: nowrap; }
995
- .toolbar-related__links { min-width: 0; }
996
- .toolbar-related a {
997
- color: inherit; text-decoration: underline; text-underline-offset: 2px; font-weight: 500;
998
- word-break: break-word;
999
- }
1000
- .toolbar-related__sep { opacity: 0.55; user-select: none; }
1001
- #documented-files-tree {
1002
- flex: 1 1 auto;
1003
- min-height: 0;
1004
- overflow: auto;
1005
- }
1006
- .documented-files-tree ul { list-style: none; margin: 0; padding-left: 12px; }
1007
- .documented-files-tree > ul { padding-left: 0; }
1008
- .documented-files-tree li { margin: 2px 0; line-height: 1.35; }
1009
- .documented-files-tree .tree-dir { font-weight: 600; margin-top: 4px; font-size: 12px; }
1010
- .documented-files-tree .tree-file {
1011
- margin: 3px 0;
1012
- font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
1013
- font-size: 11px;
1014
- }
1015
- .documented-files-tree .tree-file-link {
1016
- color: inherit;
1017
- font-weight: 500;
1018
- text-decoration: underline;
1019
- text-underline-offset: 2px;
1020
- word-break: break-word;
1021
- }
1022
- .documented-files-tree .tree-file-link:hover {
1023
- opacity: 0.92;
1024
- }
1025
- .documented-files-tree .tree-file-link.tree-file-link--current {
1026
- font-weight: 600;
1027
- text-decoration-thickness: 2px;
1028
- border-radius: 3px;
1029
- padding: 1px 3px;
1030
- margin: -1px -3px;
1031
- background: color-mix(in oklab, CanvasText 10%, Canvas);
1032
- }
1033
- .documented-files-tree .tree-file-link:focus-visible {
1034
- outline: 2px solid color-mix(in oklab, CanvasText 45%, Canvas);
1035
- outline-offset: 2px;
1036
- border-radius: 3px;
1037
- }
1038
- .toolbar button {
1039
- font: inherit;
1040
- font-size: var(--cr-ui-fs);
1041
- font-weight: 500;
1042
- min-height: var(--cr-control-h);
1043
- padding: 0 12px;
1044
- border-radius: var(--cr-control-radius);
1045
- cursor: pointer;
1046
- border: 1px solid color-mix(in oklab, CanvasText 25%, Canvas);
1047
- background: color-mix(in oklab, CanvasText 6%, Canvas);
1048
- color: CanvasText;
1049
- }
1050
- .search-results {
1051
- flex: 0 1 auto;
1052
- min-height: 0;
1053
- max-height: min(320px, 38vh);
1054
- overflow: auto;
1055
- padding: 8px 8px 10px;
1056
- border-radius: 8px;
1057
- border: 1px solid color-mix(in oklab, CanvasText 12%, Canvas);
1058
- background: Canvas;
1059
- font-size: 13px;
1060
- }
1061
- .search-results[hidden] { display: none !important; }
1062
- .search-results .hint { opacity: 0.75; margin-bottom: 8px; line-height: 1.45; }
1063
- .search-results button.hit {
1064
- display: block; width: 100%; text-align: left; margin: 4px 0; padding: 8px 10px;
1065
- border-radius: 6px; border: 1px solid color-mix(in oklab, CanvasText 14%, Canvas);
1066
- background: color-mix(in oklab, CanvasText 5%, Canvas); color: CanvasText; cursor: pointer;
1067
- font: inherit;
1068
- }
1069
- .search-results button.hit:hover { background: color-mix(in oklab, CanvasText 10%, Canvas); }
1070
- .search-results button.hit:focus-visible {
1071
- outline: 2px solid color-mix(in oklab, CanvasText 45%, Canvas);
1072
- outline-offset: 2px;
1073
- }
1074
- .search-results button.hit .meta { opacity: 0.8; font-size: 12px; }
1075
- .search-results button.hit .src-tag { opacity: 0.75; font-weight: 500; font-size: 11px; }
1076
- .search-results button.hit .snippet {
1077
- font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace; font-size: 13px;
1078
- line-height: 1.45; white-space: pre-wrap; word-break: break-word; margin-top: 4px;
1079
- }
1080
- .search-results mark.search-hit {
1081
- padding: 0 2px; border-radius: 3px; font: inherit;
1082
- background: color-mix(in oklab, #f5a623 70%, Canvas);
1083
- color: CanvasText;
1084
- box-decoration-break: clone;
1085
- -webkit-box-decoration-break: clone;
1086
- }
1087
- @media (prefers-color-scheme: dark) {
1088
- :root:is(:not([data-commentray-theme]), [data-commentray-theme="system"]) .search-results mark.search-hit {
1089
- background: color-mix(in oklab, #c9a227 55%, Canvas);
1090
- }
1091
- }
1092
- :root[data-commentray-theme="dark"] .search-results mark.search-hit {
1093
- background: color-mix(in oklab, #c9a227 55%, Canvas);
1094
- }
1095
- .shell:not(.shell--stretch-rows) {
1096
- display: flex;
1097
- flex-direction: column;
1098
- flex: 1;
1099
- min-height: 0;
1100
- min-width: 0;
1101
- --split-pct: 46%;
1102
- }
1103
- .app__main .shell { flex: 1 1 auto; }
1104
- .shell__panes {
1105
- display: flex;
1106
- flex-direction: row;
1107
- flex: 1 1 auto;
1108
- min-height: 0;
1109
- min-width: 0;
1110
- }
1111
- .shell__pair-context {
1112
- flex: 0 0 auto;
1113
- display: flex;
1114
- flex-direction: row;
1115
- align-items: stretch;
1116
- padding: 6px 0 8px;
1117
- border-bottom: 1px solid color-mix(in oklab, CanvasText 15%, Canvas);
1118
- background: color-mix(in oklab, CanvasText 3%, Canvas);
1119
- font-size: var(--cr-ui-fs);
1120
- line-height: 1.3;
1121
- }
1122
- .shell__pair-cell {
1123
- display: flex;
1124
- flex-direction: row;
1125
- align-items: center;
1126
- gap: 8px;
1127
- min-width: 0;
1128
- }
1129
- .shell__pair-cell--src {
1130
- flex: 0 0 var(--split-pct);
1131
- padding-left: var(--cr-pane-inline-pad);
1132
- }
1133
- .shell__pair-gutter-spacer {
1134
- flex: 0 0 14px;
1135
- min-width: 14px;
1136
- align-self: stretch;
1137
- }
1138
- .shell__pair-cell--doc {
1139
- flex: 1 1 auto;
1140
- min-width: 0;
1141
- padding-left: var(--cr-pane-inline-pad);
1142
- }
1143
- .shell__pair-path {
1144
- flex: 1 1 auto;
1145
- min-width: 0;
1146
- font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
1147
- font-size: var(--cr-ui-fs);
1148
- color: CanvasText;
1149
- overflow: hidden;
1150
- text-overflow: ellipsis;
1151
- white-space: nowrap;
1152
- }
1153
- .shell__pair-path--secondary {
1154
- opacity: 0.88;
1155
- text-align: right;
1156
- }
1157
- .shell--stretch-rows .shell__pair-context {
1158
- --shell-pair-gutter-w: 14px;
1159
- --shell-pair-gutter-half: calc(var(--shell-pair-gutter-w) / 2);
1160
- display: grid;
1161
- grid-template-columns:
1162
- minmax(0, calc(var(--stretch-code-pct, 50%) - var(--shell-pair-gutter-half)))
1163
- var(--shell-pair-gutter-w)
1164
- minmax(0, calc(100% - var(--stretch-code-pct, 50%) - var(--shell-pair-gutter-half)));
1165
- width: 100%;
1166
- box-sizing: border-box;
1167
- }
1168
- .shell--stretch-rows .shell__pair-cell--src,
1169
- .shell--stretch-rows .shell__pair-cell--doc,
1170
- .shell--stretch-rows .shell__pair-gutter-spacer {
1171
- min-width: 0;
1172
- }
1173
- .shell--stretch-rows .shell__pair-cell--src {
1174
- grid-column: 1;
1175
- padding-left: var(--cr-pane-inline-pad);
1176
- padding-right: 0;
1177
- }
1178
- .shell--stretch-rows .shell__pair-gutter-spacer {
1179
- grid-column: 2;
1180
- width: var(--shell-pair-gutter-w);
1181
- min-width: var(--shell-pair-gutter-w);
1182
- }
1183
- .shell--stretch-rows .shell__pair-cell--doc {
1184
- grid-column: 3;
1185
- padding-left: var(--cr-pane-inline-pad);
1186
- padding-right: var(--cr-pane-inline-pad);
1187
- }
1188
- .shell[data-mobile-single-pane="true"] .shell__pair-context {
1189
- display: flex;
1190
- flex-direction: column;
1191
- align-items: stretch;
1192
- gap: 4px;
1193
- padding: 4px 0 6px;
1194
- }
1195
- .shell[data-mobile-single-pane="true"] .shell__pair-cell--src,
1196
- .shell[data-mobile-single-pane="true"] .shell__pair-cell--doc {
1197
- width: 100%;
1198
- padding-right: var(--cr-pane-inline-pad);
1199
- box-sizing: border-box;
1200
- }
1201
- .shell[data-mobile-single-pane="true"][data-dual-mobile-pane="code"] .shell__pair-cell--doc,
1202
- .shell[data-mobile-single-pane="true"][data-dual-mobile-pane="code"] .shell__pair-gutter-spacer {
1203
- display: none;
1204
- }
1205
- .shell[data-mobile-single-pane="true"][data-dual-mobile-pane="doc"] .shell__pair-cell--src,
1206
- .shell[data-mobile-single-pane="true"][data-dual-mobile-pane="doc"] .shell__pair-gutter-spacer {
1207
- display: none;
1208
- }
1209
- .shell[data-mobile-single-pane="true"]:not([data-dual-mobile-pane]) .shell__pair-cell--src,
1210
- .shell[data-mobile-single-pane="true"]:not([data-dual-mobile-pane]) .shell__pair-gutter-spacer {
1211
- display: none;
1212
- }
1213
- .pane--code {
1214
- flex: 0 0 var(--split-pct, 46%);
1215
- min-width: 120px; overflow: auto; padding: 12px var(--cr-pane-inline-pad);
1216
- border-right: 1px solid color-mix(in oklab, CanvasText 15%, Canvas);
1217
- --code-line-font-size: 13px;
1218
- --code-line-height: 1.5;
1219
- }
1220
- .source-pane {
1221
- min-width: 0;
1222
- }
1223
- .source-pane--rendered-md {
1224
- font-size: 15px;
1225
- line-height: 1.45;
1226
- }
1227
- .source-pane--rendered-md img {
1228
- max-width: 100%;
1229
- height: auto;
1230
- }
1231
- .source-pane--rendered-md .commentray-mermaid {
1232
- overflow-x: auto;
1233
- max-width: 100%;
1234
- }
1235
- .source-pane--rendered-md .commentray-line-anchor--source {
1236
- display: inline;
1237
- vertical-align: baseline;
1238
- }
1239
- #shell[data-source-pane-mode="rendered-markdown"] .source-pane--code {
1240
- display: none;
1241
- }
1242
- #shell[data-source-pane-mode="source"] .source-pane--rendered-md {
1243
- display: none;
1244
- }
1245
- .pane--code .code-line-stack { --code-ln-min-ch: 3; }
1246
- .pane--code .code-line {
1247
- display: grid;
1248
- grid-template-columns: max-content minmax(0, 1fr);
1249
- column-gap: 10px;
1250
- align-items: start;
1251
- min-width: 0;
1252
- }
1253
- .pane--code .code-line pre {
1254
- margin: 0;
1255
- min-width: 0;
1256
- padding: 0;
1257
- border: 0;
1258
- background: transparent;
1259
- }
1260
- .pane--code .code-line pre code.hljs {
1261
- display: block;
1262
- margin: 0;
1263
- padding: 0;
1264
- font-size: var(--code-line-font-size);
1265
- line-height: var(--code-line-height);
1266
- }
1267
- .pane--code .code-line .ln {
1268
- font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
1269
- font-variant-numeric: tabular-nums;
1270
- text-align: right; user-select: none; -webkit-user-select: none;
1271
- color: color-mix(in oklab, CanvasText 45%, Canvas);
1272
- padding-right: 8px;
1273
- border-right: 1px solid color-mix(in oklab, CanvasText 12%, Canvas);
1274
- white-space: nowrap;
1275
- font-size: var(--code-line-font-size);
1276
- line-height: var(--code-line-height);
1277
- min-width: calc(var(--code-ln-min-ch, 3) * 1ch + 0.6ch);
1278
- box-sizing: content-box;
1279
- }
1280
- .pane--code .code-line:target .ln,
1281
- .pane--code .code-line:hover .ln {
1282
- color: color-mix(in oklab, CanvasText 75%, Canvas);
1283
- }
1284
- .pane--code.wrap .code-line pre, .pane--code.wrap .code-line pre code {
1285
- white-space: pre-wrap; word-break: break-word;
1286
- }
1287
- .pane--code:not(.wrap) .code-line pre, .pane--code:not(.wrap) .code-line pre code {
1288
- white-space: pre;
1289
- }
1290
- .gutter {
1291
- flex: 0 0 14px; cursor: col-resize; background: color-mix(in oklab, CanvasText 12%, Canvas);
1292
- position: relative;
1293
- --commentray-ray-accent: #3b7dd8;
1294
- }
1295
- @media (prefers-color-scheme: dark) {
1296
- :root:is(:not([data-commentray-theme]), [data-commentray-theme="system"]) .gutter {
1297
- --commentray-ray-accent: #6eb0ff;
1298
- }
1299
- }
1300
- :root[data-commentray-theme="dark"] .gutter {
1301
- --commentray-ray-accent: #6eb0ff;
1302
- }
1303
- .gutter__rays {
1304
- position: absolute; inset: 0; pointer-events: none; z-index: 1;
1305
- }
1306
- .gutter__rays svg {
1307
- width: 100%;
1308
- height: 100%;
1309
- display: block;
1310
- overflow: hidden;
1311
- }
1312
- .gutter__rays-path {
1313
- fill: none; stroke-linecap: round; vector-effect: non-scaling-stroke;
1314
- stroke: color-mix(in oklab, var(--commentray-ray-accent) 72%, CanvasText);
1315
- stroke-width: 1.35px; opacity: 0.26;
1316
- }
1317
- .gutter__rays-path--active {
1318
- stroke-width: 2.4px; opacity: 0.88;
1319
- }
1320
- .gutter__rays-path--trail {
1321
- stroke-dasharray: 3 4; opacity: 0.42;
1322
- }
1323
- .gutter__rays-path--active.gutter__rays-path--trail {
1324
- opacity: 0.72;
1325
- }
1326
- .gutter:hover { background: color-mix(in oklab, CanvasText 22%, Canvas); }
1327
- .gutter::after {
1328
- content: ""; position: absolute; top: 0; bottom: 0; left: -4px; right: -4px;
1329
- }
1330
- .pane--doc {
1331
- flex: 1 1 auto; min-width: 0; min-height: 0;
1332
- display: flex; flex-direction: column; overflow: hidden; padding: 12px var(--cr-pane-inline-pad);
1333
- background: Canvas;
1334
- color: CanvasText;
1335
- }
1336
- /* #doc-pane-body.wrap beats pre code.hljs from the hljs theme so fenced blocks follow the toggle. */
1337
- #doc-pane-body.wrap pre,
1338
- #doc-pane-body.wrap pre code {
1339
- white-space: pre-wrap;
1340
- word-break: break-word;
1341
- }
1342
- #doc-pane-body:not(.wrap) pre,
1343
- #doc-pane-body:not(.wrap) pre code {
1344
- white-space: pre;
1345
- word-break: normal;
1346
- }
1347
- .doc-pane-body {
1348
- flex: 1 1 auto; min-height: 0; overflow: auto;
1349
- }
1350
- /* scroll-behavior: smooth was removed: it interpolates many scroll events per gesture and
1351
- * exhausts the partner-echo guard in wireBidirectionalScroll, so doc↔code ping-pong returns. */
1352
- /* Inline backtick code chips (GitHub-like): prose context only, never fenced pre/code blocks. */
1353
- .pane--doc .doc-pane-body :where(p, li, blockquote, td, th, h1, h2, h3, h4, h5, h6) > code,
1354
- .shell--stretch-rows .stretch-preamble :where(p, li, blockquote, td, th, h1, h2, h3, h4, h5, h6) > code,
1355
- .block-stretch td.stretch-doc .stretch-doc-inner :where(p, li, blockquote, td, th, h1, h2, h3, h4, h5, h6) > code {
1356
- font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
1357
- font-size: 0.92em;
1358
- padding: 0.12em 0.36em;
1359
- border-radius: 6px;
1360
- border: 1px solid color-mix(in oklab, CanvasText 12%, Canvas);
1361
- background: color-mix(in oklab, CanvasText 8%, Canvas);
1362
- color: inherit;
1363
- }
1364
- @media (prefers-color-scheme: dark) {
1365
- :root:is(:not([data-commentray-theme]), [data-commentray-theme="system"]) .pane--doc .doc-pane-body :where(p, li, blockquote, td, th, h1, h2, h3, h4, h5, h6) > code,
1366
- :root:is(:not([data-commentray-theme]), [data-commentray-theme="system"]) .shell--stretch-rows .stretch-preamble :where(p, li, blockquote, td, th, h1, h2, h3, h4, h5, h6) > code,
1367
- :root:is(:not([data-commentray-theme]), [data-commentray-theme="system"]) .block-stretch td.stretch-doc .stretch-doc-inner :where(p, li, blockquote, td, th, h1, h2, h3, h4, h5, h6) > code {
1368
- border-color: color-mix(in oklab, CanvasText 26%, Canvas);
1369
- background: color-mix(in oklab, CanvasText 16%, Canvas);
1370
- }
1371
- }
1372
- :root[data-commentray-theme="dark"] .pane--doc .doc-pane-body :where(p, li, blockquote, td, th, h1, h2, h3, h4, h5, h6) > code,
1373
- :root[data-commentray-theme="dark"] .shell--stretch-rows .stretch-preamble :where(p, li, blockquote, td, th, h1, h2, h3, h4, h5, h6) > code,
1374
- :root[data-commentray-theme="dark"] .block-stretch td.stretch-doc .stretch-doc-inner :where(p, li, blockquote, td, th, h1, h2, h3, h4, h5, h6) > code {
1375
- border-color: color-mix(in oklab, CanvasText 26%, Canvas);
1376
- background: color-mix(in oklab, CanvasText 16%, Canvas);
1377
- }
1378
- /**
1379
- * GFM tables in rendered Markdown (doc pane, stretch preamble, per-block doc cells).
1380
- * Intrinsic width so the pane scrolls sideways instead of squeezing columns; borders
1381
- * and padding match familiar GitHub-style readability.
1382
- */
1383
- .pane--doc .doc-pane-body :where(table),
1384
- .shell--stretch-rows .stretch-preamble :where(table),
1385
- .block-stretch td.stretch-doc .stretch-doc-inner :where(table) {
1386
- width: max-content;
1387
- max-width: none;
1388
- border-collapse: collapse;
1389
- margin: 0.85em 0;
1390
- font-size: inherit;
1391
- line-height: inherit;
1392
- }
1393
- .pane--doc .doc-pane-body :where(th, td),
1394
- .shell--stretch-rows .stretch-preamble :where(th, td),
1395
- .block-stretch td.stretch-doc .stretch-doc-inner :where(th, td) {
1396
- border: 1px solid color-mix(in oklab, CanvasText 22%, Canvas);
1397
- padding: 8px 12px;
1398
- vertical-align: top;
1399
- }
1400
- .pane--doc .doc-pane-body :where(thead th),
1401
- .shell--stretch-rows .stretch-preamble :where(thead th),
1402
- .block-stretch td.stretch-doc .stretch-doc-inner :where(thead th) {
1403
- font-weight: 600;
1404
- background: color-mix(in oklab, CanvasText 7%, Canvas);
1405
- }
1406
- .pane--doc .doc-pane-body tbody tr:nth-child(even) :where(td),
1407
- .shell--stretch-rows .stretch-preamble tbody tr:nth-child(even) :where(td),
1408
- .block-stretch td.stretch-doc .stretch-doc-inner tbody tr:nth-child(even) :where(td) {
1409
- background: color-mix(in oklab, CanvasText 3.5%, Canvas);
1410
- }
1411
- .pane--doc .doc-pane-body :where(ul.contains-task-list),
1412
- .shell--stretch-rows .stretch-preamble :where(ul.contains-task-list),
1413
- .block-stretch td.stretch-doc .stretch-doc-inner :where(ul.contains-task-list) {
1414
- list-style: none;
1415
- padding-inline-start: 1.2em;
1416
- }
1417
- .pane--doc .doc-pane-body :where(li.task-list-item),
1418
- .shell--stretch-rows .stretch-preamble :where(li.task-list-item),
1419
- .block-stretch td.stretch-doc .stretch-doc-inner :where(li.task-list-item) {
1420
- position: relative;
1421
- }
1422
- .pane--doc .doc-pane-body :where(li.task-list-item input[type="checkbox"]),
1423
- .shell--stretch-rows .stretch-preamble :where(li.task-list-item input[type="checkbox"]),
1424
- .block-stretch td.stretch-doc .stretch-doc-inner :where(li.task-list-item input[type="checkbox"]) {
1425
- position: absolute;
1426
- margin-inline-start: -1.35em;
1427
- margin-top: 0.2em;
1428
- }
1429
- .pane--doc .doc-pane-body :where(del),
1430
- .shell--stretch-rows .stretch-preamble :where(del),
1431
- .block-stretch td.stretch-doc .stretch-doc-inner :where(del) {
1432
- opacity: 0.82;
1433
- }
1434
- .pane--doc .doc-pane-body :where(section.footnotes),
1435
- .shell--stretch-rows .stretch-preamble :where(section.footnotes),
1436
- .block-stretch td.stretch-doc .stretch-doc-inner :where(section.footnotes) {
1437
- margin-top: 1.5em;
1438
- padding-top: 0.75em;
1439
- border-top: 1px solid color-mix(in oklab, CanvasText 18%, Canvas);
1440
- font-size: 0.92em;
1441
- }
1442
- .pane--doc .doc-pane-body .commentray-mermaid {
1443
- overflow-x: auto;
1444
- max-width: 100%;
1445
- }
1446
- /** Wrap on: break long URLs/words in prose; tables opt out so they stay wide + scroll with the body. */
1447
- #doc-pane-body.wrap {
1448
- overflow-wrap: break-word;
1449
- }
1450
- #doc-pane-body.wrap :where(table) {
1451
- overflow-wrap: normal;
1452
- word-break: normal;
1453
- }
1454
- #doc-pane-body:not(.wrap) {
1455
- overflow-wrap: normal;
1456
- word-break: normal;
1457
- }
1458
- #doc-pane-body .commentray-page-break {
1459
- position: relative;
1460
- min-height: var(--commentray-page-break-min-height, clamp(260px, 56vh, 620px));
1461
- margin: 24px 0;
1462
- display: flex;
1463
- align-items: center;
1464
- justify-content: center;
1465
- pointer-events: none;
1466
- }
1467
- #doc-pane-body .commentray-page-break__rule {
1468
- width: 100%;
1469
- border-top: 1px dashed var(--border);
1470
- opacity: 0.38;
1471
- }
1472
- #shell[data-page-breaks-enabled="false"] .commentray-page-break {
1473
- display: none;
1474
- }
1475
- .toolbar-angle-picker {
1476
- display: inline-flex;
1477
- align-items: center;
1478
- gap: 6px;
1479
- flex: 0 0 auto;
1480
- }
1481
- /* Angle caption uses the same class as the Search label (.nav-rail__search-label). */
1482
- .toolbar-angle-picker__lab {
1483
- display: inline-block;
1484
- margin: 0;
1485
- padding: 0;
1486
- cursor: default;
1487
- flex: 0 0 auto;
1488
- white-space: nowrap;
1489
- user-select: none;
1490
- }
1491
- .toolbar-angle-picker select {
1492
- font: inherit;
1493
- font-size: var(--cr-ui-fs);
1494
- font-weight: 500;
1495
- min-height: var(--cr-control-h);
1496
- height: var(--cr-control-h);
1497
- padding: 0 10px;
1498
- border-radius: var(--cr-control-radius);
1499
- border: 1px solid color-mix(in oklab, CanvasText 25%, Canvas);
1500
- background: Canvas;
1501
- color: color-mix(in oklab, CanvasText 88%, Canvas);
1502
- }
1503
- .toolbar-angle-picker select:focus-visible {
1504
- outline: 2px solid color-mix(in oklab, CanvasText 45%, Canvas);
1505
- outline-offset: 2px;
1506
- }
1507
- /* Single-pane + compact chrome below typical tablet / Bootstrap md threshold (768px). */
1508
- @media (max-width: 767px) {
1509
- html,
1510
- body {
1511
- overflow-x: auto;
1512
- overflow-y: auto;
1513
- }
1514
- .app {
1515
- height: auto;
1516
- min-height: 100vh;
1517
- min-height: 100dvh;
1518
- min-width: 0;
1519
- overflow-x: auto;
1520
- overflow-y: visible;
1521
- }
1522
- .app__main {
1523
- flex: 0 0 auto;
1524
- width: 100%;
1525
- min-height: 0;
1526
- }
1527
- .app__main > #shell:not(.shell--stretch-rows) {
1528
- flex: none !important;
1529
- min-height: auto !important;
1530
- overflow: visible !important;
1531
- }
1532
- .app__main > #shell:not(.shell--stretch-rows) .shell__panes {
1533
- flex: none !important;
1534
- min-height: auto !important;
1535
- min-width: 0;
1536
- width: 100%;
1537
- max-width: 100%;
1538
- box-sizing: border-box;
1539
- }
1540
- .app__main > #shell:not(.shell--stretch-rows) .pane--code,
1541
- .app__main > #shell:not(.shell--stretch-rows) .pane--doc {
1542
- flex: none !important;
1543
- min-height: auto !important;
1544
- overflow: visible !important;
1545
- max-height: none !important;
1546
- /* flex:none + basis:auto otherwise sizes to max-content so line-wrap has no width cap */
1547
- width: 100%;
1548
- max-width: 100%;
1549
- min-width: 0 !important;
1550
- box-sizing: border-box;
1551
- }
1552
- .app__main > #shell:not(.shell--stretch-rows) .pane--doc {
1553
- display: block;
1554
- }
1555
- .app__main > #shell:not(.shell--stretch-rows) .doc-pane-body {
1556
- flex: none !important;
1557
- min-height: auto !important;
1558
- min-width: 0;
1559
- overflow: visible !important;
1560
- }
1561
- .app__footer {
1562
- margin-top: auto;
1563
- flex-shrink: 0;
1564
- padding: 5px 10px 8px;
1565
- font-size: 10px;
1566
- line-height: 1.35;
1567
- }
1568
- .app__main > #shell.shell--stretch-rows {
1569
- flex: 1 1 auto;
1570
- min-height: min(72vh, 720px);
1571
- min-height: min(72dvh, 720px);
1572
- overflow: auto;
1573
- }
1574
- .toolbar {
1575
- padding: 5px 8px 5px;
1576
- row-gap: 4px;
1577
- }
1578
- .toolbar__primary {
1579
- display: flex;
1580
- flex-direction: row;
1581
- flex-wrap: nowrap;
1582
- align-items: center;
1583
- gap: 6px;
1584
- min-width: 0;
1585
- width: 100%;
1586
- box-sizing: border-box;
1587
- }
1588
- .toolbar__primary-main {
1589
- flex: 1 1 auto;
1590
- min-width: 0;
1591
- flex-wrap: nowrap;
1592
- overflow-x: auto;
1593
- overflow-y: visible;
1594
- -webkit-overflow-scrolling: touch;
1595
- gap: 6px;
1596
- scrollbar-width: thin;
1597
- }
1598
- .toolbar__primary-trail {
1599
- flex: 0 0 auto;
1600
- flex-wrap: nowrap;
1601
- align-self: center;
1602
- }
1603
- .toolbar-angle-picker {
1604
- position: relative;
1605
- flex: 0 1 auto;
1606
- min-width: 0;
1607
- max-width: 100%;
1608
- }
1609
- .toolbar-angle-picker__lab {
1610
- position: absolute;
1611
- width: 1px;
1612
- height: 1px;
1613
- padding: 0;
1614
- margin: -1px;
1615
- overflow: hidden;
1616
- clip: rect(0, 0, 0, 0);
1617
- white-space: nowrap;
1618
- border: 0;
1619
- opacity: 0;
1620
- pointer-events: none;
1621
- }
1622
- .toolbar-angle-picker select {
1623
- max-width: min(200px, 52vw);
1624
- min-width: 0;
1625
- text-overflow: ellipsis;
1626
- }
1627
- .app__chrome {
1628
- padding: 5px 8px 6px;
1629
- gap: 5px;
1630
- max-height: min(36vh, 360px);
1631
- }
1632
- /* Compact chrome: avoid heavy rings on inline fields (clear stays a real button). */
1633
- .chrome__search-row input[type="search"]:focus-visible {
1634
- outline: none;
1635
- border-color: color-mix(in oklab, CanvasText 42%, Canvas);
1636
- }
1637
- .chrome__search-row #search-clear:focus-visible {
1638
- outline: 2px solid color-mix(in oklab, CanvasText 45%, Canvas);
1639
- outline-offset: 2px;
1640
- }
1641
- .chrome__search-label__caption {
1642
- position: absolute;
1643
- width: 1px;
1644
- height: 1px;
1645
- padding: 0;
1646
- margin: -1px;
1647
- overflow: hidden;
1648
- clip: rect(0, 0, 0, 0);
1649
- white-space: nowrap;
1650
- border: 0;
1651
- }
1652
- .chrome__search-label__glyph {
1653
- display: inline-flex;
1654
- align-items: center;
1655
- justify-content: center;
1656
- padding: 0 2px;
1657
- margin: 0;
1658
- color: color-mix(in oklab, CanvasText 72%, Canvas);
1659
- }
1660
- .chrome__search-label__glyph:hover {
1661
- color: color-mix(in oklab, CanvasText 88%, Canvas);
1662
- }
1663
- .chrome__search-label:focus-within {
1664
- outline: none;
1665
- }
1666
- .chrome__search-label__glyph svg {
1667
- display: block;
1668
- flex: 0 0 auto;
1669
- }
1670
- .toolbar-angle-picker select:focus-visible {
1671
- outline: none;
1672
- border-color: color-mix(in oklab, CanvasText 42%, Canvas);
1673
- }
1674
- .toolbar-icon-btn--flip-only-narrow {
1675
- display: inline-flex;
1676
- }
1677
- /**
1678
- * Secondary flip: only on narrow viewports, only while the toolbar flip is off-screen
1679
- * (see client IntersectionObserver). Same control as toolbar; fixed so it stays reachable.
1680
- */
1681
- .toolbar-icon-btn--flip-scroll-narrow {
1682
- display: none;
1683
- }
1684
- #mobile-pane-flip-scroll.toolbar-icon-btn--flip-scroll-narrow.is-visible {
1685
- display: inline-flex;
1686
- position: fixed;
1687
- top: calc(10px + env(safe-area-inset-top, 0px));
1688
- right: calc(12px + env(safe-area-inset-right, 0px));
1689
- z-index: 50;
1690
- box-shadow:
1691
- 0 1px 2px color-mix(in oklab, CanvasText 12%, transparent),
1692
- 0 4px 14px color-mix(in oklab, CanvasText 18%, transparent);
1693
- }
1694
- .toolbar-icon-btn--source-markdown-scroll-narrow {
1695
- display: none;
1696
- }
1697
- #source-markdown-pane-flip-scroll.toolbar-icon-btn--source-markdown-scroll-narrow.is-visible {
1698
- display: inline-flex;
1699
- position: fixed;
1700
- top: calc(10px + env(safe-area-inset-top, 0px));
1701
- left: calc(12px + env(safe-area-inset-left, 0px));
1702
- z-index: 50;
1703
- box-shadow:
1704
- 0 1px 2px color-mix(in oklab, CanvasText 12%, transparent),
1705
- 0 4px 14px color-mix(in oklab, CanvasText 18%, transparent);
1706
- }
1707
- /** Region connector lines are not needed on the narrow single-pane layout (gutter is hidden). */
1708
- .shell:not(.shell--stretch-rows) .gutter .gutter__rays {
1709
- opacity: 0 !important;
1710
- pointer-events: none !important;
1711
- }
1712
- .nav-rail__doc-hub-summary {
1713
- min-width: var(--cr-control-h);
1714
- padding: 0 10px;
1715
- justify-content: center;
1716
- gap: 0;
1717
- }
1718
- .nav-rail__doc-hub-summary__caption {
1719
- position: absolute;
1720
- width: 1px;
1721
- height: 1px;
1722
- padding: 0;
1723
- margin: -1px;
1724
- overflow: hidden;
1725
- clip: rect(0, 0, 0, 0);
1726
- white-space: nowrap;
1727
- border: 0;
1728
- }
1729
- .nav-rail__doc-hub-summary__glyph {
1730
- display: inline-flex;
1731
- }
1732
- .toolbar-wrap-lines {
1733
- min-width: var(--cr-control-h);
1734
- padding: 0;
1735
- justify-content: center;
1736
- gap: 0;
1737
- font-weight: 500;
1738
- }
1739
- .toolbar-wrap-lines__caption {
1740
- position: absolute;
1741
- width: 1px;
1742
- height: 1px;
1743
- padding: 0;
1744
- margin: -1px;
1745
- overflow: hidden;
1746
- clip: rect(0, 0, 0, 0);
1747
- white-space: nowrap;
1748
- border: 0;
1749
- }
1750
- .toolbar-wrap-lines__box {
1751
- display: none;
1752
- }
1753
- .toolbar-wrap-lines__face {
1754
- display: inline-flex;
1755
- position: relative;
1756
- width: 100%;
1757
- height: 100%;
1758
- min-height: var(--cr-control-h);
1759
- min-width: var(--cr-control-h);
1760
- }
1761
- .toolbar-wrap-lines:has(.toolbar-wrap-lines__input:checked) .toolbar-wrap-lines__face::after {
1762
- content: "✓";
1763
- position: absolute;
1764
- right: 1px;
1765
- bottom: 0;
1766
- font-size: 11px;
1767
- line-height: 1;
1768
- font-weight: 800;
1769
- color: CanvasText;
1770
- text-shadow: 0 0 2px Canvas, 0 0 3px Canvas;
1771
- }
1772
- .toolbar-source-render-toggle {
1773
- min-width: var(--cr-control-h);
1774
- width: var(--cr-control-h);
1775
- height: var(--cr-control-h);
1776
- padding: 0;
1777
- justify-content: center;
1778
- gap: 0;
1779
- }
1780
- .toolbar-source-render-toggle__caption {
1781
- position: absolute;
1782
- width: 1px;
1783
- height: 1px;
1784
- padding: 0;
1785
- margin: -1px;
1786
- overflow: hidden;
1787
- clip: rect(0, 0, 0, 0);
1788
- white-space: nowrap;
1789
- border: 0;
1790
- }
1791
- .toolbar-source-render-toggle__box {
1792
- display: none;
1793
- }
1794
- .toolbar-source-render-toggle__face {
1795
- display: inline-flex;
1796
- position: relative;
1797
- width: 100%;
1798
- height: 100%;
1799
- min-height: var(--cr-control-h);
1800
- min-width: var(--cr-control-h);
1801
- }
1802
- .toolbar-source-render-toggle[aria-pressed="true"] .toolbar-source-render-toggle__face::after {
1803
- content: "✓";
1804
- position: absolute;
1805
- right: 1px;
1806
- bottom: 0;
1807
- font-size: 11px;
1808
- line-height: 1;
1809
- font-weight: 800;
1810
- color: CanvasText;
1811
- text-shadow: 0 0 2px Canvas, 0 0 3px Canvas;
1812
- }
1813
- .shell:not(.shell--stretch-rows)[data-dual-mobile-pane="code"] .pane--doc,
1814
- .shell:not(.shell--stretch-rows)[data-dual-mobile-pane="code"] .gutter {
1815
- display: none !important;
1816
- }
1817
- .shell:not(.shell--stretch-rows)[data-dual-mobile-pane="doc"] .pane--code,
1818
- .shell:not(.shell--stretch-rows)[data-dual-mobile-pane="doc"] .gutter {
1819
- display: none !important;
1820
- }
1821
- .shell:not(.shell--stretch-rows)[data-dual-mobile-pane="code"] .pane--code,
1822
- .shell:not(.shell--stretch-rows)[data-dual-mobile-pane="doc"] .pane--doc {
1823
- border-right: 0 !important;
1824
- }
1825
- .shell:not(.shell--stretch-rows) .shell__pair-context {
1826
- flex-direction: column;
1827
- align-items: stretch;
1828
- gap: 4px;
1829
- padding: 4px 0 6px;
1830
- }
1831
- .shell:not(.shell--stretch-rows) .shell__pair-gutter-spacer {
1832
- display: none;
1833
- }
1834
- .shell:not(.shell--stretch-rows) .shell__pair-cell--src {
1835
- flex: 1 1 auto;
1836
- padding-left: var(--cr-pane-inline-pad);
1837
- }
1838
- .shell:not(.shell--stretch-rows) .shell__pair-cell--doc {
1839
- flex: 1 1 auto;
1840
- padding-left: var(--cr-pane-inline-pad);
1841
- }
1842
- .shell.shell--stretch-rows[data-dual-mobile-pane="code"] .stretch-col-doc,
1843
- .shell.shell--stretch-rows[data-dual-mobile-pane="doc"] .stretch-col-code,
1844
- .shell.shell--stretch-rows[data-dual-mobile-pane="code"] td.stretch-doc,
1845
- .shell.shell--stretch-rows[data-dual-mobile-pane="doc"] td.stretch-code {
1846
- display: none;
1847
- }
1848
- .shell.shell--stretch-rows[data-dual-mobile-pane="code"] td.stretch-code,
1849
- .shell.shell--stretch-rows[data-dual-mobile-pane="doc"] td.stretch-doc {
1850
- display: table-cell;
1851
- width: 100%;
1852
- padding-left: 0;
1853
- padding-right: 0;
318
+ const COMMENTRAY_SHELL_INTRO_PLACEHOLDER = "/* __COMMENTRAY_INTRO_CSS__ */";
319
+ /** Code browser chrome + panes; intro tour rules are spliced from {@link ./code-browser-intro.css}. */
320
+ function loadCodeBrowserShellStylesFile() {
321
+ const packagesDir = findMonorepoPackagesDir(monorepoLayoutStartDir(import.meta.url));
322
+ const renderDistDir = join(packagesDir, "render", "dist");
323
+ const inDist = join(renderDistDir, "code-browser-shell.css");
324
+ const fromSrc = join(packagesDir, "render", "src", "code-browser-shell.css");
325
+ for (const tryPath of [inDist, fromSrc]) {
326
+ if (existsSync(tryPath)) {
327
+ return readFileSync(tryPath, "utf8");
1854
328
  }
1855
- .shell.shell--stretch-rows[data-dual-mobile-pane] #stretch-gutter {
1856
- display: none;
329
+ }
330
+ throw new Error("Missing code-browser-shell.css. Run `npm run build -w @commentray/render` or ensure the file exists under render/src.");
331
+ }
332
+ let cachedCodeBrowserShellCss;
333
+ function getCodeBrowserShellCss() {
334
+ if (cachedCodeBrowserShellCss === undefined) {
335
+ cachedCodeBrowserShellCss = loadCodeBrowserShellStylesFile();
336
+ if (!cachedCodeBrowserShellCss.includes(COMMENTRAY_SHELL_INTRO_PLACEHOLDER)) {
337
+ throw new Error("code-browser-shell.css is missing the intro splice placeholder.");
1857
338
  }
1858
- }
1859
- .pane--doc { font-size: 15px; line-height: 1.45; }
1860
- .pane--doc img { max-width: 100%; height: auto; }
1861
- .pane--doc .commentray-line-anchor {
1862
- display: inline;
1863
- vertical-align: baseline;
1864
- scroll-margin-top: 10px;
1865
- }
1866
- .pane--doc .commentray-block-anchor {
1867
- display: block;
1868
- height: 0;
1869
- margin: 0;
1870
- border: 0;
1871
- pointer-events: none;
1872
- }
1873
- .shell--stretch-rows {
1874
- flex: 1;
1875
- min-height: 0;
1876
- overflow: auto;
1877
- display: block;
1878
- padding: 0 0 20px;
1879
- }
1880
- .shell--stretch-rows .stretch-preamble {
1881
- padding: 8px 4px 16px;
1882
- margin-bottom: 8px;
1883
- font-size: 15px;
1884
- line-height: 1.45;
1885
- overflow-x: auto;
1886
- /* overflow-x other than visible makes overflow-y:visible compute to auto, which traps
1887
- * vertical wheel on this node instead of the shell scrollport when height is ever capped. */
1888
- overflow-y: hidden;
1889
- max-width: 100%;
1890
- }
1891
- .shell--stretch-rows .stretch-preamble img { max-width: 100%; height: auto; }
1892
- .block-stretch {
1893
- width: 100%;
1894
- border-collapse: collapse;
1895
- table-layout: fixed;
1896
- }
1897
- .stretch-grid {
1898
- position: relative;
1899
- }
1900
- .stretch-col-code { width: var(--stretch-code-pct, 50%); }
1901
- .stretch-col-doc { width: calc(100% - var(--stretch-code-pct, 50%)); }
1902
- .block-stretch td.stretch-code {
1903
- vertical-align: top;
1904
- padding: 0 12px 0 0;
1905
- box-shadow: inset -1px 0 0 color-mix(in oklab, CanvasText 10%, Canvas);
1906
- }
1907
- #shell[data-stretch-buffer-sync="flow-synchronizer"] .block-stretch td.stretch-code > .stretch-cell-measure,
1908
- #shell[data-stretch-buffer-sync="flow-synchronizer"] .block-stretch td.stretch-doc > .stretch-cell-measure {
1909
- display: block;
1910
- width: 100%;
1911
- box-sizing: border-box;
1912
- height: max-content;
1913
- max-height: max-content;
1914
- }
1915
- #shell[data-stretch-buffer-sync="flow-synchronizer"] .block-stretch td.stretch-doc .stretch-doc-inner {
1916
- height: max-content;
1917
- max-height: max-content;
1918
- }
1919
- #shell[data-stretch-buffer-sync="flow-synchronizer"] .block-stretch .stretch-code-stack {
1920
- height: max-content;
1921
- max-height: max-content;
1922
- }
1923
- .block-stretch td.stretch-doc {
1924
- vertical-align: top;
1925
- padding: 0 0 0 12px;
1926
- box-shadow: inset 1px 0 0 color-mix(in oklab, CanvasText 8%, Canvas);
1927
- }
1928
- .block-stretch td.stretch-doc .stretch-doc-inner {
1929
- font-size: 15px;
1930
- line-height: 1.45;
1931
- min-width: 0;
1932
- overflow-x: auto;
1933
- /* Keep vertical scrolling on the shell; see stretch-preamble rule above. */
1934
- overflow-y: hidden;
1935
- }
1936
- .block-stretch td.stretch-doc .stretch-doc-inner img { max-width: 100%; height: auto; }
1937
- .block-stretch td.stretch-doc .stretch-doc-inner .commentray-mermaid {
1938
- overflow-x: auto;
1939
- overflow-y: hidden;
1940
- max-width: 100%;
1941
- }
1942
- .block-stretch.wrap td.stretch-doc .stretch-doc-inner {
1943
- overflow-wrap: break-word;
1944
- }
1945
- .block-stretch.wrap td.stretch-doc .stretch-doc-inner :where(table) {
1946
- overflow-wrap: normal;
1947
- word-break: normal;
1948
- }
1949
- .block-stretch:not(.wrap) td.stretch-doc .stretch-doc-inner {
1950
- overflow-wrap: normal;
1951
- word-break: normal;
1952
- }
1953
- .block-stretch td.stretch-doc--gap {
1954
- color: color-mix(in oklab, CanvasText 38%, Canvas);
1955
- font-size: 13px;
1956
- vertical-align: top;
1957
- }
1958
- .block-stretch .stretch-code-stack {
1959
- display: flex;
1960
- flex-direction: column;
1961
- align-items: stretch;
1962
- min-width: 0;
1963
- }
1964
- .block-stretch .code-line {
1965
- display: grid;
1966
- grid-template-columns: max-content 1fr;
1967
- column-gap: 12px;
1968
- align-items: start;
1969
- }
1970
- .block-stretch .code-line pre { margin: 0; min-width: 0; padding: 0; border: 0; background: transparent; }
1971
- .block-stretch .code-line pre code.hljs {
1972
- display: block;
1973
- margin: 0;
1974
- padding: 0;
1975
- font-size: var(--code-line-font-size, 13px);
1976
- line-height: var(--code-line-height, 1.5);
1977
- }
1978
- .block-stretch .code-line-stack { --code-ln-min-ch: 3; }
1979
- .block-stretch .code-line .ln {
1980
- font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
1981
- font-variant-numeric: tabular-nums;
1982
- text-align: right;
1983
- user-select: none;
1984
- -webkit-user-select: none;
1985
- color: color-mix(in oklab, CanvasText 45%, Canvas);
1986
- padding-right: 8px;
1987
- border-right: 1px solid color-mix(in oklab, CanvasText 12%, Canvas);
1988
- white-space: nowrap;
1989
- font-size: var(--code-line-font-size, 13px);
1990
- line-height: var(--code-line-height, 1.5);
1991
- min-width: calc(var(--code-ln-min-ch, 3) * 1ch + 0.6ch);
1992
- box-sizing: content-box;
1993
- }
1994
- .block-stretch.wrap .code-line pre,
1995
- .block-stretch.wrap .code-line pre code { white-space: pre-wrap; word-break: break-word; }
1996
- .block-stretch:not(.wrap) .code-line pre,
1997
- .block-stretch:not(.wrap) .code-line pre code { white-space: pre; }
1998
- .block-stretch.wrap .stretch-doc-inner pre,
1999
- .block-stretch.wrap .stretch-doc-inner pre code {
2000
- white-space: pre-wrap;
2001
- word-break: break-word;
2002
- }
2003
- .block-stretch:not(.wrap) .stretch-doc-inner pre,
2004
- .block-stretch:not(.wrap) .stretch-doc-inner pre code {
2005
- white-space: pre;
2006
- }
2007
- .stretch-gutter {
2008
- position: absolute;
2009
- top: 0;
2010
- bottom: 0;
2011
- left: var(--stretch-code-pct, 50%);
2012
- transform: translateX(-50%);
2013
- width: 14px;
2014
- cursor: col-resize;
2015
- touch-action: none;
2016
- border-left: 1px solid color-mix(in oklab, CanvasText 14%, Canvas);
2017
- border-right: 1px solid color-mix(in oklab, CanvasText 10%, Canvas);
2018
- background: color-mix(in oklab, CanvasText 8%, Canvas);
2019
- border-radius: 999px;
2020
- --commentray-ray-accent: #3b7dd8;
2021
- z-index: 6;
2022
- }
2023
- @media (prefers-color-scheme: dark) {
2024
- :root:is(:not([data-commentray-theme]), [data-commentray-theme="system"]) .stretch-gutter {
2025
- --commentray-ray-accent: #6eb0ff;
339
+ }
340
+ return cachedCodeBrowserShellCss;
341
+ }
342
+ const CODE_BROWSER_STYLES = getCodeBrowserShellCss().replace(COMMENTRAY_SHELL_INTRO_PLACEHOLDER, CODE_BROWSER_INTRO_STYLES);
343
+ let cachedNavRailDocHubTemplate;
344
+ function loadNavRailDocHubTemplate() {
345
+ if (cachedNavRailDocHubTemplate === undefined) {
346
+ const packagesDir = findMonorepoPackagesDir(monorepoLayoutStartDir(import.meta.url));
347
+ const renderDistDir = join(packagesDir, "render", "dist");
348
+ const inDist = join(renderDistDir, "code-browser-nav-rail-doc-hub.html");
349
+ const fromSrc = join(packagesDir, "render", "src", "code-browser-nav-rail-doc-hub.html");
350
+ for (const tryPath of [inDist, fromSrc]) {
351
+ if (existsSync(tryPath)) {
352
+ cachedNavRailDocHubTemplate = readFileSync(tryPath, "utf8").trimEnd();
353
+ break;
354
+ }
355
+ }
356
+ if (cachedNavRailDocHubTemplate === undefined) {
357
+ throw new Error("Missing code-browser-nav-rail-doc-hub.html under render/src or render/dist.");
2026
358
  }
2027
- }
2028
- :root[data-commentray-theme="dark"] .stretch-gutter {
2029
- --commentray-ray-accent: #6eb0ff;
2030
- }
2031
- `;
359
+ }
360
+ return cachedNavRailDocHubTemplate;
361
+ }
2032
362
  /** Native tooltip on #search-q (short hint is visible under the search row). */
2033
363
  const CODE_BROWSER_SEARCH_INPUT_TITLE = "Filename, path, or words. Matches this pair (source + commentray lines) first; merges commentray-nav-search.json when the export includes it (indexed paths + commentray lines).";
2034
364
  function buildCodeBrowserPageHtml(p) {