rspress-plugin-api-extractor 0.1.2 → 0.2.0

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 (109) hide show
  1. package/README.md +2 -2
  2. package/api-extracted-package.js +426 -0
  3. package/build-program.js +120 -0
  4. package/build-stages.js +664 -0
  5. package/category-resolver.js +50 -0
  6. package/code-post-processor.js +38 -0
  7. package/config-helpers.js +106 -0
  8. package/config-utils.js +258 -0
  9. package/content-hash.js +79 -0
  10. package/errors.js +29 -0
  11. package/formatter.js +69 -0
  12. package/hide-cut-transformer.js +96 -0
  13. package/index.d.ts +901 -831
  14. package/index.js +4 -6128
  15. package/layers/ConfigServiceLive.js +377 -0
  16. package/layers/ObservabilityLive.js +136 -0
  17. package/layers/PathDerivationServiceLive.js +16 -0
  18. package/layers/SnapshotServiceLive.js +94 -0
  19. package/layers/TypeRegistryServiceLive.js +46 -0
  20. package/llms-processing.js +270 -0
  21. package/llms-program.js +262 -0
  22. package/loader.js +186 -0
  23. package/markdown/cross-linker.js +156 -0
  24. package/markdown/helpers.js +364 -0
  25. package/markdown/index.js +11 -0
  26. package/markdown/page-generators/class-page.js +357 -0
  27. package/markdown/page-generators/enum-page.js +152 -0
  28. package/markdown/page-generators/function-page.js +127 -0
  29. package/markdown/page-generators/index-pages.js +27 -0
  30. package/markdown/page-generators/interface-page.js +307 -0
  31. package/markdown/page-generators/namespace-page.js +280 -0
  32. package/markdown/page-generators/type-alias-page.js +110 -0
  33. package/markdown/page-generators/variable-page.js +110 -0
  34. package/markdown/shiki-utils.js +48 -0
  35. package/migrations/001_create_snapshots.js +25 -0
  36. package/model-loader.js +95 -0
  37. package/multi-entry-resolver.js +70 -0
  38. package/og-resolver.js +271 -0
  39. package/package.json +63 -73
  40. package/path-derivation.js +48 -0
  41. package/plugin.js +218 -0
  42. package/prettier-formatter.js +73 -0
  43. package/public/tsconfig/rspress.json +44 -0
  44. package/remark-api-codeblocks.js +130 -0
  45. package/remark-with-api.js +172 -0
  46. package/route-collisions.js +52 -0
  47. package/runtime/components/ApiExample/index.js +29 -25
  48. package/runtime/components/ApiLlmsPackageActions/index.js +252 -323
  49. package/runtime/components/ApiLlmsViewOptions/index.js +269 -340
  50. package/runtime/components/ApiMember/index.js +49 -47
  51. package/runtime/components/ApiSignature/index.js +32 -28
  52. package/runtime/components/EnumMembersTable/{index_module.css → index.css} +18 -19
  53. package/runtime/components/EnumMembersTable/index.js +36 -67
  54. package/runtime/components/EnumMembersTable/index.module.js +9 -6
  55. package/runtime/components/ExampleBlock/{index_module.css → index.css} +2 -3
  56. package/runtime/components/ExampleBlock/index.js +23 -28
  57. package/runtime/components/ExampleBlock/index.module.js +8 -5
  58. package/runtime/components/MarkdownContent/index.js +26 -18
  59. package/runtime/components/MarkdownText/index.js +28 -22
  60. package/runtime/components/MemberSignature/{index_module.css → index.css} +5 -6
  61. package/runtime/components/MemberSignature/index.js +46 -46
  62. package/runtime/components/MemberSignature/index.module.js +9 -6
  63. package/runtime/components/ParametersTable/{index_module.css → index.css} +19 -20
  64. package/runtime/components/ParametersTable/index.js +36 -67
  65. package/runtime/components/ParametersTable/index.module.js +9 -6
  66. package/runtime/components/SignatureBlock/{index_module.css → index.css} +5 -6
  67. package/runtime/components/SignatureBlock/index.js +30 -29
  68. package/runtime/components/SignatureBlock/index.module.js +9 -6
  69. package/runtime/components/SignatureCode/{index_module.css → index.css} +9 -10
  70. package/runtime/components/SignatureCode/index.js +40 -32
  71. package/runtime/components/SignatureCode/index.module.js +9 -6
  72. package/runtime/components/SignatureToolbar/{index_module.css → index.css} +18 -20
  73. package/runtime/components/SignatureToolbar/index.js +48 -51
  74. package/runtime/components/SignatureToolbar/index.module.js +13 -10
  75. package/runtime/components/buttons/ButtonGroup.js +13 -6
  76. package/runtime/components/buttons/CopyCodeButton.js +40 -38
  77. package/runtime/components/buttons/WrapSignatureButton.js +20 -16
  78. package/runtime/components/buttons/{index_module.css → index.css} +5 -6
  79. package/runtime/components/buttons/index.module.js +8 -5
  80. package/runtime/components/icons/CheckIcon/index.js +20 -17
  81. package/runtime/components/icons/CopyIcon/index.js +20 -17
  82. package/runtime/components/icons/UnwrapIcon/index.js +22 -18
  83. package/runtime/components/icons/WrapIcon/index.js +20 -17
  84. package/runtime/components/shared/_twoslash.css +3 -10
  85. package/runtime/components/shared/variables.css +0 -3
  86. package/runtime/hooks/useWrapToggle.js +32 -9
  87. package/runtime/index.d.ts +513 -173
  88. package/runtime/index.js +11 -9
  89. package/runtime/utils/decode-hast.js +31 -16
  90. package/runtime/utils/hast-renderer.js +21 -7
  91. package/schemas/config.js +199 -0
  92. package/schemas/index.js +5 -0
  93. package/schemas/opengraph.js +26 -0
  94. package/schemas/performance.js +19 -0
  95. package/serve.js +133 -0
  96. package/services/ConfigService.js +7 -0
  97. package/services/PathDerivationService.js +7 -0
  98. package/services/SnapshotService.js +7 -0
  99. package/services/TypeRegistryService.js +7 -0
  100. package/shiki-transformer.js +758 -0
  101. package/tsconfig-parser.js +127 -0
  102. package/tsdoc-metadata.json +11 -11
  103. package/twoslash-patterns.js +87 -0
  104. package/twoslash-transformer.js +316 -0
  105. package/type-reference-extractor.js +201 -0
  106. package/typescript-config.js +168 -0
  107. package/vfs-registry.js +121 -0
  108. package/0~llms-program.js +0 -344
  109. package/runtime/components/ApiLlmsPackageActions/index.module.js +0 -2
