@youtyan/code-viewer 0.11.0 → 0.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/dist/code-viewer.js +567 -283
- package/package.json +3 -1
- package/web/app.js +483 -40
- package/web/style.css +237 -0
package/web/style.css
CHANGED
|
@@ -4488,6 +4488,243 @@ table.d2h-diff-table td.d2h-code-side-linenumber {
|
|
|
4488
4488
|
font-size: var(--markdown-font-size);
|
|
4489
4489
|
line-height: 1.75;
|
|
4490
4490
|
}
|
|
4491
|
+
.gdp-csv-preview {
|
|
4492
|
+
width: 100%;
|
|
4493
|
+
padding: 20px 24px 40px;
|
|
4494
|
+
overflow: auto;
|
|
4495
|
+
background: var(--bg);
|
|
4496
|
+
}
|
|
4497
|
+
.gdp-csv-shell {
|
|
4498
|
+
width: max-content;
|
|
4499
|
+
min-width: min(100%, 880px);
|
|
4500
|
+
border: 1px solid var(--border);
|
|
4501
|
+
border-radius: 8px;
|
|
4502
|
+
background: var(--bg);
|
|
4503
|
+
box-shadow: var(--shadow-sm);
|
|
4504
|
+
}
|
|
4505
|
+
.gdp-csv-toolbar {
|
|
4506
|
+
display: flex;
|
|
4507
|
+
align-items: center;
|
|
4508
|
+
gap: 8px;
|
|
4509
|
+
min-height: var(--ui-control-md);
|
|
4510
|
+
padding: 8px 10px;
|
|
4511
|
+
border-bottom: 1px solid var(--border-strong);
|
|
4512
|
+
border-radius: 7px 7px 0 0;
|
|
4513
|
+
background: var(--bg-soft);
|
|
4514
|
+
}
|
|
4515
|
+
.gdp-csv-search-icon {
|
|
4516
|
+
display: inline-flex;
|
|
4517
|
+
flex: 0 0 16px;
|
|
4518
|
+
align-items: center;
|
|
4519
|
+
justify-content: center;
|
|
4520
|
+
width: 16px;
|
|
4521
|
+
height: 16px;
|
|
4522
|
+
color: var(--fg-muted);
|
|
4523
|
+
}
|
|
4524
|
+
.gdp-csv-search-icon svg {
|
|
4525
|
+
display: block;
|
|
4526
|
+
width: 16px;
|
|
4527
|
+
height: 16px;
|
|
4528
|
+
}
|
|
4529
|
+
.gdp-csv-search {
|
|
4530
|
+
width: min(360px, 34vw);
|
|
4531
|
+
min-width: 180px;
|
|
4532
|
+
height: var(--ui-control-md);
|
|
4533
|
+
padding: 0 10px;
|
|
4534
|
+
border: 1px solid var(--border);
|
|
4535
|
+
border-radius: 6px;
|
|
4536
|
+
background: var(--bg);
|
|
4537
|
+
color: var(--fg);
|
|
4538
|
+
font: inherit;
|
|
4539
|
+
font-size: var(--ui-font-md);
|
|
4540
|
+
}
|
|
4541
|
+
.gdp-csv-search:focus,
|
|
4542
|
+
.gdp-csv-column-filter:focus {
|
|
4543
|
+
outline: 2px solid var(--accent);
|
|
4544
|
+
outline-offset: -1px;
|
|
4545
|
+
border-color: var(--accent);
|
|
4546
|
+
}
|
|
4547
|
+
.gdp-csv-result-count {
|
|
4548
|
+
flex: 0 0 14ch;
|
|
4549
|
+
margin-left: auto;
|
|
4550
|
+
color: var(--fg-muted);
|
|
4551
|
+
font-size: var(--ui-font-sm);
|
|
4552
|
+
font-variant-numeric: tabular-nums;
|
|
4553
|
+
text-align: right;
|
|
4554
|
+
white-space: nowrap;
|
|
4555
|
+
}
|
|
4556
|
+
.gdp-csv-reset {
|
|
4557
|
+
flex: 0 0 88px;
|
|
4558
|
+
width: 88px;
|
|
4559
|
+
height: var(--ui-control-md);
|
|
4560
|
+
padding: 0 10px;
|
|
4561
|
+
border: 1px solid var(--border);
|
|
4562
|
+
border-radius: 6px;
|
|
4563
|
+
background: var(--bg);
|
|
4564
|
+
color: var(--fg-muted);
|
|
4565
|
+
font: inherit;
|
|
4566
|
+
font-size: var(--ui-font-sm);
|
|
4567
|
+
font-weight: 600;
|
|
4568
|
+
cursor: pointer;
|
|
4569
|
+
}
|
|
4570
|
+
.gdp-csv-reset:hover:not(:disabled) {
|
|
4571
|
+
border-color: var(--accent);
|
|
4572
|
+
background: var(--accent-subtle);
|
|
4573
|
+
color: var(--fg);
|
|
4574
|
+
}
|
|
4575
|
+
.gdp-csv-reset:focus-visible {
|
|
4576
|
+
outline: 2px solid var(--accent);
|
|
4577
|
+
outline-offset: 1px;
|
|
4578
|
+
}
|
|
4579
|
+
.gdp-csv-reset:disabled {
|
|
4580
|
+
color: var(--fg-subtle);
|
|
4581
|
+
cursor: default;
|
|
4582
|
+
opacity: 0.58;
|
|
4583
|
+
}
|
|
4584
|
+
.gdp-csv-table {
|
|
4585
|
+
width: 100%;
|
|
4586
|
+
min-width: 100%;
|
|
4587
|
+
border-collapse: separate;
|
|
4588
|
+
border-spacing: 0;
|
|
4589
|
+
color: var(--fg);
|
|
4590
|
+
background: var(--bg);
|
|
4591
|
+
font-family: "Monaspace Neon", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
|
|
4592
|
+
font-size: var(--code-font-size);
|
|
4593
|
+
line-height: var(--code-line-height);
|
|
4594
|
+
}
|
|
4595
|
+
.gdp-csv-table th,
|
|
4596
|
+
.gdp-csv-table td {
|
|
4597
|
+
min-width: 11ch;
|
|
4598
|
+
max-width: 52ch;
|
|
4599
|
+
padding: 8px 14px;
|
|
4600
|
+
border-right: 1px solid var(--border);
|
|
4601
|
+
border-bottom: 1px solid var(--border);
|
|
4602
|
+
overflow-wrap: anywhere;
|
|
4603
|
+
text-align: left;
|
|
4604
|
+
transition: background-color 0.12s ease;
|
|
4605
|
+
vertical-align: top;
|
|
4606
|
+
white-space: pre-wrap;
|
|
4607
|
+
}
|
|
4608
|
+
.gdp-csv-table tr > :last-child {
|
|
4609
|
+
border-right: 0;
|
|
4610
|
+
}
|
|
4611
|
+
.gdp-csv-table tbody tr:last-child > * {
|
|
4612
|
+
border-bottom: 0;
|
|
4613
|
+
}
|
|
4614
|
+
.gdp-csv-table thead {
|
|
4615
|
+
position: sticky;
|
|
4616
|
+
top: 0;
|
|
4617
|
+
z-index: 2;
|
|
4618
|
+
}
|
|
4619
|
+
.gdp-csv-table thead th {
|
|
4620
|
+
background: var(--bg-mute);
|
|
4621
|
+
font-weight: 700;
|
|
4622
|
+
}
|
|
4623
|
+
.gdp-csv-table thead tr:first-child > th:not(.gdp-csv-row-number) {
|
|
4624
|
+
padding: 0;
|
|
4625
|
+
}
|
|
4626
|
+
.gdp-csv-sort-button {
|
|
4627
|
+
display: grid;
|
|
4628
|
+
grid-template-columns: minmax(0, 1fr) 16px;
|
|
4629
|
+
align-items: center;
|
|
4630
|
+
width: 100%;
|
|
4631
|
+
min-height: var(--ui-control-md);
|
|
4632
|
+
padding: 6px 14px;
|
|
4633
|
+
border: 0;
|
|
4634
|
+
background: transparent;
|
|
4635
|
+
color: var(--fg);
|
|
4636
|
+
font: inherit;
|
|
4637
|
+
font-weight: 700;
|
|
4638
|
+
text-align: left;
|
|
4639
|
+
cursor: pointer;
|
|
4640
|
+
}
|
|
4641
|
+
.gdp-csv-sort-button:hover {
|
|
4642
|
+
background: var(--accent-subtle);
|
|
4643
|
+
}
|
|
4644
|
+
.gdp-csv-sort-button:focus-visible {
|
|
4645
|
+
outline: 2px solid var(--accent);
|
|
4646
|
+
outline-offset: -2px;
|
|
4647
|
+
}
|
|
4648
|
+
.gdp-csv-sort-button::after {
|
|
4649
|
+
display: block;
|
|
4650
|
+
width: 16px;
|
|
4651
|
+
color: var(--accent);
|
|
4652
|
+
content: "";
|
|
4653
|
+
font-size: var(--ui-font-sm);
|
|
4654
|
+
text-align: center;
|
|
4655
|
+
}
|
|
4656
|
+
.gdp-csv-sort-button[data-sort-direction="asc"]::after {
|
|
4657
|
+
content: "↑";
|
|
4658
|
+
}
|
|
4659
|
+
.gdp-csv-sort-button[data-sort-direction="desc"]::after {
|
|
4660
|
+
content: "↓";
|
|
4661
|
+
}
|
|
4662
|
+
.gdp-csv-filter-row th {
|
|
4663
|
+
padding: 5px 8px;
|
|
4664
|
+
border-bottom-color: var(--border-strong);
|
|
4665
|
+
background: var(--bg-soft);
|
|
4666
|
+
}
|
|
4667
|
+
.gdp-csv-column-filter {
|
|
4668
|
+
width: 100%;
|
|
4669
|
+
min-width: 8ch;
|
|
4670
|
+
height: var(--ui-control-sm);
|
|
4671
|
+
padding: 0 7px;
|
|
4672
|
+
border: 1px solid var(--border);
|
|
4673
|
+
border-radius: 4px;
|
|
4674
|
+
background: var(--bg);
|
|
4675
|
+
color: var(--fg);
|
|
4676
|
+
font: inherit;
|
|
4677
|
+
font-size: var(--ui-font-sm);
|
|
4678
|
+
font-weight: 400;
|
|
4679
|
+
}
|
|
4680
|
+
.gdp-csv-column-filter::placeholder,
|
|
4681
|
+
.gdp-csv-search::placeholder {
|
|
4682
|
+
color: var(--fg-subtle);
|
|
4683
|
+
}
|
|
4684
|
+
.gdp-csv-table tbody tr:nth-child(2n) td {
|
|
4685
|
+
background: color-mix(in srgb, var(--bg-soft) 76%, var(--bg));
|
|
4686
|
+
}
|
|
4687
|
+
.gdp-csv-table tbody tr:hover td {
|
|
4688
|
+
background: var(--accent-subtle);
|
|
4689
|
+
}
|
|
4690
|
+
.gdp-csv-table .gdp-csv-row-number {
|
|
4691
|
+
position: sticky;
|
|
4692
|
+
left: 0;
|
|
4693
|
+
z-index: 1;
|
|
4694
|
+
width: 44px;
|
|
4695
|
+
min-width: 44px;
|
|
4696
|
+
max-width: 44px;
|
|
4697
|
+
background: var(--bg-soft);
|
|
4698
|
+
color: var(--fg-subtle);
|
|
4699
|
+
border-right-color: var(--border-strong);
|
|
4700
|
+
font-weight: 400;
|
|
4701
|
+
text-align: right;
|
|
4702
|
+
user-select: none;
|
|
4703
|
+
}
|
|
4704
|
+
.gdp-csv-table tbody tr:hover .gdp-csv-row-number {
|
|
4705
|
+
background: color-mix(in srgb, var(--accent-subtle) 72%, var(--bg-soft));
|
|
4706
|
+
color: var(--fg);
|
|
4707
|
+
}
|
|
4708
|
+
.gdp-csv-table thead .gdp-csv-row-number {
|
|
4709
|
+
z-index: 3;
|
|
4710
|
+
background: var(--bg-mute);
|
|
4711
|
+
}
|
|
4712
|
+
.gdp-csv-table .gdp-csv-filter-row .gdp-csv-row-number {
|
|
4713
|
+
background: var(--bg-soft);
|
|
4714
|
+
}
|
|
4715
|
+
.gdp-csv-empty-row td {
|
|
4716
|
+
padding: 32px 20px;
|
|
4717
|
+
background: var(--bg);
|
|
4718
|
+
color: var(--fg-muted);
|
|
4719
|
+
font-family: inherit;
|
|
4720
|
+
text-align: center;
|
|
4721
|
+
}
|
|
4722
|
+
.gdp-csv-table tbody tr:last-child > :first-child {
|
|
4723
|
+
border-bottom-left-radius: 7px;
|
|
4724
|
+
}
|
|
4725
|
+
.gdp-csv-table tbody tr:last-child > :last-child {
|
|
4726
|
+
border-bottom-right-radius: 7px;
|
|
4727
|
+
}
|
|
4491
4728
|
.gdp-html-preview {
|
|
4492
4729
|
width: 100%;
|
|
4493
4730
|
min-height: calc(var(--content-h) - var(--file-detail-head-h));
|