@hailin-zheng/editor-core 2.1.8 → 2.1.9

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.js CHANGED
@@ -1552,6 +1552,9 @@ class PageOptions {
1552
1552
  set height(value) {
1553
1553
  this._height = value;
1554
1554
  }
1555
+ clone() {
1556
+ return new PageOptions(this._width, this._height, this.orient);
1557
+ }
1555
1558
  }
1556
1559
  class ViewOptions {
1557
1560
  copyRightInfo;
@@ -1826,7 +1829,7 @@ class TextProps extends INotifyPropertyChanged {
1826
1829
  }
1827
1830
  getSerializeProps(viewOptions) {
1828
1831
  const props = {};
1829
- if (this.color && this.color !== viewOptions.defaultColor) {
1832
+ if (this.color && this.color !== viewOptions.defaultColor && this.color !== '#000000') {
1830
1833
  props["color"] = this.color;
1831
1834
  }
1832
1835
  if (this.fontName && this.fontName !== viewOptions.defaultFontName) {
@@ -26250,8 +26253,8 @@ class DocumentPrintOffscreenBase {
26250
26253
  console.warn('无可打印页');
26251
26254
  return;
26252
26255
  }
26253
- const docProps = this.docCtx.document.props;
26254
- printNodes(canvasNodes, { ...docProps }, {
26256
+ const docProps = this.docCtx.viewOptions.docPageSettings.clone();
26257
+ printNodes(canvasNodes, docProps, {
26255
26258
  beforePrint: () => this.beforePrint.next(),
26256
26259
  afterPrint: () => this.afterPrint.next()
26257
26260
  });
@@ -26280,7 +26283,7 @@ class DocumentPrintOffscreenBase {
26280
26283
  console.warn('无可打印页');
26281
26284
  return;
26282
26285
  }
26283
- const docProps = this.docCtx.viewOptions.docPageSettings;
26286
+ const docProps = this.docCtx.viewOptions.docPageSettings.clone();
26284
26287
  // if (docProps.orient === 'landscape') {
26285
26288
  // svgNodes = svgNodes.map(item => 'data:image/svg+xml;base64,' + CommonUtil.btoa(item)).map(item => `<img src="${item}" width="${docProps.width}px" height="${docProps.height-1}px" style="display: block"/>`);
26286
26289
  // }
@@ -28709,7 +28712,7 @@ class DocEditor {
28709
28712
  rule.setRuleOptions({ width: this.viewOptions.docPageSettings.width, pagePL, pagePR, docLeft });
28710
28713
  }
28711
28714
  version() {
28712
- return "2.1.8";
28715
+ return "2.1.9";
28713
28716
  }
28714
28717
  }
28715
28718