@rspress/core 0.0.9 → 0.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/index.d.ts +1 -10
  2. package/dist/index.js +189 -234
  3. package/dist/index.js.map +1 -1
  4. package/dist/loader.js +1 -3
  5. package/dist/loader.js.map +1 -1
  6. package/dist/theme/bundle.css +96 -159
  7. package/dist/theme/bundle.d.ts +1 -1
  8. package/dist/theme/bundle.js +930 -926
  9. package/dist/theme/bundle.js.map +1 -1
  10. package/package.json +14 -13
  11. package/src/theme-default/components/Aside/index.css +23 -0
  12. package/src/theme-default/components/Aside/index.tsx +7 -13
  13. package/src/theme-default/components/EditLink/index.module.scss +3 -3
  14. package/src/theme-default/components/EditLink/index.tsx +0 -5
  15. package/src/theme-default/components/HomeHero/index.module.scss +6 -0
  16. package/src/theme-default/components/HomeHero/index.tsx +4 -4
  17. package/src/theme-default/components/Nav/index.module.scss +0 -1
  18. package/src/theme-default/components/Nav/index.tsx +3 -3
  19. package/src/theme-default/components/Search/logic/providers/LocalProvider.ts +1 -2
  20. package/src/theme-default/components/Sidebar/SidebarGroup.tsx +180 -0
  21. package/src/theme-default/components/Sidebar/SidebarItem.tsx +60 -0
  22. package/src/theme-default/components/Sidebar/index.module.scss +22 -5
  23. package/src/theme-default/components/Sidebar/index.tsx +39 -248
  24. package/src/theme-default/components/Tabs/index.module.scss +11 -18
  25. package/src/theme-default/components/Tabs/index.tsx +1 -1
  26. package/src/theme-default/layout/DocLayout/index.module.scss +17 -18
  27. package/src/theme-default/layout/Layout/index.tsx +0 -1
  28. package/src/theme-default/logic/sideEffects.ts +3 -1
  29. package/src/theme-default/logic/useEditLink.ts +6 -3
  30. package/src/theme-default/styles/{doc/code.css → code.css} +4 -1
  31. package/src/theme-default/styles/index.ts +1 -3
  32. package/src/theme-default/styles/vars.css +2 -2
  33. package/src/theme-default/assets/edit.svg +0 -1
  34. package/src/theme-default/styles/doc/container.css +0 -103
  35. package/src/theme-default/styles/doc/index.css +0 -6
  36. /package/dist/theme/{index.ts → index.js} +0 -0