@@ -1,51 +1,53 @@
1
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
- import { createElement, useMemo } from "react";
3
1
  import { decodeHast } from "../../utils/decode-hast.js";
4
2
  import { MemberSignature } from "../MemberSignature/index.js";
3
+ import { createElement, useMemo } from "react";
4
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
+
6
+ //#region src/runtime/components/ApiMember/index.tsx
7
+ /**
8
+ * Renders an individual class/interface member signature block.
9
+ *
10
+ * Replaces MemberSignatureWrapper with a simpler component that takes plain
11
+ * string props. The `code` prop contains only the member signature (not
12
+ * wrapped in a class skeleton), and `summary` is plain markdown-compatible
13
+ * text (not HTML with anchor tags, not base64-encoded).
14
+ *
15
+ * In SSG-MD mode, renders a heading with member name, summary text,
16
+ * and a plain code block with the member signature.
17
+ */
5
18
  function ApiMember({ code, memberName, summary, id, hast, hasParameters }) {
6
- const parsedHast = useMemo(()=>decodeHast(hast, "ApiMember"), [
7
- hast
8
- ]);
9
- const hasParamsBoolean = "string" == typeof hasParameters ? "true" === hasParameters : !!hasParameters;
10
- if (import.meta.env.SSG_MD) {
11
- const header = "```typescript\n";
12
- const footer = "\n```\n";
13
- return /*#__PURE__*/ jsxs(Fragment, {
14
- children: [
15
- `### ${memberName}\n\n`,
16
- summary && `${summary}\n\n`,
17
- `${header}${code.trim()}${footer}`
18
- ]
19
- });
20
- }
21
- if (parsedHast) {
22
- const memberProps = {
23
- hast: parsedHast,
24
- memberName,
25
- hasParameters: hasParamsBoolean
26
- };
27
- if (null != summary) memberProps.summary = summary;
28
- if (null != id) memberProps.id = id;
29
- return /*#__PURE__*/ createElement(MemberSignature, memberProps);
30
- }
31
- return /*#__PURE__*/ jsxs("div", {
32
- children: [
33
- /*#__PURE__*/ jsx("h3", {
34
- id: id,
35
- children: memberName
36
- }),
37
- summary && /*#__PURE__*/ jsx("p", {
38
- children: summary
39
- }),
40
- /*#__PURE__*/ jsx("pre", {
41
- children: /*#__PURE__*/ jsx("code", {
42
- className: "language-typescript",
43
- children: code.trim()
44
- })
45
- })
46
- ]
47
- });
19
+ const parsedHast = useMemo(() => decodeHast(hast, "ApiMember"), [hast]);
20
+ const hasParamsBoolean = typeof hasParameters === "string" ? hasParameters === "true" : !!hasParameters;
21
+ if (import.meta.env.SSG_MD) return /* @__PURE__ */ jsxs(Fragment, { children: [
22
+ `### ${memberName}\n\n`,
23
+ summary && `${summary}\n\n`,
24
+ `\`\`\`typescript
25
+ ${code.trim()}
26
+ \`\`\`
27
+ `
28
+ ] });
29
+ if (parsedHast) {
30
+ const memberProps = {
31
+ hast: parsedHast,
32
+ memberName,
33
+ hasParameters: hasParamsBoolean
34
+ };
35
+ if (summary != null) memberProps.summary = summary;
36
+ if (id != null) memberProps.id = id;
37
+ return createElement(MemberSignature, memberProps);
38
+ }
39
+ return /* @__PURE__ */ jsxs("div", { children: [
40
+ /* @__PURE__ */ jsx("h3", {
41
+ id,
42
+ children: memberName
43
+ }),
44
+ summary && /* @__PURE__ */ jsx("p", { children: summary }),
45
+ /* @__PURE__ */ jsx("pre", { children: /* @__PURE__ */ jsx("code", {
46
+ className: "language-typescript",
47
+ children: code.trim()
48
+ }) })
49
+ ] });
48
50
  }
