@chenyomi/leafer-htmltext-editor 1.0.5 → 1.0.6
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/TextEditTool/index.d.ts.map +1 -1
- package/dist/TextEditTool/index.js +1 -0
- package/dist/esm/TextEditTool/index.d.ts.map +1 -1
- package/dist/esm/TextEditTool/index.js +1 -0
- package/dist/esm/index.d.ts +3 -3
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/utils.js +2 -2
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +32 -29
- package/dist/index.js +30 -27
- package/dist/utils.js +2 -2
- package/package.json +1 -1
- package/src/TextEditTool/index.ts +1 -0
- package/src/index.ts +37 -29
- package/src/utils.ts +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/TextEditTool/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAGT,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/TextEditTool/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAGT,MAAM,mBAAmB,CAAC;AAK3B,qBAEa,YAAa,SAAQ,QAAQ;IAExC,IAAW,GAAG,WAEb;IACM,KAAK,EAAE,GAAG,CAAQ;IACzB,OAAO,CAAC,kBAAkB,CAAsB;gBAEpC,MAAM,EAAE,GAAG;IAQvB,OAAO,CAAC,QAAQ;IAgBT,QAAQ,IAAI,IAAI;IA2BhB,MAAM,IAAI,IAAI;IA4BrB,OAAO,CAAC,gBAAgB,CAAS;IACjC,OAAO,CAAC,WAAW,CAAK;IACjB,oBAAoB,CAAC,IAAI,EAAE,GAAG,GAAG,IAAI;IAQrC,QAAQ,IAAI,IAAI;IAgBhB,QAAQ,IAAI,IAAI;IAMhB,SAAS,IAAI,IAAI;CACzB"}
|
|
@@ -14,6 +14,7 @@ const editor_1 = require("@leafer-in/editor");
|
|
|
14
14
|
const leafer_ui_1 = require("leafer-ui");
|
|
15
15
|
const __1 = require("../");
|
|
16
16
|
const utils_1 = require("../utils");
|
|
17
|
+
console.log('初始化文本外部编辑插件');
|
|
17
18
|
let TextEditTool = class TextEditTool extends editor_1.EditTool {
|
|
18
19
|
get tag() {
|
|
19
20
|
return "TextEditTool";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/TextEditTool/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAGT,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/TextEditTool/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAGT,MAAM,mBAAmB,CAAC;AAK3B,qBAEa,YAAa,SAAQ,QAAQ;IAExC,IAAW,GAAG,WAEb;IACM,KAAK,EAAE,GAAG,CAAQ;IACzB,OAAO,CAAC,kBAAkB,CAAsB;gBAEpC,MAAM,EAAE,GAAG;IAQvB,OAAO,CAAC,QAAQ;IAgBT,QAAQ,IAAI,IAAI;IA2BhB,MAAM,IAAI,IAAI;IA4BrB,OAAO,CAAC,gBAAgB,CAAS;IACjC,OAAO,CAAC,WAAW,CAAK;IACjB,oBAAoB,CAAC,IAAI,EAAE,GAAG,GAAG,IAAI;IAQrC,QAAQ,IAAI,IAAI;IAgBhB,QAAQ,IAAI,IAAI;IAMhB,SAAS,IAAI,IAAI;CACzB"}
|
|
@@ -11,6 +11,7 @@ import { EditTool, EditorScaleEvent, registerEditTool, } from "@leafer-in/editor
|
|
|
11
11
|
import { PointerEvent } from "leafer-ui";
|
|
12
12
|
import { quillManager } from "../";
|
|
13
13
|
import { updataHtmlText } from "../utils";
|
|
14
|
+
console.log('初始化文本外部编辑插件');
|
|
14
15
|
let TextEditTool = class TextEditTool extends EditTool {
|
|
15
16
|
get tag() {
|
|
16
17
|
return "TextEditTool";
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import Quill from "quill";
|
|
2
|
-
import
|
|
2
|
+
import "quill/dist/quill.core.css";
|
|
3
3
|
import "./TextEditTool";
|
|
4
|
-
import
|
|
4
|
+
import "./TextEditor";
|
|
5
5
|
declare class QuillManager {
|
|
6
6
|
private static instance;
|
|
7
7
|
private quill;
|
|
8
8
|
app_: any | null;
|
|
9
9
|
private constructor();
|
|
10
10
|
static getInstance(): QuillManager;
|
|
11
|
-
init(app: any): Promise<Quill>;
|
|
11
|
+
init(app: any): Promise<Quill | undefined>;
|
|
12
12
|
getQuill(): Quill;
|
|
13
13
|
getCanvas(): any;
|
|
14
14
|
private registerFonts;
|
package/dist/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAgB,MAAM,OAAO,CAAC;AACrC,OAAO,2BAA2B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAgB,MAAM,OAAO,CAAC;AACrC,OAAO,2BAA2B,CAAC;AAEnC,OAAO,gBAAgB,CAAC;AACxB,OAAO,cAAc,CAAC;AACtB,cAAM,YAAY;IAChB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAe;IACtC,OAAO,CAAC,KAAK,CAAsB;IAC5B,IAAI,EAAE,GAAG,GAAG,IAAI,CAAQ;IAE/B,OAAO;IAEP,MAAM,CAAC,WAAW;IAOZ,IAAI,CAAC,GAAG,EAAE,GAAG;IAwDnB,QAAQ;IAOR,SAAS;IAOT,OAAO,CAAC,aAAa;IA+Bd,aAAa,IAAI,OAAO;IAQxB,QAAQ,CACb,QAAQ,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,EAC7B,KAAK,SAAI,EACT,OAAO,CAAC,EAAE,GAAG,GACZ,IAAI;CA4BR;AAED,eAAO,MAAM,YAAY,cAA6B,CAAC"}
|
package/dist/esm/utils.js
CHANGED
|
@@ -103,7 +103,7 @@ const addFontSizeToP = (e, html, fontSize = 16, lineHeight = '1.5', letterSpacin
|
|
|
103
103
|
height = `${e.parent.height}px`;
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
|
-
const style = `<style>
|
|
106
|
+
const style = `<style>sub,sup{font-size:63%;}.ql-ui{position:absolute}ol,ul{counter-reset:list-0;padding-left:1.5em;margin:0}ol>li,ul>li{counter-increment:list-0;list-style-type:none;position:relative;padding-left:0;margin:0}ol>li::before{content:counter(list-0,decimal) '. ';position:absolute;left:-1.5em;width:1.2em;text-align:right}ul>li::before{content:'\u2022';position:absolute;left:-1.5em;width:1.2em;text-align:right}li[data-list]{counter-set:list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}.ql-align-center{text-align:center}.ql-align-right{text-align:right}.ql-align-left{text-align:left}.ql-align-justify{text-align:justify}</style>`;
|
|
107
107
|
let divBox = '';
|
|
108
108
|
if (e.parent.children[0].tag.includes('Shape')) {
|
|
109
109
|
divBox =
|
|
@@ -121,7 +121,7 @@ const addFontSizeToP = (e, html, fontSize = 16, lineHeight = '1.5', letterSpacin
|
|
|
121
121
|
}
|
|
122
122
|
else {
|
|
123
123
|
console.log(actualHeight);
|
|
124
|
-
divBox = style + `<div style="width: ${actualWidth - 10}px;
|
|
124
|
+
divBox = style + `<div style="width: ${actualWidth - 10}px;">${str}</div>`;
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
127
|
console.log(divBox, '最终的html内容');
|
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import Quill from "quill";
|
|
2
|
-
import
|
|
2
|
+
import "quill/dist/quill.core.css";
|
|
3
3
|
import "./TextEditTool";
|
|
4
|
-
import
|
|
4
|
+
import "./TextEditor";
|
|
5
5
|
declare class QuillManager {
|
|
6
6
|
private static instance;
|
|
7
7
|
private quill;
|
|
8
8
|
app_: any | null;
|
|
9
9
|
private constructor();
|
|
10
10
|
static getInstance(): QuillManager;
|
|
11
|
-
init(app: any): Promise<Quill>;
|
|
11
|
+
init(app: any): Promise<Quill | undefined>;
|
|
12
12
|
getQuill(): Quill;
|
|
13
13
|
getCanvas(): any;
|
|
14
14
|
private registerFonts;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAgB,MAAM,OAAO,CAAC;AACrC,OAAO,2BAA2B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAgB,MAAM,OAAO,CAAC;AACrC,OAAO,2BAA2B,CAAC;AAEnC,OAAO,gBAAgB,CAAC;AACxB,OAAO,cAAc,CAAC;AACtB,cAAM,YAAY;IAChB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAe;IACtC,OAAO,CAAC,KAAK,CAAsB;IAC5B,IAAI,EAAE,GAAG,GAAG,IAAI,CAAQ;IAE/B,OAAO;IAEP,MAAM,CAAC,WAAW;IAOZ,IAAI,CAAC,GAAG,EAAE,GAAG;IAwDnB,QAAQ;IAOR,SAAS;IAOT,OAAO,CAAC,aAAa;IA+Bd,aAAa,IAAI,OAAO;IAQxB,QAAQ,CACb,QAAQ,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,EAC7B,KAAK,SAAI,EACT,OAAO,CAAC,EAAE,GAAG,GACZ,IAAI;CA4BR;AAED,eAAO,MAAM,YAAY,cAA6B,CAAC"}
|
package/dist/index.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Quill, { Delta } from "quill";
|
|
2
|
-
import
|
|
2
|
+
import "quill/dist/quill.core.css";
|
|
3
3
|
import "./TextEditTool";
|
|
4
|
-
import
|
|
4
|
+
import "./TextEditor";
|
|
5
5
|
class QuillManager {
|
|
6
6
|
constructor() {
|
|
7
7
|
this.quill = null;
|
|
@@ -27,37 +27,40 @@ class QuillManager {
|
|
|
27
27
|
el.style.wordBreak = "break-all";
|
|
28
28
|
el.style.visibility = "hidden";
|
|
29
29
|
document.body.appendChild(el);
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
.
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
30
|
+
this.quill = new Quill("#textInnerEditor", {
|
|
31
|
+
theme: undefined,
|
|
32
|
+
modules: {
|
|
33
|
+
toolbar: false,
|
|
34
|
+
keyboard: {
|
|
35
|
+
bindings: {
|
|
36
|
+
enter: {
|
|
37
|
+
key: "Enter",
|
|
38
|
+
handler: (range) => {
|
|
39
|
+
const [line] = this.quill.getLine(range.index);
|
|
40
|
+
const BlockBlot = Quill.import("blots/block");
|
|
41
|
+
if (!BlockBlot?.bubbleFormats)
|
|
42
|
+
return true;
|
|
43
|
+
const lineFormats = BlockBlot.bubbleFormats(line);
|
|
44
|
+
const delta = new Delta()
|
|
45
|
+
.retain(range.index)
|
|
46
|
+
.delete(range.length)
|
|
47
|
+
.insert("\n", lineFormats);
|
|
48
|
+
this.quill.updateContents(delta, Quill.sources.USER);
|
|
49
|
+
this.quill.setSelection(range.index + 1, Quill.sources.SILENT);
|
|
50
|
+
return false;
|
|
51
|
+
},
|
|
52
52
|
},
|
|
53
53
|
},
|
|
54
54
|
},
|
|
55
55
|
},
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
56
|
+
});
|
|
57
|
+
this.app_.editor.quill = this.quill;
|
|
58
|
+
this.registerFonts();
|
|
59
|
+
return this.quill;
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
this.quill = this.app_.editor.quill;
|
|
63
|
+
}
|
|
61
64
|
}
|
|
62
65
|
getQuill() {
|
|
63
66
|
if (!this.quill) {
|
package/dist/index.js
CHANGED
|
@@ -63,37 +63,40 @@ class QuillManager {
|
|
|
63
63
|
el.style.wordBreak = "break-all";
|
|
64
64
|
el.style.visibility = "hidden";
|
|
65
65
|
document.body.appendChild(el);
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
.
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
66
|
+
this.quill = new quill_1.default("#textInnerEditor", {
|
|
67
|
+
theme: undefined,
|
|
68
|
+
modules: {
|
|
69
|
+
toolbar: false,
|
|
70
|
+
keyboard: {
|
|
71
|
+
bindings: {
|
|
72
|
+
enter: {
|
|
73
|
+
key: "Enter",
|
|
74
|
+
handler: (range) => {
|
|
75
|
+
const [line] = this.quill.getLine(range.index);
|
|
76
|
+
const BlockBlot = quill_1.default.import("blots/block");
|
|
77
|
+
if (!BlockBlot?.bubbleFormats)
|
|
78
|
+
return true;
|
|
79
|
+
const lineFormats = BlockBlot.bubbleFormats(line);
|
|
80
|
+
const delta = new quill_1.Delta()
|
|
81
|
+
.retain(range.index)
|
|
82
|
+
.delete(range.length)
|
|
83
|
+
.insert("\n", lineFormats);
|
|
84
|
+
this.quill.updateContents(delta, quill_1.default.sources.USER);
|
|
85
|
+
this.quill.setSelection(range.index + 1, quill_1.default.sources.SILENT);
|
|
86
|
+
return false;
|
|
87
|
+
},
|
|
88
88
|
},
|
|
89
89
|
},
|
|
90
90
|
},
|
|
91
91
|
},
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
92
|
+
});
|
|
93
|
+
this.app_.editor.quill = this.quill;
|
|
94
|
+
this.registerFonts();
|
|
95
|
+
return this.quill;
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
this.quill = this.app_.editor.quill;
|
|
99
|
+
}
|
|
97
100
|
}
|
|
98
101
|
getQuill() {
|
|
99
102
|
if (!this.quill) {
|
package/dist/utils.js
CHANGED
|
@@ -107,7 +107,7 @@ const addFontSizeToP = (e, html, fontSize = 16, lineHeight = '1.5', letterSpacin
|
|
|
107
107
|
height = `${e.parent.height}px`;
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
|
-
const style = `<style>
|
|
110
|
+
const style = `<style>sub,sup{font-size:63%;}.ql-ui{position:absolute}ol,ul{counter-reset:list-0;padding-left:1.5em;margin:0}ol>li,ul>li{counter-increment:list-0;list-style-type:none;position:relative;padding-left:0;margin:0}ol>li::before{content:counter(list-0,decimal) '. ';position:absolute;left:-1.5em;width:1.2em;text-align:right}ul>li::before{content:'\u2022';position:absolute;left:-1.5em;width:1.2em;text-align:right}li[data-list]{counter-set:list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}.ql-align-center{text-align:center}.ql-align-right{text-align:right}.ql-align-left{text-align:left}.ql-align-justify{text-align:justify}</style>`;
|
|
111
111
|
let divBox = '';
|
|
112
112
|
if (e.parent.children[0].tag.includes('Shape')) {
|
|
113
113
|
divBox =
|
|
@@ -125,7 +125,7 @@ const addFontSizeToP = (e, html, fontSize = 16, lineHeight = '1.5', letterSpacin
|
|
|
125
125
|
}
|
|
126
126
|
else {
|
|
127
127
|
console.log(actualHeight);
|
|
128
|
-
divBox = style + `<div style="width: ${actualWidth - 10}px;
|
|
128
|
+
divBox = style + `<div style="width: ${actualWidth - 10}px;">${str}</div>`;
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
131
|
console.log(divBox, '最终的html内容');
|
package/package.json
CHANGED
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
import { PointerEvent } from "leafer-ui";
|
|
7
7
|
import { quillManager } from "../";
|
|
8
8
|
import { updataHtmlText } from "../utils";
|
|
9
|
+
console.log('初始化文本外部编辑插件');
|
|
9
10
|
@registerEditTool()
|
|
10
11
|
// 定义插件类,继承自 EditTool,处理矩形圆角编辑交互
|
|
11
12
|
export class TextEditTool extends EditTool {
|
package/src/index.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import Quill, { Delta } from "quill";
|
|
2
|
-
import
|
|
2
|
+
import "quill/dist/quill.core.css";
|
|
3
|
+
|
|
3
4
|
import "./TextEditTool";
|
|
4
|
-
import
|
|
5
|
+
import "./TextEditor";
|
|
5
6
|
class QuillManager {
|
|
6
7
|
private static instance: QuillManager;
|
|
7
8
|
private quill: Quill | null = null;
|
|
@@ -30,39 +31,46 @@ class QuillManager {
|
|
|
30
31
|
el.style.wordBreak = "break-all";
|
|
31
32
|
el.style.visibility = "hidden";
|
|
32
33
|
document.body.appendChild(el);
|
|
33
|
-
|
|
34
|
+
this.quill = new Quill("#textInnerEditor", {
|
|
35
|
+
theme: undefined,
|
|
36
|
+
modules: {
|
|
37
|
+
toolbar: false,
|
|
38
|
+
keyboard: {
|
|
39
|
+
bindings: {
|
|
40
|
+
enter: {
|
|
41
|
+
key: "Enter",
|
|
42
|
+
handler: (range: any) => {
|
|
43
|
+
const [line] = this.quill!.getLine(range.index);
|
|
44
|
+
const BlockBlot: any = Quill.import("blots/block");
|
|
45
|
+
if (!BlockBlot?.bubbleFormats) return true;
|
|
34
46
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
bindings: {
|
|
41
|
-
enter: {
|
|
42
|
-
key: "Enter",
|
|
43
|
-
handler: (range: any) => {
|
|
44
|
-
const [line] = this.quill!.getLine(range.index);
|
|
45
|
-
const BlockBlot: any = Quill.import("blots/block");
|
|
46
|
-
if (!BlockBlot?.bubbleFormats) return true;
|
|
47
|
+
const lineFormats = BlockBlot.bubbleFormats(line);
|
|
48
|
+
const delta = new Delta()
|
|
49
|
+
.retain(range.index)
|
|
50
|
+
.delete(range.length)
|
|
51
|
+
.insert("\n", lineFormats);
|
|
47
52
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
this.quill!.setSelection(range.index + 1, Quill.sources.SILENT);
|
|
56
|
-
return false;
|
|
53
|
+
this.quill!.updateContents(delta, Quill.sources.USER);
|
|
54
|
+
this.quill!.setSelection(
|
|
55
|
+
range.index + 1,
|
|
56
|
+
Quill.sources.SILENT,
|
|
57
|
+
);
|
|
58
|
+
return false;
|
|
59
|
+
},
|
|
57
60
|
},
|
|
58
61
|
},
|
|
59
62
|
},
|
|
60
63
|
},
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
});
|
|
65
|
+
this.app_.editor.quill = this.quill;
|
|
66
|
+
this.registerFonts();
|
|
67
|
+
return this.quill;
|
|
68
|
+
} else {
|
|
69
|
+
this.quill = this.app_.editor.quill
|
|
70
|
+
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
|
|
66
74
|
}
|
|
67
75
|
|
|
68
76
|
getQuill() {
|
package/src/utils.ts
CHANGED
|
@@ -142,7 +142,7 @@ const addFontSizeToP = (e: any, html: any, fontSize = 16, lineHeight = '1.5', le
|
|
|
142
142
|
}
|
|
143
143
|
|
|
144
144
|
// 水平居中相关样式内嵌 因为这个quill居中用的class没用style
|
|
145
|
-
const style = `<style>
|
|
145
|
+
const style = `<style>sub,sup{font-size:63%;}.ql-ui{position:absolute}ol,ul{counter-reset:list-0;padding-left:1.5em;margin:0}ol>li,ul>li{counter-increment:list-0;list-style-type:none;position:relative;padding-left:0;margin:0}ol>li::before{content:counter(list-0,decimal) '. ';position:absolute;left:-1.5em;width:1.2em;text-align:right}ul>li::before{content:'\u2022';position:absolute;left:-1.5em;width:1.2em;text-align:right}li[data-list]{counter-set:list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}.ql-align-center{text-align:center}.ql-align-right{text-align:right}.ql-align-left{text-align:left}.ql-align-justify{text-align:justify}</style>`
|
|
146
146
|
let divBox = ''
|
|
147
147
|
if (e.parent.children[0].tag.includes('Shape')) {
|
|
148
148
|
divBox =
|
|
@@ -158,7 +158,7 @@ const addFontSizeToP = (e: any, html: any, fontSize = 16, lineHeight = '1.5', le
|
|
|
158
158
|
divBox = style + str
|
|
159
159
|
} else {
|
|
160
160
|
console.log(actualHeight)
|
|
161
|
-
divBox = style + `<div style="width: ${actualWidth - 10}px;
|
|
161
|
+
divBox = style + `<div style="width: ${actualWidth - 10}px;">${str}</div>`
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
164
|
console.log(divBox, '最终的html内容')
|