sourcey 3.6.3 → 3.6.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.
@@ -46,7 +46,12 @@
46
46
  /* ── Scroll Offset (clears fixed navbar on anchor clicks) ──────────── */
47
47
 
48
48
  [data-traverse-target],
49
- h1[id], h2[id], h3[id], h4[id], h5[id], h6[id] {
49
+ h1[id],
50
+ h2[id],
51
+ h3[id],
52
+ h4[id],
53
+ h5[id],
54
+ h6[id] {
50
55
  scroll-margin-top: var(--header-height, 7rem);
51
56
  }
52
57
 
@@ -93,8 +98,8 @@ h1[id], h2[id], h3[id], h4[id], h5[id], h6[id] {
93
98
  #sourcey .table-wrap table {
94
99
  margin: 0;
95
100
  }
96
- #sourcey .prose :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)) {
97
- padding-top: .571429em;
101
+ #sourcey .prose :where(thead th):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
102
+ padding-top: 0.571429em;
98
103
  }
99
104
 
100
105
  /* ── Prose Video (::video directive) ──────────────────────────────── */
@@ -218,6 +223,7 @@ h1[id], h2[id], h3[id], h4[id], h5[id], h6[id] {
218
223
  /* ── Nav Links ────────────────────────────────────────────────────── */
219
224
 
220
225
  #sourcey .nav-group-label {
226
+ display: block;
221
227
  padding: 0 0.75rem 0.25rem 1rem;
222
228
  margin-bottom: 0.625rem;
223
229
  font-size: inherit;
@@ -227,6 +233,26 @@ h1[id], h2[id], h3[id], h4[id], h5[id], h6[id] {
227
233
  .dark #sourcey .nav-group-label {
228
234
  color: rgb(var(--color-gray-200));
229
235
  }
236
+ #sourcey .nav-group-link {
237
+ cursor: pointer;
238
+ border-radius: 0.75rem;
239
+ text-decoration: none;
240
+ transition:
241
+ color 0.15s,
242
+ background-color 0.15s;
243
+ }
244
+ #sourcey .nav-group-link:hover {
245
+ color: rgb(var(--color-primary-ink));
246
+ }
247
+ .dark #sourcey .nav-group-link:hover {
248
+ color: rgb(var(--color-primary-light));
249
+ }
250
+ #sourcey .nav-group-link.active {
251
+ color: rgb(var(--color-primary-ink));
252
+ }
253
+ .dark #sourcey .nav-group-link.active {
254
+ color: rgb(var(--color-primary-light));
255
+ }
230
256
 
231
257
  #sourcey .nav-tab-label {
232
258
  display: block;
@@ -253,7 +279,9 @@ h1[id], h2[id], h3[id], h4[id], h5[id], h6[id] {
253
279
  border-radius: 0.75rem;
254
280
  width: 100%;
255
281
  color: rgb(var(--color-gray-700));
256
- transition: color 0.15s, background-color 0.15s;
282
+ transition:
283
+ color 0.15s,
284
+ background-color 0.15s;
257
285
  }
258
286
  .dark #sourcey .nav-link {
259
287
  color: rgb(var(--color-gray-400));
@@ -269,7 +297,9 @@ h1[id], h2[id], h3[id], h4[id], h5[id], h6[id] {
269
297
  #sourcey .nav-link.active {
270
298
  color: rgb(var(--color-primary-ink));
271
299
  background: rgb(var(--color-primary) / 0.08);
272
- text-shadow: -0.2px 0 0 currentColor, 0.2px 0 0 currentColor;
300
+ text-shadow:
301
+ -0.2px 0 0 currentColor,
302
+ 0.2px 0 0 currentColor;
273
303
  }
274
304
  .dark #sourcey .nav-link.active {
275
305
  color: rgb(var(--color-primary-light));
@@ -281,7 +311,9 @@ h1[id], h2[id], h3[id], h4[id], h5[id], h6[id] {
281
311
  #sourcey #toc .toc-item {
282
312
  border-left: 2px solid rgb(var(--color-gray-200));
283
313
  padding-left: 0.75rem;
284
- transition: color 0.15s, border-color 0.15s;
314
+ transition:
315
+ color 0.15s,
316
+ border-color 0.15s;
285
317
  }
