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,440 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--twoslash-border-color: #8888;
|
|
3
|
+
--twoslash-underline-color: currentColor;
|
|
4
|
+
--twoslash-highlighted-border: #c37d0d50;
|
|
5
|
+
--twoslash-highlighted-bg: #c37d0d20;
|
|
6
|
+
--twoslash-popup-bg: var(--api-shiki-light-bg, #f8f8f8);
|
|
7
|
+
--twoslash-popup-color: var(--api-shiki-light, inherit);
|
|
8
|
+
--twoslash-popup-shadow: #00000014 0px 1px 4px;
|
|
9
|
+
--twoslash-docs-color: #888;
|
|
10
|
+
--twoslash-docs-font: sans-serif;
|
|
11
|
+
--twoslash-code-font: inherit;
|
|
12
|
+
--twoslash-code-font-size: 1em;
|
|
13
|
+
--twoslash-matched-color: inherit;
|
|
14
|
+
--twoslash-unmatched-color: #888;
|
|
15
|
+
--twoslash-cursor-color: #8888;
|
|
16
|
+
--twoslash-error-color: #d45656;
|
|
17
|
+
--twoslash-error-bg: #d4565620;
|
|
18
|
+
--twoslash-warn-color: #c37d0d;
|
|
19
|
+
--twoslash-warn-bg: #c37d0d20;
|
|
20
|
+
--twoslash-tag-color: #3772cf;
|
|
21
|
+
--twoslash-tag-bg: #3772cf20;
|
|
22
|
+
--twoslash-tag-warn-color: var(--twoslash-warn-color);
|
|
23
|
+
--twoslash-tag-warn-bg: var(--twoslash-warn-bg);
|
|
24
|
+
--twoslash-tag-annotate-color: #1ba673;
|
|
25
|
+
--twoslash-tag-annotate-bg: #1ba67320;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
html.rp-dark {
|
|
29
|
+
--twoslash-popup-bg: var(--api-shiki-dark-bg, #1e1e1e);
|
|
30
|
+
--twoslash-popup-color: var(--api-shiki-dark, inherit);
|
|
31
|
+
--twoslash-popup-shadow: #0000004d 0px 2px 8px;
|
|
32
|
+
--twoslash-docs-color: #aaa;
|
|
33
|
+
--twoslash-unmatched-color: #aaa;
|
|
34
|
+
--twoslash-border-color: #555;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@media (prefers-reduced-motion: reduce) {
|
|
38
|
+
.twoslash * {
|
|
39
|
+
transition: none;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.twoslash {
|
|
44
|
+
& .twoslash-popup-container {
|
|
45
|
+
background: var(--twoslash-popup-bg);
|
|
46
|
+
color: var(--twoslash-popup-color);
|
|
47
|
+
border: 1px solid var(--twoslash-border-color);
|
|
48
|
+
z-index: 1000;
|
|
49
|
+
user-select: none;
|
|
50
|
+
text-align: left;
|
|
51
|
+
box-shadow: var(--twoslash-popup-shadow);
|
|
52
|
+
white-space: normal;
|
|
53
|
+
overflow-wrap: normal;
|
|
54
|
+
word-break: normal;
|
|
55
|
+
opacity: 0;
|
|
56
|
+
pointer-events: none;
|
|
57
|
+
border-width: 0;
|
|
58
|
+
border-radius: 4px;
|
|
59
|
+
flex-direction: column;
|
|
60
|
+
width: 0;
|
|
61
|
+
height: 0;
|
|
62
|
+
transition: opacity .3s, width 0s .3s, height 0s .3s;
|
|
63
|
+
display: flex;
|
|
64
|
+
position: absolute;
|
|
65
|
+
left: 0;
|
|
66
|
+
overflow: hidden;
|
|
67
|
+
transform: translateY(1.1em);
|
|
68
|
+
|
|
69
|
+
&:hover {
|
|
70
|
+
user-select: auto;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
& .twoslash-popup-code, & .twoslash-popup-error, & .twoslash-popup-docs {
|
|
75
|
+
padding: 6px 8px;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
& .twoslash-popup-code {
|
|
79
|
+
font-family: var(--twoslash-code-font);
|
|
80
|
+
font-size: var(--twoslash-code-font-size);
|
|
81
|
+
white-space: pre-wrap;
|
|
82
|
+
overflow-wrap: break-word;
|
|
83
|
+
display: block;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
& .twoslash-popup-docs {
|
|
87
|
+
color: var(--twoslash-docs-color);
|
|
88
|
+
font-family: var(--twoslash-docs-font);
|
|
89
|
+
border-top: 1px solid var(--twoslash-border-color);
|
|
90
|
+
font-size: .8em;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
& .twoslash-popup-error {
|
|
94
|
+
color: var(--twoslash-error-color);
|
|
95
|
+
background-color: var(--twoslash-error-bg);
|
|
96
|
+
font-family: var(--twoslash-docs-font);
|
|
97
|
+
font-size: .8em;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
& .twoslash-popup-docs-tags {
|
|
101
|
+
font-family: var(--twoslash-docs-font);
|
|
102
|
+
flex-direction: column;
|
|
103
|
+
display: flex;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
& .twoslash-popup-docs-tags, & .twoslash-popup-docs-tag-name {
|
|
107
|
+
margin-right: .5em;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
& .twoslash-popup-docs-tag-name {
|
|
111
|
+
font-family: var(--twoslash-code-font);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
& .twoslash-popup-arrow {
|
|
115
|
+
border-top: 1px solid var(--twoslash-border-color);
|
|
116
|
+
border-right: 1px solid var(--twoslash-border-color);
|
|
117
|
+
background: var(--twoslash-popup-bg);
|
|
118
|
+
pointer-events: none;
|
|
119
|
+
width: 6px;
|
|
120
|
+
height: 6px;
|
|
121
|
+
position: absolute;
|
|
122
|
+
top: -4px;
|
|
123
|
+
left: 1em;
|
|
124
|
+
transform: rotate(-45deg);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
& .twoslash-hover {
|
|
128
|
+
border-bottom: 1px dotted #0000;
|
|
129
|
+
transition: border-color .3s;
|
|
130
|
+
position: relative;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
&:hover .twoslash-hover:hover {
|
|
134
|
+
border-color: var(--twoslash-underline-color);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
& .twoslash-hover:hover .twoslash-popup-container, & .twoslash-error-hover:hover .twoslash-popup-container, & .twoslash-query-persisted .twoslash-popup-container, & .twoslash-query-line .twoslash-popup-container {
|
|
138
|
+
opacity: 1;
|
|
139
|
+
pointer-events: auto;
|
|
140
|
+
width: max-content;
|
|
141
|
+
max-width: var(--popup-max-width, 75cqi);
|
|
142
|
+
min-width: 200px;
|
|
143
|
+
height: auto;
|
|
144
|
+
left: var(--popup-left, 0px);
|
|
145
|
+
top: var(--popup-top, 0px);
|
|
146
|
+
border-width: 1px;
|
|
147
|
+
transition: opacity .3s;
|
|
148
|
+
position: fixed;
|
|
149
|
+
overflow: visible;
|
|
150
|
+
transform: none;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
& .twoslash-query-persisted .twoslash-popup-container {
|
|
154
|
+
z-index: 999;
|
|
155
|
+
position: absolute;
|
|
156
|
+
left: 0;
|
|
157
|
+
transform: translateY(1.5em);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
& .twoslash-query-line .twoslash-popup-container {
|
|
161
|
+
margin-bottom: 1.4em;
|
|
162
|
+
position: relative;
|
|
163
|
+
top: auto;
|
|
164
|
+
left: auto;
|
|
165
|
+
transform: translateY(.6em);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
& .twoslash-error-line {
|
|
169
|
+
background-color: var(--twoslash-error-bg);
|
|
170
|
+
border-left: 3px solid var(--twoslash-error-color);
|
|
171
|
+
color: var(--twoslash-error-color);
|
|
172
|
+
width: max-content;
|
|
173
|
+
min-width: 100%;
|
|
174
|
+
margin: .2em 0;
|
|
175
|
+
padding: 6px 12px;
|
|
176
|
+
position: relative;
|
|
177
|
+
|
|
178
|
+
&.twoslash-error-level-warning {
|
|
179
|
+
background-color: var(--twoslash-warn-bg);
|
|
180
|
+
border-left: 3px solid var(--twoslash-warn-color);
|
|
181
|
+
color: var(--twoslash-warn-color);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
& .twoslash-error {
|
|
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;
|
|
187
|
+
padding-bottom: 2px;
|
|
188
|
+
|
|
189
|
+
&.twoslash-error-level-warning {
|
|
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;
|
|
191
|
+
padding-bottom: 2px;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
& .twoslash-completion-cursor {
|
|
196
|
+
position: relative;
|
|
197
|
+
|
|
198
|
+
& .twoslash-completion-list {
|
|
199
|
+
user-select: none;
|
|
200
|
+
z-index: 1000;
|
|
201
|
+
box-shadow: var(--twoslash-popup-shadow);
|
|
202
|
+
background: var(--twoslash-popup-bg);
|
|
203
|
+
border: 1px solid var(--twoslash-border-color);
|
|
204
|
+
flex-direction: column;
|
|
205
|
+
gap: 4px;
|
|
206
|
+
width: 240px;
|
|
207
|
+
margin: 3px 0 0 -1px;
|
|
208
|
+
padding: 4px;
|
|
209
|
+
font-size: .8rem;
|
|
210
|
+
display: flex;
|
|
211
|
+
position: fixed;
|
|
212
|
+
top: 0;
|
|
213
|
+
left: 0;
|
|
214
|
+
transform: translate(0, 1.2em);
|
|
215
|
+
|
|
216
|
+
&:hover {
|
|
217
|
+
user-select: auto;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
&:before {
|
|
221
|
+
background-color: var(--twoslash-cursor-color);
|
|
222
|
+
content: " ";
|
|
223
|
+
width: 2px;
|
|
224
|
+
height: 1.4em;
|
|
225
|
+
position: absolute;
|
|
226
|
+
top: -1.6em;
|
|
227
|
+
left: -1px;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
& li {
|
|
231
|
+
align-items: center;
|
|
232
|
+
gap: .25em;
|
|
233
|
+
line-height: 1em;
|
|
234
|
+
display: flex;
|
|
235
|
+
overflow: hidden;
|
|
236
|
+
|
|
237
|
+
& span.twoslash-completions-unmatched {
|
|
238
|
+
color: var(--twoslash-unmatched-color);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
& span.twoslash-completions-matched {
|
|
242
|
+
color: var(--twoslash-matched-color);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
&.deprecated {
|
|
246
|
+
opacity: .5;
|
|
247
|
+
text-decoration: line-through;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
& .twoslash-completion-list .twoslash-completions-icon {
|
|
254
|
+
color: var(--twoslash-unmatched-color);
|
|
255
|
+
flex: none;
|
|
256
|
+
width: 1em;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
& .twoslash-highlighted {
|
|
260
|
+
background-color: var(--twoslash-highlighted-bg);
|
|
261
|
+
border: 1px solid var(--twoslash-highlighted-border);
|
|
262
|
+
border-radius: 4px;
|
|
263
|
+
margin: -1px -3px;
|
|
264
|
+
padding: 1px 2px;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
& .twoslash-tag-line {
|
|
268
|
+
background-color: var(--twoslash-tag-bg);
|
|
269
|
+
border-left: 3px solid var(--twoslash-tag-color);
|
|
270
|
+
color: var(--twoslash-tag-color);
|
|
271
|
+
align-items: center;
|
|
272
|
+
gap: .3em;
|
|
273
|
+
width: max-content;
|
|
274
|
+
min-width: 100%;
|
|
275
|
+
margin: .2em 0;
|
|
276
|
+
padding: 6px 10px;
|
|
277
|
+
display: flex;
|
|
278
|
+
position: relative;
|
|
279
|
+
|
|
280
|
+
& .twoslash-tag-icon {
|
|
281
|
+
width: 1.1em;
|
|
282
|
+
color: inherit;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
&.twoslash-tag-error-line {
|
|
286
|
+
background-color: var(--twoslash-error-bg);
|
|
287
|
+
border-left: 3px solid var(--twoslash-error-color);
|
|
288
|
+
color: var(--twoslash-error-color);
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
&.twoslash-tag-warn-line {
|
|
292
|
+
background-color: var(--twoslash-tag-warn-bg);
|
|
293
|
+
border-left: 3px solid var(--twoslash-tag-warn-color);
|
|
294
|
+
color: var(--twoslash-tag-warn-color);
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
&.twoslash-tag-annotate-line {
|
|
298
|
+
background-color: var(--twoslash-tag-annotate-bg);
|
|
299
|
+
border-left: 3px solid var(--twoslash-tag-annotate-color);
|
|
300
|
+
color: var(--twoslash-tag-annotate-color);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
.twoslash-popup-docs-tag:has(.twoslash-tag-hidden), .twoslash-popup-docs-tag:not(:has(.twoslash-popup-docs-tag-value)), .twoslash-popup-docs-tag:has(.twoslash-tag-remarks) .twoslash-popup-docs-tag-name {
|
|
306
|
+
display: none;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
.twoslash-popup-docs-tag:has(.twoslash-tag-param), .twoslash-popup-docs-tag:has(.twoslash-tag-typeParam), .twoslash-popup-docs-tag:has(.twoslash-tag-returns), .twoslash-popup-docs-tag:has(.twoslash-tag-throws), .twoslash-popup-docs-tag:has(.twoslash-tag-defaultValue) {
|
|
310
|
+
border-bottom: 1px solid var(--twoslash-border-color);
|
|
311
|
+
color: var(--twoslash-docs-color);
|
|
312
|
+
align-items: baseline;
|
|
313
|
+
gap: .5em;
|
|
314
|
+
margin: 0 -8px;
|
|
315
|
+
padding: .35em 8px;
|
|
316
|
+
display: flex;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
.twoslash-popup-docs-tag:has(.twoslash-tag-param) > .twoslash-popup-docs-tag-name, .twoslash-popup-docs-tag:has(.twoslash-tag-typeParam) > .twoslash-popup-docs-tag-name, .twoslash-popup-docs-tag:has(.twoslash-tag-returns) > .twoslash-popup-docs-tag-name, .twoslash-popup-docs-tag:has(.twoslash-tag-throws) > .twoslash-popup-docs-tag-name, .twoslash-popup-docs-tag:has(.twoslash-tag-defaultValue) > .twoslash-popup-docs-tag-name {
|
|
320
|
+
width: 0;
|
|
321
|
+
margin: 0;
|
|
322
|
+
padding: 0;
|
|
323
|
+
font-size: 0;
|
|
324
|
+
overflow: hidden;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
.twoslash-popup-docs-tag:has(.twoslash-tag-param):before, .twoslash-popup-docs-tag:has(.twoslash-tag-typeParam):before, .twoslash-popup-docs-tag:has(.twoslash-tag-returns):before, .twoslash-popup-docs-tag:has(.twoslash-tag-throws):before, .twoslash-popup-docs-tag:has(.twoslash-tag-defaultValue):before {
|
|
328
|
+
font-size: .65rem;
|
|
329
|
+
font-weight: 600;
|
|
330
|
+
font-family: var(--twoslash-code-font);
|
|
331
|
+
white-space: nowrap;
|
|
332
|
+
border-radius: 3px;
|
|
333
|
+
flex-shrink: 0;
|
|
334
|
+
padding: 1px 5px;
|
|
335
|
+
line-height: 1.4;
|
|
336
|
+
display: inline-block;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
.twoslash-popup-docs-tag:has(.twoslash-tag-typeParam):before {
|
|
340
|
+
content: "type";
|
|
341
|
+
background: var(--twoslash-tag-bg);
|
|
342
|
+
color: var(--twoslash-tag-color);
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
.twoslash-popup-docs-tag:has(.twoslash-tag-param):before {
|
|
346
|
+
content: "param";
|
|
347
|
+
background: var(--twoslash-tag-bg);
|
|
348
|
+
color: var(--twoslash-tag-color);
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
.twoslash-popup-docs-tag:has(.twoslash-tag-returns):before {
|
|
352
|
+
content: "returns";
|
|
353
|
+
background: var(--twoslash-tag-annotate-bg);
|
|
354
|
+
color: var(--twoslash-tag-annotate-color);
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
.twoslash-popup-docs-tag:has(.twoslash-tag-throws):before {
|
|
358
|
+
content: "throws";
|
|
359
|
+
background: var(--twoslash-warn-bg);
|
|
360
|
+
color: var(--twoslash-warn-color);
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
.twoslash-popup-docs-tag:has(.twoslash-tag-defaultValue):before {
|
|
364
|
+
content: "default";
|
|
365
|
+
background: var(--twoslash-highlighted-bg);
|
|
366
|
+
color: var(--twoslash-docs-color);
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
.twoslash-tag-remarks {
|
|
370
|
+
margin-top: .5em;
|
|
371
|
+
display: block;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
.twoslash-tag-content {
|
|
375
|
+
display: block;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
.twoslash-tag-content p {
|
|
379
|
+
margin: .25em 0;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
.twoslash-tag-content p:first-child {
|
|
383
|
+
margin-top: 0;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
.twoslash-tag-content p:last-child {
|
|
387
|
+
margin-bottom: 0;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
.twoslash .twoslash-popup-container .twoslash-popup-docs code {
|
|
391
|
+
background-color: var(--twoslash-popup-bg);
|
|
392
|
+
border: 1px solid var(--twoslash-border-color);
|
|
393
|
+
border-radius: 3px;
|
|
394
|
+
padding: 1px 4px;
|
|
395
|
+
font-size: .85em;
|
|
396
|
+
display: inline;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
.twoslash-popup-docs p {
|
|
400
|
+
text-wrap: auto;
|
|
401
|
+
font-size: .9rem;
|
|
402
|
+
line-height: 1.1rem;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
.twoslash-popup-docs p:first-child {
|
|
406
|
+
margin-top: 0;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
.twoslash-popup-docs p:last-child, .twoslash-popup-docs ul:last-child, .twoslash-popup-docs ol:last-child {
|
|
410
|
+
margin-bottom: 0;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
.twoslash-popup-docs ul, .twoslash-popup-docs ol {
|
|
414
|
+
margin: .5em 0;
|
|
415
|
+
padding-left: 1.25em;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
.twoslash-popup-docs li {
|
|
419
|
+
margin: .25em 0;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
.api-type-link {
|
|
423
|
+
color: inherit;
|
|
424
|
+
text-underline-offset: 2px;
|
|
425
|
+
text-decoration: underline 1px dotted;
|
|
426
|
+
transition: all .2s;
|
|
427
|
+
|
|
428
|
+
&:hover {
|
|
429
|
+
text-decoration-style: solid;
|
|
430
|
+
text-decoration-thickness: 2px;
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
html.rp-dark .api-type-link {
|
|
435
|
+
text-decoration-color: #fff6;
|
|
436
|
+
|
|
437
|
+
&:hover {
|
|
438
|
+
text-decoration-color: #fffc;
|
|
439
|
+
}
|
|
440
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--api-color-bg: #f6f8fa;
|
|
3
|
+
--api-color-bg-secondary: #fff;
|
|
4
|
+
--api-color-text: #24292f;
|
|
5
|
+
--api-color-text-secondary: #57606a;
|
|
6
|
+
--api-color-border: #e1e4e8;
|
|
7
|
+
--api-color-border-secondary: #d0d7de;
|
|
8
|
+
--api-color-border-hover: #b1b8c0;
|
|
9
|
+
--api-color-hover-bg: #f3f4f6;
|
|
10
|
+
--api-color-active-bg: #e5e7eb;
|
|
11
|
+
--api-color-link: #0969da;
|
|
12
|
+
--api-color-link-hover: #0550ae;
|
|
13
|
+
--api-color-code-bg: #afb8c133;
|
|
14
|
+
--api-spacing-xs: .375rem;
|
|
15
|
+
--api-spacing-sm: .5rem;
|
|
16
|
+
--api-spacing-md: .75rem;
|
|
17
|
+
--api-spacing-lg: 1rem;
|
|
18
|
+
--api-spacing-xl: 1.5rem;
|
|
19
|
+
--api-border-radius: 6px;
|
|
20
|
+
--api-border-radius-sm: 3px;
|
|
21
|
+
--api-border-radius-md: 4px;
|
|
22
|
+
--api-font-size-sm: .875rem;
|
|
23
|
+
--api-font-size-base: .9375rem;
|
|
24
|
+
--api-font-size-md: 1rem;
|
|
25
|
+
--api-font-size-lg: 1.2rem;
|
|
26
|
+
--api-line-height-base: 1.5;
|
|
27
|
+
--api-line-height-button: 1.25rem;
|
|
28
|
+
--api-transition-fast: .15s ease;
|
|
29
|
+
--api-transition-base: .2s ease;
|
|
30
|
+
--api-transition-slow: .3s ease;
|
|
31
|
+
--api-shadow-sm: 0 1px 2px #0000000d;
|
|
32
|
+
--api-shadow-md: 0 4px 6px #0000001a;
|
|
33
|
+
--api-z-index-dropdown: 40;
|
|
34
|
+
--api-z-index-tooltip: 999;
|
|
35
|
+
--api-z-index-popup: 1000;
|
|
36
|
+
--api-breakpoint-mobile: 768px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.api-doc-code .shiki, .api-doc-code .shiki span {
|
|
40
|
+
color: var(--api-shiki-light);
|
|
41
|
+
background-color: var(--api-shiki-light-bg, inherit);
|
|
42
|
+
font-style: var(--api-shiki-light-font-style, inherit);
|
|
43
|
+
font-weight: var(--api-shiki-light-font-weight, inherit);
|
|
44
|
+
text-decoration: var(--api-shiki-light-text-decoration, inherit);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
html.rp-dark .api-doc-code .shiki, html.rp-dark .api-doc-code .shiki span {
|
|
48
|
+
color: var(--api-shiki-dark);
|
|
49
|
+
background-color: var(--api-shiki-dark-bg, inherit);
|
|
50
|
+
font-style: var(--api-shiki-dark-font-style, inherit);
|
|
51
|
+
font-weight: var(--api-shiki-dark-font-weight, inherit);
|
|
52
|
+
text-decoration: var(--api-shiki-dark-text-decoration, inherit);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
html.rp-dark {
|
|
56
|
+
--api-color-bg: #161b22;
|
|
57
|
+
--api-color-bg-secondary: #21262d;
|
|
58
|
+
--api-color-text: #e6edf3;
|
|
59
|
+
--api-color-text-secondary: #8b949e;
|
|
60
|
+
--api-color-border: #30363d;
|
|
61
|
+
--api-color-border-hover: #8b949e;
|
|
62
|
+
--api-color-hover-bg: #30363d;
|
|
63
|
+
--api-color-active-bg: #161b22;
|
|
64
|
+
--api-color-link: #58a6ff;
|
|
65
|
+
--api-color-link-hover: #79c0ff;
|
|
66
|
+
--api-color-code-bg: #6e768166;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
html.rp-dark .rp-social-links__item {
|
|
70
|
+
background-color: var(--api-color-bg-secondary);
|
|
71
|
+
border-color: var(--api-color-border);
|
|
72
|
+
color: var(--api-color-text);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
html.rp-dark .rp-social-links__item:hover {
|
|
76
|
+
background-color: var(--api-color-hover-bg);
|
|
77
|
+
border-color: var(--api-color-border-hover);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
html.rp-dark .rp-social-links__item:active {
|
|
81
|
+
background-color: var(--api-color-active-bg);
|
|
82
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
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
|
+
*/
|
|
23
|
+
function useWrapToggle() {
|
|
24
|
+
const [wrapped, setWrapped] = useState(false);
|
|
25
|
+
const toggleWrap = () => {
|
|
26
|
+
setWrapped(!wrapped);
|
|
27
|
+
};
|
|
28
|
+
return {
|
|
29
|
+
wrapped,
|
|
30
|
+
toggleWrap
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
//#endregion
|
|
35
|
+
export { useWrapToggle };
|