rspress-plugin-api-extractor 0.1.1 → 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.
- package/README.md +2 -2
- package/api-extracted-package.js +426 -0
- package/build-program.js +120 -0
- package/build-stages.js +664 -0
- package/category-resolver.js +50 -0
- package/code-post-processor.js +38 -0
- package/config-helpers.js +106 -0
- package/config-utils.js +258 -0
- package/content-hash.js +79 -0
- package/errors.js +29 -0
- package/formatter.js +69 -0
- package/hide-cut-transformer.js +96 -0
- package/index.d.ts +901 -831
- package/index.js +4 -6332
- package/layers/ConfigServiceLive.js +377 -0
- package/layers/ObservabilityLive.js +136 -0
- package/layers/PathDerivationServiceLive.js +16 -0
- package/layers/SnapshotServiceLive.js +94 -0
- package/layers/TypeRegistryServiceLive.js +46 -0
- package/llms-processing.js +270 -0
- package/llms-program.js +262 -0
- package/loader.js +186 -0
- package/markdown/cross-linker.js +156 -0
- package/markdown/helpers.js +364 -0
- package/markdown/index.js +11 -0
- package/markdown/page-generators/class-page.js +357 -0
- package/markdown/page-generators/enum-page.js +152 -0
- package/markdown/page-generators/function-page.js +127 -0
- package/markdown/page-generators/index-pages.js +27 -0
- package/markdown/page-generators/interface-page.js +307 -0
- package/markdown/page-generators/namespace-page.js +280 -0
- package/markdown/page-generators/type-alias-page.js +110 -0
- package/markdown/page-generators/variable-page.js +110 -0
- package/markdown/shiki-utils.js +48 -0
- package/migrations/001_create_snapshots.js +25 -0
- package/model-loader.js +95 -0
- package/multi-entry-resolver.js +70 -0
- package/og-resolver.js +271 -0
- package/package.json +63 -72
- package/path-derivation.js +48 -0
- package/plugin.js +218 -0
- package/prettier-formatter.js +73 -0
- package/public/tsconfig/rspress.json +44 -0
- package/remark-api-codeblocks.js +130 -0
- package/remark-with-api.js +172 -0
- package/route-collisions.js +52 -0
- package/runtime/components/ApiExample/index.js +33 -0
- package/runtime/components/ApiLlmsPackageActions/index.js +277 -0
- package/runtime/components/ApiLlmsViewOptions/index.js +294 -0
- package/runtime/components/ApiMember/index.js +53 -0
- package/runtime/components/ApiSignature/index.js +36 -0
- package/runtime/components/EnumMembersTable/index.css +99 -0
- package/runtime/components/EnumMembersTable/index.js +38 -0
- package/runtime/components/EnumMembersTable/index.module.js +10 -0
- package/runtime/components/ExampleBlock/index.css +11 -0
- package/runtime/components/ExampleBlock/index.js +31 -0
- package/runtime/components/ExampleBlock/index.module.js +9 -0
- package/runtime/components/MarkdownContent/index.js +31 -0
- package/runtime/components/MarkdownText/index.js +33 -0
- package/runtime/components/MemberSignature/index.css +26 -0
- package/runtime/components/MemberSignature/index.js +54 -0
- package/runtime/components/MemberSignature/index.module.js +10 -0
- package/runtime/components/ParametersTable/index.css +103 -0
- package/runtime/components/ParametersTable/index.js +38 -0
- package/runtime/components/ParametersTable/index.module.js +10 -0
- package/runtime/components/SignatureBlock/index.css +26 -0
- package/runtime/components/SignatureBlock/index.js +36 -0
- package/runtime/components/SignatureBlock/index.module.js +10 -0
- package/runtime/components/SignatureCode/index.css +52 -0
- package/runtime/components/SignatureCode/index.js +44 -0
- package/runtime/components/SignatureCode/index.module.js +10 -0
- package/runtime/components/SignatureToolbar/index.css +122 -0
- package/runtime/components/SignatureToolbar/index.js +52 -0
- package/runtime/components/SignatureToolbar/index.module.js +14 -0
- package/runtime/components/buttons/ButtonGroup.js +16 -0
- package/runtime/components/buttons/CopyCodeButton.js +44 -0
- package/runtime/components/buttons/WrapSignatureButton.js +24 -0
- package/runtime/components/buttons/index.css +36 -0
- package/runtime/components/buttons/index.module.js +9 -0
- package/runtime/components/icons/CheckIcon/index.js +23 -0
- package/runtime/components/icons/CopyIcon/index.js +23 -0
- package/runtime/components/icons/UnwrapIcon/index.js +25 -0
- package/runtime/components/icons/WrapIcon/index.js +23 -0
- package/runtime/components/shared/_twoslash.css +440 -0
- package/runtime/components/shared/types.js +0 -0
- package/runtime/components/shared/variables.css +82 -0
- package/runtime/hooks/useWrapToggle.js +35 -0
- package/runtime/index.d.ts +513 -173
- package/runtime/index.js +13 -664
- package/runtime/utils/decode-hast.js +33 -0
- package/runtime/utils/hast-renderer.js +24 -0
- package/schemas/config.js +199 -0
- package/schemas/index.js +5 -0
- package/schemas/opengraph.js +26 -0
- package/schemas/performance.js +19 -0
- package/serve.js +133 -0
- package/services/ConfigService.js +7 -0
- package/services/PathDerivationService.js +7 -0
- package/services/SnapshotService.js +7 -0
- package/services/TypeRegistryService.js +7 -0
- package/shiki-transformer.js +758 -0
- package/tsconfig-parser.js +127 -0
- package/tsdoc-metadata.json +11 -11
- package/twoslash-patterns.js +87 -0
- package/twoslash-transformer.js +316 -0
- package/type-reference-extractor.js +201 -0
- package/typescript-config.js +168 -0
- package/vfs-registry.js +121 -0
- package/0~llms-program.js +0 -344
- package/runtime/index.css +0 -1016
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
.WkJdOG_table {
|
|
2
|
+
border: 1px solid var(--api-color-border);
|
|
3
|
+
border-radius: 0 0 var(--api-border-radius) var(--api-border-radius);
|
|
4
|
+
border-top: none;
|
|
5
|
+
margin: 0;
|
|
6
|
+
position: relative;
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
html.WkJdOG_rp-dark .WkJdOG_table {
|
|
11
|
+
border-color: var(--api-color-border);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.WkJdOG_scroll {
|
|
15
|
+
-webkit-overflow-scrolling: touch;
|
|
16
|
+
overflow-x: auto;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.WkJdOG_table table {
|
|
20
|
+
border-collapse: collapse;
|
|
21
|
+
width: 100%;
|
|
22
|
+
font-size: var(--api-font-size-base);
|
|
23
|
+
border-top-left-radius: 0;
|
|
24
|
+
border-top-right-radius: 0;
|
|
25
|
+
margin: 0;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.WkJdOG_table thead {
|
|
29
|
+
background-color: var(--api-color-bg);
|
|
30
|
+
border-bottom: 1px solid var(--api-color-border);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.WkJdOG_table th {
|
|
34
|
+
padding: var(--api-spacing-md) var(--api-spacing-lg);
|
|
35
|
+
text-align: left;
|
|
36
|
+
color: var(--api-color-text);
|
|
37
|
+
white-space: nowrap;
|
|
38
|
+
font-weight: 600;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.WkJdOG_table th:first-child {
|
|
42
|
+
width: 20%;
|
|
43
|
+
min-width: 120px;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.WkJdOG_table th:nth-child(2) {
|
|
47
|
+
width: 25%;
|
|
48
|
+
min-width: 120px;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.WkJdOG_table th:last-child {
|
|
52
|
+
width: 55%;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.WkJdOG_table td {
|
|
56
|
+
padding: var(--api-spacing-md) var(--api-spacing-lg);
|
|
57
|
+
border-top: 1px solid var(--api-color-border);
|
|
58
|
+
vertical-align: top;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.WkJdOG_table td:first-child {
|
|
62
|
+
width: 20%;
|
|
63
|
+
min-width: 120px;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.WkJdOG_table td:nth-child(2) {
|
|
67
|
+
width: 25%;
|
|
68
|
+
min-width: 120px;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.WkJdOG_table td:last-child {
|
|
72
|
+
width: 55%;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.WkJdOG_table td code, .WkJdOG_table th code {
|
|
76
|
+
font-size: var(--api-font-size-sm);
|
|
77
|
+
background-color: var(--api-color-code-bg);
|
|
78
|
+
border-radius: var(--api-border-radius-sm);
|
|
79
|
+
padding: .125rem .375rem;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.WkJdOG_table td:last-child p:first-child {
|
|
83
|
+
margin-top: 0;
|
|
84
|
+
}
|
|
85
|
+
|
|
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
|
+
margin-bottom: 0;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
@media (width <= 768px) {
|
|
91
|
+
.WkJdOG_table td, .WkJdOG_table th {
|
|
92
|
+
padding: var(--api-spacing-sm) var(--api-spacing-md);
|
|
93
|
+
font-size: var(--api-font-size-sm);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.WkJdOG_table td:first-child, .WkJdOG_table th:first-child, .WkJdOG_table td:nth-child(2), .WkJdOG_table th:nth-child(2) {
|
|
97
|
+
min-width: 100px;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { MarkdownContent } from "../MarkdownContent/index.js";
|
|
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
|
+
});
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
//#endregion
|
|
38
|
+
export { EnumMembersTable, EnumMembersTable as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
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"
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
//#endregion
|
|
10
|
+
export { index_module_default as default };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
.PkJPlW_block {
|
|
2
|
+
margin: var(--api-spacing-xl) 0;
|
|
3
|
+
border-radius: var(--api-border-radius);
|
|
4
|
+
border: 1px solid var(--api-color-border);
|
|
5
|
+
position: relative;
|
|
6
|
+
overflow: visible;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
html.PkJPlW_rp-dark .PkJPlW_block {
|
|
10
|
+
border-color: var(--api-color-border);
|
|
11
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { useWrapToggle } from "../../hooks/useWrapToggle.js";
|
|
2
|
+
import { ButtonGroup } from "../buttons/ButtonGroup.js";
|
|
3
|
+
import { CopyCodeButton } from "../buttons/CopyCodeButton.js";
|
|
4
|
+
import { WrapSignatureButton } from "../buttons/WrapSignatureButton.js";
|
|
5
|
+
import { SignatureCode } from "../SignatureCode/index.js";
|
|
6
|
+
import { SignatureToolbar } from "../SignatureToolbar/index.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
|
+
*/
|
|
16
|
+
function ExampleBlock({ hast, code }) {
|
|
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
|
+
});
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
//#endregion
|
|
31
|
+
export { ExampleBlock, ExampleBlock as default };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
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
|
+
*/
|
|
9
|
+
function Link({ children, href, title, target, rel }) {
|
|
10
|
+
return /* @__PURE__ */ jsx("a", {
|
|
11
|
+
className: "rp-link",
|
|
12
|
+
href,
|
|
13
|
+
title,
|
|
14
|
+
target,
|
|
15
|
+
rel,
|
|
16
|
+
children
|
|
17
|
+
});
|
|
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
|
+
*/
|
|
23
|
+
function MarkdownContent({ children }) {
|
|
24
|
+
return /* @__PURE__ */ jsx(Markdown, {
|
|
25
|
+
components: { a: Link },
|
|
26
|
+
children
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
//#endregion
|
|
31
|
+
export { MarkdownContent, MarkdownContent as default };
|
|
@@ -0,0 +1,33 @@
|
|
|
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
|
+
*/
|
|
8
|
+
function MarkdownText({ children }) {
|
|
9
|
+
return /* @__PURE__ */ jsx(Fragment, { children: parseMarkdownLinks(children) });
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Parse markdown links and return array of React nodes
|
|
13
|
+
*/
|
|
14
|
+
function parseMarkdownLinks(text) {
|
|
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;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
//#endregion
|
|
33
|
+
export { MarkdownText, MarkdownText as default };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
.gRiZQa_block {
|
|
2
|
+
margin: var(--api-spacing-xl) 0;
|
|
3
|
+
border-radius: var(--api-border-radius);
|
|
4
|
+
border: 1px solid var(--api-color-border);
|
|
5
|
+
position: relative;
|
|
6
|
+
overflow: visible;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
html.gRiZQa_rp-dark .gRiZQa_block {
|
|
10
|
+
border-color: var(--api-color-border);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.gRiZQa_hasParameters {
|
|
14
|
+
border-bottom-right-radius: 0;
|
|
15
|
+
border-bottom-left-radius: 0;
|
|
16
|
+
margin-bottom: 0;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.gRiZQa_hasParameters .api-signature-code {
|
|
20
|
+
border-bottom-right-radius: 0;
|
|
21
|
+
border-bottom-left-radius: 0;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.gRiZQa_hasParameters .api-signature-code pre {
|
|
25
|
+
border-radius: 0;
|
|
26
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { useWrapToggle } from "../../hooks/useWrapToggle.js";
|
|
2
|
+
import { WrapSignatureButton } from "../buttons/WrapSignatureButton.js";
|
|
3
|
+
import { SignatureCode } from "../SignatureCode/index.js";
|
|
4
|
+
import { SignatureToolbar } from "../SignatureToolbar/index.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
|
+
*/
|
|
14
|
+
function MemberSignature({ hast, memberName, id, summary, hasParameters = false }) {
|
|
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
|
+
});
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Extract plain text from a HAST tree
|
|
46
|
+
*/
|
|
47
|
+
function extractTextFromHast(node) {
|
|
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
|
+
}
|
|
52
|
+
|
|
53
|
+
//#endregion
|
|
54
|
+
export { MemberSignature, MemberSignature as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
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"
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
//#endregion
|
|
10
|
+
export { index_module_default as default };
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
.NDYkiG_table {
|
|
2
|
+
border: 1px solid var(--api-color-border);
|
|
3
|
+
border-radius: 0 0 var(--api-border-radius) var(--api-border-radius);
|
|
4
|
+
border-top: none;
|
|
5
|
+
margin: 0;
|
|
6
|
+
position: relative;
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
html.NDYkiG_rp-dark .NDYkiG_table {
|
|
11
|
+
border-color: var(--api-color-border);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.NDYkiG_scroll {
|
|
15
|
+
-webkit-overflow-scrolling: touch;
|
|
16
|
+
overflow-x: auto;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.NDYkiG_table table {
|
|
20
|
+
border-collapse: collapse;
|
|
21
|
+
width: 100%;
|
|
22
|
+
font-size: var(--api-font-size-base);
|
|
23
|
+
border-top-left-radius: 0;
|
|
24
|
+
border-top-right-radius: 0;
|
|
25
|
+
margin: 0;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.NDYkiG_table thead {
|
|
29
|
+
background-color: var(--api-color-bg);
|
|
30
|
+
border-bottom: 1px solid var(--api-color-border);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.NDYkiG_table th {
|
|
34
|
+
padding: var(--api-spacing-md) var(--api-spacing-lg);
|
|
35
|
+
text-align: left;
|
|
36
|
+
color: var(--api-color-text);
|
|
37
|
+
white-space: nowrap;
|
|
38
|
+
font-weight: 600;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.NDYkiG_table th:first-child {
|
|
42
|
+
width: 20%;
|
|
43
|
+
min-width: 120px;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.NDYkiG_table th:nth-child(2) {
|
|
47
|
+
width: 30%;
|
|
48
|
+
min-width: 150px;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.NDYkiG_table th:last-child {
|
|
52
|
+
width: 50%;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.NDYkiG_table td {
|
|
56
|
+
padding: var(--api-spacing-md) var(--api-spacing-lg);
|
|
57
|
+
border-top: 1px solid var(--api-color-border);
|
|
58
|
+
vertical-align: top;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.NDYkiG_table td:first-child {
|
|
62
|
+
width: 20%;
|
|
63
|
+
min-width: 120px;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.NDYkiG_table td:nth-child(2) {
|
|
67
|
+
width: 30%;
|
|
68
|
+
min-width: 150px;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.NDYkiG_table td:last-child {
|
|
72
|
+
width: 50%;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.NDYkiG_table td code, .NDYkiG_table th code {
|
|
76
|
+
font-size: var(--api-font-size-sm);
|
|
77
|
+
background-color: var(--api-color-code-bg);
|
|
78
|
+
border-radius: var(--api-border-radius-sm);
|
|
79
|
+
padding: .125rem .375rem;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.NDYkiG_table td:last-child p:first-child {
|
|
83
|
+
margin-top: 0;
|
|
84
|
+
}
|
|
85
|
+
|
|
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
|
+
margin-bottom: 0;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
@media (width <= 768px) {
|
|
91
|
+
.NDYkiG_table td, .NDYkiG_table th {
|
|
92
|
+
padding: var(--api-spacing-sm) var(--api-spacing-md);
|
|
93
|
+
font-size: var(--api-font-size-sm);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.NDYkiG_table td:first-child, .NDYkiG_table th:first-child {
|
|
97
|
+
min-width: 100px;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.NDYkiG_table td:nth-child(2), .NDYkiG_table th:nth-child(2) {
|
|
101
|
+
min-width: 120px;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { MarkdownContent } from "../MarkdownContent/index.js";
|
|
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
|
+
});
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
//#endregion
|
|
38
|
+
export { ParametersTable, ParametersTable as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
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"
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
//#endregion
|
|
10
|
+
export { index_module_default as default };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
.L_PAPG_block {
|
|
2
|
+
margin: var(--api-spacing-xl) 0;
|
|
3
|
+
border-radius: var(--api-border-radius);
|
|
4
|
+
border: 1px solid var(--api-color-border);
|
|
5
|
+
position: relative;
|
|
6
|
+
overflow: visible;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
html.L_PAPG_rp-dark .L_PAPG_block {
|
|
10
|
+
border-color: var(--api-color-border);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.L_PAPG_hasParameters {
|
|
14
|
+
border-bottom-right-radius: 0;
|
|
15
|
+
border-bottom-left-radius: 0;
|
|
16
|
+
margin-bottom: 0;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.L_PAPG_hasParameters .api-signature-code {
|
|
20
|
+
border-bottom-right-radius: 0;
|
|
21
|
+
border-bottom-left-radius: 0;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.L_PAPG_hasParameters .api-signature-code pre {
|
|
25
|
+
border-radius: 0;
|
|
26
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { useWrapToggle } from "../../hooks/useWrapToggle.js";
|
|
2
|
+
import { WrapSignatureButton } from "../buttons/WrapSignatureButton.js";
|
|
3
|
+
import { SignatureCode } from "../SignatureCode/index.js";
|
|
4
|
+
import { SignatureToolbar } from "../SignatureToolbar/index.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
|
+
*/
|
|
14
|
+
function SignatureBlock({ hast, heading = "Signature", id = "signature", hasParameters = false }) {
|
|
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
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
//#endregion
|
|
36
|
+
export { SignatureBlock, SignatureBlock as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
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"
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
//#endregion
|
|
10
|
+
export { index_module_default as default };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
.Ze8uHG_code {
|
|
2
|
+
border-bottom-left-radius: var(--api-border-radius);
|
|
3
|
+
border-bottom-right-radius: var(--api-border-radius);
|
|
4
|
+
position: relative;
|
|
5
|
+
container-type: inline-size;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.Ze8uHG_code pre {
|
|
9
|
+
height: auto;
|
|
10
|
+
max-height: none;
|
|
11
|
+
padding: var(--api-spacing-lg);
|
|
12
|
+
background-color: var(--shiki-light-bg);
|
|
13
|
+
border-radius: 0 0 var(--api-border-radius) var(--api-border-radius);
|
|
14
|
+
margin: 0;
|
|
15
|
+
overflow-x: auto;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
html.Ze8uHG_rp-dark .Ze8uHG_code pre {
|
|
19
|
+
background-color: var(--shiki-dark-bg);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.Ze8uHG_code code {
|
|
23
|
+
background-color: unset;
|
|
24
|
+
min-height: var(--api-font-size-md);
|
|
25
|
+
line-height: var(--api-line-height-base);
|
|
26
|
+
flex-direction: column;
|
|
27
|
+
justify-content: center;
|
|
28
|
+
display: flex;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.Ze8uHG_code code span {
|
|
32
|
+
color: var(--shiki-light);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
html.Ze8uHG_rp-dark .Ze8uHG_code code span {
|
|
36
|
+
color: var(--shiki-dark);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.Ze8uHG_code .line {
|
|
40
|
+
background: none;
|
|
41
|
+
min-height: 1lh;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.Ze8uHG_wrapped pre {
|
|
45
|
+
white-space: pre-wrap;
|
|
46
|
+
overflow-wrap: break-word;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.Ze8uHG_wrapped code {
|
|
50
|
+
white-space: pre-wrap;
|
|
51
|
+
overflow-wrap: break-word;
|
|
52
|
+
}
|