@@ -2,8 +2,8 @@
2
2
  :root {
3
3
  --rp-layout-max-width: 1440px;
4
4
  --rp-nav-height: 72px;
5
- --rp-sidebar-width: 280px;
6
- --rp-aside-width: 256px;
5
+ --rp-sidebar-width: 320px;
6
+ --rp-aside-width: 368px;
7
7
  --rp-c-bg: #ffffff;
8
8
  --rp-c-bg-soft: #f9f9f9;
9
9
  --rp-c-bg-mute: #f1f1f1;
@@ -507,6 +507,12 @@ video {
507
507
  .mr-4 {
508
508
  margin-right: 1rem;
509
509
  }
510
+ .mt-0 {
511
+ margin-top: 0px;
512
+ }
513
+ .mt-0\.5 {
514
+ margin-top: 0.125rem;
515
+ }
510
516
  .mt-1 {
511
517
  margin-top: 0.25rem;
512
518
  }
@@ -552,9 +558,6 @@ video {
552
558
  .h-14 {
553
559
  height: 3.5rem;
554
560
  }
555
- .h-5 {
556
- height: 1.25rem;
557
- }
558
561
  .h-full {
559
562
  height: 100%;
560
563
  }
@@ -752,14 +755,14 @@ video {
752
755
  padding-top: 0.25rem;
753
756
  padding-bottom: 0.25rem;
754
757
  }
755
- .py-1\.5 {
756
- padding-top: 0.375rem;
757
- padding-bottom: 0.375rem;
758
- }
759
758
  .py-2 {
760
759
  padding-top: 0.5rem;
761
760
  padding-bottom: 0.5rem;
762
761
  }
762
+ .py-2\.5 {
763
+ padding-top: 0.625rem;
764
+ padding-bottom: 0.625rem;
765
+ }
763
766
  .py-8 {
764
767
  padding-top: 2rem;
765
768
  padding-bottom: 2rem;
@@ -773,8 +776,8 @@ video {
773
776
  .pb-5 {
774
777
  padding-bottom: 1.25rem;
775
778
  }
776
- .pb-6 {
777
- padding-bottom: 1.5rem;
779
+ .pl-3 {
780
+ padding-left: 0.75rem;
778
781
  }
779
782
  .pl-4 {
780
783
  padding-left: 1rem;
@@ -1112,15 +1115,9 @@ button:focus-visible {
1112
1115
  .sm\:hidden {
1113
1116
  display: none;
1114
1117
  }
1115
- .sm\:max-h-60 {
1116
- max-height: 15rem;
1117
- }
1118
1118
  .sm\:max-w-4xl {
1119
1119
  max-width: 56rem;
1120
1120
  }
1121
- .sm\:max-w-60 {
1122
- max-width: 15rem;
1123
- }
1124
1121
  .sm\:max-w-xl {
1125
1122
  max-width: 36rem;
1126
1123
  }
@@ -1222,23 +1219,15 @@ button:focus-visible {
1222
1219
  .lg\:hidden {
1223
1220
  display: none;
1224
1221
  }
1225
- .lg\:pb-5 {
1226
- padding-bottom: 1.25rem;
1222
+ .lg\:pb-2 {
1223
+ padding-bottom: 0.5rem;
1227
1224
  }
1228
1225
  }
1229
1226
  .\[\&\:not\(\:first-child\)\]\:mt-2:not(:first-child) {
1230
1227
  margin-top: 0.5rem;
1231
1228
  }
1232
1229
 
1233
- /* src/theme-default/styles/doc/index.css */
1234
- .aside-active,
1235
- .aside-active:hover {
1236
- color: var(--rp-c-brand-dark) !important;
1237
- font-weight: bold !important;
1238
- font-size: 14px !important;
1239
- }
1240
-
1241
- /* src/theme-default/styles/doc/code.css */
1230
+ /* src/theme-default/styles/code.css */
1242
1231
  :root {
1243
1232
  --rp-code-font-size: 14px;
1244
1233
  --rp-code-block-color: rgb(46, 52, 64);
@@ -1287,7 +1276,7 @@ button:focus-visible {
1287
1276
  margin: 16px 0;
1288
1277
  background-color: var(--rp-code-block-bg);
1289
1278
  overflow-x: auto;
1290
- transition: background-color 0.5s;
1279
+ transition: none;
1291
1280
  }
1292
1281
  .rspress-doc .rspress-code-title {
1293
1282
  padding: 12px 16px;
@@ -1299,6 +1288,7 @@ button:focus-visible {
1299
1288
  .rspress-doc div[class*=language-] {
1300
1289
  border-radius: 16px;
1301
1290
  margin: 24px 0;
1291
+ contain: content;
1302
1292
  }
1303
1293
  }
1304
1294
  @media (max-width: 640px) {
@@ -1388,91 +1378,6 @@ button:focus-visible {
1388
1378
  padding: 16px 20px;
1389
1379
  }
1390
1380
 
1391
- /* src/theme-default/styles/doc/container.css */
1392
- :root {
1393
- --rp-container-info-border: rgba(7, 156, 112, 0.3);
1394
- --rp-container-info-text: #399c70;
1395
- --rp-container-info-bg: rgba(7, 156, 112, 0.02);
1396
- --rp-container-info-code-bg: rgba(7, 156, 112, 0.1);
1397
- --rp-container-warning-border: rgba(255, 197, 23, 0.5);
1398
- --rp-container-warning-text: #ad850e;
1399
- --rp-container-warning-bg: rgba(255, 197, 23, 0.02);
1400
- --rp-container-warning-code-bg: rgba(255, 197, 23, 0.1);
1401
- --rp-container-danger-border: rgba(237, 60, 80, 0.5);
1402
- --rp-container-danger-text: #ab2131;
1403
- --rp-container-danger-bg: rgba(237, 60, 80, 0.02);
1404
- --rp-container-danger-code-bg: rgba(237, 60, 80, 0.1);
1405
- }
1406
- .dark {
1407
- --rp-container-warning-border: rgba(255, 197, 23, 0.25);
1408
- --rp-container-warning-text: #fcd253;
1409
- --rp-container-danger-border: rgba(237, 60, 80, 0.25);
1410
- --rp-container-danger-text: #f54e82;
1411
- }
1412
- .rspress-doc .modern-directive {
1413
- border: 1px solid transparent;
1414
- border-radius: 16px;
1415
- padding: 20px 24px 12px;
1416
- line-height: 1.7;
1417
- font-size: 14px;
1418
- font-weight: 500;
1419
- margin: 24px 0;
1420
- }
1421
- .rspress-doc .modern-directive .modern-directive-title {
1422
- margin-bottom: 8px;
1423
- font-weight: 600;
1424
- font-size: 16px;
1425
- }
1426
- .rspress-doc .modern-directive .modern-directive-content p {
1427
- margin: 8px 0;
1428
- }
1429
- .rspress-doc .modern-directive .modern-directive-icon {
1430
- display: inline-block;
1431
- width: 20px;
1432
- height: 20px;
1433
- margin-right: 3px;
1434
- }
1435
- .rspress-doc .modern-directive p {
1436
- margin: 8px 0;
1437
- }
1438
- .rspress-doc .modern-directive code {
1439
- color: inherit;
1440
- font-weight: bold;
1441
- font-size: 13px;
1442
- }
1443
- .rspress-doc .modern-directive.tip,
1444
- .rspress-doc .modern-directive.note,
1445
- .rspress-doc .modern-directive.info {
1446
- border-color: var(--rp-container-info-border);
1447
- color: var(--rp-container-info-text);
1448
- background-color: var(--rp-container-info-bg);
1449
- }
1450
- .rspress-doc .modern-directive.tip code,
1451
- .rspress-doc .modern-directive.note code {
1452
- background-color: var(--rp-container-info-code-bg);
1453
- }
1454
- .rspress-doc .modern-directive.info code {
1455
- background-color: var(--rp-container-info-code-bg);
1456
- }
1457
- .rspress-doc .modern-directive.warning {
1458
- border-color: var(--rp-container-warning-border);
1459
- color: var(--rp-container-warning-text);
1460
- background-color: var(--rp-container-warning-bg);
1461
- }
1462
- .rspress-doc .modern-directive.warning code {
1463
- background-color: var(--rp-container-warning-code-bg);
1464
- }
1465
- .rspress-doc .modern-directive.caution,
1466
- .rspress-doc .modern-directive.danger {
1467
- border-color: var(--rp-container-danger-border);
1468
- color: var(--rp-container-danger-text);
1469
- background-color: var(--rp-container-danger-bg);
1470
- }
1471
- .rspress-doc .modern-directive.caution code,
1472
- .rspress-doc .modern-directive.danger code {
1473
- background-color: var(--rp-container-danger-code-bg);
1474
- }
1475
-
1476
1381
  /* src/theme-default/styles/scrollbar.css */
1477
1382
  .rspress-scrollbar {
1478
1383
  scrollbar-gutter: stable;
@@ -1497,16 +1402,40 @@ button:focus-visible {
1497
1402
  background: transparent;
1498
1403
  }
1499
1404
 
1500
- /* src/theme-default/components/EditLink/index.module.scss?css_virtual&hash=b3b2f950e103d20a96a637f79e580a02 */
1405
+ /* src/theme-default/components/Aside/index.css */
1406
+ .aside-link {
1407
+ padding-bottom: 1px;
1408
+ }
1409
+ .aside-link-text {
1410
+ padding: 0px 12px;
1411
+ white-space: nowrap;
1412
+ overflow: hidden;
1413
+ text-overflow: ellipsis;
1414
+ transition: all 0.2s ease-in-out;
1415
+ border-radius: 10px 0 0 10px;
1416
+ font-size: 13px;
1417
+ line-height: 1.75rem;
1418
+ }
1419
+ .aside-link-text:hover {
1420
+ background-color: var(--rp-c-bg-mute);
1421
+ }
1422
+ .aside-active,
1423
+ .aside-active:hover {
1424
+ color: var(--rp-c-brand-dark) !important;
1425
+ background-color: var(--rp-c-brand-tint);
1426
+ }
1427
+
1428
+ /* src/theme-default/components/EditLink/index.module.scss?css_virtual&hash=65df4475fa495f0b8547762ec50b924b */
1501
1429
  .editLink_eea9e {
1502
1430
  color: var(--rp-c-brand);
1503
1431
  text-decoration: none;
1504
- font-size: 14px;
1432
+ font-size: 15px;
1505
1433
  font-weight: 500;
1506
1434
  margin: 20px 0;
1435
+ transition: all 0.2s ease-in-out;
1507
1436
  }
1508
1437
  .editLink_eea9e:hover {
1509
- text-decoration: underline;
1438
+ color: var(--rp-c-brand-dark);
1510
1439
  }
1511
1440
 
1512
1441
  /* src/theme-default/components/Link/index.module.scss?css_virtual&hash=b863786183fb8875da59238226b359ae */
@@ -1573,14 +1502,14 @@ button:focus-visible {
1573
1502
  transition: color 0.25s;
1574
1503
  }
1575
1504
 
1576
- /* src/theme-default/components/Sidebar/index.module.scss?css_virtual&hash=1e50b22992d3cc70c0758d47a8be6804 */
1505
+ /* src/theme-default/components/Sidebar/index.module.scss?css_virtual&hash=4d362cac0d7d2e27cfb35a9c734cb685 */
1577
1506
  .sidebar_74484 {
1578
1507
  position: fixed;
1579
1508
  top: 0;
1580
1509
  bottom: 0;
1581
1510
  left: 0;
1582
1511
  z-index: var(--rp-z-index-sidebar);
1583
- padding: 12px 12px 96px 16px;
1512
+ padding: 12px 12px 96px 0;
1584
1513
  width: calc(100vw - 64px);
1585
1514
  max-width: 320px;
1586
1515
  background-color: var(--rp-c-bg);
@@ -1616,9 +1545,8 @@ button:focus-visible {
1616
1545
  }
1617
1546
  @media (min-width: 1440px) {
1618
1547
  .sidebar_74484 {
1619
- padding-left: 16px;
1548
+ padding-left: 0;
1620
1549
  width: var(--rp-sidebar-width);
1621
- margin-left: calc((100vw - 1440px) / 2);
1622
1550
  }
1623
1551
  }
1624
1552
  .menuLink_74484 {
@@ -1646,16 +1574,32 @@ button:focus-visible {
1646
1574
  .menuItemActive_74484 {
1647
1575
  font-size: 13px;
1648
1576
  line-height: 19px;
1577
+ border-radius: 0 1rem 1rem 0;
1649
1578
  }
1650
1579
  .menuItem_74484,
1651
1580
  .menuItemStatic_74484 {
1652
1581
  color: var(--rp-c-text-2);
1653
- transition: all 0.2s;
1582
+ transition: color 0.2s;
1583
+ font-weight: 500;
1654
1584
  }
1655
1585
  .menuItemActive_74484 {
1656
1586
  background-color: var(--rp-c-brand-tint);
1657
1587
  color: var(--rp-c-brand);
1658
1588
  font-weight: bolder;
1589
+ position: relative;
1590
+ }
1591
+ .menuItemActive_74484::before {
1592
+ content: "";
1593
+ position: absolute;
1594
+ top: 0;
1595
+ left: 0;
1596
+ width: 1px;
1597
+ height: 100%;
1598
+ background-color: var(--rp-c-brand);
1599
+ transition: all 0.2s ease;
1600
+ }
1601
+ .menuGroupActive_74484 {
1602
+ background-color: var(--rp-c-bg-mute);
1659
1603
  }
1660
1604
  .rspress-sidebar-group {
1661
1605
  position: relative;
@@ -1664,7 +1608,7 @@ button:focus-visible {
1664
1608
  content: "";
1665
1609
  position: absolute;
1666
1610
  top: 0;
1667
- left: 12px;
1611
+ left: 18px;
1668
1612
  width: 1px;
1669
1613
  height: 100%;
1670
1614
  background-color: var(--rp-c-gray-light-4);
@@ -1845,7 +1789,7 @@ button:focus-visible {
1845
1789
  }
1846
1790
  }
1847
1791
 
1848
- /* src/theme-default/layout/DocLayout/index.module.scss?css_virtual&hash=6700f01aa87c30de18c05d1577609c86 */
1792
+ /* src/theme-default/layout/DocLayout/index.module.scss?css_virtual&hash=fc1722758dddfc71c5344b874e8f6553 */
1849
1793
  .aside-container_feeda {
1850
1794
  position: sticky;
1851
1795
  display: none;
@@ -1876,7 +1820,7 @@ button:focus-visible {
1876
1820
  .content_feeda {
1877
1821
  margin-left: var(--rp-sidebar-width);
1878
1822
  width: calc(100% - var(--rp-sidebar-width));
1879
- padding: 48px 48px 72px 48px;
1823
+ padding: 48px 48px 72px 0;
1880
1824
  }
1881
1825
  .content_feeda .rspress-doc {
1882
1826
  width: 100%;
@@ -1886,34 +1830,29 @@ button:focus-visible {
1886
1830
  }
1887
1831
  }
1888
1832
  @media (min-width: 1280px) {
1889
- .docLayout_feeda {
1890
- width: calc(1280px - 100vw + 100%);
1891
- margin-left: calc((100vw - 1280px) / 2);
1892
- }
1893
1833
  .aside-container_feeda {
1894
1834
  display: block;
1895
1835
  width: var(--rp-aside-width);
1896
1836
  }
1897
1837
  .content_feeda {
1898
- margin-left: var(--rp-sidebar-width);
1899
- width: calc(100% - var(--rp-sidebar-width));
1900
1838
  padding: 48px 0 72px 0;
1901
1839
  }
1902
1840
  .content_feeda .rspress-doc {
1903
- width: calc(1280px - var(--rp-sidebar-width) - var(--rp-aside-width));
1841
+ padding: 0 48px;
1842
+ box-sizing: content-box;
1843
+ width: calc(100vw - var(--rp-aside-width) - var(--rp-sidebar-width));
1904
1844
  }
1905
1845
  }
1906
1846
  @media (min-width: 1440px) {
1907
1847
  .docLayout_feeda {
1908
- width: calc(1440px - 100vw + 100%);
1909
- margin-left: calc((100vw - 1440px) / 2);
1910
- }
1911
- .content_feeda {
1912
- padding: 48px 0 72px 64px;
1848
+ width: 100%;
1849
+ margin-left: 0;
1913
1850
  }
1914
1851
  .content_feeda .rspress-doc {
1915
- padding-right: 64px;
1916
- width: calc(1440px - var(--rp-sidebar-width) - var(--rp-aside-width) - 64px);
1852
+ box-sizing: content-box;
1853
+ width: calc(100vw - var(--rp-sidebar-width) - var(--rp-aside-width));
1854
+ padding: 0 max(48px, (100vw - var(--rp-sidebar-width) - var(--rp-aside-width) - 960px) / 2);
1855
+ max-width: 960px;
1917
1856
  }
1918
1857
  }
1919
1858
 
@@ -1983,7 +1922,7 @@ button:focus-visible {
1983
1922
  }
1984
1923
  }
1985
1924
 
1986
- /* src/theme-default/components/HomeHero/index.module.scss?css_virtual&hash=ccb5063973b03328c921f5e86594326e */
1925
+ /* src/theme-default/components/HomeHero/index.module.scss?css_virtual&hash=77a7602a25e973f2aa9f385208bcf498 */
1987
1926
  .clip_1e4a0 {
1988
1927
  background: var(--rp-home-hero-name-background);
1989
1928
  -webkit-background-clip: text;
@@ -2007,6 +1946,11 @@ button:focus-visible {
2007
1946
  .dark .mask_1e4a0 {
2008
1947
  opacity: 0.15;
2009
1948
  }
1949
+ @media (min-width: 640px) {
1950
+ .rspress-home-hero-image {
1951
+ width: 375px;
1952
+ }
1953
+ }
2010
1954
 
2011
1955
  /* src/theme-default/components/HomeFeatures/index.module.scss?css_virtual&hash=284b5aa191fe3f1ddb09180064e8904d */
2012
1956
  @media (max-width: 640px) {
@@ -2110,9 +2054,8 @@ button:focus-visible {
2110
2054
  transform: rotate(180deg);
2111
2055
  }
2112
2056
 
2113
- /* src/theme-default/components/Nav/index.module.scss?css_virtual&hash=8ae86e2c145b7387c59f67887a4cbd7b */
2057
+ /* src/theme-default/components/Nav/index.module.scss?css_virtual&hash=89d0c9f901fcc34554a4be53e920346c */
2114
2058
  .container_47ac2 {
2115
- max-width: 1440px;
2116
2059
  margin: auto;
2117
2060
  }
2118
2061
  .leftNav_47ac2 {
@@ -2348,31 +2291,31 @@ button:focus-visible {
2348
2291
  transform: translateX(4px);
2349
2292
  }
2350
2293
 
2351
- /* src/theme-default/components/Tabs/index.module.scss?css_virtual&hash=c9e818d0bb47534fff6481cd9a970a36 */
2294
+ /* src/theme-default/components/Tabs/index.module.scss?css_virtual&hash=6c08afb75394e8f9690200f76b5fc031 */
2352
2295
  .container_7e0fb {
2353
- border: 1px solid var(--rp-c-gray-light-3);
2354
- border-radius: 8px;
2296
+ background-color: var(--rp-code-block-bg);
2297
+ contain: content;
2298
+ border-radius: 16px;
2299
+ }
2300
+ .container_7e0fb div[class*=language-] {
2301
+ margin: 6px 0;
2355
2302
  }
2356
- .dark .container_7e0fb {
2357
- border-color: var(--rp-c-dark-light-1);
2303
+ .container_7e0fb div[class*=language-] code {
2304
+ background-color: var(--rp-c-bg);
2358
2305
  }
2359
2306
  .tab-list_7e0fb {
2360
2307
  padding-left: 8px;
2361
2308
  padding-top: 4px;
2362
2309
  display: flex;
2363
2310
  min-width: 100%;
2364
- border-bottom-width: 1px;
2365
- border-color: var(--rp-c-gray-light-3);
2366
- }
2367
- .dark .tab-list_7e0fb {
2368
- border-color: var(--rp-c-dark-light-1);
2311
+ background-color: var(--rp-code-title-bg);
2369
2312
  }
2370
2313
  .tab_7e0fb {
2371
2314
  color: var(--rp-c-text-2);
2372
2315
  border-bottom: 1px solid transparent;
2373
2316
  box-sizing: border-box;
2374
2317
  margin-right: 10px;
2375
- padding: 6px 8px;
2318
+ padding: 6px 12px;
2376
2319
  margin-bottom: -1px;
2377
2320
  user-select: none;
2378
2321
  transition: all 0.2s ease-in-out;
@@ -2383,12 +2326,6 @@ button:focus-visible {
2383
2326
  .not-selected_7e0fb:hover {
2384
2327
  color: var(--rp-c-text-1);
2385
2328
  border-color: var(--rp-c-gray);
2386
- border-top-left-radius: 10px;
2387
- border-top-right-radius: 10px;
2388
- background-color: var(--rp-c-gray-light-5);
2389
- }
2390
- .dark .not-selected_7e0fb:hover {
2391
- background-color: var(--rp-c-dark-light-3);
2392
2329
  }
2393
2330
  .selected_7e0fb {
2394
2331
  color: var(--rp-c-brand-dark);
@@ -66,7 +66,7 @@ declare function Search(): JSX.Element;
66
66
 
67
67
  type TabItem = {
68
68
  value?: string;
69
- label?: string;
69
+ label?: string | ReactNode;
70
70
  disabled?: boolean;
71
71
  };
72
72
  interface TabsProps {