cosey 0.6.17 → 0.6.18
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.
|
@@ -4,10 +4,15 @@ var stdin_default = getSimpleStyleHook("CoMask", (token) => {
|
|
|
4
4
|
const { componentCls } = token;
|
|
5
5
|
return {
|
|
6
6
|
[componentCls]: {
|
|
7
|
+
width: token.sizeLG,
|
|
8
|
+
height: `${token.sizeLG} !important`,
|
|
9
|
+
fontSize: token.fontSize,
|
|
10
|
+
transition: "none",
|
|
7
11
|
"&:not(.is-copied):hover": {
|
|
8
12
|
opacity: 0.75
|
|
9
13
|
},
|
|
10
14
|
"&.is-copied": {
|
|
15
|
+
fontSize: token.fontSizeXL,
|
|
11
16
|
[`${componentCls}-icon`]: {
|
|
12
17
|
color: token.colorSuccess
|
|
13
18
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getHljsDark } from '../highlight/highlight.style.js';
|
|
2
2
|
import { getGlobalStyleHook } from '../theme/getGlobalStyleHook.js';
|
|
3
3
|
import { getSimpleStyleHook } from '../theme/getSimpleStyleHook.js';
|
|
4
4
|
import { getTruncateStyle } from '../style/mixins.js';
|
|
@@ -357,7 +357,7 @@ const getEditorButtonStyle = (token) => {
|
|
|
357
357
|
};
|
|
358
358
|
};
|
|
359
359
|
const useHljsStyle = getGlobalStyleHook("CoGlobalHighlight", () => {
|
|
360
|
-
return
|
|
360
|
+
return getHljsDark();
|
|
361
361
|
});
|
|
362
362
|
var stdin_default = getSimpleStyleHook("CoEditor", (token) => {
|
|
363
363
|
return [getEditorStyle(token), getEditorToolbarStyle(token), getEditorButtonStyle(token)];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { defineComponent, computed, createVNode } from 'vue';
|
|
2
|
+
import { ElScrollbar } from 'element-plus';
|
|
2
3
|
import { highlightSlots, highlightProps } from './highlight.api.js';
|
|
3
4
|
import stdin_default$1 from './highlight.style.js';
|
|
4
5
|
import stdin_default$2 from '../copy/copy.js';
|
|
@@ -22,14 +23,16 @@ var stdin_default = defineComponent({
|
|
|
22
23
|
return () => {
|
|
23
24
|
return createVNode("div", {
|
|
24
25
|
"class": [hashId.value, prefixCls.value]
|
|
25
|
-
}, [createVNode(
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"
|
|
32
|
-
|
|
26
|
+
}, [createVNode(ElScrollbar, {
|
|
27
|
+
"tag": "pre",
|
|
28
|
+
"class": `${prefixCls.value}-scroll`,
|
|
29
|
+
"view-class": "hljs",
|
|
30
|
+
"maxHeight": props.maxHeight
|
|
31
|
+
}, {
|
|
32
|
+
default: () => [createVNode("code", {
|
|
33
|
+
"innerHTML": highlightedCode.value
|
|
34
|
+
}, null)]
|
|
35
|
+
}), createVNode("div", {
|
|
33
36
|
"class": `${prefixCls.value}-copy`
|
|
34
37
|
}, [createVNode(stdin_default$2, {
|
|
35
38
|
"text": props.code,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CSSObject } from '../cssinjs';
|
|
2
|
-
export declare function
|
|
2
|
+
export declare function getHljsDark(): CSSObject;
|
|
3
|
+
export declare function getHljsLight(): CSSObject;
|
|
3
4
|
declare const _default: (_prefixCls?: import("vue").ComputedRef<string> | string, themeManager?: import("../theme/theme-context").ThemeManager) => {
|
|
4
5
|
hashId: import("vue").Ref<string, string>;
|
|
5
6
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getSimpleStyleHook } from '../theme/getSimpleStyleHook.js';
|
|
2
2
|
|
|
3
|
-
function
|
|
3
|
+
function getHljsDark() {
|
|
4
4
|
return {
|
|
5
5
|
".hljs": {
|
|
6
6
|
color: "#abb2bf",
|
|
@@ -42,31 +42,71 @@ function getHljs() {
|
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
|
+
function getHljsLight() {
|
|
46
|
+
return {
|
|
47
|
+
".hljs": {
|
|
48
|
+
color: "#383a42",
|
|
49
|
+
background: "#fafafa"
|
|
50
|
+
},
|
|
51
|
+
".hljs-comment,.hljs-quote": {
|
|
52
|
+
color: "#a0a1a7",
|
|
53
|
+
fontStyle: "italic"
|
|
54
|
+
},
|
|
55
|
+
".hljs-doctag,.hljs-keyword,.hljs-formula": {
|
|
56
|
+
color: "#a626a4"
|
|
57
|
+
},
|
|
58
|
+
".hljs-section,.hljs-name,.hljs-selector-tag,.hljs-deletion,.hljs-subst": {
|
|
59
|
+
color: "#e45649"
|
|
60
|
+
},
|
|
61
|
+
".hljs-literal": {
|
|
62
|
+
color: "#0184bb"
|
|
63
|
+
},
|
|
64
|
+
".hljs-string,.hljs-regexp,.hljs-addition,.hljs-attribute,.hljs-meta .hljs-string": {
|
|
65
|
+
color: "#50a14f"
|
|
66
|
+
},
|
|
67
|
+
".hljs-attr,.hljs-variable,.hljs-template-variable,.hljs-type,.hljs-selector-class,.hljs-selector-attr,.hljs-selector-pseudo,.hljs-number": {
|
|
68
|
+
color: "#986801"
|
|
69
|
+
},
|
|
70
|
+
".hljs-symbol,.hljs-bullet,.hljs-link,.hljs-meta,.hljs-selector-id,.hljs-title": {
|
|
71
|
+
color: "#4078f2"
|
|
72
|
+
},
|
|
73
|
+
".hljs-built_in,.hljs-title.class_,.hljs-class .hljs-title": {
|
|
74
|
+
color: "#c18401"
|
|
75
|
+
},
|
|
76
|
+
".hljs-emphasis": {
|
|
77
|
+
fontStyle: "italic"
|
|
78
|
+
},
|
|
79
|
+
".hljs-strong": {
|
|
80
|
+
fontWeight: "bold"
|
|
81
|
+
},
|
|
82
|
+
".hljs-link": {
|
|
83
|
+
textDecoration: "underline"
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
}
|
|
45
87
|
var stdin_default = getSimpleStyleHook("CoHighlight", (token) => {
|
|
46
88
|
const { componentCls } = token;
|
|
47
89
|
return {
|
|
48
90
|
[componentCls]: {
|
|
49
91
|
position: "relative",
|
|
50
|
-
|
|
51
|
-
padding: token.paddingSM,
|
|
52
|
-
overflow: "auto",
|
|
53
|
-
color: "#abb2bf",
|
|
54
|
-
background: "#282c34",
|
|
92
|
+
[`${componentCls}-scroll`]: {
|
|
55
93
|
borderRadius: token.borderRadius
|
|
56
94
|
},
|
|
95
|
+
pre: {
|
|
96
|
+
padding: token.paddingSM
|
|
97
|
+
},
|
|
57
98
|
[`${componentCls}-copy`]: {
|
|
58
99
|
position: "absolute",
|
|
59
100
|
insetBlockStart: token.sizeXXS,
|
|
60
101
|
insetInlineEnd: token.sizeXXS,
|
|
61
|
-
zIndex: 10
|
|
62
|
-
color: token.colorWhite,
|
|
63
|
-
"&:hover,&:active": {
|
|
64
|
-
color: `${token.colorWhite} !important`
|
|
65
|
-
}
|
|
102
|
+
zIndex: 10
|
|
66
103
|
},
|
|
67
|
-
...
|
|
104
|
+
...getHljsLight(),
|
|
105
|
+
":root.dark &": {
|
|
106
|
+
...getHljsDark()
|
|
107
|
+
}
|
|
68
108
|
}
|
|
69
109
|
};
|
|
70
110
|
});
|
|
71
111
|
|
|
72
|
-
export { stdin_default as default,
|
|
112
|
+
export { stdin_default as default, getHljsDark, getHljsLight };
|