robindoc 0.0.0-experimental-a9513fc → 0.0.0-experimental-6035c0e

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.
@@ -0,0 +1,3 @@
1
+ 'use client';
2
+ import e,{useState as r,useLayoutEffect as o}from"react";import t from"clsx";import{CodeSpan as n}from"../code-span/index.js";import{highlight as c}from"./shared.js";const l=({code:l,lang:m,className:s,inline:a})=>{const[i,p]=r(null);return o(()=>{c(l,m).then(p)},[]),a?e.createElement(n,null,i):e.createElement("pre",{className:t("r-code-block",s)},i)};export{l as CodeBlock};
3
+ //# sourceMappingURL=index.client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.client.js","sources":["../../../../src/components/ui/code-block/index.client.tsx"],"sourcesContent":["\"use client\";\n\nimport React, { useState, useLayoutEffect } from \"react\";\nimport { type BuiltinLanguage } from \"shiki\";\nimport clsx from \"clsx\";\n\nimport { CodeSpan } from \"../code-span\";\nimport { highlight } from \"./shared\";\n\nimport \"./code-block.scss\";\n\nexport interface CodeBlockProps {\n code: string;\n lang: BuiltinLanguage;\n className?: string;\n inline?: boolean;\n}\n\nexport const CodeBlock: React.FC<CodeBlockProps> = ({ code, lang, className, inline }) => {\n const [nodes, setNodes] = useState<React.ReactElement | null>(null);\n\n useLayoutEffect(() => {\n void highlight(code, lang).then(setNodes);\n }, []);\n\n if (inline) return <CodeSpan>{nodes}</CodeSpan>;\n\n return <pre className={clsx(\"r-code-block\", className)}>{nodes}</pre>;\n};\n"],"names":["CodeBlock","code","lang","className","inline","nodes","setNodes","useState","useLayoutEffect","highlight","then","React","createElement","CodeSpan","clsx"],"mappings":";sKAkBO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAMA,EAAsC,CAAA,CAAGC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAMC,OAAMC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAWC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CACzE,MAAOC,CAAAA,CAAOC,CAAAA,CAAAA,CAAYC,EAAoC,CAAA,CAAA,CAAA,CAAA,CAAA,CAM9D,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAJAC,EAAgB,CAAA,CAAA,CAAA,CAAA,CACPC,CAAAA,CAAUR,EAAMC,CAAAA,CAAAA,CAAMQ,CAAAA,CAAAA,CAAAA,CAAAA,CAAKJ,IACjC,CAAA,CAAA,CAAA,CAECF,CAAAA,CAAeO,EAAAC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAACC,CAAAA,CAAQ,KAAER,CAAAA,CAAAA,CAEvBM,CAAAA,CAAAC,cAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAKT,UAAWW,CAAAA,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAgBX,IAAaE,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA"}
@@ -8,4 +8,4 @@ export interface CodeBlockProps {
8
8
  inline?: boolean;
9
9
  }
10
10
  export declare const CodeBlock: React.FC<CodeBlockProps>;
