cosey 0.6.17 → 0.6.19

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 { getHljs } from '../highlight/highlight.style.js';
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 getHljs();
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("pre", {
26
- "style": {
27
- maxHeight: props.maxHeight
28
- }
29
- }, [createVNode("code", {
30
- "class": "hljs",
31
- "innerHTML": highlightedCode.value
32
- }, null)]), createVNode("div", {
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 getHljs(): CSSObject;
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 getHljs() {
3
+ function getHljsDark() {
4
4
  return {
5
5
  ".hljs": {
6
6
  color: "#abb2bf",
@@ -42,31 +42,73 @@ 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
- pre: {
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
+ display: "inline-block",
97
+ minWidth: "100%",
98
+ padding: token.paddingSM
99
+ },
57
100
  [`${componentCls}-copy`]: {
58
101
  position: "absolute",
59
102
  insetBlockStart: token.sizeXXS,
60
103
  insetInlineEnd: token.sizeXXS,
61
- zIndex: 10,
62
- color: token.colorWhite,
63
- "&:hover,&:active": {
64
- color: `${token.colorWhite} !important`
65
- }
104
+ zIndex: 10
66
105
  },
67
- ...getHljs()
106
+ ...getHljsLight(),
107
+ ":root.dark &": {
108
+ ...getHljsDark()
109
+ }
68
110
  }
69
111
  };
70
112
  });
71
113
 
72
- export { stdin_default as default, getHljs };
114
+ export { stdin_default as default, getHljsDark, getHljsLight };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cosey",
3
- "version": "0.6.17",
3
+ "version": "0.6.19",
4
4
  "description": "基于 Vue3 + vite 的后台管理系统框架",
5
5
  "type": "module",
6
6
  "main": "index.js",