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,54 +1,54 @@
1
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
- import clsx from "clsx";
3
1
  import { useWrapToggle } from "../../hooks/useWrapToggle.js";
4
2
  import { WrapSignatureButton } from "../buttons/WrapSignatureButton.js";
5
3
  import { SignatureCode } from "../SignatureCode/index.js";
6
4
  import { SignatureToolbar } from "../SignatureToolbar/index.js";
7
- import index_module from "./index.module.js";
5
+ import index_module_default from "./index.module.js";
6
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
+ import clsx from "clsx";
8
+
9
+ //#region src/runtime/components/MemberSignature/index.tsx
10
+ /**
11
+ * Interactive member signature block with h3 header and wrap button
12
+ * Displays syntax-highlighted TypeScript member signatures with hover tooltips
13
+ */
8
14
  function MemberSignature({ hast, memberName, id, summary, hasParameters = false }) {
9
- const { wrapped, toggleWrap } = useWrapToggle();
10
- if (import.meta.env.SSG_MD) {
11
- let signature = "";
12
- if (hast) signature = extractTextFromHast(hast);
13
- const lines = signature.split("\n").filter((line)=>line.trim());
14
- if (lines.length >= 2) signature = lines[1].trim();
15
- let markdown = `### ${memberName}\n\n**Signature:** \`${signature}\``;
16
- if (summary) markdown += `\n\n${summary}`;
17
- return /*#__PURE__*/ jsx(Fragment, {
18
- children: markdown
19
- });
20
- }
21
- return /*#__PURE__*/ jsxs("div", {
22
- className: clsx(index_module.block, hasParameters && index_module.hasParameters),
23
- children: [
24
- /*#__PURE__*/ jsx(SignatureToolbar, {
25
- heading: {
26
- text: memberName,
27
- ...null != id ? {
28
- id
29
- } : {},
30
- level: "h3"
31
- },
32
- ...null != summary ? {
33
- summary
34
- } : {},
35
- buttons: /*#__PURE__*/ jsx(WrapSignatureButton, {
36
- wrapped: wrapped,
37
- onToggle: toggleWrap
38
- })
39
- }),
40
- /*#__PURE__*/ jsx(SignatureCode, {
41
- hast: hast,
42
- wrapped: wrapped
43
- })
44
- ]
45
- });
15
+ const { wrapped, toggleWrap } = useWrapToggle();
16
+ if (import.meta.env.SSG_MD) {
17
+ let signature = "";
18
+ if (hast) signature = extractTextFromHast(hast);
19
+ const lines = signature.split("\n").filter((line) => line.trim());
20
+ if (lines.length >= 2) signature = lines[1].trim();
21
+ let markdown = `### ${memberName}\n\n**Signature:** \`${signature}\``;
22
+ if (summary) markdown += `\n\n${summary}`;
23
+ return /* @__PURE__ */ jsx(Fragment, { children: markdown });
24
+ }
25
+ return /* @__PURE__ */ jsxs("div", {
26
+ className: clsx(index_module_default.block, hasParameters && index_module_default.hasParameters),
27
+ children: [/* @__PURE__ */ jsx(SignatureToolbar, {
28
+ heading: {
29
+ text: memberName,
30
+ ...id != null ? { id } : {},
31
+ level: "h3"
32
+ },
33
+ ...summary != null ? { summary } : {},
34
+ buttons: /* @__PURE__ */ jsx(WrapSignatureButton, {
35
+ wrapped,
36
+ onToggle: toggleWrap
37
+ })
38
+ }), /* @__PURE__ */ jsx(SignatureCode, {
39
+ hast,
40
+ wrapped
41
+ })]
42
+ });
46
43
  }
