@hailin-zheng/editor-core 2.2.33 → 2.2.34
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/index-cjs.js +68 -5
- package/index-cjs.js.map +1 -1
- package/index.js +68 -5
- package/index.js.map +1 -1
- package/med_editor/framework/impl/document/doc-impl.d.ts +1 -0
- package/package.json +1 -1
package/index.js
CHANGED
@@ -3979,6 +3979,7 @@ class DocumentRenderObject extends BlockContainerRenderObject {
|
|
3979
3979
|
const pageCorner = this.exportPageCornerHTML(event);
|
3980
3980
|
const pageNum = this.exportPageNumHTML(event);
|
3981
3981
|
const copyright = this.exportCopyRight(event);
|
3982
|
+
const defs = this.exportDefs();
|
3982
3983
|
return {
|
3983
3984
|
sel: "svg",
|
3984
3985
|
isCompleted: true,
|
@@ -3993,7 +3994,7 @@ class DocumentRenderObject extends BlockContainerRenderObject {
|
|
3993
3994
|
},
|
3994
3995
|
},
|
3995
3996
|
children: [
|
3996
|
-
pageCorner, highlight, selection, ...CommonUtil.toArray(event.getChildNodes(this)), pageNum, copyright
|
3997
|
+
defs, pageCorner, highlight, selection, ...CommonUtil.toArray(event.getChildNodes(this)), pageNum, copyright
|
3997
3998
|
]
|
3998
3999
|
};
|
3999
4000
|
}
|
@@ -4060,6 +4061,34 @@ class DocumentRenderObject extends BlockContainerRenderObject {
|
|
4060
4061
|
},
|
4061
4062
|
};
|
4062
4063
|
}
|
4064
|
+
exportDefs() {
|
4065
|
+
/**
|
4066
|
+
* <defs>
|
4067
|
+
<filter id="f1" x="0" y="0">
|
4068
|
+
<feGaussianBlur stdDeviation="0.5" result="blur" />
|
4069
|
+
<feMerge>
|
4070
|
+
<feMergeNode in="thicken" />
|
4071
|
+
<feMergeNode in="SourceGraphic" />
|
4072
|
+
</feMerge>
|
4073
|
+
</filter>
|
4074
|
+
</defs>
|
4075
|
+
*/
|
4076
|
+
return {
|
4077
|
+
sel: 'defs',
|
4078
|
+
data: {
|
4079
|
+
ns: "http://www.w3.org/2000/svg",
|
4080
|
+
props: {
|
4081
|
+
innerHTML: `<filter id="t_bold" x="0" y="0">
|
4082
|
+
<feGaussianBlur stdDeviation="0.5" result="blur" />
|
4083
|
+
<feMerge>
|
4084
|
+
<feMergeNode in="thicken" />
|
4085
|
+
<feMergeNode in="SourceGraphic" />
|
4086
|
+
</feMerge>
|
4087
|
+
</filter>`
|
4088
|
+
}
|
4089
|
+
},
|
4090
|
+
};
|
4091
|
+
}
|
4063
4092
|
}
|
4064
4093
|
class DocumentFactory extends ElementFactory {
|
4065
4094
|
match(type) {
|
@@ -5192,9 +5221,7 @@ class TextGroupRenderObject extends LeafRenderObject {
|
|
5192
5221
|
if (actualFontBoundingBoxAscent === undefined) {
|
5193
5222
|
t.data.attrs['dominant-baseline'] = 'hanging';
|
5194
5223
|
}
|
5195
|
-
if (this.element.props.fontWeight !== 'normal')
|
5196
|
-
t.data.attrs['font-weight'] = this.element.props.fontWeight;
|
5197
|
-
}
|
5224
|
+
if (this.element.props.fontWeight !== 'normal') ;
|
5198
5225
|
if (this.element.props.fontStyle !== 'normal') {
|
5199
5226
|
t.data.attrs['font-style'] = this.element.props.fontStyle;
|
5200
5227
|
}
|
@@ -5224,6 +5251,42 @@ class TextGroupRenderObject extends LeafRenderObject {
|
|
5224
5251
|
}
|
5225
5252
|
//处理null-text
|
5226
5253
|
if (this.element.isDecorate && this.element.disableClick && !this.element.parent) ;
|
5254
|
+
if (this.element.props.fontWeight === "bold") {
|
5255
|
+
const g = {
|
5256
|
+
sel: "g",
|
5257
|
+
data: {
|
5258
|
+
ns: "http://www.w3.org/2000/svg",
|
5259
|
+
attrs: {}
|
5260
|
+
},
|
5261
|
+
children: [
|
5262
|
+
{
|
5263
|
+
sel: "g",
|
5264
|
+
data: {
|
5265
|
+
ns: "http://www.w3.org/2000/svg",
|
5266
|
+
attrs: {
|
5267
|
+
translate: { x: 0, y: 0 }
|
5268
|
+
}
|
5269
|
+
},
|
5270
|
+
children: [
|
5271
|
+
{ ...t }
|
5272
|
+
]
|
5273
|
+
},
|
5274
|
+
{
|
5275
|
+
sel: "g",
|
5276
|
+
data: {
|
5277
|
+
ns: "http://www.w3.org/2000/svg",
|
5278
|
+
attrs: {
|
5279
|
+
translate: { x: 0.5, y: 0 }
|
5280
|
+
}
|
5281
|
+
},
|
5282
|
+
children: [
|
5283
|
+
{ ...t }
|
5284
|
+
]
|
5285
|
+
}
|
5286
|
+
]
|
5287
|
+
};
|
5288
|
+
return g;
|
5289
|
+
}
|
5227
5290
|
return t;
|
5228
5291
|
}
|
5229
5292
|
}
|
@@ -23385,7 +23448,7 @@ class DocEditor {
|
|
23385
23448
|
rule.setRuleOptions({ width: this.viewOptions.docPageSettings.width, pagePL, pagePR, docLeft });
|
23386
23449
|
}
|
23387
23450
|
version() {
|
23388
|
-
return "2.2.
|
23451
|
+
return "2.2.34";
|
23389
23452
|
}
|
23390
23453
|
switchPageHeaderEditor() {
|
23391
23454
|
this.docCtx.document.switchPageHeaderEditor(this.selectionState, null);
|