286
318
  #sourcey #toc ul ul .toc-item {
287
319
  margin-left: 0.75rem;
@@ -302,8 +334,12 @@ h1[id], h2[id], h3[id], h4[id], h5[id], h6[id] {
302
334
 
303
335
  /* ── Code Block Panels (language dropdown + response tabs) ─────────── */
304
336
 
305
- #sourcey .code-lang-panel { display: none; }
306
- #sourcey .code-lang-panel.active { display: block; }
337
+ #sourcey .code-lang-panel {
338
+ display: none;
339
+ }
340
+ #sourcey .code-lang-panel.active {
341
+ display: block;
342
+ }
307
343
 
308
344
  #sourcey .lang-icon {
309
345
  width: 0.875rem;
@@ -323,8 +359,12 @@ h1[id], h2[id], h3[id], h4[id], h5[id], h6[id] {
323
359
  mask-position: center;
324
360
  }
325
361
 
326
- #sourcey .response-panel { display: none; }
327
- #sourcey .response-panel.active { display: block; }
362
+ #sourcey .response-panel {
363
+ display: none;
364
+ }
365
+ #sourcey .response-panel.active {
366
+ display: block;
367
+ }
328
368
 
329
369
  /* ── Response Tabs (status code tabs on code block) ───────────────── */
330
370
 
@@ -345,7 +385,7 @@ h1[id], h2[id], h3[id], h4[id], h5[id], h6[id] {
345
385
 
346
386
  /* Active response tab underline */
347
387
  #sourcey .response-tab.active::after {
348
- content: '';
388
+ content: "";
349
389
  position: absolute;
350
390
  right: 0;
351
391
  bottom: -0.375rem;
@@ -505,11 +545,15 @@ h1[id], h2[id], h3[id], h4[id], h5[id], h6[id] {
505
545
  color: rgb(var(--color-gray-400));
506
546
  }
507
547
 
508
- #sourcey .json-property-enum-item { color: rgb(var(--color-gray-700)); }
509
- .dark #sourcey .json-property-enum-item { color: rgb(var(--color-gray-300)); }
548
+ #sourcey .json-property-enum-item {
549
+ color: rgb(var(--color-gray-700));
550
+ }
551
+ .dark #sourcey .json-property-enum-item {
552
+ color: rgb(var(--color-gray-300));
553
+ }
510
554
 
511
555
  #sourcey .json-property-default-value::before {
512
- content: '= ';
556
+ content: "= ";
513
557
  color: rgb(var(--color-gray-400));
514
558
  }
515
559
 
@@ -578,7 +622,6 @@ h1[id], h2[id], h3[id], h4[id], h5[id], h6[id] {
578
622
  color: rgb(var(--color-gray-400));
579
623
  }
580
624
 
581
-
582
625
  /* ── Steps (numbered step list with vertical connector) ────────────── */
583
626
 
584
627
  #sourcey .steps {
@@ -595,7 +638,7 @@ h1[id], h2[id], h3[id], h4[id], h5[id], h6[id] {
595
638
  }
596
639
 
597
640
  #sourcey .steps .step-item::before {
598
- content: '';
641
+ content: "";
599
642
  position: absolute;
600
643
  left: 13px;
601
644
  top: 2.75rem;
@@ -666,9 +709,15 @@ h1[id], h2[id], h3[id], h4[id], h5[id], h6[id] {
666
709
  margin-bottom: 2rem;
667
710
  }
668
711
  @media (min-width: 640px) {
669
- #sourcey .card-group[data-cols="2"] { grid-template-columns: repeat(2, 1fr); }
670
- #sourcey .card-group[data-cols="3"] { grid-template-columns: repeat(3, 1fr); }
671
- #sourcey .card-group[data-cols="4"] { grid-template-columns: repeat(4, 1fr); }
712
+ #sourcey .card-group[data-cols="2"] {
713
+ grid-template-columns: repeat(2, 1fr);
714
+ }
715
+ #sourcey .card-group[data-cols="3"] {
716
+ grid-template-columns: repeat(3, 1fr);
717
+ }
718
+ #sourcey .card-group[data-cols="4"] {
719
+ grid-template-columns: repeat(4, 1fr);
720
+ }
672
721
  }