49
- const components_ApiMember = ApiMember;
50
- export default components_ApiMember;
51
- export { ApiMember };
51
+
52
+ //#endregion
53
+ export { ApiMember, ApiMember as default };
@@ -1,32 +1,36 @@
1
- import { Fragment, jsx } from "react/jsx-runtime";
2
- import { createElement, useMemo } from "react";
3
1
  import { decodeHast } from "../../utils/decode-hast.js";
4
2
  import { SignatureBlock } from "../SignatureBlock/index.js";
3
+ import { createElement, useMemo } from "react";
4
+ import { Fragment, jsx } from "react/jsx-runtime";
5
+
6
+ //#region src/runtime/components/ApiSignature/index.tsx
7
+ /**
8
+ * Renders a full API type signature block.
9
+ *
10
+ * Replaces SignatureBlockWrapper with a simpler component that takes plain
11
+ * string props (no base64 encoding for code). Produces clean semantic HTML
12
+ * that RSPress converts to LLM-readable markdown in SSG-MD mode, and renders
13
+ * interactive Shiki-highlighted code in browser mode.
14
+ *
15
+ * In SSG-MD mode, renders a "Signature" heading followed by a plain
16
+ * code block with the type signature.
17
+ */
5
18
  function ApiSignature({ code, heading: _heading = "Signature", id: _id = "signature", hast, hasParameters, hasMembers }) {
6
- const parsedHast = useMemo(()=>decodeHast(hast, "ApiSignature"), [
7
- hast
8
- ]);
9
- const hasParamsBoolean = "string" == typeof hasParameters ? "true" === hasParameters : !!hasParameters;
10
- const hasMembersBoolean = "string" == typeof hasMembers ? "true" === hasMembers : !!hasMembers;
11
- const hasTableBelow = hasParamsBoolean || hasMembersBoolean;
12
- if (import.meta.env.SSG_MD) {
13
- const header = "```typescript\n";
14
- const footer = "\n```\n";
15
- return /*#__PURE__*/ jsx(Fragment, {
16
- children: `${header}${code.trim()}${footer}`
17
- });
18
- }
19
- if (parsedHast) return /*#__PURE__*/ createElement(SignatureBlock, {
20
- hast: parsedHast,
21
- hasParameters: hasTableBelow
22
- });
23
- return /*#__PURE__*/ jsx("pre", {
24
- children: /*#__PURE__*/ jsx("code", {
25
- className: "language-typescript",
26
- children: code.trim()
27
- })
28
- });
19
+ const parsedHast = useMemo(() => decodeHast(hast, "ApiSignature"), [hast]);
20
+ const hasTableBelow = (typeof hasParameters === "string" ? hasParameters === "true" : !!hasParameters) || (typeof hasMembers === "string" ? hasMembers === "true" : !!hasMembers);
21
+ if (import.meta.env.SSG_MD) return /* @__PURE__ */ jsx(Fragment, { children: `\`\`\`typescript
22
+ ${code.trim()}
23
+ \`\`\`
24
+ ` });
25
+ if (parsedHast) return createElement(SignatureBlock, {
26
+ hast: parsedHast,
27
+ hasParameters: hasTableBelow
28
+ });
29
+ return /* @__PURE__ */ jsx("pre", { children: /* @__PURE__ */ jsx("code", {
30
+ className: "language-typescript",
31
+ children: code.trim()
32
+ }) });
29
33
  }
