@univerjs/engine-render 1.0.0-alpha.0 → 1.0.0-insiders.20260629-12f2e44
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/lib/cjs/index.js +976 -125
- package/lib/es/index.js +973 -127
- package/lib/types/basics/i-document-skeleton-cached.d.ts +25 -1
- package/lib/types/components/docs/document.d.ts +2 -0
- package/lib/types/components/docs/layout/block/column.d.ts +23 -0
- package/lib/types/components/docs/layout/model/page.d.ts +2 -1
- package/lib/types/components/docs/layout/tools.d.ts +79 -2
- package/lib/types/components/docs/view-model/document-view-model.d.ts +8 -1
- package/lib/types/index.d.ts +2 -1
- package/lib/umd/index.js +2 -2
- package/package.json +3 -3
- package/LICENSE +0 -176
package/lib/es/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AlignTypeH, AlignTypeV, BaselineOffset, BooleanNumber, BorderStyleTypes, BulletAlignment, COLORS, CellValueType, ColorKit, ColumnSeparatorType, CustomDecorationType, CustomRangeType, DEFAULT_DOCUMENT_PARAGRAPH_LINE_SPACING, DEFAULT_DOCUMENT_PARAGRAPH_SPACE_ABOVE, DEFAULT_DOCUMENT_PARAGRAPH_SPACE_BELOW, DEFAULT_EMPTY_DOCUMENT_VALUE, DEFAULT_STYLES, DashStyleType, DataStreamTreeNodeType, DataStreamTreeTokenType, Disposable, DisposableCollection, DocumentBlockRangeType, DocumentDataModel, DocumentFlavor, EventSubject, FontStyleType, GridType, HorizontalAlign, IConfigService, IContextService, IUniverInstanceService, Inject, Injector, ListGlyphType, LocaleService, MODERN_DOCUMENT_DEFAULT_MARGIN, MODERN_DOCUMENT_WIDTH, MOVE_BUFFER_VALUE, ModernDocumentWidthMode, NAMED_STYLE_MAP, NAMED_STYLE_SPACE_MAP, NumberUnitType, ObjectMatrix, ObjectRelativeFromH, ObjectRelativeFromV, PRESET_LIST_TYPE, PageOrientType, Plugin, PositionedObjectLayoutType, Range, Rectangle, Registry, SectionType, SheetSkeleton, Skeleton, SpacingRule, TableAlignmentType, TableRowHeightRule, TableTextWrapType, TextDecoration, ThemeService, Tools, UniverInstanceType, VerticalAlign, VerticalAlignmentType, WrapStrategy, WrapTextType, addLinkToDocumentModel, checkParagraphHasIndentByStyle, createIdentifier, createParagraphId, deleteContent, extractPureTextFromCell, getCellInfoInMergeData, getColorStyle, getDisplayValueFromCell, horizontalLineSegmentsSubtraction, insertTextToContent, invertColorByMatrix, isClassDependencyItem, isNullCell, isWhiteColor, merge, noop, numberToABC, numberToListABC, registerDependencies, remove, requestImmediateMacroTask, searchArray, sortRules, sortRulesByDesc, toDisposable } from "@univerjs/core";
|
|
1
|
+
import { AlignTypeH, AlignTypeV, BaselineOffset, BooleanNumber, BorderStyleTypes, BulletAlignment, COLORS, CellValueType, ColorKit, ColumnResponsiveType, ColumnSeparatorType, CustomDecorationType, CustomRangeType, DEFAULT_DOCUMENT_PARAGRAPH_LINE_SPACING, DEFAULT_DOCUMENT_PARAGRAPH_SPACE_ABOVE, DEFAULT_DOCUMENT_PARAGRAPH_SPACE_BELOW, DEFAULT_EMPTY_DOCUMENT_VALUE, DEFAULT_STYLES, DashStyleType, DataStreamTreeNodeType, DataStreamTreeTokenType, Disposable, DisposableCollection, DocumentBlockRangeType, DocumentDataModel, DocumentFlavor, EventSubject, FontStyleType, GridType, HorizontalAlign, IConfigService, IContextService, IUniverInstanceService, Inject, Injector, ListGlyphType, LocaleService, MODERN_DOCUMENT_DEFAULT_MARGIN, MODERN_DOCUMENT_WIDTH, MOVE_BUFFER_VALUE, ModernDocumentWidthMode, NAMED_STYLE_MAP, NAMED_STYLE_SPACE_MAP, NumberUnitType, ObjectMatrix, ObjectRelativeFromH, ObjectRelativeFromV, PRESET_LIST_TYPE, PageOrientType, Plugin, PositionedObjectLayoutType, Range, Rectangle, Registry, SectionType, SheetSkeleton, Skeleton, SpacingRule, TableAlignmentType, TableRowHeightRule, TableTextWrapType, TextDecoration, ThemeService, Tools, UniverInstanceType, VerticalAlign, VerticalAlignmentType, WrapStrategy, WrapTextType, addLinkToDocumentModel, checkParagraphHasIndentByStyle, createIdentifier, createParagraphId, deleteContent, extractPureTextFromCell, getCellInfoInMergeData, getColorStyle, getDisplayValueFromCell, horizontalLineSegmentsSubtraction, insertTextToContent, invertColorByMatrix, isClassDependencyItem, isNullCell, isWhiteColor, merge, noop, numberToABC, numberToListABC, registerDependencies, remove, requestImmediateMacroTask, searchArray, sortRules, sortRulesByDesc, toDisposable } from "@univerjs/core";
|
|
2
2
|
import * as cjk from "cjk-regex";
|
|
3
3
|
import { BehaviorSubject, Observable, Subject, Subscription, debounceTime, distinctUntilChanged, shareReplay, startWith } from "rxjs";
|
|
4
4
|
import { parse } from "opentype.js";
|
|
@@ -3435,11 +3435,12 @@ var BaseObject = class extends Disposable {
|
|
|
3435
3435
|
if (this.isInGroup && ((_this$parent = this.parent) === null || _this$parent === void 0 ? void 0 : _this$parent.classType) === "Group" && ((_this$parent2 = this.parent) === null || _this$parent2 === void 0 ? void 0 : _this$parent2.getBaseBound)) baseBound = this.parent.getBaseBound();
|
|
3436
3436
|
if (baseBound) {
|
|
3437
3437
|
const parentState = this.getParent();
|
|
3438
|
+
const parentRealBound = typeof parentState.getRealBound === "function" ? parentState.getRealBound() : parentState;
|
|
3438
3439
|
const parentBound = {
|
|
3439
|
-
top:
|
|
3440
|
-
left:
|
|
3441
|
-
width:
|
|
3442
|
-
height:
|
|
3440
|
+
top: parentRealBound.top || 0,
|
|
3441
|
+
left: parentRealBound.left,
|
|
3442
|
+
width: parentRealBound.width || 0,
|
|
3443
|
+
height: parentRealBound.height || 0
|
|
3443
3444
|
};
|
|
3444
3445
|
const realBound = getRenderTransformBaseOnParentBound(baseBound, parentBound, {
|
|
3445
3446
|
width: realWidth,
|
|
@@ -11969,6 +11970,68 @@ var Text = class Text extends Shape {
|
|
|
11969
11970
|
}
|
|
11970
11971
|
};
|
|
11971
11972
|
|
|
11973
|
+
//#endregion
|
|
11974
|
+
//#region src/components/docs/document-compatibility.ts
|
|
11975
|
+
const MODERN_DOCUMENT_COMPATIBILITY_POLICY = {
|
|
11976
|
+
mode: "modern",
|
|
11977
|
+
applyDocumentDefaultParagraphStyle: true,
|
|
11978
|
+
useWordStyleLineHeight: true,
|
|
11979
|
+
font: { metricScaleRules: [] },
|
|
11980
|
+
table: {
|
|
11981
|
+
currentPageOverflowTolerance: 0,
|
|
11982
|
+
rowOverflowTolerance: 0,
|
|
11983
|
+
allowImportedTableMarginOverflow: false
|
|
11984
|
+
}
|
|
11985
|
+
};
|
|
11986
|
+
const TRADITIONAL_DOCUMENT_COMPATIBILITY_POLICY = {
|
|
11987
|
+
mode: "traditional",
|
|
11988
|
+
applyDocumentDefaultParagraphStyle: false,
|
|
11989
|
+
useWordStyleLineHeight: true,
|
|
11990
|
+
font: { metricScaleRules: [{
|
|
11991
|
+
fontFamily: /^calibri$/i,
|
|
11992
|
+
minFontSize: 20,
|
|
11993
|
+
fontString: /\bbold\b/i,
|
|
11994
|
+
content: /^[\d/]+$/u,
|
|
11995
|
+
widthScale: .92
|
|
11996
|
+
}] },
|
|
11997
|
+
table: {
|
|
11998
|
+
currentPageOverflowTolerance: 12,
|
|
11999
|
+
rowOverflowTolerance: 4,
|
|
12000
|
+
allowImportedTableMarginOverflow: true
|
|
12001
|
+
}
|
|
12002
|
+
};
|
|
12003
|
+
const UNSPECIFIED_DOCUMENT_COMPATIBILITY_POLICY = {
|
|
12004
|
+
mode: "unspecified",
|
|
12005
|
+
applyDocumentDefaultParagraphStyle: false,
|
|
12006
|
+
useWordStyleLineHeight: false,
|
|
12007
|
+
font: { metricScaleRules: [] },
|
|
12008
|
+
table: {
|
|
12009
|
+
currentPageOverflowTolerance: 0,
|
|
12010
|
+
rowOverflowTolerance: 0,
|
|
12011
|
+
allowImportedTableMarginOverflow: false
|
|
12012
|
+
}
|
|
12013
|
+
};
|
|
12014
|
+
function getDocumentCompatibilityPolicy(documentFlavor) {
|
|
12015
|
+
if (documentFlavor === DocumentFlavor.MODERN) return MODERN_DOCUMENT_COMPATIBILITY_POLICY;
|
|
12016
|
+
if (documentFlavor === DocumentFlavor.TRADITIONAL) return TRADITIONAL_DOCUMENT_COMPATIBILITY_POLICY;
|
|
12017
|
+
return UNSPECIFIED_DOCUMENT_COMPATIBILITY_POLICY;
|
|
12018
|
+
}
|
|
12019
|
+
function applyFontMetricCompatibility(content, fontStyle, bBox, policy) {
|
|
12020
|
+
const fontFamilies = fontStyle.fontFamily.split(",").map((item) => item.trim().replace(/^['"]|['"]$/g, ""));
|
|
12021
|
+
const rule = policy.font.metricScaleRules.find((rule) => (rule.minFontSize == null || fontStyle.originFontSize >= rule.minFontSize) && (rule.fontString == null || rule.fontString.test(fontStyle.fontString)) && (rule.content == null || rule.content.test(content)) && fontFamilies.some((family) => rule.fontFamily.test(family)));
|
|
12022
|
+
if ((rule === null || rule === void 0 ? void 0 : rule.widthScale) == null) return bBox;
|
|
12023
|
+
return {
|
|
12024
|
+
...bBox,
|
|
12025
|
+
width: bBox.width * rule.widthScale
|
|
12026
|
+
};
|
|
12027
|
+
}
|
|
12028
|
+
function isTraditionalDocumentCompatibility(policy) {
|
|
12029
|
+
return policy.mode === "traditional";
|
|
12030
|
+
}
|
|
12031
|
+
function shouldAllowImportedTableMarginOverflow(policy, tableSource) {
|
|
12032
|
+
return policy.table.allowImportedTableMarginOverflow && tableSource != null && typeof tableSource === "object" && "docxWidth" in tableSource;
|
|
12033
|
+
}
|
|
12034
|
+
|
|
11972
12035
|
//#endregion
|
|
11973
12036
|
//#region src/components/docs/liquid.ts
|
|
11974
12037
|
var Liquid = class {
|
|
@@ -12261,8 +12324,16 @@ function parseDataStreamToTree(dataStream, tables) {
|
|
|
12261
12324
|
const tableList = [];
|
|
12262
12325
|
const tableRowList = [];
|
|
12263
12326
|
const tableCellList = [];
|
|
12327
|
+
const columnGroupList = [];
|
|
12328
|
+
const columnList = [];
|
|
12329
|
+
const columnParagraphList = [];
|
|
12330
|
+
const columnSectionList = [];
|
|
12264
12331
|
const currentBlocks = [];
|
|
12265
|
-
const getParagraphList = () =>
|
|
12332
|
+
const getParagraphList = () => {
|
|
12333
|
+
if (tableCellList.length > 0) return cellParagraphList;
|
|
12334
|
+
if (columnGroupList.length > 0) return columnParagraphList;
|
|
12335
|
+
return paragraphList;
|
|
12336
|
+
};
|
|
12266
12337
|
const appendToPreviousParagraph = (char) => {
|
|
12267
12338
|
const tempParagraphList = getParagraphList();
|
|
12268
12339
|
const lastParagraph = tempParagraphList[tempParagraphList.length - 1];
|
|
@@ -12292,10 +12363,11 @@ function parseDataStreamToTree(dataStream, tables) {
|
|
|
12292
12363
|
currentBlocks.length = 0;
|
|
12293
12364
|
content = "";
|
|
12294
12365
|
if (tableCellList.length > 0) cellParagraphList.push(paragraphNode);
|
|
12366
|
+
else if (columnGroupList.length > 0) columnParagraphList.push(paragraphNode);
|
|
12295
12367
|
else paragraphList.push(paragraphNode);
|
|
12296
12368
|
} else if (char === DataStreamTreeTokenType.SECTION_BREAK) {
|
|
12297
12369
|
const sectionNode = DataStreamTreeNode.create(DataStreamTreeNodeType.SECTION_BREAK);
|
|
12298
|
-
const tempParagraphList = tableCellList.length > 0 ? cellParagraphList : paragraphList;
|
|
12370
|
+
const tempParagraphList = tableCellList.length > 0 ? cellParagraphList : columnGroupList.length > 0 ? columnParagraphList : paragraphList;
|
|
12299
12371
|
if (tempParagraphList.length === 0) {
|
|
12300
12372
|
const emptyParagraph = DataStreamTreeNode.create(DataStreamTreeNodeType.PARAGRAPH, "");
|
|
12301
12373
|
emptyParagraph.setIndexRange(i, i - 1);
|
|
@@ -12307,7 +12379,8 @@ function parseDataStreamToTree(dataStream, tables) {
|
|
|
12307
12379
|
if (tableCellList.length > 0) {
|
|
12308
12380
|
const lastCell = tableCellList[tableCellList.length - 1];
|
|
12309
12381
|
batchParent(lastCell, [sectionNode], DataStreamTreeNodeType.TABLE_CELL);
|
|
12310
|
-
} else
|
|
12382
|
+
} else if (columnGroupList.length > 0) columnSectionList.push(sectionNode);
|
|
12383
|
+
else sectionList.push(sectionNode);
|
|
12311
12384
|
tempParagraphList.length = 0;
|
|
12312
12385
|
} else if (char === DataStreamTreeTokenType.TABLE_START) {
|
|
12313
12386
|
const tableNode = DataStreamTreeNode.create(DataStreamTreeNodeType.TABLE);
|
|
@@ -12333,6 +12406,32 @@ function parseDataStreamToTree(dataStream, tables) {
|
|
|
12333
12406
|
const cellNode = tableCellList.pop();
|
|
12334
12407
|
const lastRow = tableRowList[tableRowList.length - 1];
|
|
12335
12408
|
batchParent(lastRow, [cellNode], DataStreamTreeNodeType.TABLE_ROW);
|
|
12409
|
+
} else if (char === DataStreamTreeTokenType.COLUMN_GROUP_START) {
|
|
12410
|
+
const columnGroupNode = DataStreamTreeNode.create(DataStreamTreeNodeType.COLUMN_GROUP);
|
|
12411
|
+
columnGroupNode.setIndexRange(i, i);
|
|
12412
|
+
columnGroupList.push(columnGroupNode);
|
|
12413
|
+
} else if (char === DataStreamTreeTokenType.COLUMN_START) {
|
|
12414
|
+
const columnNode = DataStreamTreeNode.create(DataStreamTreeNodeType.COLUMN);
|
|
12415
|
+
columnNode.setIndexRange(i, i);
|
|
12416
|
+
columnList.push(columnNode);
|
|
12417
|
+
} else if (char === DataStreamTreeTokenType.COLUMN_END) {
|
|
12418
|
+
const columnNode = columnList[columnList.length - 1];
|
|
12419
|
+
const columnChildren = columnSectionList.length > 0 ? columnSectionList : columnParagraphList;
|
|
12420
|
+
const columnStartIndex = columnNode.startIndex;
|
|
12421
|
+
batchParent(columnNode, columnChildren, DataStreamTreeNodeType.COLUMN);
|
|
12422
|
+
columnNode.setIndexRange(columnStartIndex, i);
|
|
12423
|
+
columnParagraphList.length = 0;
|
|
12424
|
+
columnSectionList.length = 0;
|
|
12425
|
+
} else if (char === DataStreamTreeTokenType.COLUMN_GROUP_END) {
|
|
12426
|
+
const columnGroupNode = columnGroupList.pop();
|
|
12427
|
+
const columnGroupStartIndex = columnGroupNode.startIndex;
|
|
12428
|
+
batchParent(columnGroupNode, columnList, DataStreamTreeNodeType.COLUMN_GROUP);
|
|
12429
|
+
columnGroupNode.setIndexRange(columnGroupStartIndex, i);
|
|
12430
|
+
paragraphList.push(columnGroupNode);
|
|
12431
|
+
columnList.length = 0;
|
|
12432
|
+
columnParagraphList.length = 0;
|
|
12433
|
+
columnSectionList.length = 0;
|
|
12434
|
+
content = "";
|
|
12336
12435
|
} else if (char === DataStreamTreeTokenType.BLOCK_START) content += char;
|
|
12337
12436
|
else if (char === DataStreamTreeTokenType.BLOCK_END) {
|
|
12338
12437
|
if (content.length > 0 || !appendToPreviousParagraph(char)) content += char;
|
|
@@ -12356,6 +12455,7 @@ var DocumentViewModel = class DocumentViewModel {
|
|
|
12356
12455
|
_defineProperty(this, "_sectionBreakCache", /* @__PURE__ */ new Map());
|
|
12357
12456
|
_defineProperty(this, "_customBlockCache", /* @__PURE__ */ new Map());
|
|
12358
12457
|
_defineProperty(this, "_tableCache", /* @__PURE__ */ new Map());
|
|
12458
|
+
_defineProperty(this, "_columnGroupCache", /* @__PURE__ */ new Map());
|
|
12359
12459
|
_defineProperty(this, "_tableNodeCache", /* @__PURE__ */ new Map());
|
|
12360
12460
|
_defineProperty(this, "_children", []);
|
|
12361
12461
|
_defineProperty(this, "_editArea", "BODY");
|
|
@@ -12386,6 +12486,7 @@ var DocumentViewModel = class DocumentViewModel {
|
|
|
12386
12486
|
this._sectionBreakCache.clear();
|
|
12387
12487
|
this._customBlockCache.clear();
|
|
12388
12488
|
this._tableCache.clear();
|
|
12489
|
+
this._columnGroupCache.clear();
|
|
12389
12490
|
this._tableNodeCache.clear();
|
|
12390
12491
|
this._segmentViewModels$.complete();
|
|
12391
12492
|
this._editAreaChange$.complete();
|
|
@@ -12457,6 +12558,9 @@ var DocumentViewModel = class DocumentViewModel {
|
|
|
12457
12558
|
getTableByStartIndex(index) {
|
|
12458
12559
|
return this._tableCache.get(index);
|
|
12459
12560
|
}
|
|
12561
|
+
getColumnGroupByStartIndex(index) {
|
|
12562
|
+
return this._columnGroupCache.get(index);
|
|
12563
|
+
}
|
|
12460
12564
|
findTableNodeById(id) {
|
|
12461
12565
|
var _this$_tableNodeCache;
|
|
12462
12566
|
return (_this$_tableNodeCache = this._tableNodeCache.get(id)) === null || _this$_tableNodeCache === void 0 ? void 0 : _this$_tableNodeCache.table;
|
|
@@ -12491,6 +12595,7 @@ var DocumentViewModel = class DocumentViewModel {
|
|
|
12491
12595
|
this._buildSectionBreakCache();
|
|
12492
12596
|
this._buildCustomBlockCache();
|
|
12493
12597
|
this._buildTableCache();
|
|
12598
|
+
this._buildColumnGroupCache();
|
|
12494
12599
|
}
|
|
12495
12600
|
_buildParagraphCache() {
|
|
12496
12601
|
var _this$getBody$paragra, _this$getBody;
|
|
@@ -12535,9 +12640,23 @@ var DocumentViewModel = class DocumentViewModel {
|
|
|
12535
12640
|
});
|
|
12536
12641
|
}
|
|
12537
12642
|
}
|
|
12643
|
+
_buildColumnGroupCache() {
|
|
12644
|
+
var _this$getBody5;
|
|
12645
|
+
this._columnGroupCache.clear();
|
|
12646
|
+
const columnGroups = (_this$getBody5 = this.getBody()) === null || _this$getBody5 === void 0 ? void 0 : _this$getBody5.columnGroups;
|
|
12647
|
+
if (columnGroups == null) return;
|
|
12648
|
+
for (const columnGroup of columnGroups) {
|
|
12649
|
+
const { startIndex } = columnGroup;
|
|
12650
|
+
if (!columnGroup.columns) continue;
|
|
12651
|
+
this._columnGroupCache.set(startIndex, {
|
|
12652
|
+
columnGroup,
|
|
12653
|
+
columnGroupSource: columnGroup
|
|
12654
|
+
});
|
|
12655
|
+
}
|
|
12656
|
+
}
|
|
12538
12657
|
_buildTextRunsCache() {
|
|
12539
|
-
var _this$getBody$textRun, _this$
|
|
12540
|
-
const textRuns = (_this$getBody$textRun = (_this$
|
|
12658
|
+
var _this$getBody$textRun, _this$getBody6;
|
|
12659
|
+
const textRuns = (_this$getBody$textRun = (_this$getBody6 = this.getBody()) === null || _this$getBody6 === void 0 ? void 0 : _this$getBody6.textRuns) !== null && _this$getBody$textRun !== void 0 ? _this$getBody$textRun : [];
|
|
12541
12660
|
this._textRunsCache.clear();
|
|
12542
12661
|
for (const textRun of textRuns) {
|
|
12543
12662
|
const { st, ed } = textRun;
|
|
@@ -12563,68 +12682,6 @@ var DocumentViewModel = class DocumentViewModel {
|
|
|
12563
12682
|
}
|
|
12564
12683
|
};
|
|
12565
12684
|
|
|
12566
|
-
//#endregion
|
|
12567
|
-
//#region src/components/docs/document-compatibility.ts
|
|
12568
|
-
const MODERN_DOCUMENT_COMPATIBILITY_POLICY = {
|
|
12569
|
-
mode: "modern",
|
|
12570
|
-
applyDocumentDefaultParagraphStyle: true,
|
|
12571
|
-
useWordStyleLineHeight: true,
|
|
12572
|
-
font: { metricScaleRules: [] },
|
|
12573
|
-
table: {
|
|
12574
|
-
currentPageOverflowTolerance: 0,
|
|
12575
|
-
rowOverflowTolerance: 0,
|
|
12576
|
-
allowImportedTableMarginOverflow: false
|
|
12577
|
-
}
|
|
12578
|
-
};
|
|
12579
|
-
const TRADITIONAL_DOCUMENT_COMPATIBILITY_POLICY = {
|
|
12580
|
-
mode: "traditional",
|
|
12581
|
-
applyDocumentDefaultParagraphStyle: false,
|
|
12582
|
-
useWordStyleLineHeight: true,
|
|
12583
|
-
font: { metricScaleRules: [{
|
|
12584
|
-
fontFamily: /^calibri$/i,
|
|
12585
|
-
minFontSize: 20,
|
|
12586
|
-
fontString: /\bbold\b/i,
|
|
12587
|
-
content: /^[\d/]+$/u,
|
|
12588
|
-
widthScale: .92
|
|
12589
|
-
}] },
|
|
12590
|
-
table: {
|
|
12591
|
-
currentPageOverflowTolerance: 12,
|
|
12592
|
-
rowOverflowTolerance: 4,
|
|
12593
|
-
allowImportedTableMarginOverflow: true
|
|
12594
|
-
}
|
|
12595
|
-
};
|
|
12596
|
-
const UNSPECIFIED_DOCUMENT_COMPATIBILITY_POLICY = {
|
|
12597
|
-
mode: "unspecified",
|
|
12598
|
-
applyDocumentDefaultParagraphStyle: false,
|
|
12599
|
-
useWordStyleLineHeight: false,
|
|
12600
|
-
font: { metricScaleRules: [] },
|
|
12601
|
-
table: {
|
|
12602
|
-
currentPageOverflowTolerance: 0,
|
|
12603
|
-
rowOverflowTolerance: 0,
|
|
12604
|
-
allowImportedTableMarginOverflow: false
|
|
12605
|
-
}
|
|
12606
|
-
};
|
|
12607
|
-
function getDocumentCompatibilityPolicy(documentFlavor) {
|
|
12608
|
-
if (documentFlavor === DocumentFlavor.MODERN) return MODERN_DOCUMENT_COMPATIBILITY_POLICY;
|
|
12609
|
-
if (documentFlavor === DocumentFlavor.TRADITIONAL) return TRADITIONAL_DOCUMENT_COMPATIBILITY_POLICY;
|
|
12610
|
-
return UNSPECIFIED_DOCUMENT_COMPATIBILITY_POLICY;
|
|
12611
|
-
}
|
|
12612
|
-
function applyFontMetricCompatibility(content, fontStyle, bBox, policy) {
|
|
12613
|
-
const fontFamilies = fontStyle.fontFamily.split(",").map((item) => item.trim().replace(/^['"]|['"]$/g, ""));
|
|
12614
|
-
const rule = policy.font.metricScaleRules.find((rule) => (rule.minFontSize == null || fontStyle.originFontSize >= rule.minFontSize) && (rule.fontString == null || rule.fontString.test(fontStyle.fontString)) && (rule.content == null || rule.content.test(content)) && fontFamilies.some((family) => rule.fontFamily.test(family)));
|
|
12615
|
-
if ((rule === null || rule === void 0 ? void 0 : rule.widthScale) == null) return bBox;
|
|
12616
|
-
return {
|
|
12617
|
-
...bBox,
|
|
12618
|
-
width: bBox.width * rule.widthScale
|
|
12619
|
-
};
|
|
12620
|
-
}
|
|
12621
|
-
function isTraditionalDocumentCompatibility(policy) {
|
|
12622
|
-
return policy.mode === "traditional";
|
|
12623
|
-
}
|
|
12624
|
-
function shouldAllowImportedTableMarginOverflow(policy, tableSource) {
|
|
12625
|
-
return policy.table.allowImportedTableMarginOverflow && tableSource != null && typeof tableSource === "object" && "docxWidth" in tableSource;
|
|
12626
|
-
}
|
|
12627
|
-
|
|
12628
12685
|
//#endregion
|
|
12629
12686
|
//#region src/components/docs/layout/model/glyph.ts
|
|
12630
12687
|
function isSpace(char) {
|
|
@@ -12715,6 +12772,10 @@ function _createSkeletonWordOrLetter(glyphType, content, config, glyphWidth, gly
|
|
|
12715
12772
|
DataStreamTreeTokenType.TABLE_ROW_END,
|
|
12716
12773
|
DataStreamTreeTokenType.TABLE_CELL_START,
|
|
12717
12774
|
DataStreamTreeTokenType.TABLE_CELL_END,
|
|
12775
|
+
DataStreamTreeTokenType.COLUMN_GROUP_START,
|
|
12776
|
+
DataStreamTreeTokenType.COLUMN_START,
|
|
12777
|
+
DataStreamTreeTokenType.COLUMN_END,
|
|
12778
|
+
DataStreamTreeTokenType.COLUMN_GROUP_END,
|
|
12718
12779
|
DataStreamTreeTokenType.BLOCK_START,
|
|
12719
12780
|
DataStreamTreeTokenType.BLOCK_END,
|
|
12720
12781
|
DataStreamTreeTokenType.CUSTOM_RANGE_START,
|
|
@@ -12877,7 +12938,9 @@ function createSkeletonLine(paragraphIndex, lineType, lineBoundingBox, columnWid
|
|
|
12877
12938
|
lineSke.isBehindTable = true;
|
|
12878
12939
|
lineSke.tableId = tableId;
|
|
12879
12940
|
}
|
|
12880
|
-
|
|
12941
|
+
const affectSkeDrawings = new Map(Array.from(pageSkeDrawings).filter(([_, drawing]) => drawing.drawingOrigin.layoutType !== PositionedObjectLayoutType.INLINE && drawing.drawingOrigin.layoutType !== PositionedObjectLayoutType.WRAP_NONE));
|
|
12942
|
+
const wrapTypeTables = new Map(Array.from(pageSkeTables).filter(([_, table]) => table.tableSource.textWrap === TableTextWrapType.WRAP));
|
|
12943
|
+
lineSke.divides = lineHeight <= .01 ? [__getDivideSKe(0, columnWidth)] : _calculateDividesByDrawings(lineHeight, lineTop, columnWidth, paddingLeft, paddingRight, page, headerPage, footerPage, affectSkeDrawings, headersDrawings, footersDrawings, wrapTypeTables);
|
|
12881
12944
|
for (const divide of lineSke.divides) divide.parent = lineSke;
|
|
12882
12945
|
return lineSke;
|
|
12883
12946
|
}
|
|
@@ -13116,6 +13179,8 @@ function ___getWrapTextRuler(wrapText, resultLeft, resultWidth, columnWidth) {
|
|
|
13116
13179
|
return ruler;
|
|
13117
13180
|
}
|
|
13118
13181
|
function _calculateDivideByDrawings(columnWidth, drawingSplit) {
|
|
13182
|
+
if (!Number.isFinite(columnWidth) || columnWidth <= 0) return [__getDivideSKe(0, Math.max(1, columnWidth || 1))];
|
|
13183
|
+
drawingSplit = drawingSplit.filter(({ left, width }) => Number.isFinite(left) && Number.isFinite(width) && width > 0 && left < columnWidth && left + width > 0);
|
|
13119
13184
|
drawingSplit.sort((pre, next) => {
|
|
13120
13185
|
if (pre.left > next.left) return 1;
|
|
13121
13186
|
return -1;
|
|
@@ -13645,6 +13710,13 @@ function getTableIdAndSliceIndex(tableSliceId) {
|
|
|
13645
13710
|
//#region src/components/docs/layout/block/paragraph/layout-ruler.ts
|
|
13646
13711
|
const LINE_LAYOUT_OVERFLOW_TOLERANCE = 2;
|
|
13647
13712
|
const FLOAT_OBJECT_RELAYOUT_LIMIT = 5;
|
|
13713
|
+
const MIN_LINE_WIDTH_TOLERANCE = 1;
|
|
13714
|
+
const MAX_LINE_WIDTH_TOLERANCE = 3;
|
|
13715
|
+
const RELATIVE_LINE_WIDTH_TOLERANCE = .01;
|
|
13716
|
+
function isBeyondDivideWidth(width, divideWidth) {
|
|
13717
|
+
const tolerance = Math.min(MAX_LINE_WIDTH_TOLERANCE, Math.max(MIN_LINE_WIDTH_TOLERANCE, divideWidth * RELATIVE_LINE_WIDTH_TOLERANCE));
|
|
13718
|
+
return width - divideWidth > tolerance;
|
|
13719
|
+
}
|
|
13648
13720
|
function layoutParagraph(ctx, glyphGroup, pages, sectionBreakConfig, paragraphConfig, isParagraphFirstShapedText, breakPointType = "Normal") {
|
|
13649
13721
|
if (isParagraphFirstShapedText) if (paragraphConfig.bulletSkeleton) {
|
|
13650
13722
|
var _paragraphProperties$;
|
|
@@ -13726,7 +13798,12 @@ function _divideOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphCo
|
|
|
13726
13798
|
const lastGlyph = divide === null || divide === void 0 || (_divide$glyphGroup = divide.glyphGroup) === null || _divide$glyphGroup === void 0 ? void 0 : _divide$glyphGroup[divide.glyphGroup.length - 1];
|
|
13727
13799
|
const preOffsetLeft = ((lastGlyph === null || lastGlyph === void 0 ? void 0 : lastGlyph.width) || 0) + ((lastGlyph === null || lastGlyph === void 0 ? void 0 : lastGlyph.left) || 0);
|
|
13728
13800
|
const { hyphenationZone } = sectionBreakConfig;
|
|
13729
|
-
if (preOffsetLeft + width
|
|
13801
|
+
if (isBeyondDivideWidth(preOffsetLeft + width, divide.width)) {
|
|
13802
|
+
if ((divide === null || divide === void 0 ? void 0 : divide.glyphGroup.length) === 0 && glyphGroup.length > 0 && glyphGroup[0].streamType === DataStreamTreeTokenType.CUSTOM_BLOCK) {
|
|
13803
|
+
addGlyphToDivide(divide, glyphGroup, preOffsetLeft);
|
|
13804
|
+
updateDivideInfo(divide, { breakType: breakPointType });
|
|
13805
|
+
return;
|
|
13806
|
+
}
|
|
13730
13807
|
if (shouldKeepOverflowingTextOnLine(sectionBreakConfig)) {
|
|
13731
13808
|
addGlyphToDivide(divide, glyphGroup, preOffsetLeft);
|
|
13732
13809
|
updateDivideInfo(divide, { breakType: breakPointType });
|
|
@@ -13738,13 +13815,13 @@ function _divideOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphCo
|
|
|
13738
13815
|
if (divideInfo.isLast && glyphGroup.length === 1 && (glyphGroup[0].content === DataStreamTreeTokenType.SPACE || glyphGroup[0].content === DataStreamTreeTokenType.PARAGRAPH)) addGlyphToDivide(divide, glyphGroup, preOffsetLeft);
|
|
13739
13816
|
else if (divideInfo.isLast && !isGlyphGroupBeyondContentBox(glyphGroup, preOffsetLeft, divide.width) && isGlyphGroupEndWithWhiteSpaces(glyphGroup)) addGlyphToDivide(divide, glyphGroup, preOffsetLeft);
|
|
13740
13817
|
else if (!isLast && (divide === null || divide === void 0 ? void 0 : divide.glyphGroup.length) === 0 && glyphGroup.length === 1 && glyphGroup[0].streamType === DataStreamTreeTokenType.CUSTOM_BLOCK && glyphGroup[0].width > divide.width) {
|
|
13741
|
-
|
|
13742
|
-
|
|
13818
|
+
addGlyphToDivide(divide, glyphGroup, preOffsetLeft);
|
|
13819
|
+
updateDivideInfo(divide, { breakType: breakPointType });
|
|
13743
13820
|
} else if ((divide === null || divide === void 0 ? void 0 : divide.glyphGroup.length) === 0) {
|
|
13744
13821
|
const sliceGlyphGroup = [];
|
|
13745
13822
|
while (glyphGroup.length) {
|
|
13746
13823
|
sliceGlyphGroup.push(glyphGroup.shift());
|
|
13747
|
-
if (__getGlyphGroupWidth(sliceGlyphGroup)
|
|
13824
|
+
if (isBeyondDivideWidth(__getGlyphGroupWidth(sliceGlyphGroup), divide.width)) {
|
|
13748
13825
|
if (sliceGlyphGroup.length > 1) glyphGroup.unshift(sliceGlyphGroup.pop());
|
|
13749
13826
|
break;
|
|
13750
13827
|
}
|
|
@@ -13797,6 +13874,10 @@ function _divideOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphCo
|
|
|
13797
13874
|
const paragraphAnchorLeft = __getParagraphAnchorLeft(sectionBreakConfig, paragraphConfig, (_paragraphConfig$para = paragraphConfig.paragraphStyle) === null || _paragraphConfig$para === void 0 ? void 0 : _paragraphConfig$para.indentStart);
|
|
13798
13875
|
const drawings = __getDrawingPosition(currentLine.top, currentLine.lineHeight, currentLine.parent, true, (_paragraphConfig$pDra = paragraphConfig.pDrawingAnchor) === null || _paragraphConfig$pDra === void 0 || (_paragraphConfig$pDra = _paragraphConfig$pDra.get(paragraphConfig.paragraphIndex)) === null || _paragraphConfig$pDra === void 0 ? void 0 : _paragraphConfig$pDra.top, anchorDrawings, paragraphAnchorLeft);
|
|
13799
13876
|
__updateDrawingPosition(currentLine.parent, drawings);
|
|
13877
|
+
addGlyphToDivide(divide, glyphGroup, preOffsetLeft);
|
|
13878
|
+
updateDivideInfo(divide, { breakType: breakPointType });
|
|
13879
|
+
glyphGroup.length = 0;
|
|
13880
|
+
return;
|
|
13800
13881
|
}
|
|
13801
13882
|
}
|
|
13802
13883
|
addGlyphToDivide(divide, glyphGroup, preOffsetLeft);
|
|
@@ -13808,6 +13889,19 @@ function _lineOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphConf
|
|
|
13808
13889
|
var _originParagraphStyle, _originParagraphStyle2, _skeHeaders$get, _skeFooters$get;
|
|
13809
13890
|
let lastPage = getLastPage(pages);
|
|
13810
13891
|
let columnInfo = getLastNotFullColumnInfo(lastPage);
|
|
13892
|
+
if (!columnInfo || !columnInfo.column) {
|
|
13893
|
+
const lastSection = getLastSection(lastPage);
|
|
13894
|
+
const lastColumnIndex = lastSection.columns.length - 1;
|
|
13895
|
+
const lastColumn = lastSection.columns[lastColumnIndex];
|
|
13896
|
+
if (lastColumn && isBlankColumn(lastColumn)) {
|
|
13897
|
+
setColumnFullState(lastColumn, false);
|
|
13898
|
+
columnInfo = {
|
|
13899
|
+
column: lastColumn,
|
|
13900
|
+
index: lastColumnIndex,
|
|
13901
|
+
isLast: true
|
|
13902
|
+
};
|
|
13903
|
+
}
|
|
13904
|
+
}
|
|
13811
13905
|
if (!columnInfo || !columnInfo.column) {
|
|
13812
13906
|
_pageOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphConfig, true, breakPointType);
|
|
13813
13907
|
lastPage = getLastPage(pages);
|
|
@@ -13834,9 +13928,21 @@ function _lineOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphConf
|
|
|
13834
13928
|
};
|
|
13835
13929
|
const { paragraphLineGapDefault, linePitch, lineSpacing, spacingRule, snapToGrid, gridType } = getLineHeightConfig(sectionBreakConfig, paragraphConfig);
|
|
13836
13930
|
const hasInlineCustomBlock = glyphGroup.some((glyph) => glyph.streamType === DataStreamTreeTokenType.CUSTOM_BLOCK && glyph.width !== 0);
|
|
13931
|
+
const positionedCustomBlockOnly = glyphGroup.length > 0 && paragraphNonInlineSkeDrawings != null && paragraphNonInlineSkeDrawings.size > 0 && glyphGroup.every((glyph) => {
|
|
13932
|
+
if (!glyph) return false;
|
|
13933
|
+
if (glyph.streamType === DataStreamTreeTokenType.CUSTOM_BLOCK) return [...paragraphNonInlineSkeDrawings.values()].some((drawing) => drawing.drawingId === glyph.drawingId);
|
|
13934
|
+
return glyph.streamType === DataStreamTreeTokenType.PARAGRAPH || glyph.raw === DataStreamTreeTokenType.PARAGRAPH;
|
|
13935
|
+
});
|
|
13837
13936
|
const glyphGroupCustomBlockIds = new Set(glyphGroup.filter((glyph) => glyph.streamType === DataStreamTreeTokenType.CUSTOM_BLOCK && glyph.drawingId != null).map((glyph) => glyph.drawingId));
|
|
13838
13937
|
let { paddingTop, paddingBottom, contentHeight, lineSpacingApply } = getLineHeightMetrics(glyphLineHeight, paragraphLineGapDefault, linePitch, gridType, lineSpacing, spacingRule, snapToGrid, paragraphConfig.useWordStyleLineHeight, !hasInlineCustomBlock);
|
|
13938
|
+
if (positionedCustomBlockOnly) {
|
|
13939
|
+
paddingTop = 0;
|
|
13940
|
+
paddingBottom = 0;
|
|
13941
|
+
contentHeight = .01;
|
|
13942
|
+
lineSpacingApply = .01;
|
|
13943
|
+
}
|
|
13839
13944
|
let { marginTop, spaceBelowApply } = __getParagraphSpace(ctx, lineSpacingApply, spaceAbove, spaceBelow, isParagraphFirstShapedText, preLine);
|
|
13945
|
+
if (positionedCustomBlockOnly) spaceBelowApply = 0;
|
|
13840
13946
|
if (isZeroWidthNonFlowFloatingAnchorLine) {
|
|
13841
13947
|
paddingTop = 0;
|
|
13842
13948
|
paddingBottom = 0;
|
|
@@ -13879,7 +13985,7 @@ function _lineOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphConf
|
|
|
13879
13985
|
var _pDrawingAnchor$get2;
|
|
13880
13986
|
needOpenNewPageByTableLayout = _updateAndPositionTable(ctx, lineTop, lineHeight, lastPage, column, section, skeTablesInParagraph, paragraphConfig.paragraphIndex, sectionBreakConfig, pDrawingAnchor === null || pDrawingAnchor === void 0 || (_pDrawingAnchor$get2 = pDrawingAnchor.get(paragraphIndex)) === null || _pDrawingAnchor$get2 === void 0 ? void 0 : _pDrawingAnchor$get2.top);
|
|
13881
13987
|
}
|
|
13882
|
-
const newLineTop = calculateLineTopByDrawings(lineHeight, lineTop, lastPage, headerPage, footerPage);
|
|
13988
|
+
const newLineTop = positionedCustomBlockOnly ? lineTop : calculateLineTopByDrawings(lineHeight, lineTop, lastPage, headerPage, footerPage);
|
|
13883
13989
|
if (lineHeight + newLineTop - section.height > LINE_LAYOUT_OVERFLOW_TOLERANCE && column.lines.length > 0 && lastPage.sections.length > 0 || needOpenNewPageByTableLayout) {
|
|
13884
13990
|
setColumnFullState(column, true);
|
|
13885
13991
|
_columnOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphConfig, isParagraphFirstShapedText, breakPointType, defaultGlyphLineHeight);
|
|
@@ -14505,6 +14611,25 @@ function isColumnFull(page) {
|
|
|
14505
14611
|
for (let i = 0; i < columnsLen; i++) if (!section.columns[i].isFull) return false;
|
|
14506
14612
|
return true;
|
|
14507
14613
|
}
|
|
14614
|
+
function isBlankColumn(column) {
|
|
14615
|
+
const lines = column.lines;
|
|
14616
|
+
if (lines.length > 1) return false;
|
|
14617
|
+
const line = lines[lines.length - 1];
|
|
14618
|
+
return isLineBlank(line);
|
|
14619
|
+
}
|
|
14620
|
+
function isLineBlank(line) {
|
|
14621
|
+
if (!line) return true;
|
|
14622
|
+
for (let i = 0; i < line.divides.length; i++) {
|
|
14623
|
+
const spanCount = line.divides[i].glyphGroup.length;
|
|
14624
|
+
if (spanCount > 1) return false;
|
|
14625
|
+
if (spanCount === 1) {
|
|
14626
|
+
const { glyphType, raw, streamType, width } = line.divides[i].glyphGroup[0];
|
|
14627
|
+
const isZeroWidthColumnBreak = width === 0 && (raw === DataStreamTreeTokenType.COLUMN_BREAK || streamType === DataStreamTreeTokenType.COLUMN_BREAK);
|
|
14628
|
+
if (glyphType !== 4 && glyphType !== 2 && !isZeroWidthColumnBreak) return false;
|
|
14629
|
+
}
|
|
14630
|
+
}
|
|
14631
|
+
return true;
|
|
14632
|
+
}
|
|
14508
14633
|
function getNumberUnitValue(unitValue, benchMark) {
|
|
14509
14634
|
if (!unitValue) return 0;
|
|
14510
14635
|
const { v: value, u: unit } = unitValue;
|
|
@@ -14554,15 +14679,17 @@ function getCharSpaceConfig(sectionBreakConfig, paragraphConfig) {
|
|
|
14554
14679
|
snapToGrid
|
|
14555
14680
|
};
|
|
14556
14681
|
}
|
|
14557
|
-
function updateBlockIndex(pages, start = -1) {
|
|
14682
|
+
function updateBlockIndex(pages, start = -1, documentCompatibilityPolicy) {
|
|
14558
14683
|
let prePageStartIndex = start;
|
|
14684
|
+
const shouldUseLayoutColumnWidth = (documentCompatibilityPolicy === null || documentCompatibilityPolicy === void 0 ? void 0 : documentCompatibilityPolicy.mode) !== "unspecified";
|
|
14559
14685
|
for (const page of pages) {
|
|
14560
|
-
const { sections, skeTables } = page;
|
|
14686
|
+
const { sections, skeTables, skeColumnGroups = /* @__PURE__ */ new Map() } = page;
|
|
14561
14687
|
const pageStartIndex = prePageStartIndex;
|
|
14562
14688
|
let preSectionStartIndex = pageStartIndex;
|
|
14563
14689
|
let maxContentWidth = Number.NEGATIVE_INFINITY;
|
|
14564
14690
|
let contentHeight = 0;
|
|
14565
14691
|
for (const section of sections) {
|
|
14692
|
+
collapseRedundantColumnBreakOverflow(section);
|
|
14566
14693
|
const { columns } = section;
|
|
14567
14694
|
const sectionStartIndex = preSectionStartIndex;
|
|
14568
14695
|
let preColumnStartIndex = sectionStartIndex;
|
|
@@ -14581,6 +14708,16 @@ function updateBlockIndex(pages, start = -1) {
|
|
|
14581
14708
|
const table = skeTables.get(tableId);
|
|
14582
14709
|
if (table) lineStartIndex = table.ed;
|
|
14583
14710
|
}
|
|
14711
|
+
if (line.type === 1 && divides.length === 0) {
|
|
14712
|
+
line.st = Math.max(line.st, lineStartIndex + 1);
|
|
14713
|
+
line.ed = Math.max(line.ed, line.st);
|
|
14714
|
+
line.width = 0;
|
|
14715
|
+
line.asc = 0;
|
|
14716
|
+
line.dsc = 0;
|
|
14717
|
+
columnHeight = top + lineHeight;
|
|
14718
|
+
preLineStartIndex = Math.max(preLineStartIndex, line.ed);
|
|
14719
|
+
continue;
|
|
14720
|
+
}
|
|
14584
14721
|
let preDivideStartIndex = lineStartIndex;
|
|
14585
14722
|
let actualWidth = 0;
|
|
14586
14723
|
let maxLineAsc = 0;
|
|
@@ -14620,8 +14757,9 @@ function updateBlockIndex(pages, start = -1) {
|
|
|
14620
14757
|
column.st = columStartIndex + 1;
|
|
14621
14758
|
column.ed = preLineStartIndex >= column.st ? preLineStartIndex : column.st;
|
|
14622
14759
|
column.height = columnHeight;
|
|
14623
|
-
column.width
|
|
14624
|
-
|
|
14760
|
+
const measuredColumnWidth = shouldUseLayoutColumnWidth && Number.isFinite(column.width) && column.width > 0 ? column.width : maxColumnWidth;
|
|
14761
|
+
column.width = measuredColumnWidth;
|
|
14762
|
+
sectionWidth += measuredColumnWidth;
|
|
14625
14763
|
maxSectionHeight = Math.max(maxSectionHeight, column.height);
|
|
14626
14764
|
preColumnStartIndex = column.ed;
|
|
14627
14765
|
}
|
|
@@ -14636,6 +14774,10 @@ function updateBlockIndex(pages, start = -1) {
|
|
|
14636
14774
|
const { ed } = table;
|
|
14637
14775
|
preSectionStartIndex = Math.max(preSectionStartIndex, ed);
|
|
14638
14776
|
}
|
|
14777
|
+
for (const columnGroup of skeColumnGroups.values()) {
|
|
14778
|
+
const { ed } = columnGroup;
|
|
14779
|
+
preSectionStartIndex = Math.max(preSectionStartIndex, ed);
|
|
14780
|
+
}
|
|
14639
14781
|
page.st = pageStartIndex + 1;
|
|
14640
14782
|
page.ed = preSectionStartIndex >= page.st ? preSectionStartIndex : page.st;
|
|
14641
14783
|
page.height = contentHeight;
|
|
@@ -14643,6 +14785,28 @@ function updateBlockIndex(pages, start = -1) {
|
|
|
14643
14785
|
prePageStartIndex = page.ed;
|
|
14644
14786
|
}
|
|
14645
14787
|
}
|
|
14788
|
+
function collapseRedundantColumnBreakOverflow(section) {
|
|
14789
|
+
var _targetColumn$height;
|
|
14790
|
+
const expectedColumnCount = section.colCount || section.columns.length;
|
|
14791
|
+
if (expectedColumnCount <= 0 || section.columns.length <= expectedColumnCount) return;
|
|
14792
|
+
const targetColumn = section.columns[expectedColumnCount - 1];
|
|
14793
|
+
if (!targetColumn) return;
|
|
14794
|
+
const overflowColumns = section.columns.slice(expectedColumnCount);
|
|
14795
|
+
if (!overflowColumns.some((column) => column.lines.length > 0)) return;
|
|
14796
|
+
const targetHeight = (_targetColumn$height = targetColumn.height) !== null && _targetColumn$height !== void 0 ? _targetColumn$height : 0;
|
|
14797
|
+
const overflowLines = overflowColumns.flatMap((column) => column.lines);
|
|
14798
|
+
overflowLines.forEach((line) => {
|
|
14799
|
+
line.top += targetHeight;
|
|
14800
|
+
line.parent = targetColumn;
|
|
14801
|
+
});
|
|
14802
|
+
targetColumn.lines.push(...overflowLines);
|
|
14803
|
+
targetColumn.height = Math.max(...overflowColumns.map((column) => {
|
|
14804
|
+
var _column$height;
|
|
14805
|
+
return targetHeight + ((_column$height = column.height) !== null && _column$height !== void 0 ? _column$height : 0);
|
|
14806
|
+
}), targetHeight);
|
|
14807
|
+
targetColumn.isFull = overflowColumns.some((column) => column.isFull);
|
|
14808
|
+
section.columns.splice(expectedColumnCount);
|
|
14809
|
+
}
|
|
14646
14810
|
function updateInlineDrawingCoordsAndBorder(ctx, pages) {
|
|
14647
14811
|
lineIterator(pages, (line, _, __, page) => {
|
|
14648
14812
|
var _ctx$paragraphConfigC, _ctx$skeletonResource, _paragraphStyle$shadi;
|
|
@@ -14694,6 +14858,264 @@ function lineIterator(pagesOrCells, cb) {
|
|
|
14694
14858
|
}
|
|
14695
14859
|
}
|
|
14696
14860
|
}
|
|
14861
|
+
function documentSkeletonTableIterator(pages, options = {}) {
|
|
14862
|
+
const { docsLeft = 0, docsTop = 0, pageMarginTop = 0, resolveViewport = true, tableCellInsetX = 0, unitId = "" } = options;
|
|
14863
|
+
const contexts = [];
|
|
14864
|
+
pages.forEach((rootPage, pageIndex) => {
|
|
14865
|
+
var _rootPage$skeColumnGr;
|
|
14866
|
+
const rootPageTop = ((rootPage.pageHeight === Infinity ? 0 : rootPage.pageHeight) + pageMarginTop) * pageIndex + rootPage.marginTop + docsTop;
|
|
14867
|
+
const rootPageLeft = rootPage.marginLeft + docsLeft;
|
|
14868
|
+
collectPageTables({
|
|
14869
|
+
contexts,
|
|
14870
|
+
docsLeft,
|
|
14871
|
+
page: rootPage,
|
|
14872
|
+
pageIndex,
|
|
14873
|
+
pageLeft: rootPageLeft,
|
|
14874
|
+
pageTop: rootPageTop,
|
|
14875
|
+
rootPage,
|
|
14876
|
+
source: "page",
|
|
14877
|
+
resolveViewport,
|
|
14878
|
+
tableCellInsetX,
|
|
14879
|
+
unitId
|
|
14880
|
+
});
|
|
14881
|
+
(_rootPage$skeColumnGr = rootPage.skeColumnGroups) === null || _rootPage$skeColumnGr === void 0 || _rootPage$skeColumnGr.forEach((columnGroup) => {
|
|
14882
|
+
columnGroup.columns.forEach((columnGroupColumn) => {
|
|
14883
|
+
const nestedPage = columnGroupColumn.page;
|
|
14884
|
+
collectPageTables({
|
|
14885
|
+
contexts,
|
|
14886
|
+
docsLeft,
|
|
14887
|
+
page: nestedPage,
|
|
14888
|
+
pageIndex,
|
|
14889
|
+
pageLeft: rootPageLeft + columnGroup.left + columnGroupColumn.left + nestedPage.marginLeft,
|
|
14890
|
+
pageTop: rootPageTop + columnGroup.top + columnGroupColumn.top + nestedPage.marginTop,
|
|
14891
|
+
rootPage,
|
|
14892
|
+
source: "column",
|
|
14893
|
+
resolveViewport,
|
|
14894
|
+
tableCellInsetX,
|
|
14895
|
+
unitId
|
|
14896
|
+
});
|
|
14897
|
+
});
|
|
14898
|
+
});
|
|
14899
|
+
});
|
|
14900
|
+
return contexts;
|
|
14901
|
+
}
|
|
14902
|
+
function documentSkeletonLineIterator(pages, options, cb) {
|
|
14903
|
+
const { docsLeft = 0, pageMarginTop = 0, tableCellInsetX = 0, unitId = "" } = options;
|
|
14904
|
+
pages.forEach((page, pageIndex) => {
|
|
14905
|
+
var _page$skeTables, _page$skeColumnGroups;
|
|
14906
|
+
const pageTop = ((page.pageHeight === Infinity ? 0 : page.pageHeight) + pageMarginTop) * pageIndex + page.marginTop;
|
|
14907
|
+
const pageLeft = page.marginLeft;
|
|
14908
|
+
visitPageLines(page, {
|
|
14909
|
+
pageIndex,
|
|
14910
|
+
pageLeft,
|
|
14911
|
+
pageTop,
|
|
14912
|
+
source: "page",
|
|
14913
|
+
getBounds: (linePage, column, section) => getPageLineBounds(linePage, column, section.columns.length, pageLeft)
|
|
14914
|
+
}, cb);
|
|
14915
|
+
(_page$skeTables = page.skeTables) === null || _page$skeTables === void 0 || _page$skeTables.forEach((table) => {
|
|
14916
|
+
const viewport = getDocsTableRenderViewport(unitId, getSourceTableId(table.tableId));
|
|
14917
|
+
const hasHorizontalViewport = hasDocsTableHorizontalViewport(viewport);
|
|
14918
|
+
const tableViewportLeft = getTableViewportLeft(pageLeft, table.left, viewport, docsLeft);
|
|
14919
|
+
const tableViewportRight = tableViewportLeft + (hasHorizontalViewport ? viewport.viewportWidth : table.width);
|
|
14920
|
+
const tableScrollLeft = hasHorizontalViewport ? viewport.scrollLeft : 0;
|
|
14921
|
+
table.rows.forEach((row) => {
|
|
14922
|
+
row.cells.forEach((cell) => {
|
|
14923
|
+
const cellTop = pageTop + table.top + row.top + cell.marginTop;
|
|
14924
|
+
const cellLeft = pageLeft + table.left + cell.left - tableScrollLeft + cell.marginLeft;
|
|
14925
|
+
const cellContentRight = cellLeft + cell.pageWidth - cell.marginLeft - cell.marginRight;
|
|
14926
|
+
const visualLeft = cellLeft + tableCellInsetX;
|
|
14927
|
+
const visualRight = cellContentRight - tableCellInsetX;
|
|
14928
|
+
const visualWidth = Math.max(0, visualRight - visualLeft);
|
|
14929
|
+
const clipLeft = tableViewportLeft;
|
|
14930
|
+
const clipRight = Math.min(cellContentRight, tableViewportRight);
|
|
14931
|
+
if (visualWidth <= 0 || Math.min(visualRight, clipRight) <= Math.max(visualLeft, clipLeft)) return;
|
|
14932
|
+
visitPageLines(cell, {
|
|
14933
|
+
clipLeft,
|
|
14934
|
+
clipRight,
|
|
14935
|
+
pageIndex,
|
|
14936
|
+
pageLeft: cellLeft,
|
|
14937
|
+
pageTop: cellTop,
|
|
14938
|
+
source: "table-cell",
|
|
14939
|
+
visualLeft,
|
|
14940
|
+
visualWidth
|
|
14941
|
+
}, cb);
|
|
14942
|
+
});
|
|
14943
|
+
});
|
|
14944
|
+
});
|
|
14945
|
+
(_page$skeColumnGroups = page.skeColumnGroups) === null || _page$skeColumnGroups === void 0 || _page$skeColumnGroups.forEach((columnGroup) => {
|
|
14946
|
+
columnGroup.columns.forEach((columnGroupColumn) => {
|
|
14947
|
+
const nestedPage = columnGroupColumn.page;
|
|
14948
|
+
const nestedPageLeft = pageLeft + columnGroup.left + columnGroupColumn.left + nestedPage.marginLeft;
|
|
14949
|
+
const nestedPageTop = pageTop + columnGroup.top + columnGroupColumn.top + nestedPage.marginTop;
|
|
14950
|
+
const visualWidth = Math.max(0, columnGroupColumn.width - nestedPage.marginLeft - nestedPage.marginRight);
|
|
14951
|
+
visitPageLines(nestedPage, {
|
|
14952
|
+
pageIndex,
|
|
14953
|
+
pageLeft: nestedPageLeft,
|
|
14954
|
+
pageTop: nestedPageTop,
|
|
14955
|
+
source: "column",
|
|
14956
|
+
getBounds: (_linePage, column) => ({
|
|
14957
|
+
lineWidth: Math.max(getFiniteWidth(column.width), visualWidth - column.left),
|
|
14958
|
+
visualLeft: nestedPageLeft + column.left,
|
|
14959
|
+
visualWidth: Math.max(getFiniteWidth(column.width), visualWidth - column.left)
|
|
14960
|
+
})
|
|
14961
|
+
}, cb);
|
|
14962
|
+
});
|
|
14963
|
+
});
|
|
14964
|
+
});
|
|
14965
|
+
}
|
|
14966
|
+
function getDocumentSkeletonNestedPageOffset(page) {
|
|
14967
|
+
var _parent$parent, _parent$parent$column;
|
|
14968
|
+
const parent = page.parent;
|
|
14969
|
+
if ((parent === null || parent === void 0 ? void 0 : parent.page) === page && ((_parent$parent = parent.parent) === null || _parent$parent === void 0 ? void 0 : _parent$parent.columnGroupId) && ((_parent$parent$column = parent.parent.columns) === null || _parent$parent$column === void 0 ? void 0 : _parent$parent$column.includes(parent))) {
|
|
14970
|
+
var _parent$parent$left, _parent$left, _parent$parent$top, _parent$top;
|
|
14971
|
+
return {
|
|
14972
|
+
left: ((_parent$parent$left = parent.parent.left) !== null && _parent$parent$left !== void 0 ? _parent$parent$left : 0) + ((_parent$left = parent.left) !== null && _parent$left !== void 0 ? _parent$left : 0),
|
|
14973
|
+
top: ((_parent$parent$top = parent.parent.top) !== null && _parent$parent$top !== void 0 ? _parent$parent$top : 0) + ((_parent$top = parent.top) !== null && _parent$top !== void 0 ? _parent$top : 0)
|
|
14974
|
+
};
|
|
14975
|
+
}
|
|
14976
|
+
}
|
|
14977
|
+
function getDocumentSkeletonColumnPagePathInfo(position) {
|
|
14978
|
+
var _path$indexOf, _path$indexOf2, _path$indexOf3;
|
|
14979
|
+
const { path } = position;
|
|
14980
|
+
const pagesIndex = (_path$indexOf = path === null || path === void 0 ? void 0 : path.indexOf("pages")) !== null && _path$indexOf !== void 0 ? _path$indexOf : -1;
|
|
14981
|
+
const columnGroupIndex = (_path$indexOf2 = path === null || path === void 0 ? void 0 : path.indexOf("skeColumnGroups")) !== null && _path$indexOf2 !== void 0 ? _path$indexOf2 : -1;
|
|
14982
|
+
const columnsIndex = (_path$indexOf3 = path === null || path === void 0 ? void 0 : path.indexOf("columns")) !== null && _path$indexOf3 !== void 0 ? _path$indexOf3 : -1;
|
|
14983
|
+
if (pagesIndex === -1 || columnGroupIndex === -1 || columnsIndex === -1 || (path === null || path === void 0 ? void 0 : path[columnsIndex + 2]) !== "page") return;
|
|
14984
|
+
const pageIndex = path === null || path === void 0 ? void 0 : path[pagesIndex + 1];
|
|
14985
|
+
const columnGroupId = path === null || path === void 0 ? void 0 : path[columnGroupIndex + 1];
|
|
14986
|
+
const columnIndex = path === null || path === void 0 ? void 0 : path[columnsIndex + 1];
|
|
14987
|
+
if (typeof pageIndex !== "number" || typeof columnGroupId !== "string" || typeof columnIndex !== "number") return;
|
|
14988
|
+
return {
|
|
14989
|
+
columnGroupId,
|
|
14990
|
+
columnIndex,
|
|
14991
|
+
pageIndex
|
|
14992
|
+
};
|
|
14993
|
+
}
|
|
14994
|
+
function compareDocumentSkeletonNestedPagePathOrder(pos1, pos2) {
|
|
14995
|
+
const columnGroupOrder1 = getDocumentSkeletonColumnPagePathInfo(pos1);
|
|
14996
|
+
const columnGroupOrder2 = getDocumentSkeletonColumnPagePathInfo(pos2);
|
|
14997
|
+
if (columnGroupOrder1 && columnGroupOrder2 && columnGroupOrder1.pageIndex === columnGroupOrder2.pageIndex && columnGroupOrder1.columnGroupId === columnGroupOrder2.columnGroupId && columnGroupOrder1.columnIndex !== columnGroupOrder2.columnIndex) return columnGroupOrder1.columnIndex < columnGroupOrder2.columnIndex;
|
|
14998
|
+
}
|
|
14999
|
+
function visitPageLines(page, options, cb) {
|
|
15000
|
+
page.sections.forEach((section) => {
|
|
15001
|
+
section.columns.forEach((column) => {
|
|
15002
|
+
column.lines.forEach((line) => {
|
|
15003
|
+
var _options$getBounds, _ref, _bounds$lineWidth, _bounds$visualLeft, _bounds$visualWidth;
|
|
15004
|
+
const bounds = (_options$getBounds = options.getBounds) === null || _options$getBounds === void 0 ? void 0 : _options$getBounds.call(options, page, column, section);
|
|
15005
|
+
cb({
|
|
15006
|
+
clipLeft: options.clipLeft,
|
|
15007
|
+
clipRight: options.clipRight,
|
|
15008
|
+
column,
|
|
15009
|
+
line,
|
|
15010
|
+
lineWidth: (_ref = (_bounds$lineWidth = bounds === null || bounds === void 0 ? void 0 : bounds.lineWidth) !== null && _bounds$lineWidth !== void 0 ? _bounds$lineWidth : bounds === null || bounds === void 0 ? void 0 : bounds.visualWidth) !== null && _ref !== void 0 ? _ref : getFiniteWidth(column.width),
|
|
15011
|
+
page,
|
|
15012
|
+
pageIndex: options.pageIndex,
|
|
15013
|
+
pageLeft: options.pageLeft,
|
|
15014
|
+
section,
|
|
15015
|
+
sectionTop: options.pageTop + section.top,
|
|
15016
|
+
source: options.source,
|
|
15017
|
+
visualLeft: (_bounds$visualLeft = bounds === null || bounds === void 0 ? void 0 : bounds.visualLeft) !== null && _bounds$visualLeft !== void 0 ? _bounds$visualLeft : options.visualLeft,
|
|
15018
|
+
visualWidth: (_bounds$visualWidth = bounds === null || bounds === void 0 ? void 0 : bounds.visualWidth) !== null && _bounds$visualWidth !== void 0 ? _bounds$visualWidth : options.visualWidth
|
|
15019
|
+
});
|
|
15020
|
+
});
|
|
15021
|
+
});
|
|
15022
|
+
});
|
|
15023
|
+
}
|
|
15024
|
+
function getPageLineBounds(page, column, columnCount, pageLeft) {
|
|
15025
|
+
if (columnCount !== 1 || !Number.isFinite(page.pageWidth)) return;
|
|
15026
|
+
const visualLeft = pageLeft + column.left;
|
|
15027
|
+
const visualRight = page.pageWidth - page.marginRight;
|
|
15028
|
+
const visualWidth = Math.max(0, visualRight - visualLeft);
|
|
15029
|
+
const lineWidth = Math.max(0, page.pageWidth - page.marginLeft - page.marginRight);
|
|
15030
|
+
return visualWidth > 0 ? {
|
|
15031
|
+
lineWidth,
|
|
15032
|
+
visualLeft,
|
|
15033
|
+
visualWidth
|
|
15034
|
+
} : void 0;
|
|
15035
|
+
}
|
|
15036
|
+
function collectPageTables(options) {
|
|
15037
|
+
var _page$skeTables2;
|
|
15038
|
+
const { contexts, docsLeft, page, pageIndex, pageLeft, pageTop, resolveViewport, rootPage, source, tableCellInsetX, unitId } = options;
|
|
15039
|
+
(_page$skeTables2 = page.skeTables) === null || _page$skeTables2 === void 0 || _page$skeTables2.forEach((table, tableId) => {
|
|
15040
|
+
var _table$tableId;
|
|
15041
|
+
const effectiveTableId = (_table$tableId = table.tableId) !== null && _table$tableId !== void 0 ? _table$tableId : tableId;
|
|
15042
|
+
const tableLeft = pageLeft + table.left;
|
|
15043
|
+
const tableTop = pageTop + table.top;
|
|
15044
|
+
const sourceTableId = getSourceTableId(effectiveTableId);
|
|
15045
|
+
const viewport = resolveViewport ? getDocsTableRenderViewport(unitId, sourceTableId) : null;
|
|
15046
|
+
const hasHorizontalViewport = hasDocsTableHorizontalViewport(viewport);
|
|
15047
|
+
const tableViewportLeft = getTableViewportLeft(pageLeft, table.left, viewport, docsLeft);
|
|
15048
|
+
const tableViewportRight = tableViewportLeft + (hasHorizontalViewport ? viewport.viewportWidth : table.width);
|
|
15049
|
+
const tableScrollLeft = hasHorizontalViewport ? viewport.scrollLeft : 0;
|
|
15050
|
+
const cells = [];
|
|
15051
|
+
table.rows.forEach((row, rowIndex) => {
|
|
15052
|
+
row.cells.forEach((cell, columnIndex) => {
|
|
15053
|
+
var _cell$marginLeft, _cell$marginRight, _cell$marginTop, _cell$marginBottom, _cell$pageWidth, _cell$pageHeight, _row$top, _cell$left;
|
|
15054
|
+
if (cell.isMergedCellCovered) return;
|
|
15055
|
+
const cellMarginLeft = (_cell$marginLeft = cell.marginLeft) !== null && _cell$marginLeft !== void 0 ? _cell$marginLeft : 0;
|
|
15056
|
+
const cellMarginRight = (_cell$marginRight = cell.marginRight) !== null && _cell$marginRight !== void 0 ? _cell$marginRight : 0;
|
|
15057
|
+
const cellMarginTop = (_cell$marginTop = cell.marginTop) !== null && _cell$marginTop !== void 0 ? _cell$marginTop : 0;
|
|
15058
|
+
const cellMarginBottom = (_cell$marginBottom = cell.marginBottom) !== null && _cell$marginBottom !== void 0 ? _cell$marginBottom : 0;
|
|
15059
|
+
const cellPageWidth = (_cell$pageWidth = cell.pageWidth) !== null && _cell$pageWidth !== void 0 ? _cell$pageWidth : 0;
|
|
15060
|
+
const cellPageHeight = (_cell$pageHeight = cell.pageHeight) !== null && _cell$pageHeight !== void 0 ? _cell$pageHeight : 0;
|
|
15061
|
+
const cellTop = tableTop + ((_row$top = row.top) !== null && _row$top !== void 0 ? _row$top : 0) + cellMarginTop;
|
|
15062
|
+
const cellLeft = tableLeft + ((_cell$left = cell.left) !== null && _cell$left !== void 0 ? _cell$left : 0) - tableScrollLeft + cellMarginLeft;
|
|
15063
|
+
const cellContentRight = cellLeft + cellPageWidth - cellMarginLeft - cellMarginRight;
|
|
15064
|
+
const visualLeft = cellLeft + tableCellInsetX;
|
|
15065
|
+
const visualRight = cellContentRight - tableCellInsetX;
|
|
15066
|
+
const visualWidth = Math.max(0, visualRight - visualLeft);
|
|
15067
|
+
const clipLeft = tableViewportLeft;
|
|
15068
|
+
const clipRight = Math.min(cellContentRight, tableViewportRight);
|
|
15069
|
+
if (visualWidth <= 0 || Math.min(visualRight, clipRight) <= Math.max(visualLeft, clipLeft)) return;
|
|
15070
|
+
cells.push({
|
|
15071
|
+
cell,
|
|
15072
|
+
cellRect: {
|
|
15073
|
+
bottom: cellTop + cellPageHeight - cellMarginBottom - cellMarginTop,
|
|
15074
|
+
left: Math.max(cellLeft, tableViewportLeft),
|
|
15075
|
+
right: Math.min(cellContentRight, tableViewportRight),
|
|
15076
|
+
top: cellTop
|
|
15077
|
+
},
|
|
15078
|
+
clipLeft,
|
|
15079
|
+
clipRight,
|
|
15080
|
+
columnIndex,
|
|
15081
|
+
pageLeft: cellLeft,
|
|
15082
|
+
pageTop: cellTop,
|
|
15083
|
+
row,
|
|
15084
|
+
rowIndex,
|
|
15085
|
+
visualLeft,
|
|
15086
|
+
visualWidth
|
|
15087
|
+
});
|
|
15088
|
+
});
|
|
15089
|
+
});
|
|
15090
|
+
contexts.push({
|
|
15091
|
+
cells,
|
|
15092
|
+
page,
|
|
15093
|
+
pageIndex,
|
|
15094
|
+
pageLeft,
|
|
15095
|
+
pageTop,
|
|
15096
|
+
rootPage,
|
|
15097
|
+
source,
|
|
15098
|
+
table,
|
|
15099
|
+
tableId: effectiveTableId,
|
|
15100
|
+
tableRect: {
|
|
15101
|
+
bottom: tableTop + table.height,
|
|
15102
|
+
left: tableLeft,
|
|
15103
|
+
right: tableLeft + table.width,
|
|
15104
|
+
top: tableTop
|
|
15105
|
+
}
|
|
15106
|
+
});
|
|
15107
|
+
});
|
|
15108
|
+
}
|
|
15109
|
+
function getTableViewportLeft(pageLeft, tableLeft, viewport, docsLeft) {
|
|
15110
|
+
const viewportLeft = viewport === null || viewport === void 0 ? void 0 : viewport.viewportLeft;
|
|
15111
|
+
return viewportLeft != null ? viewportLeft - docsLeft : pageLeft + tableLeft;
|
|
15112
|
+
}
|
|
15113
|
+
function getSourceTableId(tableId) {
|
|
15114
|
+
return tableId.includes("#-#") ? tableId.split("#-#")[0] : tableId;
|
|
15115
|
+
}
|
|
15116
|
+
function getFiniteWidth(width) {
|
|
15117
|
+
return Number.isFinite(width) ? width : 0;
|
|
15118
|
+
}
|
|
14697
15119
|
function columnIterator(pages, iteratorFunction) {
|
|
14698
15120
|
for (const page of pages) {
|
|
14699
15121
|
const { sections } = page;
|
|
@@ -14716,7 +15138,14 @@ function getPositionHorizon(positionH, column, page, objectWidth, isPageBreak =
|
|
|
14716
15138
|
else if (align === AlignTypeH.CENTER) absoluteLeft = left + width / 2 - objectWidth / 2;
|
|
14717
15139
|
return absoluteLeft;
|
|
14718
15140
|
}
|
|
14719
|
-
if (relativeFrom === ObjectRelativeFromH.LEFT_MARGIN) {} else if (relativeFrom === ObjectRelativeFromH.MARGIN) {
|
|
15141
|
+
if (relativeFrom === ObjectRelativeFromH.LEFT_MARGIN) {} else if (relativeFrom === ObjectRelativeFromH.MARGIN) {
|
|
15142
|
+
const { pageWidth, marginLeft, marginRight } = page;
|
|
15143
|
+
const marginWidth = pageWidth - marginLeft - marginRight;
|
|
15144
|
+
let absoluteLeft = marginLeft;
|
|
15145
|
+
if (align === AlignTypeH.RIGHT) absoluteLeft = marginLeft + marginWidth - objectWidth;
|
|
15146
|
+
else if (align === AlignTypeH.CENTER) absoluteLeft = marginLeft + marginWidth / 2 - objectWidth / 2;
|
|
15147
|
+
return absoluteLeft;
|
|
15148
|
+
} else if (relativeFrom === ObjectRelativeFromH.RIGHT_MARGIN) {} else if (relativeFrom === ObjectRelativeFromH.INSIDE_MARGIN) {} else if (relativeFrom === ObjectRelativeFromH.OUTSIDE_MARGIN) {} else if (relativeFrom === ObjectRelativeFromH.PAGE) {
|
|
14720
15149
|
const { pageWidth } = page;
|
|
14721
15150
|
let absoluteLeft = 0;
|
|
14722
15151
|
if (align === AlignTypeH.RIGHT) absoluteLeft = pageWidth - objectWidth;
|
|
@@ -14997,6 +15426,13 @@ function getPageFromPath(skeletonData, path) {
|
|
|
14997
15426
|
pathCopy.shift();
|
|
14998
15427
|
const cellIndex = pathCopy.shift();
|
|
14999
15428
|
page = (_skeTables = page.skeTables) === null || _skeTables === void 0 || (_skeTables = _skeTables.get(tableId)) === null || _skeTables === void 0 || (_skeTables = _skeTables.rows[rowIndex]) === null || _skeTables === void 0 ? void 0 : _skeTables.cells[cellIndex];
|
|
15429
|
+
} else if (field === "skeColumnGroups") {
|
|
15430
|
+
var _skeColumnGroups;
|
|
15431
|
+
const columnGroupId = pathCopy.shift();
|
|
15432
|
+
pathCopy.shift();
|
|
15433
|
+
const columnIndex = pathCopy.shift();
|
|
15434
|
+
pathCopy.shift();
|
|
15435
|
+
page = (_skeColumnGroups = page.skeColumnGroups) === null || _skeColumnGroups === void 0 || (_skeColumnGroups = _skeColumnGroups.get(columnGroupId)) === null || _skeColumnGroups === void 0 || (_skeColumnGroups = _skeColumnGroups.columns[columnIndex]) === null || _skeColumnGroups === void 0 ? void 0 : _skeColumnGroups.page;
|
|
15000
15436
|
}
|
|
15001
15437
|
}
|
|
15002
15438
|
return page;
|
|
@@ -15103,11 +15539,13 @@ function _getNullPage(type = 0, segmentId = "") {
|
|
|
15103
15539
|
ed: 0,
|
|
15104
15540
|
skeDrawings: /* @__PURE__ */ new Map(),
|
|
15105
15541
|
skeTables: /* @__PURE__ */ new Map(),
|
|
15542
|
+
skeColumnGroups: /* @__PURE__ */ new Map(),
|
|
15106
15543
|
type,
|
|
15107
15544
|
segmentId
|
|
15108
15545
|
};
|
|
15109
15546
|
}
|
|
15110
15547
|
function _createSkeletonHeaderFooter(ctx, headerOrFooterViewModel, sectionBreakConfig, skeletonResourceReference, segmentId, isHeader = true, areaPage, count = 0) {
|
|
15548
|
+
var _sectionBreakConfig$d;
|
|
15111
15549
|
const { lists, footerTreeMap, headerTreeMap, localeService, pageSize, drawings, marginLeft = 0, marginRight = 0, marginHeader = 0, marginFooter = 0 } = sectionBreakConfig;
|
|
15112
15550
|
const pageWidth = (pageSize === null || pageSize === void 0 ? void 0 : pageSize.width) || Number.POSITIVE_INFINITY;
|
|
15113
15551
|
const pageHeight = (pageSize === null || pageSize === void 0 ? void 0 : pageSize.height) || Number.POSITIVE_INFINITY;
|
|
@@ -15135,7 +15573,7 @@ function _createSkeletonHeaderFooter(ctx, headerOrFooterViewModel, sectionBreakC
|
|
|
15135
15573
|
resetContext(ctx);
|
|
15136
15574
|
return _createSkeletonHeaderFooter(ctx, headerOrFooterViewModel, sectionBreakConfig, skeletonResourceReference, segmentId, isHeader, areaPage, count);
|
|
15137
15575
|
}
|
|
15138
|
-
updateBlockIndex([page]);
|
|
15576
|
+
updateBlockIndex([page], -1, (_sectionBreakConfig$d = sectionBreakConfig.documentCompatibilityPolicy) !== null && _sectionBreakConfig$d !== void 0 ? _sectionBreakConfig$d : getDocumentCompatibilityPolicy());
|
|
15139
15577
|
if (isHeader) Object.assign(page, {
|
|
15140
15578
|
marginTop: marginHeader,
|
|
15141
15579
|
marginBottom: 5
|
|
@@ -15196,7 +15634,7 @@ function createNullCellPage(ctx, sectionBreakConfig, tableConfig, row, col, avai
|
|
|
15196
15634
|
};
|
|
15197
15635
|
}
|
|
15198
15636
|
function createSkeletonCellPages(ctx, viewModel, cellNode, sectionBreakConfig, tableConfig, row, col, availableHeight = Number.POSITIVE_INFINITY, maxCellPageHeight = Number.POSITIVE_INFINITY) {
|
|
15199
|
-
var _ctx$dataModel, _ctx$dataModel$getBod;
|
|
15637
|
+
var _sectionBreakConfig$d2, _ctx$dataModel, _ctx$dataModel$getBod;
|
|
15200
15638
|
const sectionNode = cellNode.children[0];
|
|
15201
15639
|
const { page: areaPage, sectionBreakConfig: cellSectionBreakConfig } = createNullCellPage(ctx, sectionBreakConfig, tableConfig, row, col, availableHeight, maxCellPageHeight);
|
|
15202
15640
|
const { pages } = dealWithSection(ctx, viewModel, sectionNode, areaPage, cellSectionBreakConfig);
|
|
@@ -15204,8 +15642,8 @@ function createSkeletonCellPages(ctx, viewModel, cellNode, sectionBreakConfig, t
|
|
|
15204
15642
|
p.type = 3;
|
|
15205
15643
|
p.segmentId = tableConfig.tableId;
|
|
15206
15644
|
}
|
|
15207
|
-
updateBlockIndex(pages, cellNode.startIndex);
|
|
15208
|
-
|
|
15645
|
+
updateBlockIndex(pages, cellNode.startIndex, (_sectionBreakConfig$d2 = sectionBreakConfig.documentCompatibilityPolicy) !== null && _sectionBreakConfig$d2 !== void 0 ? _sectionBreakConfig$d2 : getDocumentCompatibilityPolicy());
|
|
15646
|
+
applyTrailingBlockRangeSpaceBelow(pages, (_ctx$dataModel = ctx.dataModel) === null || _ctx$dataModel === void 0 || (_ctx$dataModel$getBod = _ctx$dataModel.getBody) === null || _ctx$dataModel$getBod === void 0 ? void 0 : _ctx$dataModel$getBod.call(_ctx$dataModel), cellNode.endIndex);
|
|
15209
15647
|
updateInlineDrawingCoordsAndBorder(ctx, pages);
|
|
15210
15648
|
expandCellPageHeightForInlineDrawings(pages);
|
|
15211
15649
|
return pages;
|
|
@@ -15221,7 +15659,7 @@ function expandCellPageHeightForInlineDrawings(pages) {
|
|
|
15221
15659
|
});
|
|
15222
15660
|
}
|
|
15223
15661
|
}
|
|
15224
|
-
function
|
|
15662
|
+
function applyTrailingBlockRangeSpaceBelow(pages, body, containerEndIndex) {
|
|
15225
15663
|
const blockRanges = body === null || body === void 0 ? void 0 : body.blockRanges;
|
|
15226
15664
|
const trailingBlockRangeSpace = 28;
|
|
15227
15665
|
if (!(blockRanges === null || blockRanges === void 0 ? void 0 : blockRanges.length)) return;
|
|
@@ -15231,7 +15669,7 @@ function applyTrailingCellBlockRangeSpaceBelow(pages, body, cellEndIndex) {
|
|
|
15231
15669
|
if (!lastLine) continue;
|
|
15232
15670
|
const paragraphIndex = lastLine.paragraphIndex;
|
|
15233
15671
|
if (!blockRanges.some((range) => range.startIndex < paragraphIndex && paragraphIndex < range.endIndex)) continue;
|
|
15234
|
-
if (body === null || body === void 0 || (_body$paragraphs = body.paragraphs) === null || _body$paragraphs === void 0 ? void 0 : _body$paragraphs.some((paragraph) => paragraph.startIndex > paragraphIndex && paragraph.startIndex <
|
|
15672
|
+
if (body === null || body === void 0 || (_body$paragraphs = body.paragraphs) === null || _body$paragraphs === void 0 ? void 0 : _body$paragraphs.some((paragraph) => paragraph.startIndex > paragraphIndex && paragraph.startIndex < containerEndIndex)) continue;
|
|
15235
15673
|
page.height += lastLine.spaceBelowApply || trailingBlockRangeSpace;
|
|
15236
15674
|
}
|
|
15237
15675
|
}
|
|
@@ -15343,6 +15781,15 @@ function adjustGlyphsInDivide(divide, justificationRatio, extraJustification) {
|
|
|
15343
15781
|
}
|
|
15344
15782
|
setGlyphGroupLeft(divide.glyphGroup);
|
|
15345
15783
|
}
|
|
15784
|
+
function distributeGlyphsInDivide(divide, remaining) {
|
|
15785
|
+
if (remaining <= 0) return false;
|
|
15786
|
+
const visibleGlyphs = divide.glyphGroup.filter((glyph) => glyph.content !== "" && glyph.width > 0);
|
|
15787
|
+
if (visibleGlyphs.length < 2) return false;
|
|
15788
|
+
const extraGap = remaining / (visibleGlyphs.length - 1);
|
|
15789
|
+
for (let i = 0; i < visibleGlyphs.length - 1; i++) visibleGlyphs[i].width += extraGap;
|
|
15790
|
+
setGlyphGroupLeft(divide.glyphGroup);
|
|
15791
|
+
return true;
|
|
15792
|
+
}
|
|
15346
15793
|
/**
|
|
15347
15794
|
* When aligning text horizontally within a document,
|
|
15348
15795
|
* it may be ineffective if the total line width is not initially calculated.
|
|
@@ -15408,7 +15855,13 @@ function horizontalAlignHandler(line, horizontalAlign, allowOverflowHorizontalOf
|
|
|
15408
15855
|
}
|
|
15409
15856
|
}
|
|
15410
15857
|
const inkBounds = allowOverflowHorizontalOffset ? getGlyphGroupInkBounds(divide) : null;
|
|
15411
|
-
if (horizontalAlign === HorizontalAlign.
|
|
15858
|
+
if (horizontalAlign === HorizontalAlign.DISTRIBUTED) {
|
|
15859
|
+
if (distributeGlyphsInDivide(divide, width - glyphGroupWidth)) {
|
|
15860
|
+
glyphGroupWidth = getGlyphGroupWidth(divide);
|
|
15861
|
+
divide.glyphGroupWidth = glyphGroupWidth;
|
|
15862
|
+
}
|
|
15863
|
+
divide.paddingLeft = 0;
|
|
15864
|
+
} else if (horizontalAlign === HorizontalAlign.CENTER && inkBounds) divide.paddingLeft = width / 2 - (inkBounds.left + inkBounds.right) / 2;
|
|
15412
15865
|
else if (horizontalAlign === HorizontalAlign.RIGHT && inkBounds) divide.paddingLeft = width - inkBounds.right;
|
|
15413
15866
|
else if (horizontalAlign === HorizontalAlign.CENTER) divide.paddingLeft = (width - glyphGroupWidth) / 2;
|
|
15414
15867
|
else if (horizontalAlign === HorizontalAlign.RIGHT) divide.paddingLeft = width - glyphGroupWidth;
|
|
@@ -15680,6 +16133,14 @@ function _isMarkedDocxColumnBreak(viewModel, absoluteIndex) {
|
|
|
15680
16133
|
function _glyphCount(glyphs) {
|
|
15681
16134
|
return glyphs.reduce((count, glyph) => count + glyph.count, 0);
|
|
15682
16135
|
}
|
|
16136
|
+
function _isDocxColumnBreakVisuallyBlankColumn(column) {
|
|
16137
|
+
return column.lines.every((line) => line.divides.every((divide) => divide.glyphGroup.every((glyph) => {
|
|
16138
|
+
const { glyphType, raw, streamType, width } = glyph;
|
|
16139
|
+
const isParagraphMark = raw === DataStreamTreeTokenType.PARAGRAPH || streamType === DataStreamTreeTokenType.PARAGRAPH;
|
|
16140
|
+
const isColumnBreak = width === 0 && (raw === DataStreamTreeTokenType.COLUMN_BREAK || streamType === DataStreamTreeTokenType.COLUMN_BREAK);
|
|
16141
|
+
return glyphType === 4 || glyphType === 2 || isParagraphMark || isColumnBreak;
|
|
16142
|
+
})));
|
|
16143
|
+
}
|
|
15683
16144
|
function _hasOnlyCustomBlockGlyphs(glyphs) {
|
|
15684
16145
|
return glyphs.length > 0 && glyphs.every((glyph) => glyph.streamType === DataStreamTreeTokenType.CUSTOM_BLOCK);
|
|
15685
16146
|
}
|
|
@@ -15736,7 +16197,9 @@ function _withMinSpacing(style, key, value) {
|
|
|
15736
16197
|
};
|
|
15737
16198
|
}
|
|
15738
16199
|
function _getNextAdjacentBlockRange(blockRanges, blockRange) {
|
|
15739
|
-
|
|
16200
|
+
let nextBlockRange;
|
|
16201
|
+
for (const range of blockRanges !== null && blockRanges !== void 0 ? blockRanges : []) if (range.startIndex > blockRange.endIndex && (!nextBlockRange || range.startIndex < nextBlockRange.startIndex)) nextBlockRange = range;
|
|
16202
|
+
return nextBlockRange;
|
|
15740
16203
|
}
|
|
15741
16204
|
function _hasNextAdjacentLayoutBlockRange(blockRanges, blockRange) {
|
|
15742
16205
|
const nextBlockRange = _getNextAdjacentBlockRange(blockRanges, blockRange);
|
|
@@ -15901,7 +16364,12 @@ function lineBreaking(ctx, viewModel, shapedTextList, curPage, paragraphNode, se
|
|
|
15901
16364
|
const lastPage = allPages[allPages.length - 1];
|
|
15902
16365
|
const columnInfo = getLastNotFullColumnInfo(lastPage);
|
|
15903
16366
|
if (columnInfo && !columnInfo.isLast) setColumnFullState(columnInfo.column, true);
|
|
15904
|
-
else
|
|
16367
|
+
else if (columnInfo && columnInfo.isLast && isTraditionalDocumentCompatibility(documentCompatibilityPolicy) && (isBlankColumn(columnInfo.column) || _isDocxColumnBreakVisuallyBlankColumn(columnInfo.column))) {} else if (isTraditionalDocumentCompatibility(documentCompatibilityPolicy)) {
|
|
16368
|
+
var _getLastSection;
|
|
16369
|
+
const lastColumn = (_getLastSection = getLastSection(lastPage)) === null || _getLastSection === void 0 ? void 0 : _getLastSection.columns.at(-1);
|
|
16370
|
+
if (lastColumn && (isBlankColumn(lastColumn) || _isDocxColumnBreakVisuallyBlankColumn(lastColumn))) setColumnFullState(lastColumn, false);
|
|
16371
|
+
else allPages.push(createSkeletonPage(ctx, sectionBreakConfig, skeletonResourceReference, _getNextPageNumber(lastPage), 2));
|
|
16372
|
+
} else allPages.push(createSkeletonPage(ctx, sectionBreakConfig, skeletonResourceReference, _getNextPageNumber(lastPage), 2));
|
|
15905
16373
|
shapedTextOffset += textGlyphCount;
|
|
15906
16374
|
continue;
|
|
15907
16375
|
}
|
|
@@ -16655,6 +17123,219 @@ function dealWidthParagraph(ctx, viewModel, paragraphNode, curPage, sectionBreak
|
|
|
16655
17123
|
return allPages;
|
|
16656
17124
|
}
|
|
16657
17125
|
|
|
17126
|
+
//#endregion
|
|
17127
|
+
//#region src/components/docs/layout/block/column.ts
|
|
17128
|
+
const EMPTY_COLUMN_GROUP_MIN_HEIGHT = 72;
|
|
17129
|
+
function createColumnGroupSkeleton(ctx, curPage, viewModel, columnGroupNode, sectionBreakConfig) {
|
|
17130
|
+
var _viewModel$getColumnG, _getLastNotFullColumn;
|
|
17131
|
+
const columnGroupSource = (_viewModel$getColumnG = viewModel.getColumnGroupByStartIndex(columnGroupNode.startIndex)) === null || _viewModel$getColumnG === void 0 ? void 0 : _viewModel$getColumnG.columnGroupSource;
|
|
17132
|
+
if (columnGroupSource == null) {
|
|
17133
|
+
console.warn("Column group not found when creating column group skeleton");
|
|
17134
|
+
return null;
|
|
17135
|
+
}
|
|
17136
|
+
const hostColumn = (_getLastNotFullColumn = getLastNotFullColumnInfo(curPage)) === null || _getLastNotFullColumn === void 0 ? void 0 : _getLastNotFullColumn.column;
|
|
17137
|
+
if (hostColumn == null) return null;
|
|
17138
|
+
const columnPages = columnGroupNode.children.map((columnNode, index) => {
|
|
17139
|
+
const sourceColumn = columnGroupSource.columns[index];
|
|
17140
|
+
return createColumnContentPage(ctx, viewModel, columnNode, sectionBreakConfig, Math.max(0, getInitialColumnWidth(columnGroupSource, sourceColumn, hostColumn.width)));
|
|
17141
|
+
});
|
|
17142
|
+
const columnHeights = columnPages.map((page) => Math.max(page.height, EMPTY_COLUMN_GROUP_MIN_HEIGHT));
|
|
17143
|
+
const layout = calculateColumnGroupLayout(columnGroupSource, hostColumn.width, columnHeights);
|
|
17144
|
+
const columns = layout.columns.map((layoutColumn, index) => {
|
|
17145
|
+
const page = columnPages[index];
|
|
17146
|
+
page.pageHeight = columnHeights[index];
|
|
17147
|
+
return {
|
|
17148
|
+
columnId: layoutColumn.columnId,
|
|
17149
|
+
left: layoutColumn.left,
|
|
17150
|
+
top: layoutColumn.top,
|
|
17151
|
+
width: layoutColumn.width,
|
|
17152
|
+
height: columnHeights[index],
|
|
17153
|
+
st: columnGroupNode.children[index].startIndex,
|
|
17154
|
+
ed: columnGroupNode.children[index].endIndex,
|
|
17155
|
+
page
|
|
17156
|
+
};
|
|
17157
|
+
});
|
|
17158
|
+
const columnGroupSkeleton = {
|
|
17159
|
+
columns,
|
|
17160
|
+
width: layout.width,
|
|
17161
|
+
height: layout.height,
|
|
17162
|
+
top: getNextBlockTop(hostColumn.lines),
|
|
17163
|
+
left: hostColumn.left,
|
|
17164
|
+
st: columnGroupNode.startIndex,
|
|
17165
|
+
ed: columnGroupNode.endIndex,
|
|
17166
|
+
columnGroupId: columnGroupSource.columnGroupId,
|
|
17167
|
+
columnGroupSource
|
|
17168
|
+
};
|
|
17169
|
+
columns.forEach((column) => {
|
|
17170
|
+
column.parent = columnGroupSkeleton;
|
|
17171
|
+
column.page.parent = column;
|
|
17172
|
+
});
|
|
17173
|
+
return columnGroupSkeleton;
|
|
17174
|
+
}
|
|
17175
|
+
function appendColumnGroupBlockLine(page, columnGroup) {
|
|
17176
|
+
const columnInfo = getLastNotFullColumnInfo(page);
|
|
17177
|
+
if (columnInfo == null) return false;
|
|
17178
|
+
const { column } = columnInfo;
|
|
17179
|
+
const line = createColumnGroupBlockLine(columnGroup, column.lines.length);
|
|
17180
|
+
line.parent = column;
|
|
17181
|
+
column.lines.push(line);
|
|
17182
|
+
page.skeColumnGroups.set(columnGroup.columnGroupId, columnGroup);
|
|
17183
|
+
columnGroup.parent = page;
|
|
17184
|
+
return true;
|
|
17185
|
+
}
|
|
17186
|
+
function createColumnContentPage(ctx, viewModel, columnNode, sectionBreakConfig, width) {
|
|
17187
|
+
var _sectionBreakConfig$d, _ctx$dataModel, _ctx$dataModel$getBod;
|
|
17188
|
+
const columnSectionBreakConfig = {
|
|
17189
|
+
...sectionBreakConfig,
|
|
17190
|
+
pageSize: {
|
|
17191
|
+
width,
|
|
17192
|
+
height: Number.POSITIVE_INFINITY
|
|
17193
|
+
},
|
|
17194
|
+
marginTop: 0,
|
|
17195
|
+
marginBottom: 0,
|
|
17196
|
+
marginLeft: 0,
|
|
17197
|
+
marginRight: 0,
|
|
17198
|
+
columnProperties: []
|
|
17199
|
+
};
|
|
17200
|
+
const page = createSkeletonPage(ctx, columnSectionBreakConfig, ctx.skeletonResourceReference);
|
|
17201
|
+
page.type = 3;
|
|
17202
|
+
for (const paragraphNode of getColumnParagraphNodes(columnNode)) dealWidthParagraph(ctx, viewModel, paragraphNode, page, columnSectionBreakConfig);
|
|
17203
|
+
updateBlockIndex([page], columnNode.startIndex, (_sectionBreakConfig$d = sectionBreakConfig.documentCompatibilityPolicy) !== null && _sectionBreakConfig$d !== void 0 ? _sectionBreakConfig$d : getDocumentCompatibilityPolicy());
|
|
17204
|
+
applyTrailingBlockRangeSpaceBelow([page], (_ctx$dataModel = ctx.dataModel) === null || _ctx$dataModel === void 0 || (_ctx$dataModel$getBod = _ctx$dataModel.getBody) === null || _ctx$dataModel$getBod === void 0 ? void 0 : _ctx$dataModel$getBod.call(_ctx$dataModel), columnNode.endIndex);
|
|
17205
|
+
return page;
|
|
17206
|
+
}
|
|
17207
|
+
function getColumnParagraphNodes(columnNode) {
|
|
17208
|
+
const firstChild = columnNode.children[0];
|
|
17209
|
+
if ((firstChild === null || firstChild === void 0 ? void 0 : firstChild.nodeType) === DataStreamTreeNodeType.SECTION_BREAK) return firstChild.children;
|
|
17210
|
+
return columnNode.children;
|
|
17211
|
+
}
|
|
17212
|
+
function createColumnGroupBlockLine(columnGroup, lineIndex) {
|
|
17213
|
+
const top = columnGroup.top;
|
|
17214
|
+
return {
|
|
17215
|
+
paragraphIndex: columnGroup.ed,
|
|
17216
|
+
type: 1,
|
|
17217
|
+
divides: [],
|
|
17218
|
+
divideLen: 0,
|
|
17219
|
+
lineHeight: columnGroup.height,
|
|
17220
|
+
contentHeight: columnGroup.height,
|
|
17221
|
+
top,
|
|
17222
|
+
asc: 0,
|
|
17223
|
+
dsc: 0,
|
|
17224
|
+
paddingTop: 0,
|
|
17225
|
+
paddingBottom: 0,
|
|
17226
|
+
marginTop: 0,
|
|
17227
|
+
marginBottom: 0,
|
|
17228
|
+
spaceBelowApply: 0,
|
|
17229
|
+
st: columnGroup.st,
|
|
17230
|
+
ed: columnGroup.ed,
|
|
17231
|
+
lineIndex,
|
|
17232
|
+
paragraphStart: true,
|
|
17233
|
+
isBehindTable: false,
|
|
17234
|
+
tableId: ""
|
|
17235
|
+
};
|
|
17236
|
+
}
|
|
17237
|
+
function getNextBlockTop(lines) {
|
|
17238
|
+
const lastLine = lines[lines.length - 1];
|
|
17239
|
+
if (lastLine == null) return 0;
|
|
17240
|
+
return lastLine.top + lastLine.lineHeight;
|
|
17241
|
+
}
|
|
17242
|
+
function calculateColumnGroupLayout(source, availableWidth, columnHeights) {
|
|
17243
|
+
var _source$gap$v, _source$gap;
|
|
17244
|
+
const width = Math.max(0, availableWidth);
|
|
17245
|
+
const gap = Math.max(0, (_source$gap$v = (_source$gap = source.gap) === null || _source$gap === void 0 ? void 0 : _source$gap.v) !== null && _source$gap$v !== void 0 ? _source$gap$v : 0);
|
|
17246
|
+
const columns = source.columns;
|
|
17247
|
+
if (columns.length === 0) return {
|
|
17248
|
+
mode: "horizontal",
|
|
17249
|
+
width,
|
|
17250
|
+
height: 0,
|
|
17251
|
+
columns: []
|
|
17252
|
+
};
|
|
17253
|
+
if (shouldStack(columns, width, gap, source.responsive)) {
|
|
17254
|
+
let top = 0;
|
|
17255
|
+
return {
|
|
17256
|
+
mode: "stack",
|
|
17257
|
+
width,
|
|
17258
|
+
height: sumHeights(columnHeights),
|
|
17259
|
+
columns: columns.map((column, index) => {
|
|
17260
|
+
var _columnHeights$index;
|
|
17261
|
+
const layoutColumn = {
|
|
17262
|
+
columnId: column.columnId,
|
|
17263
|
+
left: 0,
|
|
17264
|
+
top,
|
|
17265
|
+
width
|
|
17266
|
+
};
|
|
17267
|
+
top += Math.max(0, (_columnHeights$index = columnHeights[index]) !== null && _columnHeights$index !== void 0 ? _columnHeights$index : 0);
|
|
17268
|
+
return layoutColumn;
|
|
17269
|
+
})
|
|
17270
|
+
};
|
|
17271
|
+
}
|
|
17272
|
+
const widths = allocateHorizontalWidths(columns, Math.max(0, width - gap * (columns.length - 1)));
|
|
17273
|
+
let left = 0;
|
|
17274
|
+
return {
|
|
17275
|
+
mode: "horizontal",
|
|
17276
|
+
width,
|
|
17277
|
+
height: Math.max(0, ...columnHeights),
|
|
17278
|
+
columns: columns.map((column, index) => {
|
|
17279
|
+
const layoutColumn = {
|
|
17280
|
+
columnId: column.columnId,
|
|
17281
|
+
left,
|
|
17282
|
+
top: 0,
|
|
17283
|
+
width: widths[index]
|
|
17284
|
+
};
|
|
17285
|
+
left += widths[index] + gap;
|
|
17286
|
+
return layoutColumn;
|
|
17287
|
+
})
|
|
17288
|
+
};
|
|
17289
|
+
}
|
|
17290
|
+
function shouldStack(columns, availableWidth, gap, responsive) {
|
|
17291
|
+
if (responsive !== ColumnResponsiveType.STACK) return false;
|
|
17292
|
+
return columns.reduce((sum, column) => sum + getMinWidth(column), 0) + gap * Math.max(0, columns.length - 1) > availableWidth;
|
|
17293
|
+
}
|
|
17294
|
+
function getInitialColumnWidth(source, column, availableWidth) {
|
|
17295
|
+
var _source$gap$v2, _source$gap2;
|
|
17296
|
+
if (column == null) return availableWidth;
|
|
17297
|
+
const contentWidth = Math.max(0, availableWidth - Math.max(0, (_source$gap$v2 = (_source$gap2 = source.gap) === null || _source$gap2 === void 0 ? void 0 : _source$gap2.v) !== null && _source$gap$v2 !== void 0 ? _source$gap$v2 : 0) * Math.max(0, source.columns.length - 1));
|
|
17298
|
+
const ratioSum = source.columns.reduce((sum, item) => sum + Math.max(0, item.widthRatio || 0), 0) || source.columns.length;
|
|
17299
|
+
return Math.max(getMinWidth(column), contentWidth * (Math.max(0, column.widthRatio || 0) || 1) / ratioSum);
|
|
17300
|
+
}
|
|
17301
|
+
function allocateHorizontalWidths(columns, contentWidth) {
|
|
17302
|
+
const ratioSum = columns.reduce((sum, column) => sum + Math.max(0, column.widthRatio || 0), 0) || columns.length;
|
|
17303
|
+
const idealWidths = columns.map((column) => contentWidth * (Math.max(0, column.widthRatio || 0) || 1) / ratioSum);
|
|
17304
|
+
const minWidths = columns.map(getMinWidth);
|
|
17305
|
+
const widths = idealWidths.map((width, index) => Math.max(width, minWidths[index]));
|
|
17306
|
+
const overflow = widths.reduce((sum, width) => sum + width, 0) - contentWidth;
|
|
17307
|
+
if (overflow <= 0) return widths;
|
|
17308
|
+
return compressToFit(widths, minWidths, overflow);
|
|
17309
|
+
}
|
|
17310
|
+
function compressToFit(widths, minWidths, overflow) {
|
|
17311
|
+
const nextWidths = [...widths];
|
|
17312
|
+
let remainingOverflow = overflow;
|
|
17313
|
+
let flexibleIndexes = getFlexibleIndexes(nextWidths, minWidths);
|
|
17314
|
+
while (remainingOverflow > 0 && flexibleIndexes.length > 0) {
|
|
17315
|
+
const totalShrink = flexibleIndexes.reduce((sum, item) => sum + item.shrink, 0);
|
|
17316
|
+
for (const item of flexibleIndexes) {
|
|
17317
|
+
const shrink = Math.min(item.shrink, remainingOverflow * item.shrink / totalShrink);
|
|
17318
|
+
nextWidths[item.index] -= shrink;
|
|
17319
|
+
remainingOverflow -= shrink;
|
|
17320
|
+
}
|
|
17321
|
+
flexibleIndexes = getFlexibleIndexes(nextWidths, minWidths);
|
|
17322
|
+
}
|
|
17323
|
+
return nextWidths;
|
|
17324
|
+
}
|
|
17325
|
+
function getFlexibleIndexes(widths, minWidths) {
|
|
17326
|
+
return widths.map((width, index) => ({
|
|
17327
|
+
index,
|
|
17328
|
+
shrink: Math.max(0, width - minWidths[index])
|
|
17329
|
+
})).filter((item) => item.shrink > 0);
|
|
17330
|
+
}
|
|
17331
|
+
function getMinWidth(column) {
|
|
17332
|
+
var _column$minWidth$v, _column$minWidth;
|
|
17333
|
+
return Math.max(0, (_column$minWidth$v = (_column$minWidth = column.minWidth) === null || _column$minWidth === void 0 ? void 0 : _column$minWidth.v) !== null && _column$minWidth$v !== void 0 ? _column$minWidth$v : 0);
|
|
17334
|
+
}
|
|
17335
|
+
function sumHeights(heights) {
|
|
17336
|
+
return heights.reduce((sum, height) => sum + Math.max(0, height), 0);
|
|
17337
|
+
}
|
|
17338
|
+
|
|
16658
17339
|
//#endregion
|
|
16659
17340
|
//#region src/components/docs/layout/block/section.ts
|
|
16660
17341
|
function dealWithSection(ctx, viewModel, sectionNode, curPage, sectionBreakConfig, layoutAnchor) {
|
|
@@ -16679,6 +17360,10 @@ function dealWithSection(ctx, viewModel, sectionNode, curPage, sectionBreakConfi
|
|
|
16679
17360
|
if (ctx.paragraphsOpenNewPage.has(paragraphNode.endIndex)) currentPageCache = createSkeletonPage(ctx, sectionBreakConfig, ctx.skeletonResourceReference, currentPageCache.pageNumber + 1);
|
|
16680
17361
|
skeletonPages = dealWidthParagraph(ctx, viewModel, paragraphNode, currentPageCache, sectionBreakConfig);
|
|
16681
17362
|
}
|
|
17363
|
+
if (paragraphNode.nodeType === DataStreamTreeNodeType.COLUMN_GROUP) {
|
|
17364
|
+
const columnGroupSkeleton = createColumnGroupSkeleton(ctx, currentPageCache, viewModel, paragraphNode, sectionBreakConfig);
|
|
17365
|
+
if (columnGroupSkeleton && appendColumnGroupBlockLine(currentPageCache, columnGroupSkeleton)) skeletonPages = [currentPageCache];
|
|
17366
|
+
}
|
|
16682
17367
|
if (skeletonPages.length === 0) skeletonPages = dealWithBlockError();
|
|
16683
17368
|
_pushPage(allCurrentSkeletonPages, skeletonPages);
|
|
16684
17369
|
if (ctx.isDirty) break;
|
|
@@ -17061,11 +17746,49 @@ function removeDupPages(ctx) {
|
|
|
17061
17746
|
return !hasPage;
|
|
17062
17747
|
});
|
|
17063
17748
|
}
|
|
17749
|
+
function mergeContinuousDuplicatePages(pages) {
|
|
17750
|
+
for (let index = 1; index < pages.length;) {
|
|
17751
|
+
var _page$skeDrawings, _page$skeTables;
|
|
17752
|
+
const previousPage = pages[index - 1];
|
|
17753
|
+
const page = pages[index];
|
|
17754
|
+
if (previousPage.pageNumber !== page.pageNumber) {
|
|
17755
|
+
index++;
|
|
17756
|
+
continue;
|
|
17757
|
+
}
|
|
17758
|
+
const topOffset = previousPage.height;
|
|
17759
|
+
for (const section of page.sections) {
|
|
17760
|
+
section.top += topOffset;
|
|
17761
|
+
section.parent = previousPage;
|
|
17762
|
+
previousPage.sections.push(section);
|
|
17763
|
+
}
|
|
17764
|
+
(_page$skeDrawings = page.skeDrawings) === null || _page$skeDrawings === void 0 || _page$skeDrawings.forEach((drawing, drawingId) => {
|
|
17765
|
+
drawing.aTop += topOffset;
|
|
17766
|
+
previousPage.skeDrawings.set(drawingId, drawing);
|
|
17767
|
+
});
|
|
17768
|
+
(_page$skeTables = page.skeTables) === null || _page$skeTables === void 0 || _page$skeTables.forEach((table, tableId) => {
|
|
17769
|
+
table.top += topOffset;
|
|
17770
|
+
table.parent = previousPage;
|
|
17771
|
+
previousPage.skeTables.set(tableId, table);
|
|
17772
|
+
});
|
|
17773
|
+
previousPage.height += page.height;
|
|
17774
|
+
previousPage.width = Math.max(previousPage.width, page.width);
|
|
17775
|
+
previousPage.ed = Math.max(previousPage.ed, page.ed);
|
|
17776
|
+
pages.splice(index, 1);
|
|
17777
|
+
}
|
|
17778
|
+
}
|
|
17064
17779
|
function getPagePath(page) {
|
|
17065
17780
|
const path = [];
|
|
17066
17781
|
let skeNode = page;
|
|
17067
17782
|
let parent = skeNode.parent;
|
|
17068
17783
|
while (parent) {
|
|
17784
|
+
var _parent$parent;
|
|
17785
|
+
if (parent.page === skeNode && ((_parent$parent = parent.parent) === null || _parent$parent === void 0 ? void 0 : _parent$parent.columns)) {
|
|
17786
|
+
const index = parent.parent.columns.indexOf(parent);
|
|
17787
|
+
if (index !== -1) path.unshift("columns", index, "page");
|
|
17788
|
+
skeNode = parent.parent;
|
|
17789
|
+
parent = skeNode === null || skeNode === void 0 ? void 0 : skeNode.parent;
|
|
17790
|
+
continue;
|
|
17791
|
+
}
|
|
17069
17792
|
if (parent.pages) {
|
|
17070
17793
|
const index = parent.pages.indexOf(skeNode);
|
|
17071
17794
|
if (index !== -1) path.unshift("pages", index);
|
|
@@ -17076,11 +17799,53 @@ function getPagePath(page) {
|
|
|
17076
17799
|
const index = parent.rows.indexOf(skeNode);
|
|
17077
17800
|
if (index !== -1) path.unshift("rows", index);
|
|
17078
17801
|
} else if (parent.skeTables && parent.skeTables.has(skeNode.tableId)) path.unshift("skeTables", skeNode.tableId);
|
|
17802
|
+
else if (parent.skeColumnGroups && parent.skeColumnGroups.has(skeNode.columnGroupId)) path.unshift("skeColumnGroups", skeNode.columnGroupId);
|
|
17079
17803
|
skeNode = parent;
|
|
17080
17804
|
parent = parent === null || parent === void 0 ? void 0 : parent.parent;
|
|
17081
17805
|
}
|
|
17082
17806
|
return path;
|
|
17083
17807
|
}
|
|
17808
|
+
function getBoundaryGlyphInPage(page, useLast) {
|
|
17809
|
+
const sections = useLast ? [...page.sections].reverse() : page.sections;
|
|
17810
|
+
for (const section of sections) {
|
|
17811
|
+
const columns = useLast ? [...section.columns].reverse() : section.columns;
|
|
17812
|
+
for (const column of columns) {
|
|
17813
|
+
const lines = useLast ? [...column.lines].reverse() : column.lines;
|
|
17814
|
+
for (const line of lines) {
|
|
17815
|
+
const divides = useLast ? [...line.divides].reverse() : line.divides;
|
|
17816
|
+
for (const divide of divides) {
|
|
17817
|
+
const glyph = (useLast ? [...divide.glyphGroup].reverse() : divide.glyphGroup).find((item) => {
|
|
17818
|
+
var _item$content;
|
|
17819
|
+
return (_item$content = item.content) === null || _item$content === void 0 ? void 0 : _item$content.length;
|
|
17820
|
+
});
|
|
17821
|
+
if (glyph) return {
|
|
17822
|
+
section,
|
|
17823
|
+
column,
|
|
17824
|
+
line,
|
|
17825
|
+
divide,
|
|
17826
|
+
glyph
|
|
17827
|
+
};
|
|
17828
|
+
}
|
|
17829
|
+
}
|
|
17830
|
+
}
|
|
17831
|
+
}
|
|
17832
|
+
}
|
|
17833
|
+
function isHitTestAddressableGlyph(glyph) {
|
|
17834
|
+
var _glyph$content;
|
|
17835
|
+
return Boolean((_glyph$content = glyph.content) === null || _glyph$content === void 0 ? void 0 : _glyph$content.length) || glyph.streamType === DataStreamTreeTokenType.PARAGRAPH && glyph.count > 0;
|
|
17836
|
+
}
|
|
17837
|
+
function resolveMostSpecificPageByCharIndex(page, charIndex) {
|
|
17838
|
+
var _page$skeTables$value, _page$skeTables2, _page$skeColumnGroups, _page$skeColumnGroups2;
|
|
17839
|
+
for (const table of (_page$skeTables$value = (_page$skeTables2 = page.skeTables) === null || _page$skeTables2 === void 0 ? void 0 : _page$skeTables2.values()) !== null && _page$skeTables$value !== void 0 ? _page$skeTables$value : []) for (const row of table.rows) for (const cell of row.cells) {
|
|
17840
|
+
const { st, ed } = cell;
|
|
17841
|
+
if (charIndex >= st && charIndex <= ed) return resolveMostSpecificPageByCharIndex(cell, charIndex);
|
|
17842
|
+
}
|
|
17843
|
+
for (const columnGroup of (_page$skeColumnGroups = (_page$skeColumnGroups2 = page.skeColumnGroups) === null || _page$skeColumnGroups2 === void 0 ? void 0 : _page$skeColumnGroups2.values()) !== null && _page$skeColumnGroups !== void 0 ? _page$skeColumnGroups : []) for (const column of columnGroup.columns) {
|
|
17844
|
+
const { st, ed } = column;
|
|
17845
|
+
if (charIndex >= st && charIndex <= ed) return resolveMostSpecificPageByCharIndex(column.page, charIndex);
|
|
17846
|
+
}
|
|
17847
|
+
return page;
|
|
17848
|
+
}
|
|
17084
17849
|
var DocumentSkeleton = class DocumentSkeleton extends Skeleton {
|
|
17085
17850
|
constructor(_docViewModel, localeService) {
|
|
17086
17851
|
super(localeService);
|
|
@@ -17380,7 +18145,7 @@ var DocumentSkeleton = class DocumentSkeleton extends Skeleton {
|
|
|
17380
18145
|
return this._getNearestNode(cache.nearestNodeList, cache.nearestNodeDistanceList);
|
|
17381
18146
|
}
|
|
17382
18147
|
_collectNearestNode(segmentPage, pageType, page, segmentId, pi, cache, x, y, pageLength, nestLevel = 0) {
|
|
17383
|
-
const { sections, skeTables } = segmentPage;
|
|
18148
|
+
const { sections, skeTables, skeColumnGroups = /* @__PURE__ */ new Map() } = segmentPage;
|
|
17384
18149
|
this._findLiquid.translateSave();
|
|
17385
18150
|
const pageLeft = this._findLiquid.x;
|
|
17386
18151
|
const pageRight = pageLeft + page.pageWidth;
|
|
@@ -17441,7 +18206,7 @@ var DocumentSkeleton = class DocumentSkeleton extends Skeleton {
|
|
|
17441
18206
|
this._findLiquid.translateDivide(divide);
|
|
17442
18207
|
const { x: startX } = this._findLiquid;
|
|
17443
18208
|
for (const glyph of glyphGroup) {
|
|
17444
|
-
if (!glyph
|
|
18209
|
+
if (!isHitTestAddressableGlyph(glyph)) continue;
|
|
17445
18210
|
const { width: glyphWidth, left: glyphLeft } = glyph;
|
|
17446
18211
|
const startX_fin = startX + glyphLeft;
|
|
17447
18212
|
const endX_fin = startX + glyphLeft + glyphWidth;
|
|
@@ -17544,6 +18309,30 @@ var DocumentSkeleton = class DocumentSkeleton extends Skeleton {
|
|
|
17544
18309
|
(_this$_findLiquid11 = this._findLiquid) === null || _this$_findLiquid11 === void 0 || _this$_findLiquid11.translateRestore();
|
|
17545
18310
|
}
|
|
17546
18311
|
}
|
|
18312
|
+
if (skeColumnGroups.size > 0) for (const columnGroup of skeColumnGroups.values()) {
|
|
18313
|
+
var _this$_findLiquid12, _this$_findLiquid13, _this$_findLiquid17;
|
|
18314
|
+
const { top: columnGroupTop, left: columnGroupLeft, width: columnGroupWidth, height: columnGroupHeight, columns } = columnGroup;
|
|
18315
|
+
const absoluteColumnGroupLeft = this._findLiquid.x + columnGroupLeft;
|
|
18316
|
+
const absoluteColumnGroupTop = this._findLiquid.y + columnGroupTop;
|
|
18317
|
+
if (x < absoluteColumnGroupLeft || x > absoluteColumnGroupLeft + columnGroupWidth || y < absoluteColumnGroupTop || y > absoluteColumnGroupTop + columnGroupHeight) continue;
|
|
18318
|
+
(_this$_findLiquid12 = this._findLiquid) === null || _this$_findLiquid12 === void 0 || _this$_findLiquid12.translateSave();
|
|
18319
|
+
(_this$_findLiquid13 = this._findLiquid) === null || _this$_findLiquid13 === void 0 || _this$_findLiquid13.translate(columnGroupLeft, columnGroupTop);
|
|
18320
|
+
for (const column of columns) {
|
|
18321
|
+
var _this$_findLiquid14, _this$_findLiquid15, _ref, _exactMatch4, _this$_findLiquid16;
|
|
18322
|
+
const absoluteColumnLeft = absoluteColumnGroupLeft + column.left;
|
|
18323
|
+
const absoluteColumnTop = absoluteColumnGroupTop + column.top;
|
|
18324
|
+
if (x < absoluteColumnLeft || x > absoluteColumnLeft + column.width || y < absoluteColumnTop || y > absoluteColumnTop + column.height) continue;
|
|
18325
|
+
const nestedCache = {
|
|
18326
|
+
nearestNodeList: [],
|
|
18327
|
+
nearestNodeDistanceList: []
|
|
18328
|
+
};
|
|
18329
|
+
(_this$_findLiquid14 = this._findLiquid) === null || _this$_findLiquid14 === void 0 || _this$_findLiquid14.translateSave();
|
|
18330
|
+
(_this$_findLiquid15 = this._findLiquid) === null || _this$_findLiquid15 === void 0 || _this$_findLiquid15.translate(column.left, column.top);
|
|
18331
|
+
exactMatch = (_ref = (_exactMatch4 = exactMatch) !== null && _exactMatch4 !== void 0 ? _exactMatch4 : this._collectNearestNode(column.page, 3, column.page, segmentId, pi, nestedCache, x, y, pageLength, nestLevel + 1)) !== null && _ref !== void 0 ? _ref : this._getNearestNode(nestedCache.nearestNodeList, nestedCache.nearestNodeDistanceList);
|
|
18332
|
+
(_this$_findLiquid16 = this._findLiquid) === null || _this$_findLiquid16 === void 0 || _this$_findLiquid16.translateRestore();
|
|
18333
|
+
}
|
|
18334
|
+
(_this$_findLiquid17 = this._findLiquid) === null || _this$_findLiquid17 === void 0 || _this$_findLiquid17.translateRestore();
|
|
18335
|
+
}
|
|
17547
18336
|
if (exactMatch) {
|
|
17548
18337
|
this._findLiquid.translateRestore();
|
|
17549
18338
|
return exactMatch;
|
|
@@ -17688,7 +18477,7 @@ var DocumentSkeleton = class DocumentSkeleton extends Skeleton {
|
|
|
17688
18477
|
let isContinuous = false;
|
|
17689
18478
|
ctx.sectionBreakConfigCache.set(sectionNode.endIndex, sectionBreakConfig);
|
|
17690
18479
|
if (sectionType === SectionType.CONTINUOUS && curSkeletonPage != null) {
|
|
17691
|
-
updateBlockIndex(allSkeletonPages);
|
|
18480
|
+
updateBlockIndex(allSkeletonPages, -1, ctx.docsConfig.documentCompatibilityPolicy);
|
|
17692
18481
|
this._addNewSectionByContinuous(curSkeletonPage, columnProperties, columnSeparatorType);
|
|
17693
18482
|
isContinuous = true;
|
|
17694
18483
|
} else if (layoutAnchor == null || curSkeletonPage == null) {
|
|
@@ -17697,7 +18486,10 @@ var DocumentSkeleton = class DocumentSkeleton extends Skeleton {
|
|
|
17697
18486
|
}
|
|
17698
18487
|
const { pages } = dealWithSection(ctx, viewModel, sectionNode, curSkeletonPage, sectionBreakConfig, layoutAnchor);
|
|
17699
18488
|
if (sectionTypeNext === SectionType.CONTINUOUS && columnProperties.length > 0) {}
|
|
17700
|
-
if (isContinuous)
|
|
18489
|
+
if (isContinuous) {
|
|
18490
|
+
const continuousFirstPage = pages.shift();
|
|
18491
|
+
if (continuousFirstPage && allSkeletonPages.length > 0) allSkeletonPages[allSkeletonPages.length - 1] = continuousFirstPage;
|
|
18492
|
+
}
|
|
17701
18493
|
allSkeletonPages.push(...pages);
|
|
17702
18494
|
if (ctx.isDirty) break;
|
|
17703
18495
|
}
|
|
@@ -17708,7 +18500,8 @@ var DocumentSkeleton = class DocumentSkeleton extends Skeleton {
|
|
|
17708
18500
|
} else {
|
|
17709
18501
|
this._iteratorCount = 0;
|
|
17710
18502
|
removeDupPages(ctx);
|
|
17711
|
-
updateBlockIndex(skeleton.pages);
|
|
18503
|
+
updateBlockIndex(skeleton.pages, -1, ctx.docsConfig.documentCompatibilityPolicy);
|
|
18504
|
+
mergeContinuousDuplicatePages(skeleton.pages);
|
|
17712
18505
|
updateInlineDrawingCoordsAndBorder(ctx, skeleton.pages);
|
|
17713
18506
|
for (const hSkeMap of skeleton.skeHeaders.values()) for (const page of hSkeMap.values()) updateInlineDrawingCoordsAndBorder(ctx, [page]);
|
|
17714
18507
|
for (const fSkeMap of skeleton.skeFooters.values()) for (const page of fSkeMap.values()) updateInlineDrawingCoordsAndBorder(ctx, [page]);
|
|
@@ -17732,9 +18525,10 @@ var DocumentSkeleton = class DocumentSkeleton extends Skeleton {
|
|
|
17732
18525
|
if (skeletonData == null) return;
|
|
17733
18526
|
const { pages, skeFooters, skeHeaders } = skeletonData;
|
|
17734
18527
|
for (const page of pages) {
|
|
18528
|
+
var _segmentPageParent$pa;
|
|
17735
18529
|
const curPageIndex = pages.indexOf(page);
|
|
17736
18530
|
if (segmentId && curPageIndex !== segmentPageIndex) continue;
|
|
17737
|
-
const { pageWidth
|
|
18531
|
+
const { pageWidth } = page;
|
|
17738
18532
|
let segmentPage = page;
|
|
17739
18533
|
if (segmentId) {
|
|
17740
18534
|
var _skeHeaders$get5, _skeFooters$get5;
|
|
@@ -17744,27 +18538,22 @@ var DocumentSkeleton = class DocumentSkeleton extends Skeleton {
|
|
|
17744
18538
|
else if (maybeFooterSke) segmentPage = maybeFooterSke;
|
|
17745
18539
|
else continue;
|
|
17746
18540
|
}
|
|
17747
|
-
if (segmentId === "")
|
|
17748
|
-
|
|
17749
|
-
|
|
17750
|
-
|
|
17751
|
-
|
|
17752
|
-
|
|
17753
|
-
|
|
17754
|
-
|
|
17755
|
-
|
|
17756
|
-
|
|
17757
|
-
|
|
17758
|
-
|
|
17759
|
-
|
|
17760
|
-
}
|
|
17761
|
-
if (foundCell) break;
|
|
17762
|
-
}
|
|
17763
|
-
if (foundCell) break;
|
|
18541
|
+
if (segmentId === "") segmentPage = resolveMostSpecificPageByCharIndex(page, charIndex);
|
|
18542
|
+
const { sections, st, ed } = segmentPage;
|
|
18543
|
+
const segmentPageParent = segmentPage.parent;
|
|
18544
|
+
const isColumnSegmentPage = segmentId === "" && (segmentPageParent === null || segmentPageParent === void 0 ? void 0 : segmentPageParent.page) === segmentPage && ((_segmentPageParent$pa = segmentPageParent.parent) === null || _segmentPageParent$pa === void 0 ? void 0 : _segmentPageParent$pa.columnGroupId);
|
|
18545
|
+
if (charIndex < st || charIndex > ed) {
|
|
18546
|
+
if (isColumnSegmentPage) {
|
|
18547
|
+
const boundary = getBoundaryGlyphInPage(segmentPage, charIndex >= ed);
|
|
18548
|
+
if (boundary) return {
|
|
18549
|
+
page: segmentPage,
|
|
18550
|
+
pageType: segmentPage.type,
|
|
18551
|
+
segmentPageIndex,
|
|
18552
|
+
...boundary
|
|
18553
|
+
};
|
|
17764
18554
|
}
|
|
18555
|
+
continue;
|
|
17765
18556
|
}
|
|
17766
|
-
const { sections, st, ed } = segmentPage;
|
|
17767
|
-
if (charIndex < st || charIndex > ed) continue;
|
|
17768
18557
|
for (const section of sections) {
|
|
17769
18558
|
const { columns, st, ed } = section;
|
|
17770
18559
|
if (charIndex < st || charIndex > ed) continue;
|
|
@@ -17797,6 +18586,15 @@ var DocumentSkeleton = class DocumentSkeleton extends Skeleton {
|
|
|
17797
18586
|
}
|
|
17798
18587
|
}
|
|
17799
18588
|
}
|
|
18589
|
+
if (isColumnSegmentPage) {
|
|
18590
|
+
const boundary = getBoundaryGlyphInPage(segmentPage, charIndex >= segmentPage.ed);
|
|
18591
|
+
if (boundary) return {
|
|
18592
|
+
page: segmentPage,
|
|
18593
|
+
pageType: segmentPage.type,
|
|
18594
|
+
segmentPageIndex,
|
|
18595
|
+
...boundary
|
|
18596
|
+
};
|
|
18597
|
+
}
|
|
17800
18598
|
}
|
|
17801
18599
|
}
|
|
17802
18600
|
};
|
|
@@ -22569,7 +23367,7 @@ var Documents = class Documents extends DocComponent {
|
|
|
22569
23367
|
for (let i = 0, len = pages.length; i < len; i++) {
|
|
22570
23368
|
var _skeHeaders$get, _headerSkeletonPage$m, _skeFooters$get;
|
|
22571
23369
|
const page = pages[i];
|
|
22572
|
-
const { sections, marginTop: pagePaddingTop = 0, marginBottom: pagePaddingBottom = 0, marginLeft: pagePaddingLeft = 0, marginRight: pagePaddingRight = 0, width: actualWidth, height: actualHeight, pageWidth, headerId, footerId, renderConfig = {}, skeTables } = page;
|
|
23370
|
+
const { sections, marginTop: pagePaddingTop = 0, marginBottom: pagePaddingBottom = 0, marginLeft: pagePaddingLeft = 0, marginRight: pagePaddingRight = 0, width: actualWidth, height: actualHeight, pageWidth, headerId, footerId, renderConfig = {}, skeTables, skeColumnGroups = /* @__PURE__ */ new Map() } = page;
|
|
22573
23371
|
const { verticalAlign = VerticalAlign.TOP, horizontalAlign = HorizontalAlign.LEFT, centerAngle: centerAngleDeg = 0, vertexAngle: vertexAngleDeg = 0, wrapStrategy = WrapStrategy.UNSPECIFIED, cellValueType } = renderConfig;
|
|
22574
23372
|
const isVertical = vertexAngleDeg === 90 && centerAngleDeg === 90;
|
|
22575
23373
|
const horizontalOffsetNoAngle = this._horizontalHandler(actualWidth, pagePaddingLeft, pagePaddingRight, horizontalAlign, vertexAngleDeg, centerAngleDeg, cellValueType);
|
|
@@ -22669,6 +23467,7 @@ var Documents = class Documents extends DocComponent {
|
|
|
22669
23467
|
this._drawLiquid.translateRestore();
|
|
22670
23468
|
}
|
|
22671
23469
|
}
|
|
23470
|
+
if (skeColumnGroups.size > 0) this._drawColumnGroups(ctx, page, skeColumnGroups, extensions, backgroundExtension, glyphExtensionsExcludeBackground, alignOffsetNoAngle, centerAngle, vertexAngle, renderConfig, parentScale);
|
|
22672
23471
|
this._resetRotation(ctx, finalAngle);
|
|
22673
23472
|
const footerSkeletonPage = (_skeFooters$get = skeFooters.get(footerId)) === null || _skeFooters$get === void 0 ? void 0 : _skeFooters$get.get(pageWidth);
|
|
22674
23473
|
if (footerSkeletonPage) {
|
|
@@ -22726,6 +23525,21 @@ var Documents = class Documents extends DocComponent {
|
|
|
22726
23525
|
drawLiquid.translateRestore();
|
|
22727
23526
|
}
|
|
22728
23527
|
}
|
|
23528
|
+
_drawColumnGroups(ctx, page, skeColumnGroups, extensions, backgroundExtension, glyphExtensionsExcludeBackground, alignOffsetNoAngle, centerAngle, vertexAngle, renderConfig, parentScale) {
|
|
23529
|
+
const drawLiquid = this._drawLiquid;
|
|
23530
|
+
if (drawLiquid == null) return;
|
|
23531
|
+
for (const columnGroup of skeColumnGroups.values()) {
|
|
23532
|
+
drawLiquid.translateSave();
|
|
23533
|
+
drawLiquid.translate(columnGroup.left, columnGroup.top);
|
|
23534
|
+
for (const column of columnGroup.columns) {
|
|
23535
|
+
drawLiquid.translateSave();
|
|
23536
|
+
drawLiquid.translate(column.left, column.top);
|
|
23537
|
+
this._drawNestedPageContent(ctx, page, column.page, extensions, backgroundExtension, glyphExtensionsExcludeBackground, alignOffsetNoAngle, centerAngle, vertexAngle, renderConfig, parentScale);
|
|
23538
|
+
drawLiquid.translateRestore();
|
|
23539
|
+
}
|
|
23540
|
+
drawLiquid.translateRestore();
|
|
23541
|
+
}
|
|
23542
|
+
}
|
|
22729
23543
|
_drawTableCellBackgrounds(ctx, page, tableSkeleton) {
|
|
22730
23544
|
if (this._drawLiquid == null) return;
|
|
22731
23545
|
const backgrounds = /* @__PURE__ */ new Map();
|
|
@@ -22834,15 +23648,33 @@ var Documents = class Documents extends DocComponent {
|
|
|
22834
23648
|
_drawTableCell(ctx, page, cell, extensions, backgroundExtension, glyphExtensionsExcludeBackground, alignOffsetNoAngle, centerAngle, vertexAngle, renderConfig, parentScale) {
|
|
22835
23649
|
if (this._drawLiquid == null) return;
|
|
22836
23650
|
this._drawTableCellBordersAndBg(ctx, page, cell, false);
|
|
22837
|
-
|
|
22838
|
-
|
|
23651
|
+
this._drawNestedPageContent(ctx, page, cell, extensions, backgroundExtension, glyphExtensionsExcludeBackground, alignOffsetNoAngle, centerAngle, vertexAngle, renderConfig, parentScale);
|
|
23652
|
+
}
|
|
23653
|
+
_drawNestedPageContent(ctx, parentPage, nestedPage, extensions, backgroundExtension, glyphExtensionsExcludeBackground, alignOffsetNoAngle, centerAngle, vertexAngle, renderConfig, parentScale) {
|
|
23654
|
+
if (this._drawLiquid == null) return;
|
|
23655
|
+
const { sections, marginLeft, marginTop, skeTables } = nestedPage;
|
|
23656
|
+
const alignOffset = Vector2.create(alignOffsetNoAngle.x + marginLeft, alignOffsetNoAngle.y + marginTop);
|
|
22839
23657
|
ctx.save();
|
|
22840
23658
|
const { x, y } = this._drawLiquid;
|
|
22841
|
-
const { pageWidth, pageHeight } =
|
|
23659
|
+
const { pageWidth, pageHeight } = nestedPage;
|
|
23660
|
+
const clipOrigin = getNestedPageClipOrigin(parentPage, nestedPage, {
|
|
23661
|
+
x,
|
|
23662
|
+
y
|
|
23663
|
+
}, alignOffset);
|
|
22842
23664
|
ctx.beginPath();
|
|
22843
|
-
ctx.rectByPrecision(x
|
|
23665
|
+
ctx.rectByPrecision(clipOrigin.x, clipOrigin.y, pageWidth, pageHeight);
|
|
22844
23666
|
ctx.closePath();
|
|
22845
23667
|
ctx.clip();
|
|
23668
|
+
if (skeTables.size > 0) if (isColumnGroupNestedPage(nestedPage)) {
|
|
23669
|
+
this._drawLiquid.translateSave();
|
|
23670
|
+
this._drawLiquid.translate(alignOffset.x, alignOffset.y);
|
|
23671
|
+
this._drawTable(ctx, {
|
|
23672
|
+
...nestedPage,
|
|
23673
|
+
marginLeft: 0,
|
|
23674
|
+
marginTop: 0
|
|
23675
|
+
}, skeTables, extensions, backgroundExtension, glyphExtensionsExcludeBackground, Vector2.create(0, 0), centerAngle, vertexAngle, renderConfig, parentScale);
|
|
23676
|
+
this._drawLiquid.translateRestore();
|
|
23677
|
+
} else this._drawTable(ctx, nestedPage, skeTables, extensions, backgroundExtension, glyphExtensionsExcludeBackground, alignOffset, centerAngle, vertexAngle, renderConfig, parentScale);
|
|
22846
23678
|
for (const section of sections) {
|
|
22847
23679
|
const { columns } = section;
|
|
22848
23680
|
this._drawLiquid.translateSave();
|
|
@@ -22852,7 +23684,6 @@ var Documents = class Documents extends DocComponent {
|
|
|
22852
23684
|
this._drawLiquid.translateSave();
|
|
22853
23685
|
this._drawLiquid.translateColumn(column);
|
|
22854
23686
|
const linesCount = lines.length;
|
|
22855
|
-
const alignOffset = alignOffsetNoAngle;
|
|
22856
23687
|
for (let i = 0; i < linesCount; i++) {
|
|
22857
23688
|
const line = lines[i];
|
|
22858
23689
|
const { divides, asc = 0, type, lineHeight = 0 } = line;
|
|
@@ -22870,7 +23701,7 @@ var Documents = class Documents extends DocComponent {
|
|
|
22870
23701
|
} else {
|
|
22871
23702
|
this._drawLiquid.translateSave();
|
|
22872
23703
|
this._drawLiquid.translateLine(line, true, true);
|
|
22873
|
-
this._drawLineBackground(ctx,
|
|
23704
|
+
this._drawLineBackground(ctx, nestedPage, line);
|
|
22874
23705
|
const divideLength = divides.length;
|
|
22875
23706
|
for (let i = 0; i < divideLength; i++) {
|
|
22876
23707
|
const divide = divides[i];
|
|
@@ -22899,7 +23730,7 @@ var Documents = class Documents extends DocComponent {
|
|
|
22899
23730
|
}
|
|
22900
23731
|
this._drawLiquid.translateRestore();
|
|
22901
23732
|
}
|
|
22902
|
-
if (line.borderBottom) this._drawBorderBottom(ctx,
|
|
23733
|
+
if (line.borderBottom) this._drawBorderBottom(ctx, nestedPage, line, parentPage.marginLeft, parentPage.marginTop);
|
|
22903
23734
|
this._drawLiquid.translateRestore();
|
|
22904
23735
|
}
|
|
22905
23736
|
}
|
|
@@ -23102,6 +23933,21 @@ function setTableCellBorderDash(ctx, dashStyle) {
|
|
|
23102
23933
|
}
|
|
23103
23934
|
ctx.setLineDash([0]);
|
|
23104
23935
|
}
|
|
23936
|
+
function isColumnGroupNestedPage(page) {
|
|
23937
|
+
var _parent$parent;
|
|
23938
|
+
const parent = page.parent;
|
|
23939
|
+
return (parent === null || parent === void 0 ? void 0 : parent.columnId) != null && ((_parent$parent = parent.parent) === null || _parent$parent === void 0 ? void 0 : _parent$parent.columnGroupId) != null;
|
|
23940
|
+
}
|
|
23941
|
+
function getNestedPageClipOrigin(parentPage, nestedPage, drawOrigin, alignOffset) {
|
|
23942
|
+
if (isColumnGroupNestedPage(nestedPage)) return {
|
|
23943
|
+
x: drawOrigin.x + alignOffset.x,
|
|
23944
|
+
y: drawOrigin.y + alignOffset.y
|
|
23945
|
+
};
|
|
23946
|
+
return {
|
|
23947
|
+
x: drawOrigin.x + parentPage.marginLeft,
|
|
23948
|
+
y: drawOrigin.y + parentPage.marginTop
|
|
23949
|
+
};
|
|
23950
|
+
}
|
|
23105
23951
|
function fillRectByPrecisionBounds(ctx, x, y, width, height) {
|
|
23106
23952
|
const { scaleX, scaleY } = ctx.getScale();
|
|
23107
23953
|
const startX = fixLineWidthByScale(x, scaleX);
|
|
@@ -25684,7 +26530,7 @@ Engine = __decorate([__decorateParam(2, ICanvasColorService)], Engine);
|
|
|
25684
26530
|
//#endregion
|
|
25685
26531
|
//#region package.json
|
|
25686
26532
|
var name = "@univerjs/engine-render";
|
|
25687
|
-
var version = "1.0.0-
|
|
26533
|
+
var version = "1.0.0-insiders.20260629-12f2e44";
|
|
25688
26534
|
|
|
25689
26535
|
//#endregion
|
|
25690
26536
|
//#region src/config/config.ts
|
|
@@ -29962,4 +30808,4 @@ var Viewport = class {
|
|
|
29962
30808
|
};
|
|
29963
30809
|
|
|
29964
30810
|
//#endregion
|
|
29965
|
-
export { BASE_OBJECT_ARRAY, BG_Z_INDEX, BORDER_TYPE, BORDER_Z_INDEX, Background, BaseObject, Border, BreakType, CHECK_OBJECT_ARRAY, CIRCLE_OBJECT_ARRAY, COLOR_BLACK_RGB, CURSOR_TYPE, Canvas, CanvasColorService, CanvasRenderMode, CheckboxShape, Circle, ColumnHeaderLayout, ComponentExtension, Control, Custom, CustomObject, DEFAULT_DOCUMENT_FONTSIZE, DEFAULT_FONTFACE_PLANE, DEFAULT_FRAME_LIST_SIZE, DEFAULT_FRAME_SAMPLE_SIZE, DEFAULT_MEASURE_TEXT, DEFAULT_OFFSET_SPACING, DEFAULT_PADDING_DATA, DEFAULT_SKELETON_FOOTER, DEFAULT_SKELETON_HEADER, DOCUMENT_CONTEXT_CLIP_TYPE, DRAWING_OBJECT_LAYER_INDEX, DRAWING_OBJECT_LOWER_LAYER_INDEX, DRAWING_OBJECT_UPPER_LAYER_INDEX, DashedRect, DataStreamTreeNode, DeviceInputEventType, DeviceType, DocBackground, DocSimpleSkeleton, DocumentEditArea, DocumentSkeleton, DocumentSkeletonPageType, DocumentViewModel, Documents, DocumentsSpanAndLineExtensionRegistry, Drawing, DrawingGroupObject, DumbCanvasColorService, EXPAND_SIZE_FOR_RENDER_OVERFLOW, Engine, EventConstants, FIX_ONE_PIXEL_BLUR_OFFSET, FONT_EXTENSION_Z_INDEX, Font, FontCache, GlyphType, Group, HitCanvas, ICanvasColorService, INITIAL_MATRIX, INITIAL_Path2, IRenderManagerService, IRenderingEngine, IWatermarkTypeEnum, Image$1 as Image, IsSafari, LINK_VIEW_PORT_TYPE, Layer, LineType, Liquid, MAIN_VIEW_PORT_KEY, MAXIMUM_COL_WIDTH, MAXIMUM_ROW_HEIGHT, MEASURE_EXTENT, MEASURE_EXTENT_FOR_PARAGRAPH, MIDDLE_CELL_POS_MAGIC_NUMBER, MIN_COL_WIDTH, Marker, NORMAL_TEXT_SELECTION_PLUGIN_STYLE, ORIENTATION_TYPE, ObjectType, PATH_OBJECT_ARRAY, PRINTING_BG_Z_INDEX, PageLayoutType, Path, Path2, PerformanceMonitor, PointerInput, RECT_OBJECT_ARRAY, REGULAR_POLYGON_OBJECT_ARRAY, RENDER_CLASS_TYPE, RENDER_RAW_FORMULA_KEY, RICHTEXT_OBJECT_ARRAY, Rect, RegularPolygon, RenderComponent, RenderManagerService, RenderUnit, RichText, RollingAverage, RowHeaderLayout, SHAPE_OBJECT_ARRAY, SHAPE_TYPE, SHEET_EXTENSION_PREFIX, SHEET_EXTENSION_TYPE, SHEET_VIEWPORT_KEY, SLIDE_NAVIGATION_KEY, Scene, SceneCanvas, SceneViewer, ScrollBar, ScrollTimer, ScrollTimerType, Shape, SheetColumnHeaderExtensionRegistry, SheetComponent, SheetExtension, SheetRowHeaderExtensionRegistry, ShowGridlinesState, SkeletonType, Slide, Spreadsheet, SpreadsheetColumnHeader, SpreadsheetExtensionRegistry, SpreadsheetHeader, SpreadsheetRowHeader, SpreadsheetSkeleton, TEXT_OBJECT_ARRAY, TRANSFORM_CHANGE_OBSERVABLE_TYPE, Text, Transform, UNIVER_WATERMARK_LAYER_INDEX, UNIVER_WATERMARK_STORAGE_KEY, UniverPrintingContext, UniverRenderEnginePlugin, UniverRenderingContext, UniverRenderingContext2D, VERTICAL_ROTATE_ANGLE, Vector2, Viewport, WatermarkLayer, calculateRectRotate, cancelRequestFrame, checkStyle, clampRange, clearLineByBorderType, convertTextRotation, convertTransformToOffsetX, convertTransformToOffsetY, createCanvasElement, createImageElement, degToRad, drawDiagonalLineByBorderType, drawLineByBorderType, expandRangeIfIntersects, fixLineWidthByScale, generateRandomKey, getCellByIndexWithMergeInfo, getCellPositionByIndex, getCharSpaceApply, getColor, getCurrentScrollXY, getCurrentTypeOfRenderer, getDPI, getDevicePixelRatio, getDocsSkeletonPageSize, getDocsTableRenderViewport, getDrawingGroupState, getFirstGrapheme, getFontStyleString, getGroupState, getLastColumn, getLastLine, getLineOffset, getLineWidth, getLineWith, getNextWheelZoomRatio, getNumberUnitValue, getOffsetRectForDom, getPageFromPath, getParagraphByGlyph, getPointerPrefix, getRenderTransformBaseOnParentBound, getRotateOffsetAndFarthestHypotenuse, getRotateOrientation, getRotatedBoundInGroup, getScale, getSizeForDom, getSystemHighlightColor, getTableIdAndSliceIndex, getTranslateInSpreadContextWithPixelRatio, getValueType, glyphIterator, hasAllLatin, hasArabic, hasBasicLatin, hasCJK, hasCJKPunctuation, hasCJKText, hasLatinExtendedA, hasLatinExtendedB, hasLatinOneSupplement, hasListGlyph, hasSpace, hasThai, hasTibetan, hasUnMergedCellInRow, inViewRanges, injectStyle, isArray, isCjkCenterAlignedPunctuation, isCjkLeftAlignedPunctuation, isCjkRightAlignedPunctuation, isDate, isEmojiGrapheme, isFirstGlyph, isFunction, isIndentByGlyph, isLastGlyph, isNumber, isObject, isPlaceholderOrSpace, isRectIntersect, isRegExp, isSameLine, isString, lineIterator, mergeInfoOffset, parseDataStreamToTree, pixelToPt, precisionTo, ptToMM, ptToPixel, ptToPx, pxToInch, pxToNum, pxToPt, radToDeg, renderImageWatermark, renderTextWatermark, renderUserInfoWatermark, renderWatermark, requestNewFrame, setDocsTableRenderViewportProvider, setLineType, sheetContentViewportKeys, sheetHeaderViewportKeys, startWithEmoji, toPx, transformObjectOutOfGroup, withCurrentTypeOfRenderer };
|
|
30811
|
+
export { BASE_OBJECT_ARRAY, BG_Z_INDEX, BORDER_TYPE, BORDER_Z_INDEX, Background, BaseObject, Border, BreakType, CHECK_OBJECT_ARRAY, CIRCLE_OBJECT_ARRAY, COLOR_BLACK_RGB, CURSOR_TYPE, Canvas, CanvasColorService, CanvasRenderMode, CheckboxShape, Circle, ColumnHeaderLayout, ComponentExtension, Control, Custom, CustomObject, DEFAULT_DOCUMENT_FONTSIZE, DEFAULT_FONTFACE_PLANE, DEFAULT_FRAME_LIST_SIZE, DEFAULT_FRAME_SAMPLE_SIZE, DEFAULT_MEASURE_TEXT, DEFAULT_OFFSET_SPACING, DEFAULT_PADDING_DATA, DEFAULT_SKELETON_FOOTER, DEFAULT_SKELETON_HEADER, DOCUMENT_CONTEXT_CLIP_TYPE, DRAWING_OBJECT_LAYER_INDEX, DRAWING_OBJECT_LOWER_LAYER_INDEX, DRAWING_OBJECT_UPPER_LAYER_INDEX, DashedRect, DataStreamTreeNode, DeviceInputEventType, DeviceType, DocBackground, DocSimpleSkeleton, DocumentEditArea, DocumentSkeleton, DocumentSkeletonPageType, DocumentViewModel, Documents, DocumentsSpanAndLineExtensionRegistry, Drawing, DrawingGroupObject, DumbCanvasColorService, EXPAND_SIZE_FOR_RENDER_OVERFLOW, Engine, EventConstants, FIX_ONE_PIXEL_BLUR_OFFSET, FONT_EXTENSION_Z_INDEX, Font, FontCache, GlyphType, Group, HitCanvas, ICanvasColorService, INITIAL_MATRIX, INITIAL_Path2, IRenderManagerService, IRenderingEngine, IWatermarkTypeEnum, Image$1 as Image, IsSafari, LINK_VIEW_PORT_TYPE, Layer, LineType, Liquid, MAIN_VIEW_PORT_KEY, MAXIMUM_COL_WIDTH, MAXIMUM_ROW_HEIGHT, MEASURE_EXTENT, MEASURE_EXTENT_FOR_PARAGRAPH, MIDDLE_CELL_POS_MAGIC_NUMBER, MIN_COL_WIDTH, Marker, NORMAL_TEXT_SELECTION_PLUGIN_STYLE, ORIENTATION_TYPE, ObjectType, PATH_OBJECT_ARRAY, PRINTING_BG_Z_INDEX, PageLayoutType, Path, Path2, PerformanceMonitor, PointerInput, RECT_OBJECT_ARRAY, REGULAR_POLYGON_OBJECT_ARRAY, RENDER_CLASS_TYPE, RENDER_RAW_FORMULA_KEY, RICHTEXT_OBJECT_ARRAY, Rect, RegularPolygon, RenderComponent, RenderManagerService, RenderUnit, RichText, RollingAverage, RowHeaderLayout, SHAPE_OBJECT_ARRAY, SHAPE_TYPE, SHEET_EXTENSION_PREFIX, SHEET_EXTENSION_TYPE, SHEET_VIEWPORT_KEY, SLIDE_NAVIGATION_KEY, Scene, SceneCanvas, SceneViewer, ScrollBar, ScrollTimer, ScrollTimerType, Shape, SheetColumnHeaderExtensionRegistry, SheetComponent, SheetExtension, SheetRowHeaderExtensionRegistry, ShowGridlinesState, SkeletonType, Slide, Spreadsheet, SpreadsheetColumnHeader, SpreadsheetExtensionRegistry, SpreadsheetHeader, SpreadsheetRowHeader, SpreadsheetSkeleton, TEXT_OBJECT_ARRAY, TRANSFORM_CHANGE_OBSERVABLE_TYPE, Text, Transform, UNIVER_WATERMARK_LAYER_INDEX, UNIVER_WATERMARK_STORAGE_KEY, UniverPrintingContext, UniverRenderEnginePlugin, UniverRenderingContext, UniverRenderingContext2D, VERTICAL_ROTATE_ANGLE, Vector2, Viewport, WatermarkLayer, calculateRectRotate, cancelRequestFrame, checkStyle, clampRange, clearLineByBorderType, compareDocumentSkeletonNestedPagePathOrder, convertTextRotation, convertTransformToOffsetX, convertTransformToOffsetY, createCanvasElement, createImageElement, degToRad, documentSkeletonLineIterator, documentSkeletonTableIterator, drawDiagonalLineByBorderType, drawLineByBorderType, expandRangeIfIntersects, fixLineWidthByScale, generateRandomKey, getCellByIndexWithMergeInfo, getCellPositionByIndex, getCharSpaceApply, getColor, getCurrentScrollXY, getCurrentTypeOfRenderer, getDPI, getDevicePixelRatio, getDocsSkeletonPageSize, getDocsTableRenderViewport, getDocumentSkeletonColumnPagePathInfo, getDocumentSkeletonNestedPageOffset, getDrawingGroupState, getFirstGrapheme, getFontStyleString, getGroupState, getLastColumn, getLastLine, getLineOffset, getLineWidth, getLineWith, getNextWheelZoomRatio, getNumberUnitValue, getOffsetRectForDom, getPageFromPath, getParagraphByGlyph, getPointerPrefix, getRenderTransformBaseOnParentBound, getRotateOffsetAndFarthestHypotenuse, getRotateOrientation, getRotatedBoundInGroup, getScale, getSizeForDom, getSystemHighlightColor, getTableIdAndSliceIndex, getTranslateInSpreadContextWithPixelRatio, getValueType, glyphIterator, hasAllLatin, hasArabic, hasBasicLatin, hasCJK, hasCJKPunctuation, hasCJKText, hasLatinExtendedA, hasLatinExtendedB, hasLatinOneSupplement, hasListGlyph, hasSpace, hasThai, hasTibetan, hasUnMergedCellInRow, inViewRanges, injectStyle, isArray, isCjkCenterAlignedPunctuation, isCjkLeftAlignedPunctuation, isCjkRightAlignedPunctuation, isDate, isEmojiGrapheme, isFirstGlyph, isFunction, isIndentByGlyph, isLastGlyph, isNumber, isObject, isPlaceholderOrSpace, isRectIntersect, isRegExp, isSameLine, isString, lineIterator, mergeInfoOffset, parseDataStreamToTree, pixelToPt, precisionTo, ptToMM, ptToPixel, ptToPx, pxToInch, pxToNum, pxToPt, radToDeg, renderImageWatermark, renderTextWatermark, renderUserInfoWatermark, renderWatermark, requestNewFrame, setDocsTableRenderViewportProvider, setLineType, sheetContentViewportKeys, sheetHeaderViewportKeys, startWithEmoji, toPx, transformObjectOutOfGroup, withCurrentTypeOfRenderer };
|