673
722
 
674
723
  #sourcey .card-item {
@@ -768,7 +817,9 @@ h1[id], h2[id], h3[id], h4[id], h5[id], h6[id] {
768
817
  color: rgb(var(--color-gray-900));
769
818
  list-style: none;
770
819
  }
771
- #sourcey .accordion-trigger::-webkit-details-marker { display: none; }
820
+ #sourcey .accordion-trigger::-webkit-details-marker {
821
+ display: none;
822
+ }
772
823
  .dark #sourcey .accordion-trigger {
773
824
  color: rgb(var(--color-gray-200));
774
825
  }
@@ -781,7 +832,7 @@ h1[id], h2[id], h3[id], h4[id], h5[id], h6[id] {
781
832
  }
782
833
 
783
834
  #sourcey .accordion-trigger::before {
784
- content: '';
835
+ content: "";
785
836
  display: inline-block;
786
837
  width: 0.75rem;
787
838
  height: 0.75rem;
@@ -856,16 +907,32 @@ h1[id], h2[id], h3[id], h4[id], h5[id], h6[id] {
856
907
  }
857
908
 
858
909
  /* Note — blue */
859
- #sourcey .callout-note { border-left-color: #3b82f6; }
860
- .dark #sourcey .callout-note { border-left-color: #60a5fa; }
861
- #sourcey .callout-note .callout-title { color: #3b82f6; }
862
- .dark #sourcey .callout-note .callout-title { color: #60a5fa; }
910
+ #sourcey .callout-note {
911
+ border-left-color: #3b82f6;
912
+ }
913
+ .dark #sourcey .callout-note {
914
+ border-left-color: #60a5fa;
915
+ }
916
+ #sourcey .callout-note .callout-title {
917
+ color: #3b82f6;
918
+ }
919
+ .dark #sourcey .callout-note .callout-title {
920
+ color: #60a5fa;
921
+ }
863
922
 
864
923
  /* Warning — amber */
865
- #sourcey .callout-warning { border-left-color: #f59e0b; }
866
- .dark #sourcey .callout-warning { border-left-color: #fbbf24; }
867
- #sourcey .callout-warning .callout-title { color: #f59e0b; }
868
- .dark #sourcey .callout-warning .callout-title { color: #fbbf24; }
924
+ #sourcey .callout-warning {
925
+ border-left-color: #f59e0b;
926
+ }
927
+ .dark #sourcey .callout-warning {
928
+ border-left-color: #fbbf24;
929
+ }
930
+ #sourcey .callout-warning .callout-title {
931
+ color: #f59e0b;
932
+ }
933
+ .dark #sourcey .callout-warning .callout-title {
934
+ color: #fbbf24;
935
+ }
869
936
 
870
937
  /* ── Changelog ───────────────────────────────────────────────────── */
871
938
 
@@ -944,13 +1011,21 @@ h1[id], h2[id], h3[id], h4[id], h5[id], h6[id] {
944
1011
  border-color: rgb(var(--color-primary) / 0.18);
945
1012
  border-left: 3px solid rgb(var(--color-primary));
946
1013
  padding-left: calc(1.25rem - 2px);
947
- background: linear-gradient(180deg, rgb(var(--color-primary) / 0.04), rgb(var(--color-primary) / 0.015));
1014
+ background: linear-gradient(
1015
+ 180deg,
1016
+ rgb(var(--color-primary) / 0.04),
1017
+ rgb(var(--color-primary) / 0.015)
1018
+ );
948
1019
  }
949
1020
 
950
1021
  .dark #sourcey .sourcey-changelog-version-unreleased {
951
1022
  border-color: rgb(var(--color-primary-light) / 0.22);
952
1023
  border-left-color: rgb(var(--color-primary-light));
953
- background: linear-gradient(180deg, rgb(var(--color-primary-light) / 0.06), rgb(var(--color-primary-light) / 0.02));
1024
+ background: linear-gradient(
1025
+ 180deg,
1026
+ rgb(var(--color-primary-light) / 0.06),
1027
+ rgb(var(--color-primary-light) / 0.02)
1028
+ );
954
1029
  }