30
- const components_ApiSignature = ApiSignature;
31
- export default components_ApiSignature;
32
- export { ApiSignature };
34
+
35
+ //#endregion
36
+ export { ApiSignature, ApiSignature as default };
@@ -1,4 +1,4 @@
1
- .table-vZ4IFZ {
1
+ .WkJdOG_table {
2
2
  border: 1px solid var(--api-color-border);
3
3
  border-radius: 0 0 var(--api-border-radius) var(--api-border-radius);
4
4
  border-top: none;
@@ -7,16 +7,16 @@
7
7
  overflow: hidden;
8
8
  }
9
9
 
10
- html.rp-dark-Xp3cTC .table-vZ4IFZ {
10
+ html.WkJdOG_rp-dark .WkJdOG_table {
11
11
  border-color: var(--api-color-border);
12
12
  }
13
13
 
14
- .scroll-NvHud6 {
14
+ .WkJdOG_scroll {
15
15
  -webkit-overflow-scrolling: touch;
16
16
  overflow-x: auto;
17
17
  }
18
18
 
19
- .table-vZ4IFZ table {
19
+ .WkJdOG_table table {
20
20
  border-collapse: collapse;
21
21
  width: 100%;
22
22
  font-size: var(--api-font-size-base);
@@ -25,12 +25,12 @@ html.rp-dark-Xp3cTC .table-vZ4IFZ {
25
25
  margin: 0;
26
26
  }
27
27
 
28
- .table-vZ4IFZ thead {
28
+ .WkJdOG_table thead {
29
29
  background-color: var(--api-color-bg);
30
30
  border-bottom: 1px solid var(--api-color-border);
31
31
  }
32
32
 
33
- .table-vZ4IFZ th {
33
+ .WkJdOG_table th {
34
34
  padding: var(--api-spacing-md) var(--api-spacing-lg);
35
35
  text-align: left;
36
36
  color: var(--api-color-text);
@@ -38,63 +38,62 @@ html.rp-dark-Xp3cTC .table-vZ4IFZ {
38
38
  font-weight: 600;
39
39
  }
40
40
 
41
- .table-vZ4IFZ th:first-child {
41
+ .WkJdOG_table th:first-child {
42
42
  width: 20%;
43
43
  min-width: 120px;
44
44
  }
45
45
 
46
- .table-vZ4IFZ th:nth-child(2) {
46
+ .WkJdOG_table th:nth-child(2) {
47
47
  width: 25%;
48
48
  min-width: 120px;
49
49
  }
50
50
 
51
- .table-vZ4IFZ th:last-child {
51
+ .WkJdOG_table th:last-child {
52
52
  width: 55%;
53
53
  }
54
54
 
55
- .table-vZ4IFZ td {
55
+ .WkJdOG_table td {
56
56
  padding: var(--api-spacing-md) var(--api-spacing-lg);
57
57
  border-top: 1px solid var(--api-color-border);
58
58
  vertical-align: top;
59
59
  }
60
60
 
61
- .table-vZ4IFZ td:first-child {
61
+ .WkJdOG_table td:first-child {
62
62
  width: 20%;
63
63
  min-width: 120px;
64
64
  }
65
65
 
66
- .table-vZ4IFZ td:nth-child(2) {
66
+ .WkJdOG_table td:nth-child(2) {
67
67
  width: 25%;
68
68
  min-width: 120px;
69
69
  }
70
70
 
71
- .table-vZ4IFZ td:last-child {
71
+ .WkJdOG_table td:last-child {
72
72
  width: 55%;
73
73
  }
74
74
 
75
- .table-vZ4IFZ td code, .table-vZ4IFZ th code {
75
+ .WkJdOG_table td code, .WkJdOG_table th code {
76
76
  font-size: var(--api-font-size-sm);
77
77
  background-color: var(--api-color-code-bg);
78
78
  border-radius: var(--api-border-radius-sm);
79
79
  padding: .125rem .375rem;
80
80
  }
81
81
 
82
- .table-vZ4IFZ td:last-child p:first-child {
82
+ .WkJdOG_table td:last-child p:first-child {
83
83
  margin-top: 0;
84
84
  }
85
85
 
86
- .table-vZ4IFZ td:last-child p:last-child, .table-vZ4IFZ td:last-child ul:last-child, .table-vZ4IFZ td:last-child ol:last-child {
86
+ .WkJdOG_table td:last-child p:last-child, .WkJdOG_table td:last-child ul:last-child, .WkJdOG_table td:last-child ol:last-child {
87
87
  margin-bottom: 0;
88
88
  }
89
89
 
90
90
  @media (width <= 768px) {
91
- .table-vZ4IFZ td, .table-vZ4IFZ th {
91
+ .WkJdOG_table td, .WkJdOG_table th {
92
92
  padding: var(--api-spacing-sm) var(--api-spacing-md);
93
93
  font-size: var(--api-font-size-sm);
94
94
  }
95
95
 
96
- .table-vZ4IFZ td:first-child, .table-vZ4IFZ th:first-child, .table-vZ4IFZ td:nth-child(2), .table-vZ4IFZ th:nth-child(2) {
96
+ .WkJdOG_table td:first-child, .WkJdOG_table th:first-child, .WkJdOG_table td:nth-child(2), .WkJdOG_table th:nth-child(2) {
97
97
  min-width: 100px;
98
98
  }
99
99
  }
100
-
@@ -1,69 +1,38 @@
1
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
1
  import { MarkdownContent } from "../MarkdownContent/index.js";
3
- import index_module from "./index.module.js";
4
- const EnumMembersTable = ({ members })=>{
5
- if (!members || 0 === members.length) return null;
6
- if (import.meta.env.SSG_MD) {
7
- let markdown = "#### Members\n\n";
8
- markdown += "| Member | Value | Description |\n";
9
- markdown += "|--------|-------|-------------|\n";
10
- for (const member of members){
11
- const name = `\`${member.name}\``;
12
- const value = member.value ? `\`${member.value}\`` : "";
13
- const description = member.description.replace(/<[^>]*>/g, "").trim();
14
- markdown += `| ${name} | ${value} | ${description} |\n`;
15
- }
16
- return /*#__PURE__*/ jsx(Fragment, {
17
- children: markdown
18
- });
19
- }
20
- return /*#__PURE__*/ jsx("div", {
21
- className: index_module.table,
22
- children: /*#__PURE__*/ jsx("div", {
23
- className: index_module.scroll,
24
- children: /*#__PURE__*/ jsxs("table", {
25
- children: [
26
- /*#__PURE__*/ jsx("thead", {
27
- children: /*#__PURE__*/ jsxs("tr", {
28
- children: [
29
- /*#__PURE__*/ jsx("th", {
30
- children: "Member"
31
- }),
32
- /*#__PURE__*/ jsx("th", {
33
- children: "Value"
34
- }),
35
- /*#__PURE__*/ jsx("th", {
36
- children: "Description"
37
- })
38
- ]
39
- })
40
- }),
41
- /*#__PURE__*/ jsx("tbody", {
42
- children: members.map((member)=>/*#__PURE__*/ jsxs("tr", {
43
- children: [
44
- /*#__PURE__*/ jsx("td", {
45
- children: /*#__PURE__*/ jsx("code", {
46
- children: member.name
47
- })
48
- }),
49
- /*#__PURE__*/ jsx("td", {
50
- children: member.value && /*#__PURE__*/ jsx("code", {
51
- children: member.value
52
- })
53
- }),
54
- /*#__PURE__*/ jsx("td", {
55
- children: /*#__PURE__*/ jsx(MarkdownContent, {
56
- children: member.description
57
- })
58
- })
59
- ]
60
- }, member.name))
61
- })
62
- ]
63
- })
64
- })
65
- });
2
+ import index_module_default from "./index.module.js";
3
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
+
5
+ //#region src/runtime/components/EnumMembersTable/index.tsx
6
+ const EnumMembersTable = ({ members }) => {
7
+ if (!members || members.length === 0) return null;
8
+ if (import.meta.env.SSG_MD) {
9
+ let markdown = "#### Members\n\n";
10
+ markdown += "| Member | Value | Description |\n";
11
+ markdown += "|--------|-------|-------------|\n";
12
+ for (const member of members) {
13
+ const name = `\`${member.name}\``;
14
+ const value = member.value ? `\`${member.value}\`` : "";
15
+ const description = member.description.replace(/<[^>]*>/g, "").trim();
16
+ markdown += `| ${name} | ${value} | ${description} |\n`;
17
+ }
18
+ return /* @__PURE__ */ jsx(Fragment, { children: markdown });
19
+ }
20
+ return /* @__PURE__ */ jsx("div", {
21
+ className: index_module_default.table,
22
+ children: /* @__PURE__ */ jsx("div", {
23
+ className: index_module_default.scroll,
24
+ children: /* @__PURE__ */ jsxs("table", { children: [/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
25
+ /* @__PURE__ */ jsx("th", { children: "Member" }),
26
+ /* @__PURE__ */ jsx("th", { children: "Value" }),
27
+ /* @__PURE__ */ jsx("th", { children: "Description" })
28
+ ] }) }), /* @__PURE__ */ jsx("tbody", { children: members.map((member) => /* @__PURE__ */ jsxs("tr", { children: [
29
+ /* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsx("code", { children: member.name }) }),
30
+ /* @__PURE__ */ jsx("td", { children: member.value && /* @__PURE__ */ jsx("code", { children: member.value }) }),
31
+ /* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsx(MarkdownContent, { children: member.description }) })
32
+ ] }, member.name)) })] })
33
+ })
34
+ });
66
35
  };
67
- const components_EnumMembersTable = EnumMembersTable;
68
- export default components_EnumMembersTable;
69
- export { EnumMembersTable };
36
+
37
+ //#endregion
38
+ export { EnumMembersTable, EnumMembersTable as default };
@@ -1,7 +1,10 @@
1
- import "./index_module.css";
2
- const index_module = {
3
- table: "table-vZ4IFZ",
4
- rpDark: "rp-dark-Xp3cTC",
5
- scroll: "scroll-NvHud6"
1
+ import './index.css';
2
+ //#region src/runtime/components/EnumMembersTable/index.module.css
3
+ var index_module_default = {
4
+ "rpDark": "WkJdOG_rp-dark",
5
+ "scroll": "WkJdOG_scroll",
6
+ "table": "WkJdOG_table"
6
7
  };
7
- export default index_module;
8
+
9
+ //#endregion
10
+ export { index_module_default as default };
@@ -1,4 +1,4 @@
1
- .block-g6Xu1V {
1
+ .PkJPlW_block {
2
2
  margin: var(--api-spacing-xl) 0;
3
3
  border-radius: var(--api-border-radius);
4
4
  border: 1px solid var(--api-color-border);
@@ -6,7 +6,6 @@
6
6
  overflow: visible;
7
7
  }
8
8
 
9
- html.rp-dark-q3G77C .block-g6Xu1V {
9
+ html.PkJPlW_rp-dark .PkJPlW_block {
10
10
  border-color: var(--api-color-border);
11
11
  }
12
-
@@ -1,36 +1,31 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
1
  import { useWrapToggle } from "../../hooks/useWrapToggle.js";
3
2
  import { ButtonGroup } from "../buttons/ButtonGroup.js";
4
3
  import { CopyCodeButton } from "../buttons/CopyCodeButton.js";
5
4
  import { WrapSignatureButton } from "../buttons/WrapSignatureButton.js";
6
5
  import { SignatureCode } from "../SignatureCode/index.js";
7
6
  import { SignatureToolbar } from "../SignatureToolbar/index.js";
8
- import index_module from "./index.module.js";
7
+ import index_module_default from "./index.module.js";
8
+ import { jsx, jsxs } from "react/jsx-runtime";
9
+
10
+ //#region src/runtime/components/ExampleBlock/index.tsx
11
+ /**
12
+ * Code block for examples - displays syntax-highlighted code without a heading
13
+ * Similar to SignatureBlock but without the "Signature" header
14
+ * Includes both copy and wrap buttons in the toolbar
15
+ */
9
16
  function ExampleBlock({ hast, code }) {
10
- const { wrapped, toggleWrap } = useWrapToggle();
11
- return /*#__PURE__*/ jsxs("div", {
12
- className: index_module.block,
13
- children: [
14
- /*#__PURE__*/ jsx(SignatureToolbar, {
15
- buttons: /*#__PURE__*/ jsxs(ButtonGroup, {
16
- children: [
17
- code && /*#__PURE__*/ jsx(CopyCodeButton, {
18
- code: code
19
- }),
20
- /*#__PURE__*/ jsx(WrapSignatureButton, {
21
- wrapped: wrapped,
22
- onToggle: toggleWrap
23
- })
24
- ]
25
- })
26
- }),
27
- /*#__PURE__*/ jsx(SignatureCode, {
28
- hast: hast,
29
- wrapped: wrapped
30
- })
31
- ]
32
- });
17
+ const { wrapped, toggleWrap } = useWrapToggle();
18
+ return /* @__PURE__ */ jsxs("div", {
19
+ className: index_module_default.block,
20
+ children: [/* @__PURE__ */ jsx(SignatureToolbar, { buttons: /* @__PURE__ */ jsxs(ButtonGroup, { children: [code && /* @__PURE__ */ jsx(CopyCodeButton, { code }), /* @__PURE__ */ jsx(WrapSignatureButton, {
21
+ wrapped,
22
+ onToggle: toggleWrap
23
+ })] }) }), /* @__PURE__ */ jsx(SignatureCode, {
24
+ hast,
25
+ wrapped
26
+ })]
27
+ });
33
28
  }
34
- const components_ExampleBlock = ExampleBlock;
35
- export default components_ExampleBlock;
36
- export { ExampleBlock };
29
+
30
+ //#endregion
31
+ export { ExampleBlock, ExampleBlock as default };
@@ -1,6 +1,9 @@
1
- import "./index_module.css";
2
- const index_module = {
3
- block: "block-g6Xu1V",
4
- rpDark: "rp-dark-q3G77C"
1
+ import './index.css';
2
+ //#region src/runtime/components/ExampleBlock/index.module.css
3
+ var index_module_default = {
4
+ "block": "PkJPlW_block",
5
+ "rpDark": "PkJPlW_rp-dark"
5
6
  };
6
- export default index_module;
7
+
8
+ //#endregion
9
+ export { index_module_default as default };
@@ -1,23 +1,31 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import react_markdown from "react-markdown";
2
+ import Markdown from "react-markdown";
3
+
4
+ //#region src/runtime/components/MarkdownContent/index.tsx
5
+ /**
6
+ * Custom link component that adds the rp-link class for RSPress styling
7
+ * Filters out extra props passed by react-markdown (like `node`)
8
+ */
3
9
  function Link({ children, href, title, target, rel }) {
4
- return /*#__PURE__*/ jsx("a", {
5
- className: "rp-link",
6
- href: href,
7
- title: title,
8
- target: target,
9
- rel: rel,
10
- children: children
11
- });
10
+ return /* @__PURE__ */ jsx("a", {
11
+ className: "rp-link",
12
+ href,
13
+ title,
14
+ target,
15
+ rel,
16
+ children
17
+ });
12
18
  }
19
+ /**
20
+ * Renders markdown content with RSPress-compatible link styling.
21
+ * Wraps react-markdown and adds the `rp-link` class to all anchor tags.
22
+ */
13
23
  function MarkdownContent({ children }) {
14
- return /*#__PURE__*/ jsx(react_markdown, {
15
- components: {
16
- a: Link
17
- },
18
- children: children
19
- });
24
+ return /* @__PURE__ */ jsx(Markdown, {
25
+ components: { a: Link },
26
+ children
27
+ });
20
28
  }
21
- const components_MarkdownContent = MarkdownContent;
22
- export default components_MarkdownContent;
23
- export { MarkdownContent };
29
+
30
+ //#endregion
31
+ export { MarkdownContent, MarkdownContent as default };
@@ -1,27 +1,33 @@
1
1
  import { Fragment, jsx } from "react/jsx-runtime";
2
+
3
+ //#region src/runtime/components/MarkdownText/index.tsx
4
+ /**
5
+ * Renders plain text with markdown links as React elements.
6
+ * Only supports basic markdown links: [text](url)
7
+ */
2
8
  function MarkdownText({ children }) {
3
- const parts = parseMarkdownLinks(children);
4
- return /*#__PURE__*/ jsx(Fragment, {
5
- children: parts
6
- });
9
+ return /* @__PURE__ */ jsx(Fragment, { children: parseMarkdownLinks(children) });
7
10
  }
11
+ /**
12
+ * Parse markdown links and return array of React nodes
13
+ */
8
14
  function parseMarkdownLinks(text) {
9
- const linkRegex = /\[([^\]]+)\]\(([^)]+)\)/g;
10
- const parts = [];
11
- let lastIndex = 0;
12
- let key = 0;
13
- for (const match of text.matchAll(linkRegex)){
14
- if (void 0 !== match.index && match.index > lastIndex) parts.push(text.slice(lastIndex, match.index));
15
- const [fullMatch, linkText, url] = match;
16
- parts.push(/*#__PURE__*/ jsx("a", {
17
- href: url,
18
- children: linkText
19
- }, key++));
20
- lastIndex = (match.index ?? 0) + fullMatch.length;
21
- }
22
- if (lastIndex < text.length) parts.push(text.slice(lastIndex));
23
- return parts;
15
+ const linkRegex = /\[([^\]]+)\]\(([^)]+)\)/g;
16
+ const parts = [];
17
+ let lastIndex = 0;
18
+ let key = 0;
19
+ for (const match of text.matchAll(linkRegex)) {
20
+ if (match.index !== void 0 && match.index > lastIndex) parts.push(text.slice(lastIndex, match.index));
21
+ const [fullMatch, linkText, url] = match;
22
+ parts.push(/* @__PURE__ */ jsx("a", {
23
+ href: url,
24
+ children: linkText
25
+ }, key++));
26
+ lastIndex = (match.index ?? 0) + fullMatch.length;
27
+ }
28
+ if (lastIndex < text.length) parts.push(text.slice(lastIndex));
29
+ return parts;
24
30
  }
25
- const components_MarkdownText = MarkdownText;
26
- export default components_MarkdownText;
27
- export { MarkdownText };
31
+
32
+ //#endregion
33
+ export { MarkdownText, MarkdownText as default };
@@ -1,4 +1,4 @@
1
- .block-Qq5hxM {
1
+ .gRiZQa_block {
2
2
  margin: var(--api-spacing-xl) 0;
3
3
  border-radius: var(--api-border-radius);
4
4
  border: 1px solid var(--api-color-border);
@@ -6,22 +6,21 @@
6
6
  overflow: visible;
7
7
  }
8
8
 
9
- html.rp-dark-TylSkU .block-Qq5hxM {
9
+ html.gRiZQa_rp-dark .gRiZQa_block {
10
10
  border-color: var(--api-color-border);
11
11
  }
12
12
 
13
- .hasParameters-u13UWy {
13
+ .gRiZQa_hasParameters {
14
14
  border-bottom-right-radius: 0;
15
15
  border-bottom-left-radius: 0;
16
16
  margin-bottom: 0;
17
17
  }
18
18
 
19
- .hasParameters-u13UWy .api-signature-code {
19
+ .gRiZQa_hasParameters .api-signature-code {
20
20
  border-bottom-right-radius: 0;
21
21
  border-bottom-left-radius: 0;
22
22
  }
23
23
 
24
- .hasParameters-u13UWy .api-signature-code pre {
24
+ .gRiZQa_hasParameters .api-signature-code pre {
25
25
  border-radius: 0;
26
26
  }
27
-