@ebl-vue/editor-full 2.31.22 → 2.31.24
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.d.ts +0 -2
- package/dist/index.mjs +22 -23
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/Editor/EditorRender.vue +4 -4
- package/src/plugins/outline/index.css +5 -2
- package/src/plugins/outline/index.ts +4 -11
- package/src/style.css +5 -20
package/package.json
CHANGED
|
@@ -50,7 +50,7 @@ interface Props {
|
|
|
50
50
|
data: OutputData,
|
|
51
51
|
locale: any,
|
|
52
52
|
showOutline?: boolean,
|
|
53
|
-
|
|
53
|
+
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
const props = withDefaults(defineProps<Props>(), {
|
|
@@ -59,7 +59,7 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
59
59
|
}),
|
|
60
60
|
locale: {},
|
|
61
61
|
showOutline: false,
|
|
62
|
-
|
|
62
|
+
|
|
63
63
|
});
|
|
64
64
|
let editorData=toRaw(props.data);
|
|
65
65
|
let editorIsReady = false;
|
|
@@ -161,7 +161,7 @@ onMounted(() => {
|
|
|
161
161
|
tunes: tunes.concat(['imageResize']),
|
|
162
162
|
config: {
|
|
163
163
|
types: ".png,.jpeg,.jpg,.gif,.webp",
|
|
164
|
-
|
|
164
|
+
|
|
165
165
|
endpoints: {
|
|
166
166
|
byFile: '',
|
|
167
167
|
|
|
@@ -202,7 +202,7 @@ onMounted(() => {
|
|
|
202
202
|
}
|
|
203
203
|
//文档大纲
|
|
204
204
|
if(props.showOutline){
|
|
205
|
-
outline = new Outline("holder",
|
|
205
|
+
outline = new Outline("holder",editor!);
|
|
206
206
|
outline.render(editorData);
|
|
207
207
|
}
|
|
208
208
|
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
.ebl-outline{
|
|
2
|
+
background-color: #fff;
|
|
3
|
+
box-sizing: border-box;
|
|
2
4
|
position:fixed;
|
|
3
|
-
top:
|
|
5
|
+
top:var(--header-height,84px);
|
|
6
|
+
|
|
4
7
|
right:0;
|
|
5
8
|
padding: 15px 12px;
|
|
6
9
|
width:280px;
|
|
@@ -10,7 +13,7 @@
|
|
|
10
13
|
color: #606266;
|
|
11
14
|
font-size: 14px;
|
|
12
15
|
padding-bottom: 50px;
|
|
13
|
-
height: calc(100vh - var(--header-height));
|
|
16
|
+
max-height: calc(100vh - var(--header-height,84px));
|
|
14
17
|
}
|
|
15
18
|
.ebl-outline:hover{
|
|
16
19
|
overflow: auto;
|
|
@@ -8,15 +8,15 @@ import { OutputData } from '@ebl-vue/editorjs';
|
|
|
8
8
|
export default class Outline{
|
|
9
9
|
private editor: EditorJS;
|
|
10
10
|
private holder: HTMLElement;
|
|
11
|
-
|
|
11
|
+
|
|
12
12
|
/**
|
|
13
13
|
* 初始化插件
|
|
14
14
|
* @param {EditorJS} editor - 编辑器实例
|
|
15
15
|
*/
|
|
16
|
-
constructor(holderId: string,
|
|
16
|
+
constructor(holderId: string,editor: EditorJS) {
|
|
17
17
|
this.editor = editor;
|
|
18
18
|
this.holder = document.getElementById(holderId) as HTMLElement;
|
|
19
|
-
|
|
19
|
+
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
public render(data: OutputData) {
|
|
@@ -26,7 +26,6 @@ export default class Outline{
|
|
|
26
26
|
this.holder.classList.add("outline");
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
|
|
30
29
|
private createUI(data: OutputData): HTMLElement {
|
|
31
30
|
|
|
32
31
|
const ui = document.createElement('div');
|
|
@@ -51,13 +50,7 @@ export default class Outline{
|
|
|
51
50
|
const block = document.querySelector<HTMLElement>('.codex-editor .ce-block[data-id="' + blockData.id + '"]');
|
|
52
51
|
if (block) {
|
|
53
52
|
const top = block.offsetTop;
|
|
54
|
-
|
|
55
|
-
if (!this.scrollWrap) {
|
|
56
|
-
document.querySelector<HTMLElement>('.codex-editor')?.scrollTo(0, top);
|
|
57
|
-
} else {
|
|
58
|
-
window.scrollTo(0,top)
|
|
59
|
-
//this.scrollWrap.scrollTo(0, top);
|
|
60
|
-
}
|
|
53
|
+
window.scrollTo(0, top);
|
|
61
54
|
}
|
|
62
55
|
|
|
63
56
|
});
|
package/src/style.css
CHANGED
|
@@ -21,11 +21,7 @@
|
|
|
21
21
|
padding-right: 280px;
|
|
22
22
|
}
|
|
23
23
|
.ebl-editor.outline .codex-editor{flex:1;}
|
|
24
|
-
|
|
25
|
-
width: 200px;
|
|
26
|
-
border-right: 1px solid var(--color-border);
|
|
27
|
-
overflow: auto;
|
|
28
|
-
} */
|
|
24
|
+
|
|
29
25
|
|
|
30
26
|
@media(max-width:1240px){
|
|
31
27
|
.ebl-outline{
|
|
@@ -39,25 +35,14 @@
|
|
|
39
35
|
@media(min-width:1240px){
|
|
40
36
|
.ebl-editor.readonly .ce-block__content{
|
|
41
37
|
max-width: 100%;
|
|
42
|
-
padding-left:
|
|
43
|
-
padding-right:
|
|
38
|
+
padding-left: 100px;
|
|
39
|
+
padding-right: 100px;
|
|
44
40
|
|
|
45
41
|
}
|
|
46
42
|
|
|
47
43
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
} */
|
|
51
|
-
/* @media (min-width: 1050px) {
|
|
52
|
-
.ce-block__content {
|
|
53
|
-
max-width: 700px;
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
.ce-toolbar__content {
|
|
57
|
-
max-width: 700px;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
} */
|
|
44
|
+
|
|
45
|
+
|
|
61
46
|
|
|
62
47
|
.ce-toolbar,.ce-inline-toolbar{
|
|
63
48
|
z-index: 1000;
|