@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 CHANGED
@@ -4008,6 +4008,7 @@ class DocumentRenderObject extends BlockContainerRenderObject {
4008
4008
  const pageCorner = this.exportPageCornerHTML(event);
4009
4009
  const pageNum = this.exportPageNumHTML(event);
4010
4010
  const copyright = this.exportCopyRight(event);
4011
+ const defs = this.exportDefs();
4011
4012
  return {
4012
4013
  sel: "svg",
4013
4014
  isCompleted: true,
@@ -4022,7 +4023,7 @@ class DocumentRenderObject extends BlockContainerRenderObject {
4022
4023
  },
4023
4024
  },
4024
4025
  children: [
4025
- pageCorner, highlight, selection, ...CommonUtil.toArray(event.getChildNodes(this)), pageNum, copyright
4026
+ defs, pageCorner, highlight, selection, ...CommonUtil.toArray(event.getChildNodes(this)), pageNum, copyright
4026
4027
  ]
4027
4028
  };
4028
4029
  }
@@ -4089,6 +4090,34 @@ class DocumentRenderObject extends BlockContainerRenderObject {
4089
4090
  },
4090
4091
  };
4091
4092
  }
4093
+ exportDefs() {
4094
+ /**
4095
+ * <defs>
4096
+ <filter id="f1" x="0" y="0">
4097
+ <feGaussianBlur stdDeviation="0.5" result="blur" />
4098
+ <feMerge>
4099
+ <feMergeNode in="thicken" />
4100
+ <feMergeNode in="SourceGraphic" />
4101
+ </feMerge>
4102
+ </filter>
4103
+ </defs>
4104
+ */
4105
+ return {
4106
+ sel: 'defs',
4107
+ data: {
4108
+ ns: "http://www.w3.org/2000/svg",
4109
+ props: {
4110
+ innerHTML: `<filter id="t_bold" x="0" y="0">
4111
+ <feGaussianBlur stdDeviation="0.5" result="blur" />
4112
+ <feMerge>
4113
+ <feMergeNode in="thicken" />
4114
+ <feMergeNode in="SourceGraphic" />
4115
+ </feMerge>
4116
+ </filter>`
4117
+ }
4118
+ },
4119
+ };
4120
+ }
4092
4121
  }
4093
4122
  class DocumentFactory extends ElementFactory {
4094
4123
  match(type) {
@@ -5221,9 +5250,7 @@ class TextGroupRenderObject extends LeafRenderObject {
5221
5250
  if (actualFontBoundingBoxAscent === undefined) {
5222
5251
  t.data.attrs['dominant-baseline'] = 'hanging';
5223
5252
  }
5224
- if (this.element.props.fontWeight !== 'normal') {
5225
- t.data.attrs['font-weight'] = this.element.props.fontWeight;
5226
- }
5253
+ if (this.element.props.fontWeight !== 'normal') ;
5227
5254
  if (this.element.props.fontStyle !== 'normal') {
5228
5255
  t.data.attrs['font-style'] = this.element.props.fontStyle;
5229
5256
  }
@@ -5253,6 +5280,42 @@ class TextGroupRenderObject extends LeafRenderObject {
5253
5280
  }
5254
5281
  //处理null-text
5255
5282
  if (this.element.isDecorate && this.element.disableClick && !this.element.parent) ;
5283
+ if (this.element.props.fontWeight === "bold") {
5284
+ const g = {
5285
+ sel: "g",
5286
+ data: {
5287
+ ns: "http://www.w3.org/2000/svg",
5288
+ attrs: {}
5289
+ },
5290
+ children: [
5291
+ {
5292
+ sel: "g",
5293
+ data: {
5294
+ ns: "http://www.w3.org/2000/svg",
5295
+ attrs: {
5296
+ translate: { x: 0, y: 0 }
5297
+ }
5298
+ },
5299
+ children: [
5300
+ { ...t }
5301
+ ]
5302
+ },
5303
+ {
5304
+ sel: "g",
5305
+ data: {
5306
+ ns: "http://www.w3.org/2000/svg",
5307
+ attrs: {
5308
+ translate: { x: 0.5, y: 0 }
5309
+ }
5310
+ },
5311
+ children: [
5312
+ { ...t }
5313
+ ]
5314
+ }
5315
+ ]
5316
+ };
5317
+ return g;
5318
+ }
5256
5319
  return t;
5257
5320
  }
5258
5321
  }
@@ -23414,7 +23477,7 @@ class DocEditor {
23414
23477
  rule.setRuleOptions({ width: this.viewOptions.docPageSettings.width, pagePL, pagePR, docLeft });
23415
23478
  }
23416
23479
  version() {
23417
- return "2.2.33";
23480
+ return "2.2.34";
23418
23481
  }
23419
23482
  switchPageHeaderEditor() {
23420
23483
  this.docCtx.document.switchPageHeaderEditor(this.selectionState, null);