955
1030
 
956
1031
  #sourcey .sourcey-changelog-version-header {
@@ -1160,16 +1235,32 @@ h1[id], h2[id], h3[id], h4[id], h5[id], h6[id] {
1160
1235
  }
1161
1236
 
1162
1237
  /* Tip — green */
1163
- #sourcey .callout-tip { border-left-color: #22c55e; }
1164
- .dark #sourcey .callout-tip { border-left-color: #4ade80; }
1165
- #sourcey .callout-tip .callout-title { color: #22c55e; }
1166
- .dark #sourcey .callout-tip .callout-title { color: #4ade80; }
1238
+ #sourcey .callout-tip {
1239
+ border-left-color: #22c55e;
1240
+ }
1241
+ .dark #sourcey .callout-tip {
1242
+ border-left-color: #4ade80;
1243
+ }
1244
+ #sourcey .callout-tip .callout-title {
1245
+ color: #22c55e;
1246
+ }
1247
+ .dark #sourcey .callout-tip .callout-title {
1248
+ color: #4ade80;
1249
+ }
1167
1250
 
1168
1251
  /* Info — violet */
1169
- #sourcey .callout-info { border-left-color: #8b5cf6; }
1170
- .dark #sourcey .callout-info { border-left-color: #a78bfa; }
1171
- #sourcey .callout-info .callout-title { color: #8b5cf6; }
1172
- .dark #sourcey .callout-info .callout-title { color: #a78bfa; }
1252
+ #sourcey .callout-info {
1253
+ border-left-color: #8b5cf6;
1254
+ }
1255
+ .dark #sourcey .callout-info {
1256
+ border-left-color: #a78bfa;
1257
+ }
1258
+ #sourcey .callout-info .callout-title {
1259
+ color: #8b5cf6;
1260
+ }
1261
+ .dark #sourcey .callout-info .callout-title {
1262
+ color: #a78bfa;
1263
+ }
1173
1264
 
1174
1265
  /* ── Directive Tabs (:::tabs, :::code-group) ───────────────────────── */
1175
1266
 
@@ -1221,7 +1312,7 @@ h1[id], h2[id], h3[id], h4[id], h5[id], h6[id] {
1221
1312
  }
1222
1313
 
1223
1314
  #sourcey .directive-tab.active::after {
1224
- content: '';
1315
+ content: "";
1225
1316
  position: absolute;
1226
1317
  right: 0.5rem;
1227
1318
  bottom: -1px;
