@shikijs/vitepress-twoslash 1.0.0-beta.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/LICENSE +22 -0
- package/README.md +9 -0
- package/dist/client.d.mts +14 -0
- package/dist/client.d.ts +14 -0
- package/dist/client.mjs +50 -0
- package/dist/index.d.mts +37 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.mjs +176 -0
- package/package.json +64 -0
- package/style-core.css +121 -0
- package/style.css +382 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2021 Pine Wu
|
|
4
|
+
Copyright (c) 2023 Anthony Fu <https://github.com/antfu>
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { App } from 'vue';
|
|
2
|
+
import FloatingVue from 'floating-vue';
|
|
3
|
+
|
|
4
|
+
type FloatingVueConfig = Parameters<(typeof FloatingVue)['install']>[1];
|
|
5
|
+
/**
|
|
6
|
+
* Vue plugin to install FloatingVue with styles.
|
|
7
|
+
*
|
|
8
|
+
* Import this function in `.vitepress/theme/index.ts` and use `app.use(TwoslashFloatingVue)` inside the `enhanceApp` hook.
|
|
9
|
+
*/
|
|
10
|
+
declare const TwoslashFloatingVue: {
|
|
11
|
+
install: (app: App, options?: FloatingVueConfig) => void;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export { type FloatingVueConfig, TwoslashFloatingVue as default };
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { App } from 'vue';
|
|
2
|
+
import FloatingVue from 'floating-vue';
|
|
3
|
+
|
|
4
|
+
type FloatingVueConfig = Parameters<(typeof FloatingVue)['install']>[1];
|
|
5
|
+
/**
|
|
6
|
+
* Vue plugin to install FloatingVue with styles.
|
|
7
|
+
*
|
|
8
|
+
* Import this function in `.vitepress/theme/index.ts` and use `app.use(TwoslashFloatingVue)` inside the `enhanceApp` hook.
|
|
9
|
+
*/
|
|
10
|
+
declare const TwoslashFloatingVue: {
|
|
11
|
+
install: (app: App, options?: FloatingVueConfig) => void;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export { type FloatingVueConfig, TwoslashFloatingVue as default };
|
package/dist/client.mjs
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import FloatingVue, { recomputeAllPoppers } from 'floating-vue';
|
|
2
|
+
|
|
3
|
+
const isMobile = typeof navigator !== "undefined" && /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
|
4
|
+
const TwoslashFloatingVue = {
|
|
5
|
+
install: (app, options = {}) => {
|
|
6
|
+
if (typeof window !== "undefined") {
|
|
7
|
+
window.addEventListener("click", (e) => {
|
|
8
|
+
const path = e.composedPath();
|
|
9
|
+
if (path.some((el) => el?.classList?.contains?.("vp-code-group") || el?.classList?.contains?.("tabs")))
|
|
10
|
+
recomputeAllPoppers();
|
|
11
|
+
}, { passive: true });
|
|
12
|
+
}
|
|
13
|
+
app.use(FloatingVue, {
|
|
14
|
+
...options,
|
|
15
|
+
themes: {
|
|
16
|
+
"twoslash": {
|
|
17
|
+
$extend: "dropdown",
|
|
18
|
+
triggers: isMobile ? ["touch"] : ["hover", "touch"],
|
|
19
|
+
popperTriggers: isMobile ? ["touch"] : ["hover", "touch"],
|
|
20
|
+
placement: "bottom-start",
|
|
21
|
+
overflowPadding: 10,
|
|
22
|
+
delay: 0,
|
|
23
|
+
handleResize: false,
|
|
24
|
+
autoHide: true,
|
|
25
|
+
instantMove: true,
|
|
26
|
+
flip: false,
|
|
27
|
+
arrowPadding: 8,
|
|
28
|
+
autoBoundaryMaxSize: true
|
|
29
|
+
},
|
|
30
|
+
"twoslash-query": {
|
|
31
|
+
$extend: "twoslash",
|
|
32
|
+
triggers: ["click"],
|
|
33
|
+
popperTriggers: ["click"],
|
|
34
|
+
autoHide: false
|
|
35
|
+
},
|
|
36
|
+
"twoslash-completion": {
|
|
37
|
+
$extend: "twoslash-query",
|
|
38
|
+
triggers: ["click"],
|
|
39
|
+
popperTriggers: ["click"],
|
|
40
|
+
autoHide: false,
|
|
41
|
+
distance: 0,
|
|
42
|
+
arrowOverflow: true
|
|
43
|
+
},
|
|
44
|
+
...options.theme
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export { TwoslashFloatingVue as default };
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { TransformerTwoslashOptions } from '@shikijs/twoslash/core';
|
|
2
|
+
import { ShikiTransformer } from 'shiki';
|
|
3
|
+
import { RendererRichOptions, TwoslashRenderer } from '@shikijs/twoslash';
|
|
4
|
+
export { defaultHoverInfoProcessor } from '@shikijs/twoslash';
|
|
5
|
+
|
|
6
|
+
interface TwoslashFloatingVueOptions {
|
|
7
|
+
classCopyIgnore?: string;
|
|
8
|
+
classFloatingPanel?: string;
|
|
9
|
+
classCode?: string;
|
|
10
|
+
classMarkdown?: string;
|
|
11
|
+
floatingVueTheme?: string;
|
|
12
|
+
floatingVueThemeQuery?: string;
|
|
13
|
+
floatingVueThemeCompletion?: string;
|
|
14
|
+
}
|
|
15
|
+
interface TwoslashFloatingVueRendererOptions extends RendererRichOptions {
|
|
16
|
+
/**
|
|
17
|
+
* Class and themes for floating-vue specific nodes
|
|
18
|
+
*/
|
|
19
|
+
floatingVue?: TwoslashFloatingVueOptions;
|
|
20
|
+
}
|
|
21
|
+
declare function rendererFloatingVue(options?: TwoslashFloatingVueRendererOptions): TwoslashRenderer;
|
|
22
|
+
|
|
23
|
+
interface VitePressPluginTwoslashOptions extends TransformerTwoslashOptions, TwoslashFloatingVueRendererOptions {
|
|
24
|
+
/**
|
|
25
|
+
* Requires adding `twoslash` to the code block explicitly to run twoslash
|
|
26
|
+
* @default true
|
|
27
|
+
*/
|
|
28
|
+
explicitTrigger?: boolean;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Create a Shiki transformer for VitePress to enable twoslash integration
|
|
32
|
+
*
|
|
33
|
+
* Add this to `markdown.codeTransformers` in `.vitepress/config.ts`
|
|
34
|
+
*/
|
|
35
|
+
declare function transformerTwoslash(options?: VitePressPluginTwoslashOptions): ShikiTransformer;
|
|
36
|
+
|
|
37
|
+
export { type TwoslashFloatingVueOptions, type TwoslashFloatingVueRendererOptions, type VitePressPluginTwoslashOptions, rendererFloatingVue, transformerTwoslash };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { TransformerTwoslashOptions } from '@shikijs/twoslash/core';
|
|
2
|
+
import { ShikiTransformer } from 'shiki';
|
|
3
|
+
import { RendererRichOptions, TwoslashRenderer } from '@shikijs/twoslash';
|
|
4
|
+
export { defaultHoverInfoProcessor } from '@shikijs/twoslash';
|
|
5
|
+
|
|
6
|
+
interface TwoslashFloatingVueOptions {
|
|
7
|
+
classCopyIgnore?: string;
|
|
8
|
+
classFloatingPanel?: string;
|
|
9
|
+
classCode?: string;
|
|
10
|
+
classMarkdown?: string;
|
|
11
|
+
floatingVueTheme?: string;
|
|
12
|
+
floatingVueThemeQuery?: string;
|
|
13
|
+
floatingVueThemeCompletion?: string;
|
|
14
|
+
}
|
|
15
|
+
interface TwoslashFloatingVueRendererOptions extends RendererRichOptions {
|
|
16
|
+
/**
|
|
17
|
+
* Class and themes for floating-vue specific nodes
|
|
18
|
+
*/
|
|
19
|
+
floatingVue?: TwoslashFloatingVueOptions;
|
|
20
|
+
}
|
|
21
|
+
declare function rendererFloatingVue(options?: TwoslashFloatingVueRendererOptions): TwoslashRenderer;
|
|
22
|
+
|
|
23
|
+
interface VitePressPluginTwoslashOptions extends TransformerTwoslashOptions, TwoslashFloatingVueRendererOptions {
|
|
24
|
+
/**
|
|
25
|
+
* Requires adding `twoslash` to the code block explicitly to run twoslash
|
|
26
|
+
* @default true
|
|
27
|
+
*/
|
|
28
|
+
explicitTrigger?: boolean;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Create a Shiki transformer for VitePress to enable twoslash integration
|
|
32
|
+
*
|
|
33
|
+
* Add this to `markdown.codeTransformers` in `.vitepress/config.ts`
|
|
34
|
+
*/
|
|
35
|
+
declare function transformerTwoslash(options?: VitePressPluginTwoslashOptions): ShikiTransformer;
|
|
36
|
+
|
|
37
|
+
export { type TwoslashFloatingVueOptions, type TwoslashFloatingVueRendererOptions, type VitePressPluginTwoslashOptions, rendererFloatingVue, transformerTwoslash };
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { createTransformerFactory } from '@shikijs/twoslash/core';
|
|
2
|
+
import { createTwoslasher } from 'twoslash-vue';
|
|
3
|
+
import { rendererRich } from '@shikijs/twoslash';
|
|
4
|
+
export { defaultHoverInfoProcessor } from '@shikijs/twoslash';
|
|
5
|
+
import { gfmFromMarkdown } from 'mdast-util-gfm';
|
|
6
|
+
import { fromMarkdown } from 'mdast-util-from-markdown';
|
|
7
|
+
import { toHast, defaultHandlers } from 'mdast-util-to-hast';
|
|
8
|
+
|
|
9
|
+
function rendererFloatingVue(options = {}) {
|
|
10
|
+
const {
|
|
11
|
+
classCopyIgnore = "vp-copy-ignore",
|
|
12
|
+
classFloatingPanel = "twoslash-floating",
|
|
13
|
+
classCode = "vp-code",
|
|
14
|
+
classMarkdown = "vp-doc",
|
|
15
|
+
floatingVueTheme = "twoslash",
|
|
16
|
+
floatingVueThemeQuery = "twoslash-query",
|
|
17
|
+
floatingVueThemeCompletion = "twoslash-completion"
|
|
18
|
+
} = options.floatingVue || {};
|
|
19
|
+
const hoverBasicProps = {
|
|
20
|
+
"class": "twoslash-hover",
|
|
21
|
+
"popper-class": ["shiki", classFloatingPanel, classCopyIgnore, classCode].join(" "),
|
|
22
|
+
"theme": floatingVueTheme
|
|
23
|
+
};
|
|
24
|
+
function compose(parts) {
|
|
25
|
+
return [
|
|
26
|
+
{
|
|
27
|
+
type: "element",
|
|
28
|
+
tagName: "span",
|
|
29
|
+
properties: {},
|
|
30
|
+
children: [parts.token]
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
type: "element",
|
|
34
|
+
tagName: "template",
|
|
35
|
+
properties: {
|
|
36
|
+
"v-slot:popper": "{}"
|
|
37
|
+
},
|
|
38
|
+
content: {
|
|
39
|
+
type: "root",
|
|
40
|
+
children: [vPre(parts.popup)]
|
|
41
|
+
},
|
|
42
|
+
children: []
|
|
43
|
+
}
|
|
44
|
+
];
|
|
45
|
+
}
|
|
46
|
+
const rich = rendererRich({
|
|
47
|
+
classExtra: classCopyIgnore,
|
|
48
|
+
...options,
|
|
49
|
+
renderMarkdown,
|
|
50
|
+
renderMarkdownInline,
|
|
51
|
+
hast: {
|
|
52
|
+
hoverToken: {
|
|
53
|
+
tagName: "v-menu",
|
|
54
|
+
properties: hoverBasicProps
|
|
55
|
+
},
|
|
56
|
+
hoverCompose: compose,
|
|
57
|
+
queryToken: {
|
|
58
|
+
tagName: "v-menu",
|
|
59
|
+
properties: {
|
|
60
|
+
...hoverBasicProps,
|
|
61
|
+
theme: floatingVueThemeQuery
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
queryCompose: compose,
|
|
65
|
+
popupDocs: {
|
|
66
|
+
class: `twoslash-popup-docs ${classMarkdown}`
|
|
67
|
+
},
|
|
68
|
+
popupDocsTags: {
|
|
69
|
+
class: `twoslash-popup-docs twoslash-popup-docs-tags ${classMarkdown}`
|
|
70
|
+
},
|
|
71
|
+
completionCompose({ popup, cursor }) {
|
|
72
|
+
return [
|
|
73
|
+
{
|
|
74
|
+
type: "element",
|
|
75
|
+
tagName: "v-menu",
|
|
76
|
+
properties: {
|
|
77
|
+
"popper-class": ["shiki twoslash-completion", classCopyIgnore, classFloatingPanel],
|
|
78
|
+
"theme": floatingVueThemeCompletion,
|
|
79
|
+
":shown": "true"
|
|
80
|
+
},
|
|
81
|
+
children: [
|
|
82
|
+
cursor,
|
|
83
|
+
{
|
|
84
|
+
type: "element",
|
|
85
|
+
tagName: "template",
|
|
86
|
+
properties: {
|
|
87
|
+
"v-slot:popper": "{}"
|
|
88
|
+
},
|
|
89
|
+
content: {
|
|
90
|
+
type: "root",
|
|
91
|
+
children: [vPre(popup)]
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
];
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
return rich;
|
|
101
|
+
}
|
|
102
|
+
function vPre(el) {
|
|
103
|
+
if (el.type === "element") {
|
|
104
|
+
el.properties = el.properties || {};
|
|
105
|
+
el.properties["v-pre"] = "";
|
|
106
|
+
}
|
|
107
|
+
return el;
|
|
108
|
+
}
|
|
109
|
+
function renderMarkdown(md) {
|
|
110
|
+
const mdast = fromMarkdown(
|
|
111
|
+
md.replace(/{@link ([^}]*)}/g, "$1"),
|
|
112
|
+
// replace jsdoc links
|
|
113
|
+
{ mdastExtensions: [gfmFromMarkdown()] }
|
|
114
|
+
);
|
|
115
|
+
return toHast(
|
|
116
|
+
mdast,
|
|
117
|
+
{
|
|
118
|
+
handlers: {
|
|
119
|
+
code: (state, node) => {
|
|
120
|
+
const lang = node.lang || "";
|
|
121
|
+
if (lang) {
|
|
122
|
+
return this.codeToHast(
|
|
123
|
+
node.value,
|
|
124
|
+
{
|
|
125
|
+
...this.options,
|
|
126
|
+
transformers: [],
|
|
127
|
+
lang
|
|
128
|
+
}
|
|
129
|
+
).children[0];
|
|
130
|
+
}
|
|
131
|
+
return defaultHandlers.code(state, node);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
).children;
|
|
136
|
+
}
|
|
137
|
+
function renderMarkdownInline(md, context) {
|
|
138
|
+
if (context === "tag:param")
|
|
139
|
+
md = md.replace(/^([\w$-]+)/, "`$1` ");
|
|
140
|
+
const children = renderMarkdown.call(this, md);
|
|
141
|
+
if (children.length === 1 && children[0].type === "element" && children[0].tagName === "p")
|
|
142
|
+
return children[0].children;
|
|
143
|
+
return children;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function transformerTwoslash(options = {}) {
|
|
147
|
+
const twoslash = createTransformerFactory(
|
|
148
|
+
createTwoslasher()
|
|
149
|
+
)({
|
|
150
|
+
langs: ["ts", "tsx", "js", "jsx", "json", "vue"],
|
|
151
|
+
explicitTrigger: true,
|
|
152
|
+
renderer: rendererFloatingVue(options),
|
|
153
|
+
...options
|
|
154
|
+
});
|
|
155
|
+
return {
|
|
156
|
+
...twoslash,
|
|
157
|
+
name: "@shikijs/vitepress-twoslash",
|
|
158
|
+
preprocess(code, options2) {
|
|
159
|
+
const cleanup = options2.transformers?.find((i) => i.name === "vitepress:clean-up");
|
|
160
|
+
if (cleanup)
|
|
161
|
+
options2.transformers?.splice(options2.transformers.indexOf(cleanup), 1);
|
|
162
|
+
if (options2.meta?.__raw?.includes("twoslash")) {
|
|
163
|
+
const vPre = options2.transformers?.find((i) => i.name === "vitepress:v-pre");
|
|
164
|
+
if (vPre)
|
|
165
|
+
options2.transformers?.splice(options2.transformers.indexOf(vPre), 1);
|
|
166
|
+
}
|
|
167
|
+
return twoslash.preprocess.call(this, code, options2);
|
|
168
|
+
},
|
|
169
|
+
postprocess(html) {
|
|
170
|
+
if (this.meta.twoslash)
|
|
171
|
+
return html.replace(/{/g, "{");
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export { rendererFloatingVue, transformerTwoslash };
|
package/package.json
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@shikijs/vitepress-twoslash",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "1.0.0-beta.0",
|
|
5
|
+
"description": "Enable Twoslash support in VitePress",
|
|
6
|
+
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"homepage": "https://github.com/shikijs/shiki#readme",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/shikijs/shiki.git",
|
|
12
|
+
"directory": "packages/vitepress-twoslash"
|
|
13
|
+
},
|
|
14
|
+
"bugs": "https://github.com/shikijs/shiki/issues",
|
|
15
|
+
"keywords": [
|
|
16
|
+
"shiki",
|
|
17
|
+
"twoslash",
|
|
18
|
+
"vitepress-plugin"
|
|
19
|
+
],
|
|
20
|
+
"sideEffects": false,
|
|
21
|
+
"exports": {
|
|
22
|
+
".": {
|
|
23
|
+
"types": "./dist/index.d.mts",
|
|
24
|
+
"default": "./dist/index.mjs"
|
|
25
|
+
},
|
|
26
|
+
"./client": {
|
|
27
|
+
"types": "./dist/client.d.mts",
|
|
28
|
+
"default": "./dist/client.mjs"
|
|
29
|
+
},
|
|
30
|
+
"./style.css": "./style.css",
|
|
31
|
+
"./style-core.css": "./style-core.css"
|
|
32
|
+
},
|
|
33
|
+
"main": "./dist/index.mjs",
|
|
34
|
+
"module": "./dist/index.mjs",
|
|
35
|
+
"types": "./dist/index.d.mts",
|
|
36
|
+
"typesVersions": {
|
|
37
|
+
"*": {
|
|
38
|
+
"./client": [
|
|
39
|
+
"./dist/client.d.mts"
|
|
40
|
+
],
|
|
41
|
+
"*": [
|
|
42
|
+
"./dist/index.d.mts"
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"files": [
|
|
47
|
+
"*.css",
|
|
48
|
+
"dist"
|
|
49
|
+
],
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"floating-vue": "^5.2.0",
|
|
52
|
+
"mdast-util-from-markdown": "^2.0.0",
|
|
53
|
+
"mdast-util-gfm": "^3.0.0",
|
|
54
|
+
"mdast-util-to-hast": "^13.1.0",
|
|
55
|
+
"twoslash-vue": "^0.1.0",
|
|
56
|
+
"vue": "^3.4.15",
|
|
57
|
+
"@shikijs/twoslash": "1.0.0-beta.0",
|
|
58
|
+
"shiki": "1.0.0-beta.0"
|
|
59
|
+
},
|
|
60
|
+
"scripts": {
|
|
61
|
+
"build": "unbuild",
|
|
62
|
+
"dev": "unbuild --stub"
|
|
63
|
+
}
|
|
64
|
+
}
|
package/style-core.css
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--twoslash-popup-bg: var(--vp-c-bg, inherit);
|
|
3
|
+
--twoslash-popup-color: var(--vp-c-text-1);
|
|
4
|
+
--twoslash-docs-color: var(--vp-c-text-1);
|
|
5
|
+
--twoslash-docs-font: var(--vp-font-family-base);
|
|
6
|
+
--twoslash-code-font: var(--vp-font-family-mono);
|
|
7
|
+
--twoslash-code-size: var(--vp-code-font-size);
|
|
8
|
+
--twoslash-underline-color: #8888;
|
|
9
|
+
--twoslash-border-color: var(--vp-c-border);
|
|
10
|
+
--twoslash-cursor-color: var(--vp-c-brand);
|
|
11
|
+
--twoslash-matched-color: var(--vp-c-brand);
|
|
12
|
+
--twoslash-unmatched-color: var(--vp-c-text-2);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.v-popper--theme-twoslash {
|
|
16
|
+
z-index: calc(var(--vp-z-index-local-nav) - 1);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.v-popper--theme-twoslash .v-popper__inner {
|
|
20
|
+
background: var(--twoslash-popup-bg);
|
|
21
|
+
color: var(--twoslash-popup-color);
|
|
22
|
+
border-color: var(--twoslash-border-color);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.v-popper--theme-twoslash .v-popper__arrow-outer {
|
|
26
|
+
border-color: var(--twoslash-border-color);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.v-popper--theme-twoslash .v-popper__arrow-inner {
|
|
30
|
+
border-color: var(--twoslash-popup-bg);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.twoslash-popup-container {
|
|
34
|
+
transform: translateY(1.5em);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.twoslash-query-presisted .twoslash-popup-container {
|
|
38
|
+
transform: translateY(1.8em);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.twoslash .v-popper {
|
|
42
|
+
display: inline-block;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.twoslash-completion-list .twoslash-completions-icon {
|
|
46
|
+
color: var(--twoslash-unmatched-color) !important;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.twoslash-floating .twoslash-popup-code {
|
|
50
|
+
max-width: 600px;
|
|
51
|
+
display: block;
|
|
52
|
+
width: fit-content;
|
|
53
|
+
min-width: 100%;
|
|
54
|
+
padding: 6px 12px;
|
|
55
|
+
line-height: var(--vp-code-line-height);
|
|
56
|
+
font-size: var(--twoslash-code-size);
|
|
57
|
+
transition: color 0.5s;
|
|
58
|
+
white-space: pre-wrap;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.twoslash-floating .twoslash-popup-docs {
|
|
62
|
+
border-top: 1px solid var(--twoslash-border-color);
|
|
63
|
+
color: var(--twoslash-docs-color);
|
|
64
|
+
padding: 0px 12px 0px 12px !important;
|
|
65
|
+
font-family: var(--twoslash-docs-font);
|
|
66
|
+
font-size: 0.9em;
|
|
67
|
+
max-height: 500px;
|
|
68
|
+
max-width: 700px;
|
|
69
|
+
overflow-y: auto;
|
|
70
|
+
overflow-x: hidden;
|
|
71
|
+
text-wrap: balance;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.twoslash-floating .twoslash-popup-docs p {
|
|
75
|
+
margin: 0;
|
|
76
|
+
padding: 6px 0;
|
|
77
|
+
text-wrap: balance;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.twoslash-floating .twoslash-popup-docs pre {
|
|
81
|
+
background-color: var(--vp-code-block-bg);
|
|
82
|
+
border-radius: 8px;
|
|
83
|
+
padding: 12px;
|
|
84
|
+
margin: 6px -2px;
|
|
85
|
+
overflow-x: auto;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.twoslash-floating .twoslash-popup-docs-tags {
|
|
89
|
+
display: flex;
|
|
90
|
+
flex-direction: column;
|
|
91
|
+
padding: 8px 12px !important;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.twoslash-floating .twoslash-popup-docs-tags .twoslash-popup-docs-tag-name {
|
|
95
|
+
font-family: var(--twoslash-code-font);
|
|
96
|
+
color: var(--twoslash-unmatched-color);
|
|
97
|
+
margin-right: 0.5em;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.twoslash-completion-cursor {
|
|
101
|
+
height: 1.2em;
|
|
102
|
+
width: 2px;
|
|
103
|
+
margin-bottom: -0.2em;
|
|
104
|
+
background: var(--twoslash-cursor-color);
|
|
105
|
+
display: inline-block;
|
|
106
|
+
user-select: none;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.twoslash-floating.twoslash-completion .v-popper__arrow-container {
|
|
110
|
+
display: none;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.twoslash-floating.twoslash-completion .twoslash-completion-list {
|
|
114
|
+
padding: 6px;
|
|
115
|
+
font-family: var(--twoslash-code-font);
|
|
116
|
+
font-size: var(--twoslash-code-size) !important;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.twoslash-floating.twoslash-completion .twoslash-completion-list li {
|
|
120
|
+
padding: 3px 0;
|
|
121
|
+
}
|
package/style.css
ADDED
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
/* BUNDLED FROM floating-vue/dist/style.css */
|
|
2
|
+
.resize-observer[data-v-b329ee4c]{position:absolute;top:0;left:0;z-index:-1;width:100%;height:100%;border:none;background-color:transparent;pointer-events:none;display:block;overflow:hidden;opacity:0}.resize-observer[data-v-b329ee4c] object{display:block;position:absolute;top:0;left:0;height:100%;width:100%;overflow:hidden;pointer-events:none;z-index:-1}.v-popper__popper{z-index:10000;top:0;left:0;outline:none}.v-popper__popper.v-popper__popper--hidden{visibility:hidden;opacity:0;transition:opacity .15s,visibility .15s;pointer-events:none}.v-popper__popper.v-popper__popper--shown{visibility:visible;opacity:1;transition:opacity .15s}.v-popper__popper.v-popper__popper--skip-transition,.v-popper__popper.v-popper__popper--skip-transition>.v-popper__wrapper{transition:none!important}.v-popper__backdrop{position:absolute;top:0;left:0;width:100%;height:100%;display:none}.v-popper__inner{position:relative;box-sizing:border-box;overflow-y:auto}.v-popper__inner>div{position:relative;z-index:1;max-width:inherit;max-height:inherit}.v-popper__arrow-container{position:absolute;width:10px;height:10px}.v-popper__popper--arrow-overflow .v-popper__arrow-container,.v-popper__popper--no-positioning .v-popper__arrow-container{display:none}.v-popper__arrow-inner,.v-popper__arrow-outer{border-style:solid;position:absolute;top:0;left:0;width:0;height:0}.v-popper__arrow-inner{visibility:hidden;border-width:7px}.v-popper__arrow-outer{border-width:6px}.v-popper__popper[data-popper-placement^=top] .v-popper__arrow-inner,.v-popper__popper[data-popper-placement^=bottom] .v-popper__arrow-inner{left:-2px}.v-popper__popper[data-popper-placement^=top] .v-popper__arrow-outer,.v-popper__popper[data-popper-placement^=bottom] .v-popper__arrow-outer{left:-1px}.v-popper__popper[data-popper-placement^=top] .v-popper__arrow-inner,.v-popper__popper[data-popper-placement^=top] .v-popper__arrow-outer{border-bottom-width:0;border-left-color:transparent!important;border-right-color:transparent!important;border-bottom-color:transparent!important}.v-popper__popper[data-popper-placement^=top] .v-popper__arrow-inner{top:-2px}.v-popper__popper[data-popper-placement^=bottom] .v-popper__arrow-container{top:0}.v-popper__popper[data-popper-placement^=bottom] .v-popper__arrow-inner,.v-popper__popper[data-popper-placement^=bottom] .v-popper__arrow-outer{border-top-width:0;border-left-color:transparent!important;border-right-color:transparent!important;border-top-color:transparent!important}.v-popper__popper[data-popper-placement^=bottom] .v-popper__arrow-inner{top:-4px}.v-popper__popper[data-popper-placement^=bottom] .v-popper__arrow-outer{top:-6px}.v-popper__popper[data-popper-placement^=left] .v-popper__arrow-inner,.v-popper__popper[data-popper-placement^=right] .v-popper__arrow-inner{top:-2px}.v-popper__popper[data-popper-placement^=left] .v-popper__arrow-outer,.v-popper__popper[data-popper-placement^=right] .v-popper__arrow-outer{top:-1px}.v-popper__popper[data-popper-placement^=right] .v-popper__arrow-inner,.v-popper__popper[data-popper-placement^=right] .v-popper__arrow-outer{border-left-width:0;border-left-color:transparent!important;border-top-color:transparent!important;border-bottom-color:transparent!important}.v-popper__popper[data-popper-placement^=right] .v-popper__arrow-inner{left:-4px}.v-popper__popper[data-popper-placement^=right] .v-popper__arrow-outer{left:-6px}.v-popper__popper[data-popper-placement^=left] .v-popper__arrow-container{right:-10px}.v-popper__popper[data-popper-placement^=left] .v-popper__arrow-inner,.v-popper__popper[data-popper-placement^=left] .v-popper__arrow-outer{border-right-width:0;border-top-color:transparent!important;border-right-color:transparent!important;border-bottom-color:transparent!important}.v-popper__popper[data-popper-placement^=left] .v-popper__arrow-inner{left:-2px}.v-popper--theme-tooltip .v-popper__inner{background:rgba(0,0,0,.8);color:#fff;border-radius:6px;padding:7px 12px 6px}.v-popper--theme-tooltip .v-popper__arrow-outer{border-color:#000c}.v-popper--theme-dropdown .v-popper__inner{background:#fff;color:#000;border-radius:6px;border:1px solid #ddd;box-shadow:0 6px 30px #0000001a}.v-popper--theme-dropdown .v-popper__arrow-inner{visibility:visible;border-color:#fff}.v-popper--theme-dropdown .v-popper__arrow-outer{border-color:#ddd}
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
/* BUNDLED FROM @shikijs/twoslash/style-rich.css */
|
|
6
|
+
/* ===== Basic ===== */
|
|
7
|
+
:root {
|
|
8
|
+
--twoslash-border-color: #8888;
|
|
9
|
+
--twoslash-underline-color: currentColor;
|
|
10
|
+
--twoslash-highlighted-border: #c37d0d50;
|
|
11
|
+
--twoslash-highlighted-bg: #c37d0d20;
|
|
12
|
+
--twoslash-popup-bg: #f8f8f8;
|
|
13
|
+
--twoslash-popup-color: inherit;
|
|
14
|
+
--twoslash-popup-shadow: rgba(0, 0, 0.08) 0px 1px 4px;
|
|
15
|
+
--twoslash-docs-color: #888;
|
|
16
|
+
--twoslash-docs-font: sans-serif;
|
|
17
|
+
--twoslach-code-font: inherit;
|
|
18
|
+
--twoslach-code-font-size: 1em;
|
|
19
|
+
--twoslash-matched-color: inherit;
|
|
20
|
+
--twoslash-unmatched-color: #888;
|
|
21
|
+
--twoslash-cursor-color: #8888;
|
|
22
|
+
--twoslash-error-color: #d45656;
|
|
23
|
+
--twoslash-error-bg: #d4565620;
|
|
24
|
+
--twoslash-tag-color: #3772cf;
|
|
25
|
+
--twoslash-tag-bg: #3772cf20;
|
|
26
|
+
--twoslash-tag-warn-color: #c37d0d;
|
|
27
|
+
--twoslash-tag-warn-bg: #c37d0d20;
|
|
28
|
+
--twoslash-tag-annotate-color: #1ba673;
|
|
29
|
+
--twoslash-tag-annotate-bg: #1ba67320;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/* Respect people's wishes to not have animations */
|
|
33
|
+
@media (prefers-reduced-motion: reduce) {
|
|
34
|
+
.twoslash * {
|
|
35
|
+
transition: none !important;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/* ===== Hover Info ===== */
|
|
40
|
+
.twoslash:hover .twoslash-hover {
|
|
41
|
+
border-color: var(--twoslash-underline-color);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.twoslash .twoslash-hover {
|
|
45
|
+
border-bottom: 1px dotted transparent;
|
|
46
|
+
transition-timing-function: ease;
|
|
47
|
+
transition: border-color 0.3s;
|
|
48
|
+
position: relative;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.twoslash .twoslash-popup-container {
|
|
52
|
+
position: absolute;
|
|
53
|
+
opacity: 0;
|
|
54
|
+
display: inline-flex;
|
|
55
|
+
flex-direction: column;
|
|
56
|
+
transform: translateY(1.1em);
|
|
57
|
+
background: var(--twoslash-popup-bg);
|
|
58
|
+
color: var(--twoslash-popup-color);
|
|
59
|
+
border: 1px solid var(--twoslash-border-color);
|
|
60
|
+
transition: opacity 0.3s;
|
|
61
|
+
border-radius: 4px;
|
|
62
|
+
pointer-events: none;
|
|
63
|
+
z-index: 10;
|
|
64
|
+
user-select: none;
|
|
65
|
+
text-align: left;
|
|
66
|
+
box-shadow: var(--twoslash-popup-shadow);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.twoslash .twoslash-query-presisted .twoslash-popup-container {
|
|
70
|
+
z-index: 9;
|
|
71
|
+
transform: translateY(1.5em);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.twoslash .twoslash-hover:hover .twoslash-popup-container,
|
|
75
|
+
.twoslash .twoslash-query-presisted .twoslash-popup-container {
|
|
76
|
+
opacity: 1;
|
|
77
|
+
pointer-events: auto;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.twoslash .twoslash-popup-container:hover {
|
|
81
|
+
user-select: auto;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.twoslash .twoslash-popup-arrow {
|
|
85
|
+
position: absolute;
|
|
86
|
+
top: -4px;
|
|
87
|
+
left: 1em;
|
|
88
|
+
border-top: 1px solid var(--twoslash-border-color);
|
|
89
|
+
border-right: 1px solid var(--twoslash-border-color);
|
|
90
|
+
background: var(--twoslash-popup-bg);
|
|
91
|
+
transform: rotate(-45deg);
|
|
92
|
+
width: 6px;
|
|
93
|
+
height: 6px;
|
|
94
|
+
pointer-events: none;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.twoslash .twoslash-popup-code,
|
|
98
|
+
.twoslash .twoslash-popup-docs {
|
|
99
|
+
padding: 6px 8px !important;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.twoslash .twoslash-popup-code {
|
|
103
|
+
font-family: var(--twoslach-code-font);
|
|
104
|
+
font-size: var(--twoslach-code-font-size);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.twoslash .twoslash-popup-docs {
|
|
108
|
+
color: var(--twoslash-docs-color);
|
|
109
|
+
font-family: var(--twoslash-docs-font);
|
|
110
|
+
font-size: 0.8em;
|
|
111
|
+
border-top: 1px solid var(--twoslash-border-color);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.twoslash .twoslash-popup-docs-tags {
|
|
115
|
+
display: flex;
|
|
116
|
+
flex-direction: column;
|
|
117
|
+
font-family: var(--twoslash-docs-font);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.twoslash .twoslash-popup-docs-tags,
|
|
121
|
+
.twoslash .twoslash-popup-docs-tag-name {
|
|
122
|
+
margin-right: 0.5em;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.twoslash .twoslash-popup-docs-tag-name {
|
|
126
|
+
font-family: var(--twoslach-code-font);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/* ===== Error Line ===== */
|
|
130
|
+
.twoslash .twoslash-error-line {
|
|
131
|
+
position: relative;
|
|
132
|
+
background-color: var(--twoslash-error-bg);
|
|
133
|
+
border-left: 3px solid var(--twoslash-error-color);
|
|
134
|
+
color: var(--twoslash-error-color);
|
|
135
|
+
padding: 6px 12px;
|
|
136
|
+
margin: 0.2em 0;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.twoslash .twoslash-error {
|
|
140
|
+
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")
|
|
141
|
+
repeat-x bottom left;
|
|
142
|
+
padding-bottom: 2px;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/* ===== Completeions ===== */
|
|
146
|
+
.twoslash .twoslash-completion-cursor {
|
|
147
|
+
position: relative;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.twoslash .twoslash-completion-cursor .twoslash-completion-list {
|
|
151
|
+
user-select: none;
|
|
152
|
+
position: absolute;
|
|
153
|
+
top: 0;
|
|
154
|
+
left: 0;
|
|
155
|
+
transform: translate(0, 1.2em);
|
|
156
|
+
margin: 3px 0 0 -1px;
|
|
157
|
+
display: inline-block;
|
|
158
|
+
z-index: 8;
|
|
159
|
+
box-shadow: var(--twoslash-popup-shadow);
|
|
160
|
+
background: var(--twoslash-popup-bg);
|
|
161
|
+
border: 1px solid var(--twoslash-border-color);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.twoslash-completion-list {
|
|
165
|
+
width: 240px;
|
|
166
|
+
font-size: 0.8rem;
|
|
167
|
+
padding: 4px;
|
|
168
|
+
display: flex;
|
|
169
|
+
flex-direction: column;
|
|
170
|
+
gap: 4px;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.twoslash-completion-list:hover {
|
|
174
|
+
user-select: auto;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.twoslash-completion-list::before {
|
|
178
|
+
background-color: var(--twoslash-cursor-color);
|
|
179
|
+
width: 2px;
|
|
180
|
+
position: absolute;
|
|
181
|
+
top: -1.6em;
|
|
182
|
+
height: 1.4em;
|
|
183
|
+
left: -1px;
|
|
184
|
+
content: ' ';
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.twoslash-completion-list li {
|
|
188
|
+
overflow: hidden;
|
|
189
|
+
display: flex;
|
|
190
|
+
align-items: center;
|
|
191
|
+
gap: 0.25em;
|
|
192
|
+
line-height: 1em;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.twoslash-completion-list li span.twoslash-completions-unmatched {
|
|
196
|
+
color: var(--twoslash-unmatched-color);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.twoslash-completion-list .deprecated {
|
|
200
|
+
text-decoration: line-through;
|
|
201
|
+
opacity: 0.5;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.twoslash-completion-list li span.twoslash-completions-matched {
|
|
205
|
+
color: var(--twoslash-matched-color);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/* Highlights */
|
|
209
|
+
.twoslash-highlighted {
|
|
210
|
+
background-color: var(--twoslash-highlighted-bg);
|
|
211
|
+
border: 1px solid var(--twoslash-highlighted-border);
|
|
212
|
+
padding: 1px 2px;
|
|
213
|
+
margin: -1px -3px;
|
|
214
|
+
border-radius: 4px;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/* Icons */
|
|
218
|
+
.twoslash-completion-list .twoslash-completions-icon {
|
|
219
|
+
color: var(--twoslash-unmatched-color);
|
|
220
|
+
width: 1em;
|
|
221
|
+
flex: none;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/* Custom Tags */
|
|
225
|
+
.twoslash .twoslash-tag-line {
|
|
226
|
+
position: relative;
|
|
227
|
+
background-color: var(--twoslash-tag-bg);
|
|
228
|
+
border-left: 3px solid var(--twoslash-tag-color);
|
|
229
|
+
color: var(--twoslash-tag-color);
|
|
230
|
+
padding: 6px 10px;
|
|
231
|
+
margin: 0.2em 0;
|
|
232
|
+
display: flex;
|
|
233
|
+
align-items: center;
|
|
234
|
+
gap: 0.3em;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.twoslash .twoslash-tag-line .twoslash-tag-icon {
|
|
238
|
+
width: 1.1em;
|
|
239
|
+
color: inherit;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.twoslash .twoslash-tag-line.twoslash-tag-error-line {
|
|
243
|
+
background-color: var(--twoslash-error-bg);
|
|
244
|
+
border-left: 3px solid var(--twoslash-error-color);
|
|
245
|
+
color: var(--twoslash-error-color);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.twoslash .twoslash-tag-line.twoslash-tag-warn-line {
|
|
249
|
+
background-color: var(--twoslash-tag-warn-bg);
|
|
250
|
+
border-left: 3px solid var(--twoslash-tag-warn-color);
|
|
251
|
+
color: var(--twoslash-tag-warn-color);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
.twoslash .twoslash-tag-line.twoslash-tag-annotate-line {
|
|
255
|
+
background-color: var(--twoslash-tag-annotate-bg);
|
|
256
|
+
border-left: 3px solid var(--twoslash-tag-annotate-color);
|
|
257
|
+
color: var(--twoslash-tag-annotate-color);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
/* BUNDLED FROM @shikijs/vitepress-twoslash/style-core.css */
|
|
262
|
+
:root {
|
|
263
|
+
--twoslash-popup-bg: var(--vp-c-bg, inherit);
|
|
264
|
+
--twoslash-popup-color: var(--vp-c-text-1);
|
|
265
|
+
--twoslash-docs-color: var(--vp-c-text-1);
|
|
266
|
+
--twoslash-docs-font: var(--vp-font-family-base);
|
|
267
|
+
--twoslash-code-font: var(--vp-font-family-mono);
|
|
268
|
+
--twoslash-code-size: var(--vp-code-font-size);
|
|
269
|
+
--twoslash-underline-color: #8888;
|
|
270
|
+
--twoslash-border-color: var(--vp-c-border);
|
|
271
|
+
--twoslash-cursor-color: var(--vp-c-brand);
|
|
272
|
+
--twoslash-matched-color: var(--vp-c-brand);
|
|
273
|
+
--twoslash-unmatched-color: var(--vp-c-text-2);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
.v-popper--theme-twoslash {
|
|
277
|
+
z-index: calc(var(--vp-z-index-local-nav) - 1);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.v-popper--theme-twoslash .v-popper__inner {
|
|
281
|
+
background: var(--twoslash-popup-bg);
|
|
282
|
+
color: var(--twoslash-popup-color);
|
|
283
|
+
border-color: var(--twoslash-border-color);
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
.v-popper--theme-twoslash .v-popper__arrow-outer {
|
|
287
|
+
border-color: var(--twoslash-border-color);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
.v-popper--theme-twoslash .v-popper__arrow-inner {
|
|
291
|
+
border-color: var(--twoslash-popup-bg);
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
.twoslash-popup-container {
|
|
295
|
+
transform: translateY(1.5em);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
.twoslash-query-presisted .twoslash-popup-container {
|
|
299
|
+
transform: translateY(1.8em);
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.twoslash .v-popper {
|
|
303
|
+
display: inline-block;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
.twoslash-completion-list .twoslash-completions-icon {
|
|
307
|
+
color: var(--twoslash-unmatched-color) !important;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
.twoslash-floating .twoslash-popup-code {
|
|
311
|
+
max-width: 600px;
|
|
312
|
+
display: block;
|
|
313
|
+
width: fit-content;
|
|
314
|
+
min-width: 100%;
|
|
315
|
+
padding: 6px 12px;
|
|
316
|
+
line-height: var(--vp-code-line-height);
|
|
317
|
+
font-size: var(--twoslash-code-size);
|
|
318
|
+
transition: color 0.5s;
|
|
319
|
+
white-space: pre-wrap;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
.twoslash-floating .twoslash-popup-docs {
|
|
323
|
+
border-top: 1px solid var(--twoslash-border-color);
|
|
324
|
+
color: var(--twoslash-docs-color);
|
|
325
|
+
padding: 0px 12px 0px 12px !important;
|
|
326
|
+
font-family: var(--twoslash-docs-font);
|
|
327
|
+
font-size: 0.9em;
|
|
328
|
+
max-height: 500px;
|
|
329
|
+
max-width: 700px;
|
|
330
|
+
overflow-y: auto;
|
|
331
|
+
overflow-x: hidden;
|
|
332
|
+
text-wrap: balance;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
.twoslash-floating .twoslash-popup-docs p {
|
|
336
|
+
margin: 0;
|
|
337
|
+
padding: 6px 0;
|
|
338
|
+
text-wrap: balance;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
.twoslash-floating .twoslash-popup-docs pre {
|
|
342
|
+
background-color: var(--vp-code-block-bg);
|
|
343
|
+
border-radius: 8px;
|
|
344
|
+
padding: 12px;
|
|
345
|
+
margin: 6px -2px;
|
|
346
|
+
overflow-x: auto;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
.twoslash-floating .twoslash-popup-docs-tags {
|
|
350
|
+
display: flex;
|
|
351
|
+
flex-direction: column;
|
|
352
|
+
padding: 8px 12px !important;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
.twoslash-floating .twoslash-popup-docs-tags .twoslash-popup-docs-tag-name {
|
|
356
|
+
font-family: var(--twoslash-code-font);
|
|
357
|
+
color: var(--twoslash-unmatched-color);
|
|
358
|
+
margin-right: 0.5em;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
.twoslash-completion-cursor {
|
|
362
|
+
height: 1.2em;
|
|
363
|
+
width: 2px;
|
|
364
|
+
margin-bottom: -0.2em;
|
|
365
|
+
background: var(--twoslash-cursor-color);
|
|
366
|
+
display: inline-block;
|
|
367
|
+
user-select: none;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
.twoslash-floating.twoslash-completion .v-popper__arrow-container {
|
|
371
|
+
display: none;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
.twoslash-floating.twoslash-completion .twoslash-completion-list {
|
|
375
|
+
padding: 6px;
|
|
376
|
+
font-family: var(--twoslash-code-font);
|
|
377
|
+
font-size: var(--twoslash-code-size) !important;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
.twoslash-floating.twoslash-completion .twoslash-completion-list li {
|
|
381
|
+
padding: 3px 0;
|
|
382
|
+
}
|