Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.
TypeScript boardcollaborationdocdocxexceloffce365officepdfpptpptxpresentationsdksheetslidesspreadsheetuniverwordwordprocessorworkspacexlsx
fix: optimization of create empty doc (#4149)
Ran Luoc88e70980974
diff --git a/mockdata/src/docs/default-document-data-cn.ts b/mockdata/src/docs/default-document-data-cn.tsindex d4a5207c45..5e241f65c3 100644--- a/mockdata/src/docs/default-document-data-cn.ts+++ b/mockdata/src/docs/default-document-data-cn.ts@@ -613,7 +613,7 @@ export const DEFAULT_DOCUMENT_DATA_CN: IDocumentData = {marginRight: ptToPixel(50),marginLeft: ptToPixel(50),renderConfig: {- zeroWidthParagraphBreak: BooleanNumber.TRUE,+ zeroWidthParagraphBreak: BooleanNumber.FALSE,vertexAngle: 0,centerAngle: 0,background: {diff --git a/packages/core/src/docs/data-model/empty-snapshot.ts b/packages/core/src/docs/data-model/empty-snapshot.tsindex 24784fbf55..fd12a3ad22 100644--- a/packages/core/src/docs/data-model/empty-snapshot.ts+++ b/packages/core/src/docs/data-model/empty-snapshot.ts@@ -15,8 +15,9 @@*/import { Tools } from '../../shared/tools';+import { BooleanNumber } from '../../types/enum';import { LocaleType } from '../../types/enum/locale-type';-import type { IDocumentData } from '../../types/interfaces';+import { DocumentFlavor, type IDocumentData } from '../../types/interfaces';export function getEmptySnapshot(unitID = Tools.generateRandomId(6),@@ -27,9 +28,16 @@ export function getEmptySnapshot(id: unitID,locale,title, // title should get from request.+ tableSource: {},+ drawings: {},+ drawingsOrder: [],+ headers: {},+ footers: {},body: {dataStream: '\r\n',textRuns: [],+ customBlocks: [],+ tables: [],paragraphs: [{startIndex: 0,@@ -51,14 +59,32 @@ export function getEmptySnapshot(width: 595 / 0.75,height: 842 / 0.75,},+ documentFlavor: DocumentFlavor.TRADITIONAL,marginTop: 50,marginBottom: 50,- marginRight: 40,- marginLeft: 40,+ marginRight: 50,+ marginLeft: 50,renderConfig: {+ zeroWidthParagraphBreak: BooleanNumber.FALSE,vertexAngle: 0,centerAngle: 0,+ background: {+ rgb: '#ccc',+ },},+ autoHyphenation: BooleanNumber.TRUE,+ doNotHyphenateCaps: BooleanNumber.FALSE,+ consecutiveHyphenLimit: 2,+ defaultHeaderId: '',+ defaultFooterId: '',+ evenPageHeaderId: '',+ evenPageFooterId: '',+ firstPageHeaderId: '',+ firstPageFooterId: '',+ evenAndOddHeaders: BooleanNumber.FALSE,+ useFirstPageHeaderFooter: BooleanNumber.FALSE,+ marginHeader: 30,+ marginFooter: 30,},settings: {},