@@ -1334,10 +1425,16 @@ h1[id], h2[id], h3[id], h4[id], h5[id], h6[id] {
1334
1425
  .drawer-dropdown-trigger[aria-expanded="true"] {
1335
1426
  border-bottom-left-radius: 0;
1336
1427
  border-bottom-right-radius: 0;
1337
- box-shadow: inset 1px 0 0 rgb(var(--color-gray-200)), inset -1px 0 0 rgb(var(--color-gray-200)), inset 0 1px 0 rgb(var(--color-gray-200));
1428
+ box-shadow:
1429
+ inset 1px 0 0 rgb(var(--color-gray-200)),
1430
+ inset -1px 0 0 rgb(var(--color-gray-200)),
1431
+ inset 0 1px 0 rgb(var(--color-gray-200));
1338
1432
  }
1339
1433
  .dark .drawer-dropdown-trigger[aria-expanded="true"] {
1340
- box-shadow: inset 1px 0 0 rgb(var(--color-gray-600)), inset -1px 0 0 rgb(var(--color-gray-600)), inset 0 1px 0 rgb(var(--color-gray-600));
1434
+ box-shadow:
1435
+ inset 1px 0 0 rgb(var(--color-gray-600)),
1436
+ inset -1px 0 0 rgb(var(--color-gray-600)),
1437
+ inset 0 1px 0 rgb(var(--color-gray-600));
1341
1438
  }
1342
1439
 
1343
1440
  .drawer-dropdown-chevron {
@@ -1361,11 +1458,19 @@ h1[id], h2[id], h3[id], h4[id], h5[id], h6[id] {
1361
1458
  border-radius: 0 0 var(--radius, 0.5rem) var(--radius, 0.5rem);
1362
1459
  background: rgb(var(--color-background-light));
1363
1460
  border: none;
1364
- box-shadow: inset 1px 0 0 rgb(var(--color-gray-200)), inset -1px 0 0 rgb(var(--color-gray-200)), inset 0 -1px 0 rgb(var(--color-gray-200)), 0 6px 16px rgb(0 0 0 / 0.08);
1461
+ box-shadow:
1462
+ inset 1px 0 0 rgb(var(--color-gray-200)),
1463
+ inset -1px 0 0 rgb(var(--color-gray-200)),
1464
+ inset 0 -1px 0 rgb(var(--color-gray-200)),
1465
+ 0 6px 16px rgb(0 0 0 / 0.08);
1365
1466
  }
1366
1467
  .dark .drawer-dropdown-list {
1367
1468
  background: rgb(var(--color-background-dark));
1368
- box-shadow: inset 1px 0 0 rgb(var(--color-gray-600)), inset -1px 0 0 rgb(var(--color-gray-600)), inset 0 -1px 0 rgb(var(--color-gray-600)), 0 6px 16px rgb(0 0 0 / 0.3);
1469
+ box-shadow:
1470
+ inset 1px 0 0 rgb(var(--color-gray-600)),
1471
+ inset -1px 0 0 rgb(var(--color-gray-600)),
1472
+ inset 0 -1px 0 rgb(var(--color-gray-600)),
1473
+ 0 6px 16px rgb(0 0 0 / 0.3);
1369
1474
  }
1370
1475
 
1371
1476
  .drawer-dropdown-item {
@@ -1411,12 +1516,20 @@ h1[id], h2[id], h3[id], h4[id], h5[id], h6[id] {
1411
1516
  }
1412
1517
 
1413
1518
  @keyframes drawer-slide-in {
1414
- from { transform: translateX(-100%); }
1415
- to { transform: translateX(0); }
1519
+ from {
1520
+ transform: translateX(-100%);
1521
+ }
1522
+ to {
1523
+ transform: translateX(0);
1524
+ }
1416
1525
  }
1417
1526
  @keyframes drawer-fade-in {
1418
- from { opacity: 0; }
1419
- to { opacity: 1; }
1527
+ from {
1528
+ opacity: 0;
1529
+ }
1530
+ to {
1531
+ opacity: 1;
1532
+ }
1420
1533
  }
1421
1534
 
1422
1535
  /* ── Code group cards (API right-hand panels) ─────────────────────── */
@@ -1452,9 +1565,141 @@ h1[id], h2[id], h3[id], h4[id], h5[id], h6[id] {
1452
1565
  border-bottom-right-radius: var(--radius);
1453
1566
  }
1454
1567
 
1568
+ #sourcey .code-lang-menu {
1569
+ max-height: min(18rem, calc(100vh - var(--header-height, 0px) - 2rem));
1570
+ overflow-y: auto;
1571
+ overscroll-behavior: contain;
1572
+ }
1573
+
1574
+ /* ── Print/PDF output ─────────────────────────────────────────────── */
1575
+
1576
+ @media print {
1577
+ @page {
1578
+ margin: 0.7in;
1579
+ }
1580
+
1581
+ html,
1582
+ body,
1583
+ #sourcey,
1584
+ #sourcey #page,
1585
+ #sourcey #docs {
1586
+ background: #fff !important;
1587
+ color: #111827 !important;
1588
+ }
1589
+
1590
+ #sourcey #page::before,
1591
+ #sourcey #navbar,
1592
+ #sourcey #toc,
1593
+ #sourcey #search-dialog,
1594
+ #sourcey .mobile-nav-dialog,
1595
+ #sourcey .copy-btn,
1596
+ #sourcey .prose-code-copy,
1597
+ #sourcey .code-lang-dropdown {
1598
+ display: none !important;
1599
+ }
1600
+
1601
+ #sourcey .max-w-\[92rem\],
1602
+ #sourcey .max-w-3xl {
1603
+ max-width: none !important;
1604
+ margin: 0 !important;
1605
+ padding: 0 !important;
1606
+ }
1607
+
1608
+ #sourcey #docs {
1609
+ padding-top: 0 !important;
1610
+ }
1611
+
1612
+ #sourcey #docs > .flex,
1613
+ #sourcey #docs [class*="lg:flex-row"],
1614
+ #sourcey #docs [class*="xl:flex-row"] {
1615
+ display: block !important;
1616
+ }
1617
+
1618
+ #sourcey #content-area {
1619
+ width: 100% !important;
1620
+ max-width: none !important;
1621
+ margin: 0 !important;
1622
+ padding: 0 !important;
1623
+ }
1624
+
1625
+ #sourcey #sidebar {
1626
+ display: block !important;
1627
+ position: static !important;
1628
+ inset: auto !important;
1629
+ width: auto !important;
1630
+ margin: 0 0 1.5rem !important;
1631
+ padding: 0 0 1rem !important;
1632
+ border-bottom: 1px solid #e5e7eb;
1633
+ }
1634
+
1635
+ #sourcey #sidebar > div {
1636
+ position: static !important;
1637
+ inset: auto !important;
1638
+ overflow: visible !important;
1639
+ padding: 0 !important;
1640
+ }
1641
+
1642
+ #sourcey #sidebar .sticky {
1643
+ display: none !important;
1644
+ }
1645
+
1646
+ #sourcey #sidebar #nav::before {
1647
+ content: "Table of Contents";
1648
+ display: block;
1649
+ margin: 0 0 0.75rem;
1650
+ font-size: 0.875rem;
1651
+ font-weight: 700;
1652
+ color: #111827;
1653
+ }
1654
+
1655
+ #sourcey #sidebar .nav-group-label,
1656
+ #sourcey #sidebar .nav-link {
1657
+ color: #111827 !important;
1658
+ background: transparent !important;
1659
+ }
1660
+
1661
+ #sourcey #sidebar .nav-link {
1662
+ padding: 0.125rem 0 !important;
1663
+ }
1664
+
1665
+ #sourcey #docs article aside {
1666
+ display: none !important;
1667
+ }
1668
+
1669
+ #sourcey #docs [class*="lg:hidden"],
1670
+ #sourcey #docs [class*="xl:hidden"] {
1671
+ display: block !important;
1672
+ }
1673
+
1674
+ #sourcey .code-group,
1675
+ #sourcey .prose-code-block,
1676
+ #sourcey .param-item,
1677
+ #sourcey .schema-expandable,
1678
+ #sourcey .sourcey-changelog-version {
1679
+ break-inside: avoid;
1680
+ }
1681
+
1682
+ #sourcey .code-group,
1683
+ #sourcey .prose-code-block,
1684
+ #sourcey .prose-code-content,
1685
+ #sourcey .code-card-body,
1686
+ #sourcey .code-card-body > div,
1687
+ #sourcey .code-card-body .font-mono {
1688
+ background: #fff !important;
1689
+ color: #111827 !important;
1690
+ }
1691
+
1692
+ #sourcey a {
1693
+ color: #111827 !important;
1694
+ text-decoration: underline;
1695
+ }
1696
+ }
1697
+
1455
1698
  /* ── Selection ─────────────────────────────────────────────────────── */
