@ebl-vue/editor-full 2.31.23 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ebl-vue/editor-full",
3
- "version": "2.31.23",
3
+ "version": "2.31.24",
4
4
  "type": "module",
5
5
  "author": "lrj525@sina.com",
6
6
  "description": "结构化编辑器",
@@ -50,7 +50,7 @@ interface Props {
50
50
  data: OutputData,
51
51
  locale: any,
52
52
  showOutline?: boolean,
53
- scrollWrap:string
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
- scrollWrap:''
62
+
63
63
  });
64
64
  let editorData=toRaw(props.data);
65
65
  let editorIsReady = false;
@@ -202,7 +202,7 @@ onMounted(() => {
202
202
  }
203
203
  //文档大纲
204
204
  if(props.showOutline){
205
- outline = new Outline("holder",props.scrollWrap,editor!);
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:0;
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
- private scrollWrap: HTMLElement;
11
+
12
12
  /**
13
13
  * 初始化插件
14
14
  * @param {EditorJS} editor - 编辑器实例
15
15
  */
16
- constructor(holderId: string,scrollWrap:string,editor: EditorJS) {
16
+ constructor(holderId: string,editor: EditorJS) {
17
17
  this.editor = editor;
18
18
  this.holder = document.getElementById(holderId) as HTMLElement;
19
- this.scrollWrap = (document.getElementById(scrollWrap) ||document.getElementsByTagName(scrollWrap)[0] || document.querySelector(scrollWrap)) as HTMLElement;
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
  });