11
- //# sourceMappingURL=index.isomirphic.d.ts.map
11
+ //# sourceMappingURL=index.isomorphic.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.isomirphic.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/code-block/index.isomirphic.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyB,MAAM,OAAO,CAAC;AAE9C,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,OAAO,CAAC;AAI7C,OAAO,mBAAmB,CAAC;AAE3B,MAAM,WAAW,cAAc;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,eAAe,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB;AAGD,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAU9C,CAAC"}
1
+ {"version":3,"file":"index.isomorphic.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/code-block/index.isomorphic.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyB,MAAM,OAAO,CAAC;AAE9C,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,OAAO,CAAC;AAI7C,OAAO,mBAAmB,CAAC;AAE3B,MAAM,WAAW,cAAc;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,eAAe,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB;AAGD,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAU9C,CAAC"}
@@ -0,0 +1,2 @@
1
+ import e,{lazy as l,Suspense as n}from"react";import{CodeBlock as a}from"./index.server.js";const t=l(()=>import("./index.client.js").then(e=>({default:e.CodeBlock}))),c=({code:l,lang:c,className:o,inline:r})=>"useState"in e?e.createElement(n,{fallback:e.createElement("pre",null,l)},e.createElement(t,{code:l,lang:c,className:o,inline:r})):e.createElement(a,{code:l,lang:c,className:o,inline:r});export{c as CodeBlock};
2
+ //# sourceMappingURL=index.isomorphic.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.isomorphic.js","sources":["../../../../src/components/ui/code-block/index.isomorphic.tsx"],"sourcesContent":["import React, { lazy, Suspense } from \"react\";\n\nimport { type BuiltinLanguage } from \"shiki\";\n\nimport { CodeBlock as CodeBlockServer } from \"./index.server\";\n\nimport \"./code-block.scss\";\n\nexport interface CodeBlockProps {\n code: string;\n lang: BuiltinLanguage;\n className?: string;\n inline?: boolean;\n}\nconst CodeBlockClient = lazy(() => import(\"./index.client\").then((module) => ({ default: module.CodeBlock })));\n\nexport const CodeBlock: React.FC<CodeBlockProps> = ({ code, lang, className, inline }) => {\n if (\"useState\" in React) {\n return (\n <Suspense fallback={<pre>{code}</pre>}>\n <CodeBlockClient code={code} lang={lang} className={className} inline={inline} />\n </Suspense>\n );\n }\n\n return <CodeBlockServer code={code} lang={lang} className={className} inline={inline} />;\n};\n"],"names":["CodeBlockClient","lazy","import","then","module","default","CodeBlock","code","lang","className","inline","React","Suspense","fallback","createElement","CodeBlockServer"],"mappings":"4FAcA,MAAMA,EAAkBC,EAAK,IAAMC,OAAO,qBAAkBC,KAAMC,IAAM,CAAQC,QAASD,EAAOE,cAEnFA,EAAsC,EAAGC,OAAMC,OAAMC,YAAWC,YACrE,aAAcC,EAEVA,gBAACC,EAAQ,CAACC,SAAUF,EAAAG,cAAA,MAAA,KAAMP,IACtBI,EAAAG,cAACd,GAAgBO,KAAMA,EAAMC,KAAMA,EAAMC,UAAWA,EAAWC,OAAQA,KAK5EC,gBAACI,EAAe,CAACR,KAAMA,EAAMC,KAAMA,EAAMC,UAAWA,EAAWC,OAAQA"}
@@ -0,0 +1,2 @@
1
+ import{toJsxRuntime as t}from"hast-util-to-jsx-runtime";import{Fragment as r}from"react";import{jsxs as e,jsx as m}from"react/jsx-runtime";import{codeToHast as i}from"shiki/bundle/web";import{githubDynamic as o}from"./theme.js";async function n(n,s){const a=await i(n,{lang:s,theme:o,structure:"inline"});return t(a,{Fragment:r,jsx:m,jsxs:e})}export{n as highlight};
2
+ //# sourceMappingURL=shared.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.js","sources":["../../../../src/components/ui/code-block/shared.ts"],"sourcesContent":["import { type BuiltinLanguage } from \"shiki\";\nimport { toJsxRuntime } from \"hast-util-to-jsx-runtime\";\nimport { Fragment } from \"react\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\nimport { codeToHast } from \"shiki/bundle/web\";\n\nimport { githubDynamic } from \"./theme\";\n\nexport async function highlight(code: string, lang: BuiltinLanguage) {\n const out = await codeToHast(code, {\n lang,\n theme: githubDynamic,\n structure: \"inline\",\n });\n\n return toJsxRuntime(out, {\n Fragment,\n jsx,\n jsxs,\n }) as React.ReactElement;\n}\n"],"names":["async","highlight","code","lang","out","codeToHast","theme","githubDynamic","structure","toJsxRuntime","Fragment","jsx","jsxs"],"mappings":"oOAQOA,eAAeC,EAAUC,EAAcC,GAC1C,MAAMC,QAAYC,EAAWH,EAAM,CAC/BC,OACAG,MAAOC,EACPC,UAAW,WAGf,OAAOC,EAAaL,EAAK,CACrBM,WACAC,MACAC,QAER"}
package/lib/styles.css CHANGED
@@ -1,4 +1,17 @@
1
- .r-header {
1
+ .r-code-block {
2
+ font-family: var(--monospace-font, monospace, monospace);
3
+ font-size: 16px;
4
+ line-height: 1.33;
5
+ border-radius: 6px;
6
+ padding: 16px 20px;
7
+ margin: 0;
8
+ color: var(--r-primary-800);
9
+ background-color: var(--r-main-50);
10
+ overflow-x: auto;
11
+ scrollbar-width: thin;
12
+ scrollbar-color: var(--r-main-200) transparent;
13
+ box-sizing: border-box;
14
+ }.r-header {
2
15
  position: sticky;
3
16
  background-color: var(--r-main-50);
4
17
  top: 0;
@@ -421,6 +434,72 @@
421
434
  z-index: 1001;
422
435
  }.r-keylink.keylink-to-navigation:focus {
423
436
  margin-top: -40px;
437
+ }.r-article {
438
+ padding: 20px 0 40px;
439
+ grid-area: content;
440
+ }
441
+ @media screen and (width >= 1180px) {
442
+ .r-article {
443
+ padding: 32px 0 40px;
444
+ }
445
+ }
446
+ .r-article > *:first-child {
447
+ margin-top: 0;
448
+ }
449
+ .r-article > *:last-child {
450
+ margin-bottom: 0;
451
+ }
452
+
453
+ .r-checkbox {
454
+ cursor: pointer;
455
+ width: 20px;
456
+ height: 20px;
457
+ margin: 4px;
458
+ vertical-align: middle;
459
+ box-sizing: border-box;
460
+ }
461
+
462
+ .r-label {
463
+ cursor: pointer;
464
+ }
465
+
466
+ .r-task-ol,
467
+ .r-task-ul {
468
+ list-style: none;
469
+ }
470
+
471
+ .r-task-label {
472
+ display: block;
473
+ width: 100%;
474
+ padding-top: 2px;
475
+ padding-bottom: 2px;
476
+ box-sizing: border-box;
477
+ }
478
+ .r-task-label:hover .r-checkbox {
479
+ filter: brightness(0.8);
480
+ }
481
+
482
+ .r-task-li.r-task-li {
483
+ margin-block-start: 2px;
484
+ margin-block-end: 2px;
485
+ }
486
+
487
+ .r-label-text {
488
+ vertical-align: middle;
489
+ }.r-code-span {
490
+ font-family: var(--monospace-font, monospace, monospace);
491
+ background-color: var(--r-main-100);
492
+ border: 1px solid var(--r-main-200);
493
+ color: var(--r-main-950);
494
+ border-radius: 4px;
495
+ padding: 2px 6px;
496
+ font-size: inherit;
497
+ font-weight: 500;
498
+ letter-spacing: 0.5px;
499
+ }
500
+
501
+ .r-code-span + .r-content-link-external {
502
+ margin-left: -12px;
424
503
  }.r-sidebar {
425
504
  grid-area: sidebar;
426
505
  box-sizing: border-box;
@@ -712,58 +791,6 @@
712
791
 
713
792
  .r-sidebar-drop[open] > .r-sidebar-drop-btn > .r-sidebar-drop-icon {
714
793
  transform: rotate(90deg);
715
- }.r-article {
716
- padding: 20px 0 40px;
717
- grid-area: content;
718
- }
719
- @media screen and (width >= 1180px) {
720
- .r-article {
721
- padding: 32px 0 40px;
722
- }
723
- }
724
- .r-article > *:first-child {
725
- margin-top: 0;
726
- }
727
- .r-article > *:last-child {
728
- margin-bottom: 0;
729
- }
730
-
731
- .r-checkbox {
732
- cursor: pointer;
733
- width: 20px;
734
- height: 20px;
735
- margin: 4px;
736
- vertical-align: middle;
737
- box-sizing: border-box;
738
- }
739
-
740
- .r-label {
741
- cursor: pointer;
742
- }
743
-
744
- .r-task-ol,
745
- .r-task-ul {
746
- list-style: none;
747
- }
748
-
749
- .r-task-label {
750
- display: block;
751
- width: 100%;
752
- padding-top: 2px;
753
- padding-bottom: 2px;
754
- box-sizing: border-box;
755
- }
756
- .r-task-label:hover .r-checkbox {
757
- filter: brightness(0.8);
758
- }
759
-
760
- .r-task-li.r-task-li {
761
- margin-block-start: 2px;
762
- margin-block-end: 2px;
763
- }
764
-
765
- .r-label-text {
766
- vertical-align: middle;
767
794
  }.r-header-menu {
768
795
  display: flex;
769
796
  justify-content: flex-end;
@@ -1114,13 +1141,6 @@
1114
1141
 
1115
1142
  .r-dropdown-link._active {
1116
1143
  color: var(--r-primary-700);
1117
- }.r-container {
1118
- max-width: 1180px;
1119
- padding-right: 12px;
1120
- padding-left: 12px;
1121
- margin-right: auto;
1122
- margin-left: auto;
1123
- box-sizing: border-box;
1124
1144
  }.r-header-social {
1125
1145
  display: flex;
1126
1146
  flex: 1;
@@ -1139,6 +1159,13 @@
1139
1159
  }
1140
1160
  .r-header-social-git:hover, .r-header-social-git:focus {
1141
1161
  color: var(--r-main-950);
1162
+ }.r-container {
1163
+ max-width: 1180px;
1164
+ padding-right: 12px;
1165
+ padding-left: 12px;
1166
+ margin-right: auto;
1167
+ margin-left: auto;
1168
+ box-sizing: border-box;
1142
1169
  }.r-theme-switcher {
1143
1170
  position: relative;
1144
1171
  display: flex;
@@ -1225,47 +1252,6 @@
1225
1252
  user-select: none;
1226
1253
  pointer-events: none;
1227
1254
  box-sizing: border-box;
1228
- }.r-breadcrumbs {
1229
- grid-area: breadcrumbs;
1230
- list-style: none;
1231
- margin: 0;
1232
- padding: 20px 0 0;
1233
- line-height: 2;
1234
- }
1235
- @media screen and (width >= 768px) {
1236
- .r-breadcrumbs {
1237
- padding: 32px 0 0;
1238
- }
1239
- }
1240
-
1241
- .r-breadcrumb {
1242
- display: inline;
1243
- }
1244
-
1245
- .r-breadcrumb._previous::after {
1246
- content: "/";
1247
- font-weight: 600;
1248
- margin-inline: 8px;
1249
- }
1250
-
1251
- .r-breadcrumb-link {
1252
- color: var(--r-main-700);
1253
- text-decoration: none;
1254
- }
1255
- .r-breadcrumb-link:hover {
1256
- color: var(--r-primary-800);
1257
- }
1258
-
1259
- .r-breadcrumb-link,
1260
- .r-breadcrumb-title {
1261
- display: inline;
1262
- padding: 6px 0;
1263
- margin: 0;
1264
- }
1265
-
1266
- .r-breadcrumb-title {
1267
- color: var(--r-main-950);
1268
- font-weight: 600;
1269
1255
  }.r-contents {
1270
1256
  grid-area: contents;
1271
1257
  }
@@ -1577,6 +1563,47 @@
1577
1563
 
1578
1564
  .r-pagination-svg {
1579
1565
  display: block;
1566
+ }.r-breadcrumbs {
1567
+ grid-area: breadcrumbs;
1568
+ list-style: none;
1569
+ margin: 0;
1570
+ padding: 20px 0 0;
1571
+ line-height: 2;
1572
+ }
1573
+ @media screen and (width >= 768px) {
1574
+ .r-breadcrumbs {
1575
+ padding: 32px 0 0;
1576
+ }
1577
+ }
1578
+
1579
+ .r-breadcrumb {
1580
+ display: inline;
1581
+ }
1582
+
1583
+ .r-breadcrumb._previous::after {
1584
+ content: "/";
1585
+ font-weight: 600;
1586
+ margin-inline: 8px;
1587
+ }
1588
+
1589
+ .r-breadcrumb-link {
1590
+ color: var(--r-main-700);
1591
+ text-decoration: none;
1592
+ }
1593
+ .r-breadcrumb-link:hover {
1594
+ color: var(--r-primary-800);
1595
+ }
1596
+
1597
+ .r-breadcrumb-link,
1598
+ .r-breadcrumb-title {
1599
+ display: inline;
1600
+ padding: 6px 0;
1601
+ margin: 0;
1602
+ }
1603
+
1604
+ .r-breadcrumb-title {
1605
+ color: var(--r-main-950);
1606
+ font-weight: 600;
1580
1607
  }.r-last-modified {
1581
1608
  color: var(--r-main-700);
1582
1609
  margin-block-start: 16px;
@@ -1596,6 +1623,8 @@
1596
1623
  opacity: 1;
1597
1624
  visibility: visible;
1598
1625
  pointer-events: all;
1626
+ }.r-git-logo {
1627
+ display: block;
1599
1628
  }.r-external-mark {
1600
1629
  position: relative;
1601
1630
  vertical-align: text-top;
@@ -1627,8 +1656,6 @@
1627
1656
  background-color: currentColor;
1628
1657
  border-radius: 0 0 0 4px;
1629
1658
  box-sizing: border-box;
1630
- }.r-git-logo {
1631
- display: block;
1632
1659
  }.r-kbd-container {
1633
1660
  display: flex;
1634
1661
  gap: 4px;
@@ -1782,32 +1809,8 @@
1782
1809
  }
1783
1810
  .r-blockquote-caution .r-blockquote-title {
1784
1811
  color: var(--r-caution);
1785
- }.r-code-span {
1786
- font-family: var(--monospace-font, monospace, monospace);
1787
- background-color: var(--r-main-100);
1788
- border: 1px solid var(--r-main-200);
1789
- color: var(--r-main-950);
1790
- border-radius: 4px;
1791
- padding: 2px 6px;
1792
- font-size: inherit;
1793
- font-weight: 500;
1794
- letter-spacing: 0.5px;
1795
- }
1796
-
1797
- .r-code-span + .r-content-link-external {
1798
- margin-left: -12px;
1799
- }.r-code-block {
1800
- font-family: var(--monospace-font, monospace, monospace);
1801
- font-size: 16px;
1802
- line-height: 1.33;
1803
- border-radius: 6px;
1804
- padding: 16px 20px;
1805
- margin: 0;
1806
- color: var(--r-primary-800);
1807
- background-color: var(--r-main-50);
1808
- overflow-x: auto;
1809
- scrollbar-width: thin;
1810
- scrollbar-color: var(--r-main-200) transparent;
1812
+ }.r-img {
1813
+ max-width: 100%;
1811
1814
  box-sizing: border-box;
1812
1815
  }.r-h1 {
1813
1816
  font-size: 32px;
@@ -1849,9 +1852,6 @@
1849
1852
  line-height: 1.4;
1850
1853
  margin-block-start: 1.8em;
1851
1854
  margin-block-end: 1.8em;
1852
- }.r-img {
1853
- max-width: 100%;
1854
- box-sizing: border-box;
1855
1855
  }.r-p {
1856
1856
  line-height: 1.8;
1857
1857
  margin-block-start: 1em;
@@ -2072,6 +2072,11 @@
2072
2072
 
2073
2073
  .r-td_right {
2074
2074
  text-align: right;
2075
+ }.r-tr {
2076
+ border-collapse: collapse;
2077
+ }
2078
+ .r-tr:not(:first-child) {
2079
+ border-top: 1px solid var(--r-main-200);
2075
2080
  }.r-th {
2076
2081
  padding: 8px 12px;
2077
2082
  border-collapse: collapse;
@@ -2098,11 +2103,8 @@
2098
2103
 
2099
2104
  .r-th_right {
2100
2105
  text-align: right;
2101
- }.r-tr {
2102
- border-collapse: collapse;
2103
- }
2104
- .r-tr:not(:first-child) {
2105
- border-top: 1px solid var(--r-main-200);
2106
+ }.r-task-ol {
2107
+ list-style: none;
2106
2108
  }.r-task-li.r-task-li {
2107
2109
  margin-block-start: 2px;
2108
2110
  margin-block-end: 2px;
@@ -2132,8 +2134,6 @@
2132
2134
 
2133
2135
  .r-task-label-text {
2134
2136
  vertical-align: middle;
2135
- }.r-task-ol {
2136
- list-style: none;
2137
2137
  }.r-task-ul {
2138
2138
  list-style: none;
2139
2139
  }.r-tooltip {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "robindoc",
3
- "version": "0.0.0-experimental-a9513fc",
3
+ "version": "0.0.0-experimental-6035c0e",
4
4
  "description": "Robindoc is a framework for automatically creating documentation websites based on markdown files, built on React.js Server Components",
5
5
  "main": "./lib/index.js",
6
6
  "scripts": {