rspress-plugin-api-extractor 0.1.2 → 0.2.1
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 +64 -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
|
@@ -46,7 +46,6 @@ html.rp-dark {
|
|
|
46
46
|
color: var(--twoslash-popup-color);
|
|
47
47
|
border: 1px solid var(--twoslash-border-color);
|
|
48
48
|
z-index: 1000;
|
|
49
|
-
-webkit-user-select: none;
|
|
50
49
|
user-select: none;
|
|
51
50
|
text-align: left;
|
|
52
51
|
box-shadow: var(--twoslash-popup-shadow);
|
|
@@ -68,7 +67,6 @@ html.rp-dark {
|
|
|
68
67
|
transform: translateY(1.1em);
|
|
69
68
|
|
|
70
69
|
&:hover {
|
|
71
|
-
-webkit-user-select: auto;
|
|
72
70
|
user-select: auto;
|
|
73
71
|
}
|
|
74
72
|
}
|
|
@@ -185,11 +183,11 @@ html.rp-dark {
|
|
|
185
183
|
}
|
|
186
184
|
|
|
187
185
|
& .twoslash-error {
|
|
188
|
-
background: url("data:image/svg+xml,%3Csvg%20xmlns%3D%
|
|
186
|
+
background: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%206%203'%20enable-background%3D'new%200%200%206%203'%20height%3D'3'%20width%3D'6'%3E%3Cg%20fill%3D'%23c94824'%3E%3Cpolygon%20points%3D'5.5%2C0%202.5%2C3%201.1%2C3%204.1%2C0'%2F%3E%3Cpolygon%20points%3D'4%2C0%206%2C2%206%2C0.6%205.4%2C0'%2F%3E%3Cpolygon%20points%3D'0%2C2%201%2C3%202.4%2C3%200%2C0.6'%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E") 0 100% repeat-x;
|
|
189
187
|
padding-bottom: 2px;
|
|
190
188
|
|
|
191
189
|
&.twoslash-error-level-warning {
|
|
192
|
-
background: url("data:image/svg+xml,%3Csvg%20xmlns%3D%
|
|
190
|
+
background: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%206%203'%20enable-background%3D'new%200%200%206%203'%20height%3D'3'%20width%3D'6'%3E%3Cg%20fill%3D'%23c37d0d'%3E%3Cpolygon%20points%3D'5.5%2C0%202.5%2C3%201.1%2C3%204.1%2C0'%2F%3E%3Cpolygon%20points%3D'4%2C0%206%2C2%206%2C0.6%205.4%2C0'%2F%3E%3Cpolygon%20points%3D'0%2C2%201%2C3%202.4%2C3%200%2C0.6'%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E") 0 100% repeat-x;
|
|
193
191
|
padding-bottom: 2px;
|
|
194
192
|
}
|
|
195
193
|
}
|
|
@@ -198,7 +196,6 @@ html.rp-dark {
|
|
|
198
196
|
position: relative;
|
|
199
197
|
|
|
200
198
|
& .twoslash-completion-list {
|
|
201
|
-
-webkit-user-select: none;
|
|
202
199
|
user-select: none;
|
|
203
200
|
z-index: 1000;
|
|
204
201
|
box-shadow: var(--twoslash-popup-shadow);
|
|
@@ -217,7 +214,6 @@ html.rp-dark {
|
|
|
217
214
|
transform: translate(0, 1.2em);
|
|
218
215
|
|
|
219
216
|
&:hover {
|
|
220
|
-
-webkit-user-select: auto;
|
|
221
217
|
user-select: auto;
|
|
222
218
|
}
|
|
223
219
|
|
|
@@ -426,9 +422,7 @@ html.rp-dark {
|
|
|
426
422
|
.api-type-link {
|
|
427
423
|
color: inherit;
|
|
428
424
|
text-underline-offset: 2px;
|
|
429
|
-
|
|
430
|
-
text-decoration: underline dotted;
|
|
431
|
-
text-decoration-thickness: 1px;
|
|
425
|
+
text-decoration: underline 1px dotted;
|
|
432
426
|
transition: all .2s;
|
|
433
427
|
|
|
434
428
|
&:hover {
|
|
@@ -444,4 +438,3 @@ html.rp-dark .api-type-link {
|
|
|
444
438
|
text-decoration-color: #fffc;
|
|
445
439
|
}
|
|
446
440
|
}
|
|
447
|
-
|
|
@@ -41,7 +41,6 @@
|
|
|
41
41
|
background-color: var(--api-shiki-light-bg, inherit);
|
|
42
42
|
font-style: var(--api-shiki-light-font-style, inherit);
|
|
43
43
|
font-weight: var(--api-shiki-light-font-weight, inherit);
|
|
44
|
-
-webkit-text-decoration: var(--api-shiki-light-text-decoration, inherit);
|
|
45
44
|
text-decoration: var(--api-shiki-light-text-decoration, inherit);
|
|
46
45
|
}
|
|
47
46
|
|
|
@@ -50,7 +49,6 @@ html.rp-dark .api-doc-code .shiki, html.rp-dark .api-doc-code .shiki span {
|
|
|
50
49
|
background-color: var(--api-shiki-dark-bg, inherit);
|
|
51
50
|
font-style: var(--api-shiki-dark-font-style, inherit);
|
|
52
51
|
font-weight: var(--api-shiki-dark-font-weight, inherit);
|
|
53
|
-
-webkit-text-decoration: var(--api-shiki-dark-text-decoration, inherit);
|
|
54
52
|
text-decoration: var(--api-shiki-dark-text-decoration, inherit);
|
|
55
53
|
}
|
|
56
54
|
|
|
@@ -82,4 +80,3 @@ html.rp-dark .rp-social-links__item:hover {
|
|
|
82
80
|
html.rp-dark .rp-social-links__item:active {
|
|
83
81
|
background-color: var(--api-color-active-bg);
|
|
84
82
|
}
|
|
85
|
-
|
|
@@ -1,12 +1,35 @@
|
|
|
1
1
|
import { useState } from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/runtime/hooks/useWrapToggle.ts
|
|
4
|
+
/* v8 ignore start -- React hook, requires React test environment */
|
|
5
|
+
/**
|
|
6
|
+
* Hook for managing code/signature wrapping state
|
|
7
|
+
* Provides a boolean state and toggle function
|
|
8
|
+
*
|
|
9
|
+
* @returns Object with wrapped state and toggleWrap function
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* const { wrapped, toggleWrap } = useWrapToggle();
|
|
14
|
+
*
|
|
15
|
+
* return (
|
|
16
|
+
* <div>
|
|
17
|
+
* <button onClick={toggleWrap}>Toggle Wrap</button>
|
|
18
|
+
* <pre className={wrapped ? 'wrapped' : ''}>...</pre>
|
|
19
|
+
* </div>
|
|
20
|
+
* );
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
2
23
|
function useWrapToggle() {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
24
|
+
const [wrapped, setWrapped] = useState(false);
|
|
25
|
+
const toggleWrap = () => {
|
|
26
|
+
setWrapped(!wrapped);
|
|
27
|
+
};
|
|
28
|
+
return {
|
|
29
|
+
wrapped,
|
|
30
|
+
toggleWrap
|
|
31
|
+
};
|
|
11
32
|
}
|
|
12
|
-
|
|
33
|
+
|
|
34
|
+
//#endregion
|
|
35
|
+
export { useWrapToggle };
|