44
+ /**
45
+ * Extract plain text from a HAST tree
46
+ */
47
47
  function extractTextFromHast(node) {
48
- if ("value" in node && "string" == typeof node.value) return node.value;
49
- if ("children" in node && Array.isArray(node.children)) return node.children.map(extractTextFromHast).join("");
50
- return "";
48
+ if ("value" in node && typeof node.value === "string") return node.value;
49
+ if ("children" in node && Array.isArray(node.children)) return node.children.map(extractTextFromHast).join("");
50
+ return "";
51
51
  }
52
- const components_MemberSignature = MemberSignature;
53
- export default components_MemberSignature;
54
- export { MemberSignature };
52
+
53
+ //#endregion
54
+ export { MemberSignature, MemberSignature as default };
@@ -1,7 +1,10 @@
1
- import "./index_module.css";
2
- const index_module = {
3
- block: "block-Qq5hxM",
4
- rpDark: "rp-dark-TylSkU",
5
- hasParameters: "hasParameters-u13UWy"
1
+ import './index.css';
2
+ //#region src/runtime/components/MemberSignature/index.module.css
3
+ var index_module_default = {
4
+ "block": "gRiZQa_block",
5
+ "hasParameters": "gRiZQa_hasParameters",
6
+ "rpDark": "gRiZQa_rp-dark"
6
7
  };
7
- export default index_module;
8
+
9
+ //#endregion
10
+ export { index_module_default as default };
@@ -1,4 +1,4 @@
1
- .table-wOupSX {
1
+ .NDYkiG_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-MFxhEo .table-wOupSX {
10
+ html.NDYkiG_rp-dark .NDYkiG_table {
11
11
  border-color: var(--api-color-border);
12
12
  }
13
13
 
14
- .scroll-prKOBp {
14
+ .NDYkiG_scroll {
15
15
  -webkit-overflow-scrolling: touch;
16
16
  overflow-x: auto;
17
17
  }
18
18
 
19
- .table-wOupSX table {
19
+ .NDYkiG_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-MFxhEo .table-wOupSX {
25
25
  margin: 0;
26
26
  }
27
27
 
28
- .table-wOupSX thead {
28
+ .NDYkiG_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-wOupSX th {
33
+ .NDYkiG_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,67 +38,66 @@ html.rp-dark-MFxhEo .table-wOupSX {
38
38
  font-weight: 600;
39
39
  }
40
40
 
41
- .table-wOupSX th:first-child {
41
+ .NDYkiG_table th:first-child {
42
42
  width: 20%;
43
43
  min-width: 120px;
44
44
  }
45
45
 
46
- .table-wOupSX th:nth-child(2) {
46
+ .NDYkiG_table th:nth-child(2) {
47
47
  width: 30%;
48
48
  min-width: 150px;
49
49
  }
50
50
 
51
- .table-wOupSX th:last-child {
51
+ .NDYkiG_table th:last-child {
52
52
  width: 50%;
53
53
  }
54
54
 
55
- .table-wOupSX td {
55
+ .NDYkiG_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-wOupSX td:first-child {
61
+ .NDYkiG_table td:first-child {
62
62
  width: 20%;
63
63
  min-width: 120px;
64
64
  }
65
65
 
66
- .table-wOupSX td:nth-child(2) {
66
+ .NDYkiG_table td:nth-child(2) {
67
67
  width: 30%;
68
68
  min-width: 150px;
69
69
  }
70
70
 
71
- .table-wOupSX td:last-child {
71
+ .NDYkiG_table td:last-child {
72
72
  width: 50%;
73
73
  }
74
74
 
75
- .table-wOupSX td code, .table-wOupSX th code {
75
+ .NDYkiG_table td code, .NDYkiG_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-wOupSX td:last-child p:first-child {
82
+ .NDYkiG_table td:last-child p:first-child {
83
83
  margin-top: 0;
84
84
  }
85
85
 
86
- .table-wOupSX td:last-child p:last-child, .table-wOupSX td:last-child ul:last-child, .table-wOupSX td:last-child ol:last-child {
86
+ .NDYkiG_table td:last-child p:last-child, .NDYkiG_table td:last-child ul:last-child, .NDYkiG_table td:last-child ol:last-child {
87
87
  margin-bottom: 0;
88
88
  }
89
89
 
90
90
  @media (width <= 768px) {
91
- .table-wOupSX td, .table-wOupSX th {
91
+ .NDYkiG_table td, .NDYkiG_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-wOupSX td:first-child, .table-wOupSX th:first-child {
96
+ .NDYkiG_table td:first-child, .NDYkiG_table th:first-child {
97
97
  min-width: 100px;
98
98
  }
99
99
 
100
- .table-wOupSX td:nth-child(2), .table-wOupSX th:nth-child(2) {
100
+ .NDYkiG_table td:nth-child(2), .NDYkiG_table th:nth-child(2) {
101
101
  min-width: 120px;
102
102
  }
103
103
  }
104
-
@@ -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 ParametersTable = ({ parameters })=>{
5
- if (!parameters || 0 === parameters.length) return null;
6
- if (import.meta.env.SSG_MD) {
7
- let markdown = "#### Parameters\n\n";
8
- markdown += "| Name | Type | Description |\n";
9
- markdown += "|------|------|-------------|\n";
10
- for (const param of parameters){
11
- const name = `\`${param.name}\``;
12
- const type = param.type ? `\`${param.type}\`` : "";
13
- const description = param.description.replace(/<[^>]*>/g, "").trim();
14
- markdown += `| ${name} | ${type} | ${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: "Parameter"
31
- }),
32
- /*#__PURE__*/ jsx("th", {
33
- children: "Type"
34
- }),
35
- /*#__PURE__*/ jsx("th", {
36
- children: "Description"
37
- })
38
- ]
39
- })
40
- }),
41
- /*#__PURE__*/ jsx("tbody", {
42
- children: parameters.map((param)=>/*#__PURE__*/ jsxs("tr", {
43
- children: [
44
- /*#__PURE__*/ jsx("td", {
45
- children: /*#__PURE__*/ jsx("code", {
46
- children: param.name
47
- })
48
- }),
49
- /*#__PURE__*/ jsx("td", {
50
- children: param.type && /*#__PURE__*/ jsx("code", {
51
- children: param.type
52
- })
53
- }),
54
- /*#__PURE__*/ jsx("td", {
55
- children: /*#__PURE__*/ jsx(MarkdownContent, {
56
- children: param.description
57
- })
58
- })
59
- ]
60
- }, param.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/ParametersTable/index.tsx
6
+ const ParametersTable = ({ parameters }) => {
7
+ if (!parameters || parameters.length === 0) return null;
8
+ if (import.meta.env.SSG_MD) {
9
+ let markdown = "#### Parameters\n\n";
10
+ markdown += "| Name | Type | Description |\n";
11
+ markdown += "|------|------|-------------|\n";
12
+ for (const param of parameters) {
13
+ const name = `\`${param.name}\``;
14
+ const type = param.type ? `\`${param.type}\`` : "";
15
+ const description = param.description.replace(/<[^>]*>/g, "").trim();
16
+ markdown += `| ${name} | ${type} | ${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: "Parameter" }),
26
+ /* @__PURE__ */ jsx("th", { children: "Type" }),
27
+ /* @__PURE__ */ jsx("th", { children: "Description" })
28
+ ] }) }), /* @__PURE__ */ jsx("tbody", { children: parameters.map((param) => /* @__PURE__ */ jsxs("tr", { children: [
29
+ /* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsx("code", { children: param.name }) }),
30
+ /* @__PURE__ */ jsx("td", { children: param.type && /* @__PURE__ */ jsx("code", { children: param.type }) }),
31
+ /* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsx(MarkdownContent, { children: param.description }) })
32
+ ] }, param.name)) })] })
33
+ })
34
+ });
66
35
  };
67
- const components_ParametersTable = ParametersTable;
68
- export default components_ParametersTable;
69
- export { ParametersTable };
36
+
37
+ //#endregion
38
+ export { ParametersTable, ParametersTable as default };
@@ -1,7 +1,10 @@
1
- import "./index_module.css";
2
- const index_module = {
3
- table: "table-wOupSX",
4
- rpDark: "rp-dark-MFxhEo",
5
- scroll: "scroll-prKOBp"
1
+ import './index.css';
2
+ //#region src/runtime/components/ParametersTable/index.module.css
3
+ var index_module_default = {
4
+ "rpDark": "NDYkiG_rp-dark",
5
+ "scroll": "NDYkiG_scroll",
6
+ "table": "NDYkiG_table"
6
7
  };
7
- export default index_module;
8
+
9
+ //#endregion
10
+ export { index_module_default as default };
@@ -1,4 +1,4 @@
1
- .block-fru9Q7 {
1
+ .L_PAPG_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-Bh4pwS .block-fru9Q7 {
9
+ html.L_PAPG_rp-dark .L_PAPG_block {
10
10
  border-color: var(--api-color-border);
11
11
  }
12
12
 
13
- .hasParameters-UU0nI6 {
13
+ .L_PAPG_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-UU0nI6 .api-signature-code {
19
+ .L_PAPG_hasParameters .api-signature-code {
20
20
  border-bottom-right-radius: 0;
21
21
  border-bottom-left-radius: 0;
22
22
  }
23
23
 
24
- .hasParameters-UU0nI6 .api-signature-code pre {
24
+ .L_PAPG_hasParameters .api-signature-code pre {
25
25
  border-radius: 0;
26
26
  }
27
-
@@ -1,35 +1,36 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import clsx from "clsx";
3
1
  import { useWrapToggle } from "../../hooks/useWrapToggle.js";
4
2
  import { WrapSignatureButton } from "../buttons/WrapSignatureButton.js";
5
3
  import { SignatureCode } from "../SignatureCode/index.js";
6
4
  import { SignatureToolbar } from "../SignatureToolbar/index.js";
7
- import index_module from "./index.module.js";
5
+ import index_module_default from "./index.module.js";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ import clsx from "clsx";
8
+
9
+ //#region src/runtime/components/SignatureBlock/index.tsx
10
+ /**
11
+ * Interactive signature block with wrap button
12
+ * Displays syntax-highlighted TypeScript signatures with hover tooltips
13
+ */
8
14
  function SignatureBlock({ hast, heading = "Signature", id = "signature", hasParameters = false }) {
9
- const { wrapped, toggleWrap } = useWrapToggle();
10
- return /*#__PURE__*/ jsxs("div", {
11
- className: clsx(index_module.block, hasParameters && index_module.hasParameters),
12
- children: [
13
- /*#__PURE__*/ jsx(SignatureToolbar, {
14
- ...heading && id ? {
15
- heading: {
16
- text: heading,
17
- id,
18
- level: "h2"
19
- }
20
- } : {},
21
- buttons: /*#__PURE__*/ jsx(WrapSignatureButton, {
22
- wrapped: wrapped,
23
- onToggle: toggleWrap
24
- })
25
- }),
26
- /*#__PURE__*/ jsx(SignatureCode, {
27
- hast: hast,
28
- wrapped: wrapped
29
- })
30
- ]
31
- });
15
+ const { wrapped, toggleWrap } = useWrapToggle();
16
+ return /* @__PURE__ */ jsxs("div", {
17
+ className: clsx(index_module_default.block, hasParameters && index_module_default.hasParameters),
18
+ children: [/* @__PURE__ */ jsx(SignatureToolbar, {
19
+ ...heading && id ? { heading: {
20
+ text: heading,
21
+ id,
22
+ level: "h2"
23
+ } } : {},
24
+ buttons: /* @__PURE__ */ jsx(WrapSignatureButton, {
25
+ wrapped,
26
+ onToggle: toggleWrap
27
+ })
28
+ }), /* @__PURE__ */ jsx(SignatureCode, {
29
+ hast,
30
+ wrapped
31
+ })]
32
+ });
32
33
  }
33
- const components_SignatureBlock = SignatureBlock;
34
- export default components_SignatureBlock;
35
- export { SignatureBlock };
34
+
35
+ //#endregion
36
+ export { SignatureBlock, SignatureBlock as default };
@@ -1,7 +1,10 @@
1
- import "./index_module.css";
2
- const index_module = {
3
- block: "block-fru9Q7",
4
- rpDark: "rp-dark-Bh4pwS",
5
- hasParameters: "hasParameters-UU0nI6"
1
+ import './index.css';
2
+ //#region src/runtime/components/SignatureBlock/index.module.css
3
+ var index_module_default = {
4
+ "block": "L_PAPG_block",
5
+ "hasParameters": "L_PAPG_hasParameters",
6
+ "rpDark": "L_PAPG_rp-dark"
6
7
  };
7
- export default index_module;
8
+
9
+ //#endregion
10
+ export { index_module_default as default };
@@ -1,11 +1,11 @@
1
- .code-C94Xw8 {
1
+ .Ze8uHG_code {
2
2
  border-bottom-left-radius: var(--api-border-radius);
3
3
  border-bottom-right-radius: var(--api-border-radius);
4
4
  position: relative;
5
5
  container-type: inline-size;
6
6
  }
7
7
 
8
- .code-C94Xw8 pre {
8
+ .Ze8uHG_code pre {
9
9
  height: auto;
10
10
  max-height: none;
11
11
  padding: var(--api-spacing-lg);
@@ -15,11 +15,11 @@
15
15
  overflow-x: auto;
16
16
  }
17
17
 
18
- html.rp-dark-uV29jl .code-C94Xw8 pre {
18
+ html.Ze8uHG_rp-dark .Ze8uHG_code pre {
19
19
  background-color: var(--shiki-dark-bg);
20
20
  }
21
21
 
22
- .code-C94Xw8 code {
22
+ .Ze8uHG_code code {
23
23
  background-color: unset;
24
24
  min-height: var(--api-font-size-md);
25
25
  line-height: var(--api-line-height-base);
@@ -28,26 +28,25 @@ html.rp-dark-uV29jl .code-C94Xw8 pre {
28
28
  display: flex;
29
29
  }
30
30
 
31
- .code-C94Xw8 code span {
31
+ .Ze8uHG_code code span {
32
32
  color: var(--shiki-light);
33
33
  }
34
34
 
35
- html.rp-dark-uV29jl .code-C94Xw8 code span {
35
+ html.Ze8uHG_rp-dark .Ze8uHG_code code span {
36
36
  color: var(--shiki-dark);
37
37
  }
38
38
 
39
- .code-C94Xw8 .line {
39
+ .Ze8uHG_code .line {
40
40
  background: none;
41
41
  min-height: 1lh;
42
42
  }
43
43
 
44
- .wrapped-CCFVeG pre {
44
+ .Ze8uHG_wrapped pre {
45
45
  white-space: pre-wrap;
46
46
  overflow-wrap: break-word;
47
47
  }
48
48
 
49
- .wrapped-CCFVeG code {
49
+ .Ze8uHG_wrapped code {
50
50
  white-space: pre-wrap;
51
51
  overflow-wrap: break-word;
52
52
  }
53
-
@@ -1,36 +1,44 @@
1
+ import { hastToReact } from "../../utils/hast-renderer.js";
2
+ import index_module_default from "./index.module.js";
3
+ import { useEffect, useRef } from "react";
1
4
  import { jsx } from "react/jsx-runtime";
2
5
  import clsx from "clsx";
3
- import { useEffect, useRef } from "react";
4
- import { hastToReact } from "../../utils/hast-renderer.js";
5
- import index_module from "./index.module.js";
6
+
7
+ //#region src/runtime/components/SignatureCode/index.tsx
8
+ /**
9
+ * Code block for displaying syntax-highlighted signatures
10
+ * Supports wrapped and unwrapped states
11
+ * Uses HAST for safe rendering without dangerouslySetInnerHTML
12
+ */
6
13
  function SignatureCode({ hast, wrapped }) {
7
- const containerRef = useRef(null);
8
- useEffect(()=>{
9
- const container = containerRef.current;
10
- if (!container) return;
11
- const handleMouseOver = (e)=>{
12
- const target = e.target;
13
- const hover = target.closest?.(".twoslash-hover");
14
- if (!hover) return;
15
- const popup = hover.querySelector(".twoslash-popup-container");
16
- if (!popup) return;
17
- const hoverRect = hover.getBoundingClientRect();
18
- const containerWidth = container.getBoundingClientRect().width;
19
- popup.style.setProperty("--popup-top", `${hoverRect.bottom + 4}px`);
20
- popup.style.setProperty("--popup-left", `${hoverRect.left}px`);
21
- popup.style.setProperty("--popup-max-width", `${0.75 * containerWidth}px`);
22
- };
23
- container.addEventListener("mouseover", handleMouseOver);
24
- return ()=>container.removeEventListener("mouseover", handleMouseOver);
25
- }, []);
26
- if (!hast) return /*#__PURE__*/ jsx("div", {
27
- ref: containerRef,
28
- className: clsx(index_module.code, wrapped && index_module.wrapped)
29
- });
30
- return /*#__PURE__*/ jsx("div", {
31
- ref: containerRef,
32
- className: clsx("api-doc-code", index_module.code, wrapped && index_module.wrapped),
33
- children: hastToReact(hast)
34
- });
14
+ const containerRef = useRef(null);
15
+ useEffect(() => {
16
+ const container = containerRef.current;
17
+ if (!container) return;
18
+ const handleMouseOver = (e) => {
19
+ const hover = e.target.closest?.(".twoslash-hover");
20
+ if (!hover) return;
21
+ const popup = hover.querySelector(".twoslash-popup-container");
22
+ if (!popup) return;
23
+ const hoverRect = hover.getBoundingClientRect();
24
+ const containerWidth = container.getBoundingClientRect().width;
25
+ popup.style.setProperty("--popup-top", `${hoverRect.bottom + 4}px`);
26
+ popup.style.setProperty("--popup-left", `${hoverRect.left}px`);
27
+ popup.style.setProperty("--popup-max-width", `${containerWidth * .75}px`);
28
+ };
29
+ container.addEventListener("mouseover", handleMouseOver);
30
+ return () => container.removeEventListener("mouseover", handleMouseOver);
31
+ }, []);
32
+ if (!hast) return /* @__PURE__ */ jsx("div", {
33
+ ref: containerRef,
34
+ className: clsx(index_module_default.code, wrapped && index_module_default.wrapped)
35
+ });
36
+ return /* @__PURE__ */ jsx("div", {
37
+ ref: containerRef,
38
+ className: clsx("api-doc-code", index_module_default.code, wrapped && index_module_default.wrapped),
39
+ children: hastToReact(hast)
40
+ });
35
41
  }
36
- export { SignatureCode };
42
+
43
+ //#endregion
44
+ export { SignatureCode };
@@ -1,7 +1,10 @@
1
- import "./index_module.css";
2
- const index_module = {
3
- code: "code-C94Xw8",
4
- rpDark: "rp-dark-uV29jl",
5
- wrapped: "wrapped-CCFVeG"
1
+ import './index.css';
2
+ //#region src/runtime/components/SignatureCode/index.module.css
3
+ var index_module_default = {
4
+ "code": "Ze8uHG_code",
5
+ "rpDark": "Ze8uHG_rp-dark",
6
+ "wrapped": "Ze8uHG_wrapped"
6
7
  };
7
- export default index_module;
8
+
9
+ //#endregion
10
+ export { index_module_default as default };