@ebl-vue/editor-full 2.31.9 → 2.31.11
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/dist/index.mjs +419 -305
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -4
- package/src/components/Editor/Editor.vue +1 -0
- package/src/plugins/code/index.css +31 -2
- package/src/plugins/code/index.ts +7 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ebl-vue/editor-full",
|
|
3
|
-
"version": "2.31.
|
|
3
|
+
"version": "2.31.11",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"author": "lrj525@sina.com",
|
|
6
6
|
"description": "结构化编辑器",
|
|
@@ -11,13 +11,11 @@
|
|
|
11
11
|
"types": "./dist/index.d.ts",
|
|
12
12
|
"import": "./dist/index.mjs"
|
|
13
13
|
}
|
|
14
|
-
|
|
15
14
|
},
|
|
16
15
|
"scripts": {
|
|
17
16
|
"dev": "rimraf dist && vite build --watch",
|
|
18
17
|
"build": "rimraf dist && vite build"
|
|
19
18
|
},
|
|
20
|
-
|
|
21
19
|
"main": "./dist/index.mjs",
|
|
22
20
|
"module": "./dist/indexs.mjs",
|
|
23
21
|
"types": "./dist/index.d.ts",
|
|
@@ -44,7 +42,7 @@
|
|
|
44
42
|
"@editorjs/caret": "^1.0.3",
|
|
45
43
|
"@editorjs/dom": "^1.0.1",
|
|
46
44
|
"axios": "^1.13.2",
|
|
47
|
-
"shiki": "^3.
|
|
45
|
+
"shiki": "^3.20.0",
|
|
48
46
|
"vanilla-caret-js": "^1.1.0"
|
|
49
47
|
},
|
|
50
48
|
"devDependencies": {
|
|
@@ -40,7 +40,12 @@
|
|
|
40
40
|
.ce-editorjs-x-shiki__span {
|
|
41
41
|
position: relative;
|
|
42
42
|
z-index: 0;
|
|
43
|
-
padding: 20px;
|
|
43
|
+
padding-top: 20px;
|
|
44
|
+
padding-bottom: 20px;
|
|
45
|
+
padding-right: 20px;
|
|
46
|
+
/* padding: 20px; */
|
|
47
|
+
padding-left: 55px;
|
|
48
|
+
|
|
44
49
|
margin: 0;
|
|
45
50
|
white-space: pre;
|
|
46
51
|
font-size: 13px;
|
|
@@ -52,7 +57,11 @@
|
|
|
52
57
|
overflow: hidden;
|
|
53
58
|
background-color: transparent;
|
|
54
59
|
position: absolute;
|
|
55
|
-
padding: 20px;
|
|
60
|
+
/* padding: 20px; */
|
|
61
|
+
padding-top: 20px;
|
|
62
|
+
padding-bottom: 20px;
|
|
63
|
+
padding-right: 20px;
|
|
64
|
+
padding-left:55px;
|
|
56
65
|
inset: 0 0 0 0;
|
|
57
66
|
color: transparent;
|
|
58
67
|
z-index: 0;
|
|
@@ -117,4 +126,24 @@
|
|
|
117
126
|
.ce-editorjs-x-shiki__copy_tip.visible {
|
|
118
127
|
visibility: visible;
|
|
119
128
|
opacity: 1;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/* 添加行号样式 */
|
|
132
|
+
|
|
133
|
+
.ce-editorjs-x-shiki__span.shiki .line{
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
}
|
|
137
|
+
.ce-editorjs-x-shiki__span.shiki .line::before {
|
|
138
|
+
content: attr(data-line);
|
|
139
|
+
width: 40px;
|
|
140
|
+
/* padding-right: 15px;
|
|
141
|
+
margin-right: 15px; */
|
|
142
|
+
display: inline-block;
|
|
143
|
+
text-align: right;
|
|
144
|
+
color: #888;
|
|
145
|
+
/* border-right: 1px solid #eee; */
|
|
146
|
+
/* padding-left: 10px; */
|
|
147
|
+
position:absolute;
|
|
148
|
+
left: 0;
|
|
120
149
|
}
|
|
@@ -481,6 +481,7 @@ export default class CodeTool implements BlockTool {
|
|
|
481
481
|
const html = await codeToHtml(this.data.code, {
|
|
482
482
|
lang: this._selectorLanguage,
|
|
483
483
|
theme: this._selectorTheme,
|
|
484
|
+
|
|
484
485
|
transformers: [
|
|
485
486
|
{
|
|
486
487
|
preprocess(code) {
|
|
@@ -491,6 +492,12 @@ export default class CodeTool implements BlockTool {
|
|
|
491
492
|
this.addClassToHast(node, 'ce-editorjs-x-shiki__span')
|
|
492
493
|
preStyle = node.properties?.style as string || ''
|
|
493
494
|
},
|
|
495
|
+
line(node, line) {
|
|
496
|
+
node.properties = node.properties || {};
|
|
497
|
+
node.properties['data-line'] = line;
|
|
498
|
+
|
|
499
|
+
}
|
|
500
|
+
|
|
494
501
|
}
|
|
495
502
|
]
|
|
496
503
|
})
|