1456
1699
 
1457
- #sourcey ::selection { background: rgb(var(--color-primary) / 0.12); }
1700
+ #sourcey ::selection {
1701
+ background: rgb(var(--color-primary) / 0.12);
1702
+ }
1458
1703
 
1459
1704
  /* ── Search Dialog ────────────────────────────────────────────────── */
1460
1705
 
@@ -1515,7 +1760,9 @@ h1[id], h2[id], h3[id], h4[id], h5[id], h6[id] {
1515
1760
  color: rgb(var(--color-gray-100));
1516
1761
  }
1517
1762
 
1518
- #sourcey #search-input::placeholder { color: rgb(var(--color-gray-400)); }
1763
+ #sourcey #search-input::placeholder {
1764
+ color: rgb(var(--color-gray-400));
1765
+ }
1519
1766
 
1520
1767
  #sourcey #search-results {
1521
1768
  max-height: 50vh;
@@ -1624,14 +1871,30 @@ h1[id], h2[id], h3[id], h4[id], h5[id], h6[id] {
1624
1871
  flex-shrink: 0;
1625
1872
  }
1626
1873
 
1627
- #sourcey .search-result-method.method-get { background: var(--method-get); }
1628
- #sourcey .search-result-method.method-post { background: var(--method-post); }
1629
- #sourcey .search-result-method.method-put { background: var(--method-put); }
1630
- #sourcey .search-result-method.method-delete { background: var(--method-delete); }
1631
- #sourcey .search-result-method.method-patch { background: var(--method-patch); }
1632
- #sourcey .search-result-method.method-tool { background: var(--method-tool); }
1633
- #sourcey .search-result-method.method-resource { background: var(--method-resource); }
1634
- #sourcey .search-result-method.method-prompt { background: var(--method-prompt); }
1874
+ #sourcey .search-result-method.method-get {
1875
+ background: var(--method-get);
1876
+ }
1877
+ #sourcey .search-result-method.method-post {
1878
+ background: var(--method-post);
1879
+ }
1880
+ #sourcey .search-result-method.method-put {
1881
+ background: var(--method-put);
1882
+ }
1883
+ #sourcey .search-result-method.method-delete {
1884
+ background: var(--method-delete);
1885
+ }
1886
+ #sourcey .search-result-method.method-patch {
1887
+ background: var(--method-patch);
1888
+ }
1889
+ #sourcey .search-result-method.method-tool {
1890
+ background: var(--method-tool);
1891
+ }
1892
+ #sourcey .search-result-method.method-resource {
1893
+ background: var(--method-resource);
1894
+ }
1895
+ #sourcey .search-result-method.method-prompt {
1896
+ background: var(--method-prompt);
1897
+ }
1635
1898
 
