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.
- 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 -6128
- 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 -73
- 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 +29 -25
- package/runtime/components/ApiLlmsPackageActions/index.js +252 -323
- package/runtime/components/ApiLlmsViewOptions/index.js +269 -340
- package/runtime/components/ApiMember/index.js +49 -47
- package/runtime/components/ApiSignature/index.js +32 -28
- package/runtime/components/EnumMembersTable/{index_module.css → index.css} +18 -19
- package/runtime/components/EnumMembersTable/index.js +36 -67
- package/runtime/components/EnumMembersTable/index.module.js +9 -6
- package/runtime/components/ExampleBlock/{index_module.css → index.css} +2 -3
- package/runtime/components/ExampleBlock/index.js +23 -28
- package/runtime/components/ExampleBlock/index.module.js +8 -5
- package/runtime/components/MarkdownContent/index.js +26 -18
- package/runtime/components/MarkdownText/index.js +28 -22
- package/runtime/components/MemberSignature/{index_module.css → index.css} +5 -6
- package/runtime/components/MemberSignature/index.js +46 -46
- package/runtime/components/MemberSignature/index.module.js +9 -6
- package/runtime/components/ParametersTable/{index_module.css → index.css} +19 -20
- package/runtime/components/ParametersTable/index.js +36 -67
- package/runtime/components/ParametersTable/index.module.js +9 -6
- package/runtime/components/SignatureBlock/{index_module.css → index.css} +5 -6
- package/runtime/components/SignatureBlock/index.js +30 -29
- package/runtime/components/SignatureBlock/index.module.js +9 -6
- package/runtime/components/SignatureCode/{index_module.css → index.css} +9 -10
- package/runtime/components/SignatureCode/index.js +40 -32
- package/runtime/components/SignatureCode/index.module.js +9 -6
- package/runtime/components/SignatureToolbar/{index_module.css → index.css} +18 -20
- package/runtime/components/SignatureToolbar/index.js +48 -51
- package/runtime/components/SignatureToolbar/index.module.js +13 -10
- package/runtime/components/buttons/ButtonGroup.js +13 -6
- package/runtime/components/buttons/CopyCodeButton.js +40 -38
- package/runtime/components/buttons/WrapSignatureButton.js +20 -16
- package/runtime/components/buttons/{index_module.css → index.css} +5 -6
- package/runtime/components/buttons/index.module.js +8 -5
- package/runtime/components/icons/CheckIcon/index.js +20 -17
- package/runtime/components/icons/CopyIcon/index.js +20 -17
- package/runtime/components/icons/UnwrapIcon/index.js +22 -18
- package/runtime/components/icons/WrapIcon/index.js +20 -17
- package/runtime/components/shared/_twoslash.css +3 -10
- package/runtime/components/shared/variables.css +0 -3
- package/runtime/hooks/useWrapToggle.js +32 -9
- package/runtime/index.d.ts +513 -173
- package/runtime/index.js +11 -9
- package/runtime/utils/decode-hast.js +31 -16
- package/runtime/utils/hast-renderer.js +21 -7
- 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/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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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
|
-
|
|
50
|
-
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
|
|
31
|
-
|
|
32
|
-
export { ApiSignature };
|
|
34
|
+
|
|
35
|
+
//#endregion
|
|
36
|
+
export { ApiSignature, ApiSignature as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.
|
|
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.
|
|
10
|
+
html.WkJdOG_rp-dark .WkJdOG_table {
|
|
11
11
|
border-color: var(--api-color-border);
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
.
|
|
14
|
+
.WkJdOG_scroll {
|
|
15
15
|
-webkit-overflow-scrolling: touch;
|
|
16
16
|
overflow-x: auto;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
.
|
|
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
|
-
.
|
|
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
|
-
.
|
|
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
|
-
.
|
|
41
|
+
.WkJdOG_table th:first-child {
|
|
42
42
|
width: 20%;
|
|
43
43
|
min-width: 120px;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
.
|
|
46
|
+
.WkJdOG_table th:nth-child(2) {
|
|
47
47
|
width: 25%;
|
|
48
48
|
min-width: 120px;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
.
|
|
51
|
+
.WkJdOG_table th:last-child {
|
|
52
52
|
width: 55%;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
.
|
|
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
|
-
.
|
|
61
|
+
.WkJdOG_table td:first-child {
|
|
62
62
|
width: 20%;
|
|
63
63
|
min-width: 120px;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
.
|
|
66
|
+
.WkJdOG_table td:nth-child(2) {
|
|
67
67
|
width: 25%;
|
|
68
68
|
min-width: 120px;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
.
|
|
71
|
+
.WkJdOG_table td:last-child {
|
|
72
72
|
width: 55%;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
.
|
|
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
|
-
.
|
|
82
|
+
.WkJdOG_table td:last-child p:first-child {
|
|
83
83
|
margin-top: 0;
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
.
|
|
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
|
-
.
|
|
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
|
-
.
|
|
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
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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
|
-
|
|
68
|
-
|
|
69
|
-
export { EnumMembersTable };
|
|
36
|
+
|
|
37
|
+
//#endregion
|
|
38
|
+
export { EnumMembersTable, EnumMembersTable as default };
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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
|
-
|
|
8
|
+
|
|
9
|
+
//#endregion
|
|
10
|
+
export { index_module_default as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.
|
|
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.
|
|
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
|
|
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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
|
|
35
|
-
|
|
36
|
-
export { ExampleBlock };
|
|
29
|
+
|
|
30
|
+
//#endregion
|
|
31
|
+
export { ExampleBlock, ExampleBlock as default };
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
|
|
7
|
+
|
|
8
|
+
//#endregion
|
|
9
|
+
export { index_module_default as default };
|
|
@@ -1,23 +1,31 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
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
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
children: children
|
|
19
|
-
});
|
|
24
|
+
return /* @__PURE__ */ jsx(Markdown, {
|
|
25
|
+
components: { a: Link },
|
|
26
|
+
children
|
|
27
|
+
});
|
|
20
28
|
}
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
|
|
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
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
-
|
|
26
|
-
|
|
27
|
-
export { MarkdownText };
|
|
31
|
+
|
|
32
|
+
//#endregion
|
|
33
|
+
export { MarkdownText, MarkdownText as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.
|
|
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.
|
|
9
|
+
html.gRiZQa_rp-dark .gRiZQa_block {
|
|
10
10
|
border-color: var(--api-color-border);
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
.
|
|
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
|
-
.
|
|
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
|
-
.
|
|
24
|
+
.gRiZQa_hasParameters .api-signature-code pre {
|
|
25
25
|
border-radius: 0;
|
|
26
26
|
}
|
|
27
|
-
|