1636
1899
  #sourcey .search-result-path {
1637
1900
  font-family: var(--font-mono);
@@ -1923,7 +2186,8 @@ h1[id], h2[id], h3[id], h4[id], h5[id], h6[id] {
1923
2186
 
1924
2187
  #sourcey .code-header,
1925
2188
  #sourcey .rust-signature {
1926
- font-family: ui-monospace, "SF Mono", "Cascadia Code", Consolas, "Liberation Mono", Menlo, monospace;
2189
+ font-family:
2190
+ ui-monospace, "SF Mono", "Cascadia Code", Consolas, "Liberation Mono", Menlo, monospace;
1927
2191
  font-size: 0.9375rem;
1928
2192
  color: rgb(var(--color-gray-900));
1929
2193
  white-space: pre-wrap;
@@ -0,0 +1,4 @@
1
+ import type { NormalizedSpec } from "../core/types.js";
2
+ export declare function findPlaceholderServerUrls(spec: Pick<NormalizedSpec, "servers">): string[];
3
+ export declare function isPlaceholderServerUrl(serverUrl: string): boolean;
4
+ //# sourceMappingURL=server-warnings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server-warnings.d.ts","sourceRoot":"","sources":["../../src/utils/server-warnings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAWvD,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,IAAI,CAAC,cAAc,EAAE,SAAS,CAAC,GAAG,MAAM,EAAE,CAQzF;AAED,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAajE"}
@@ -0,0 +1,41 @@
1
+ const PLACEHOLDER_HOSTS = new Set([
2
+ "localhost",
3
+ "0.0.0.0",
4
+ "::1",
5
+ "example.com",
6
+ "example.org",
7
+ "example.net",
8
+ ]);
9
+ export function findPlaceholderServerUrls(spec) {
10
+ const urls = new Set();
11
+ for (const server of spec.servers) {
12
+ if (isPlaceholderServerUrl(server.url))
13
+ urls.add(server.url);
14
+ }
15
+ return [...urls];
16
+ }
17
+ export function isPlaceholderServerUrl(serverUrl) {
18
+ const hostname = extractHostname(serverUrl);
19
+ if (!hostname)
20
+ return false;
21
+ const normalized = hostname.toLowerCase().replace(/^\[|\]$/g, "");
22
+ if (PLACEHOLDER_HOSTS.has(normalized))
23
+ return true;
24
+ if (/^127(?:\.\d{1,3}){3}$/.test(normalized))
25
+ return true;
26
+ return (normalized.endsWith(".example.com") ||
27
+ normalized.endsWith(".example.org") ||
28
+ normalized.endsWith(".example.net"));
29
+ }
30
+ function extractHostname(serverUrl) {
31
+ const trimmed = serverUrl.trim();
32
+ if (!trimmed || trimmed.startsWith("/") || trimmed.startsWith("{"))
33
+ return null;
34
+ const candidate = /^[a-z][a-z\d+.-]*:\/\//i.test(trimmed) ? trimmed : `http://${trimmed}`;
35
+ try {
36
+ return new URL(candidate).hostname || null;
37
+ }
38
+ catch {
39
+ return null;
40
+ }
41
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"vite-plugin.d.ts","sourceRoot":"","sources":["../src/vite-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAiB,MAAM,MAAM,CAAC;AAKlD,MAAM,WAAW,oBAAoB;IACnC,uDAAuD;IACvD,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,mEAAmE;IACnE,OAAO,CAAC,EAAE,MAAM,MAAM,CAAC;IACvB,iEAAiE;IACjE,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAChD,qDAAqD;IACrD,WAAW,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IACpC,2FAA2F;IAC3F,SAAS,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC,CAAC;CAC1E;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,MAAM,CA6HnE"}
1
+ {"version":3,"file":"vite-plugin.d.ts","sourceRoot":"","sources":["../src/vite-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAiB,MAAM,MAAM,CAAC;AAMlD,MAAM,WAAW,oBAAoB;IACnC,uDAAuD;IACvD,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,mEAAmE;IACnE,OAAO,CAAC,EAAE,MAAM,MAAM,CAAC;IACvB,iEAAiE;IACjE,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAChD,qDAAqD;IACrD,WAAW,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IACpC,2FAA2F;IAC3F,SAAS,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC,CAAC;CAC1E;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,MAAM,CA6HnE"}
@@ -1,5 +1,6 @@
1
1
  import { resolve, extname } from "node:path";
2
2
  import { normalizeBaseUrl } from "./site-url.js";
3
+ import { contentTypeForPath, outputPathFromRequestPath } from "./renderer/static-files.js";
3
4
  /**
4
5
  * Vite plugin for Sourcey.
5
6
  * - Injects SSR middleware that renders pages on the fly
@@ -116,56 +117,3 @@ export function sourceyPlugin(options) {
116
117
  },
117
118
  };
118
119
  }
119
- function outputPathFromRequestPath(pathname, baseUrl) {
120
- let path = pathname;
121
- if (baseUrl && path.startsWith(baseUrl)) {
122
- path = path.slice(baseUrl.length);
123
- }
124
- try {
125
- path = decodeURIComponent(path);
126
- }
127
- catch {
128
- // Keep the raw path; a malformed escape cannot match generated output.
129
- }
130
- return path.replace(/^\/+/, "");
131
- }
132
- function contentTypeForPath(path) {
133
- switch (extname(path).toLowerCase()) {
134
- case ".css":
135
- return "text/css; charset=utf-8";
136
- case ".js":
137
- case ".mjs":
138
- return "text/javascript; charset=utf-8";
139
- case ".json":
140
- return "application/json; charset=utf-8";
141
- case ".svg":
142
- return "image/svg+xml";
143
- case ".png":
144
- return "image/png";
145
- case ".jpg":
146
- case ".jpeg":
147
- return "image/jpeg";
148
- case ".gif":
149
- return "image/gif";
150
- case ".webp":
151
- return "image/webp";
152
- case ".avif":
153
- return "image/avif";
154
- case ".ico":
155
- return "image/x-icon";
156
- case ".txt":
157
- return "text/plain; charset=utf-8";
158
- case ".pdf":
159
- return "application/pdf";
160
- case ".woff":
161
- return "font/woff";
162
- case ".woff2":
163
- return "font/woff2";
164
- case ".mp4":
165
- return "video/mp4";
166
- case ".webm":
167
- return "video/webm";
168
- default:
169
- return "application/octet-stream";
170
- }
171
- }