@univerjs/engine-render 1.0.0-alpha.1 → 1.0.0-insiders.20260701-0ef51b0
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 +245 -57
- package/lib/es/index.js +245 -59
- package/lib/types/basics/i-document-skeleton-cached.d.ts +8 -0
- package/lib/types/basics/interfaces.d.ts +1 -0
- package/lib/types/components/docs/custom-block-render-viewport.d.ts +37 -0
- package/lib/types/components/docs/layout/block/paragraph/layout-ruler.d.ts +1 -1
- package/lib/types/index.d.ts +2 -0
- package/lib/types/render-manager/render-manager.service.d.ts +1 -1
- package/lib/types/render-manager/render-unit.d.ts +2 -0
- package/lib/umd/index.js +2 -2
- package/package.json +2 -2
- 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, 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";
|
|
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, LookUp, 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";
|
|
@@ -12682,6 +12682,34 @@ var DocumentViewModel = class DocumentViewModel {
|
|
|
12682
12682
|
}
|
|
12683
12683
|
};
|
|
12684
12684
|
|
|
12685
|
+
//#endregion
|
|
12686
|
+
//#region src/components/docs/custom-block-render-viewport.ts
|
|
12687
|
+
let docsCustomBlockRenderViewportProvider = null;
|
|
12688
|
+
const docsCustomBlockRenderViewportProviders = /* @__PURE__ */ new Set();
|
|
12689
|
+
function setDocsCustomBlockRenderViewportProvider(provider) {
|
|
12690
|
+
if (provider == null) {
|
|
12691
|
+
docsCustomBlockRenderViewportProvider = null;
|
|
12692
|
+
docsCustomBlockRenderViewportProviders.clear();
|
|
12693
|
+
return () => {};
|
|
12694
|
+
}
|
|
12695
|
+
docsCustomBlockRenderViewportProvider = provider;
|
|
12696
|
+
docsCustomBlockRenderViewportProviders.add(provider);
|
|
12697
|
+
return () => {
|
|
12698
|
+
var _providers;
|
|
12699
|
+
docsCustomBlockRenderViewportProviders.delete(provider);
|
|
12700
|
+
const providers = Array.from(docsCustomBlockRenderViewportProviders);
|
|
12701
|
+
docsCustomBlockRenderViewportProvider = (_providers = providers[providers.length - 1]) !== null && _providers !== void 0 ? _providers : null;
|
|
12702
|
+
};
|
|
12703
|
+
}
|
|
12704
|
+
function getDocsCustomBlockRenderViewport(unitId, blockId, input) {
|
|
12705
|
+
const providers = docsCustomBlockRenderViewportProviders.size ? Array.from(docsCustomBlockRenderViewportProviders).reverse() : docsCustomBlockRenderViewportProvider ? [docsCustomBlockRenderViewportProvider] : [];
|
|
12706
|
+
for (const provider of providers) {
|
|
12707
|
+
const viewport = provider(unitId, blockId, input);
|
|
12708
|
+
if (viewport != null) return viewport;
|
|
12709
|
+
}
|
|
12710
|
+
return null;
|
|
12711
|
+
}
|
|
12712
|
+
|
|
12685
12713
|
//#endregion
|
|
12686
12714
|
//#region src/components/docs/layout/model/glyph.ts
|
|
12687
12715
|
function isSpace(char) {
|
|
@@ -13872,7 +13900,7 @@ function _divideOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphCo
|
|
|
13872
13900
|
if (anchorDrawings.length > 0) {
|
|
13873
13901
|
var _paragraphConfig$para, _paragraphConfig$pDra;
|
|
13874
13902
|
const paragraphAnchorLeft = __getParagraphAnchorLeft(sectionBreakConfig, paragraphConfig, (_paragraphConfig$para = paragraphConfig.paragraphStyle) === null || _paragraphConfig$para === void 0 ? void 0 : _paragraphConfig$para.indentStart);
|
|
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);
|
|
13903
|
+
const drawings = __getDrawingPosition(ctx, 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, false);
|
|
13876
13904
|
__updateDrawingPosition(currentLine.parent, drawings);
|
|
13877
13905
|
addGlyphToDivide(divide, glyphGroup, preOffsetLeft);
|
|
13878
13906
|
updateDivideInfo(divide, { breakType: breakPointType });
|
|
@@ -13972,6 +14000,7 @@ function _lineOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphConf
|
|
|
13972
14000
|
}
|
|
13973
14001
|
}
|
|
13974
14002
|
let deferredInlineGroupAnchorDrawings = [];
|
|
14003
|
+
let deferredTopBottomAnchorDrawings = [];
|
|
13975
14004
|
if (paragraphNonInlineSkeDrawings != null && paragraphNonInlineSkeDrawings.size > 0) {
|
|
13976
14005
|
var _pDrawingAnchor$get;
|
|
13977
14006
|
let targetDrawings = [...paragraphNonInlineSkeDrawings.values()].filter((drawing) => drawing.drawingOrigin.docTransform.positionV.relativeFrom !== ObjectRelativeFromV.LINE);
|
|
@@ -13979,13 +14008,17 @@ function _lineOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphConf
|
|
|
13979
14008
|
deferredInlineGroupAnchorDrawings = targetDrawings.filter((drawing) => glyphGroupCustomBlockIds.has(drawing.drawingId) && drawing.drawingOrigin.docTransform.positionV.relativeFrom === ObjectRelativeFromV.LINE);
|
|
13980
14009
|
targetDrawings = targetDrawings.filter((drawing) => !deferredInlineGroupAnchorDrawings.includes(drawing));
|
|
13981
14010
|
}
|
|
13982
|
-
|
|
14011
|
+
deferredTopBottomAnchorDrawings = targetDrawings.filter((drawing) => glyphGroupCustomBlockIds.has(drawing.drawingId) && drawing.drawingOrigin.layoutType === PositionedObjectLayoutType.WRAP_TOP_AND_BOTTOM);
|
|
14012
|
+
targetDrawings = targetDrawings.filter((drawing) => drawing.drawingOrigin.layoutType !== PositionedObjectLayoutType.WRAP_TOP_AND_BOTTOM);
|
|
14013
|
+
__updateAndPositionDrawings(ctx, lineTop, lineHeight, column, targetDrawings, paragraphConfig.paragraphIndex, isParagraphFirstShapedText, pDrawingAnchor === null || pDrawingAnchor === void 0 || (_pDrawingAnchor$get = pDrawingAnchor.get(paragraphIndex)) === null || _pDrawingAnchor$get === void 0 ? void 0 : _pDrawingAnchor$get.top, paragraphAnchorLeft, false, deferredTopBottomAnchorDrawings.length > 0);
|
|
13983
14014
|
}
|
|
13984
14015
|
if (skeTablesInParagraph != null && skeTablesInParagraph.length > 0) {
|
|
13985
14016
|
var _pDrawingAnchor$get2;
|
|
13986
14017
|
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);
|
|
13987
14018
|
}
|
|
13988
|
-
const
|
|
14019
|
+
const calculatedLineTop = positionedCustomBlockOnly ? lineTop : calculateLineTopByDrawings(lineHeight, lineTop, lastPage, headerPage, footerPage);
|
|
14020
|
+
const previousTopBottomCustomBlockFlowBottom = deferredTopBottomAnchorDrawings.length > 0 ? paragraphConfig.topBottomCustomBlockFlowBottom : void 0;
|
|
14021
|
+
const newLineTop = previousTopBottomCustomBlockFlowBottom == null ? calculatedLineTop : Math.max(calculatedLineTop, previousTopBottomCustomBlockFlowBottom);
|
|
13989
14022
|
if (lineHeight + newLineTop - section.height > LINE_LAYOUT_OVERFLOW_TOLERANCE && column.lines.length > 0 && lastPage.sections.length > 0 || needOpenNewPageByTableLayout) {
|
|
13990
14023
|
setColumnFullState(column, true);
|
|
13991
14024
|
_columnOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphConfig, isParagraphFirstShapedText, breakPointType, defaultGlyphLineHeight);
|
|
@@ -14019,16 +14052,21 @@ function _lineOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphConf
|
|
|
14019
14052
|
}, column.width, lineIndex, isParagraphFirstShapedText, paragraphConfig, lastPage, headerPage, footerPage);
|
|
14020
14053
|
column.lines.push(newLine);
|
|
14021
14054
|
newLine.parent = column;
|
|
14022
|
-
|
|
14055
|
+
const blockAnchorTop = deferredTopBottomAnchorDrawings.length > 0 ? newLineTop : lineTop;
|
|
14056
|
+
createAndUpdateBlockAnchor(paragraphIndex, newLine, blockAnchorTop, pDrawingAnchor);
|
|
14057
|
+
if (deferredTopBottomAnchorDrawings.length > 0) {
|
|
14058
|
+
__updateAndPositionDrawings(ctx, newLineTop, lineHeight, column, deferredTopBottomAnchorDrawings, paragraphConfig.paragraphIndex, isParagraphFirstShapedText, blockAnchorTop, paragraphAnchorLeft, true, true);
|
|
14059
|
+
__updateTopBottomCustomBlockFlowBottom(paragraphConfig, deferredTopBottomAnchorDrawings);
|
|
14060
|
+
}
|
|
14023
14061
|
_divideOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphConfig, isParagraphFirstShapedText, breakPointType, defaultGlyphLineHeight);
|
|
14024
14062
|
if (deferredInlineGroupAnchorDrawings.length > 0) {
|
|
14025
14063
|
var _pDrawingAnchor$get3;
|
|
14026
14064
|
__updateAndPositionDrawings(ctx, lineTop, lineHeight, column, deferredInlineGroupAnchorDrawings, paragraphConfig.paragraphIndex, isParagraphFirstShapedText, pDrawingAnchor === null || pDrawingAnchor === void 0 || (_pDrawingAnchor$get3 = pDrawingAnchor.get(paragraphIndex)) === null || _pDrawingAnchor$get3 === void 0 ? void 0 : _pDrawingAnchor$get3.top, paragraphAnchorLeft, true);
|
|
14027
14065
|
}
|
|
14028
14066
|
}
|
|
14029
|
-
function __updateAndPositionDrawings(ctx, lineTop, lineHeight, column, targetDrawings, paragraphIndex, isParagraphFirstShapedText, drawingAnchorTop, drawingAnchorLeft = 0, skipRelayoutCheck = false) {
|
|
14067
|
+
function __updateAndPositionDrawings(ctx, lineTop, lineHeight, column, targetDrawings, paragraphIndex, isParagraphFirstShapedText, drawingAnchorTop, drawingAnchorLeft = 0, skipRelayoutCheck = false, overwriteTopBottomPosition = false) {
|
|
14030
14068
|
if (targetDrawings.length === 0) return;
|
|
14031
|
-
const drawings = __getDrawingPosition(lineTop, lineHeight, column, isParagraphFirstShapedText, drawingAnchorTop, targetDrawings, drawingAnchorLeft);
|
|
14069
|
+
const drawings = __getDrawingPosition(ctx, lineTop, lineHeight, column, isParagraphFirstShapedText, drawingAnchorTop, targetDrawings, drawingAnchorLeft);
|
|
14032
14070
|
if (drawings == null || drawings.size === 0) return;
|
|
14033
14071
|
const floatObjects = [...drawings.values()].filter((drawing) => {
|
|
14034
14072
|
const layoutType = drawing.drawingOrigin.layoutType;
|
|
@@ -14050,7 +14088,7 @@ function __updateAndPositionDrawings(ctx, lineTop, lineHeight, column, targetDra
|
|
|
14050
14088
|
};
|
|
14051
14089
|
});
|
|
14052
14090
|
if (!skipRelayoutCheck) _reLayoutCheck(ctx, floatObjects, column, paragraphIndex);
|
|
14053
|
-
__updateDrawingPosition(column, drawings);
|
|
14091
|
+
__updateDrawingPosition(column, drawings, overwriteTopBottomPosition);
|
|
14054
14092
|
}
|
|
14055
14093
|
function __updateWrapTablePosition(ctx, table, lineTop, lineHeight, column, paragraphIndex, drawingAnchorTop) {
|
|
14056
14094
|
const wrapTablePosition = __getWrapTablePosition(table, column, lineTop, lineHeight, drawingAnchorTop);
|
|
@@ -14161,6 +14199,15 @@ function _getCustomBlockIdsInLine(line) {
|
|
|
14161
14199
|
for (const divide of line.divides) for (const glyph of divide.glyphGroup) if (glyph.streamType === DataStreamTreeTokenType.CUSTOM_BLOCK) customBlockIds.push(glyph.drawingId);
|
|
14162
14200
|
return customBlockIds;
|
|
14163
14201
|
}
|
|
14202
|
+
function __updateTopBottomCustomBlockFlowBottom(paragraphConfig, drawings) {
|
|
14203
|
+
for (const drawing of drawings) {
|
|
14204
|
+
var _drawingOrigin$distB, _paragraphConfig$topB;
|
|
14205
|
+
const { drawingOrigin } = drawing;
|
|
14206
|
+
if (drawingOrigin.layoutType !== PositionedObjectLayoutType.WRAP_TOP_AND_BOTTOM || drawingOrigin.behindDoc === BooleanNumber.TRUE) continue;
|
|
14207
|
+
const bottom = drawing.aTop + drawing.height + ((_drawingOrigin$distB = drawingOrigin.distB) !== null && _drawingOrigin$distB !== void 0 ? _drawingOrigin$distB : 0);
|
|
14208
|
+
paragraphConfig.topBottomCustomBlockFlowBottom = Math.max((_paragraphConfig$topB = paragraphConfig.topBottomCustomBlockFlowBottom) !== null && _paragraphConfig$topB !== void 0 ? _paragraphConfig$topB : Number.NEGATIVE_INFINITY, bottom);
|
|
14209
|
+
}
|
|
14210
|
+
}
|
|
14164
14211
|
function __isZeroWidthNonFlowFloatingAnchorLine(glyphGroup, paragraphNonInlineSkeDrawings) {
|
|
14165
14212
|
return __getZeroWidthNonFlowFloatingAnchorDrawings(glyphGroup, paragraphNonInlineSkeDrawings).length > 0;
|
|
14166
14213
|
}
|
|
@@ -14392,7 +14439,7 @@ function getLineHeightMetrics(glyphLineHeight, paragraphLineGapDefault, linePitc
|
|
|
14392
14439
|
lineSpacingApply: exactLineSpacingApply
|
|
14393
14440
|
};
|
|
14394
14441
|
}
|
|
14395
|
-
function updateInlineDrawingPosition(line, paragraphInlineSkeDrawings, blockAnchorTop, paragraphNonInlineSkeDrawings) {
|
|
14442
|
+
function updateInlineDrawingPosition(line, paragraphInlineSkeDrawings, unitId = "", blockAnchorTop, paragraphNonInlineSkeDrawings) {
|
|
14396
14443
|
var _line$parent, _section$top;
|
|
14397
14444
|
const column = line.parent;
|
|
14398
14445
|
const section = column === null || column === void 0 ? void 0 : column.parent;
|
|
@@ -14404,6 +14451,7 @@ function updateInlineDrawingPosition(line, paragraphInlineSkeDrawings, blockAnch
|
|
|
14404
14451
|
const sectionTop = (_section$top = section === null || section === void 0 ? void 0 : section.top) !== null && _section$top !== void 0 ? _section$top : 0;
|
|
14405
14452
|
const lineTop = sectionTop + top;
|
|
14406
14453
|
for (const divide of line.divides) for (const glyph of divide.glyphGroup) if (glyph.streamType === DataStreamTreeTokenType.CUSTOM_BLOCK && glyph.width !== 0) {
|
|
14454
|
+
var _viewport$width, _viewport$height, _viewport$offsetLeft;
|
|
14407
14455
|
const { drawingId } = glyph;
|
|
14408
14456
|
if (drawingId == null) continue;
|
|
14409
14457
|
const drawing = paragraphInlineSkeDrawings === null || paragraphInlineSkeDrawings === void 0 ? void 0 : paragraphInlineSkeDrawings.get(drawingId);
|
|
@@ -14413,7 +14461,19 @@ function updateInlineDrawingPosition(line, paragraphInlineSkeDrawings, blockAnch
|
|
|
14413
14461
|
const { size, angle } = docTransform;
|
|
14414
14462
|
const { width = 0, height = 0 } = size;
|
|
14415
14463
|
const glyphHeight = glyph.bBox.bd + glyph.bBox.ba;
|
|
14416
|
-
|
|
14464
|
+
const glyphLeft = divide.left + divide.paddingLeft + glyph.left;
|
|
14465
|
+
const blockLeft = column.left + glyphLeft;
|
|
14466
|
+
const viewport = getDocsCustomBlockRenderViewport(unitId, drawingId, {
|
|
14467
|
+
blockLeft,
|
|
14468
|
+
fallbackHeight: height,
|
|
14469
|
+
fallbackWidth: width,
|
|
14470
|
+
pageMarginLeft: page.marginLeft,
|
|
14471
|
+
pageMarginRight: page.marginRight,
|
|
14472
|
+
pageWidth: page.pageWidth
|
|
14473
|
+
});
|
|
14474
|
+
const drawingWidth = (_viewport$width = viewport === null || viewport === void 0 ? void 0 : viewport.width) !== null && _viewport$width !== void 0 ? _viewport$width : width;
|
|
14475
|
+
const drawingHeight = (_viewport$height = viewport === null || viewport === void 0 ? void 0 : viewport.height) !== null && _viewport$height !== void 0 ? _viewport$height : height;
|
|
14476
|
+
drawing.aLeft = viewport ? blockLeft + ((_viewport$offsetLeft = viewport.offsetLeft) !== null && _viewport$offsetLeft !== void 0 ? _viewport$offsetLeft : 0) : blockLeft + .5 * glyph.width - .5 * drawingWidth || 0;
|
|
14417
14477
|
if (glyph.width > divide.width) {
|
|
14418
14478
|
var _paragraphNonInlineSk;
|
|
14419
14479
|
for (const positionedDrawing of (_paragraphNonInlineSk = paragraphNonInlineSkeDrawings === null || paragraphNonInlineSkeDrawings === void 0 ? void 0 : paragraphNonInlineSkeDrawings.values()) !== null && _paragraphNonInlineSk !== void 0 ? _paragraphNonInlineSk : []) {
|
|
@@ -14423,17 +14483,25 @@ function updateInlineDrawingPosition(line, paragraphInlineSkeDrawings, blockAnch
|
|
|
14423
14483
|
const lineBottom = lineTop + lineHeight;
|
|
14424
14484
|
if (positionedDrawing.aTop >= lineBottom || positionedBottom <= lineTop) continue;
|
|
14425
14485
|
const positionedRight = positionedDrawing.aLeft + positionedDrawing.width;
|
|
14426
|
-
const drawingRight = drawing.aLeft +
|
|
14486
|
+
const drawingRight = drawing.aLeft + drawingWidth;
|
|
14427
14487
|
if (positionedDrawing.aLeft < drawingRight && positionedRight > drawing.aLeft) {
|
|
14428
14488
|
var _positionedOrigin$dis;
|
|
14429
14489
|
drawing.aLeft = Math.max(drawing.aLeft, positionedDrawing.aLeft + positionedDrawing.width + ((_positionedOrigin$dis = positionedOrigin.distR) !== null && _positionedOrigin$dis !== void 0 ? _positionedOrigin$dis : 0));
|
|
14430
14490
|
}
|
|
14431
14491
|
}
|
|
14432
14492
|
}
|
|
14433
|
-
drawing.
|
|
14434
|
-
drawing.
|
|
14435
|
-
drawing.
|
|
14493
|
+
drawing.width = drawingWidth;
|
|
14494
|
+
drawing.height = drawingHeight;
|
|
14495
|
+
drawing.aTop = lineTop + lineHeight - .5 * glyphHeight - .5 * drawingHeight - marginBottom;
|
|
14436
14496
|
drawing.angle = angle;
|
|
14497
|
+
drawing.customBlockRenderViewport = viewport ? {
|
|
14498
|
+
bleedLeft: viewport.bleedLeft,
|
|
14499
|
+
bleedWidth: viewport.bleedWidth,
|
|
14500
|
+
contentHeight: viewport.contentHeight,
|
|
14501
|
+
contentWidth: viewport.contentWidth,
|
|
14502
|
+
height: viewport.height,
|
|
14503
|
+
viewportHeight: viewport.viewportHeight
|
|
14504
|
+
} : void 0;
|
|
14437
14505
|
drawing.isPageBreak = isPageBreak;
|
|
14438
14506
|
drawing.lineTop = lineTop;
|
|
14439
14507
|
drawing.columnLeft = column.left;
|
|
@@ -14443,7 +14511,7 @@ function updateInlineDrawingPosition(line, paragraphInlineSkeDrawings, blockAnch
|
|
|
14443
14511
|
}
|
|
14444
14512
|
page.skeDrawings = new Map([...page.skeDrawings, ...drawings]);
|
|
14445
14513
|
}
|
|
14446
|
-
function __getDrawingPosition(lineTop, lineHeight, column, isParagraphFirstShapedText, blockAnchorTop, needPositionDrawings = [], blockAnchorLeft = 0) {
|
|
14514
|
+
function __getDrawingPosition(ctx, lineTop, lineHeight, column, isParagraphFirstShapedText, blockAnchorTop, needPositionDrawings = [], blockAnchorLeft = 0, normalizeTraditionalColumnAnchor = true) {
|
|
14447
14515
|
var _column$parent3;
|
|
14448
14516
|
const page = (_column$parent3 = column.parent) === null || _column$parent3 === void 0 ? void 0 : _column$parent3.parent;
|
|
14449
14517
|
if (page == null || needPositionDrawings.length === 0) return;
|
|
@@ -14451,22 +14519,42 @@ function __getDrawingPosition(lineTop, lineHeight, column, isParagraphFirstShape
|
|
|
14451
14519
|
const isPageBreak = __checkPageBreak(column);
|
|
14452
14520
|
if (isPageBreak && !isParagraphFirstShapedText) return;
|
|
14453
14521
|
for (const drawing of needPositionDrawings) {
|
|
14454
|
-
var _getPositionHorizon2, _getPositionVertical2;
|
|
14522
|
+
var _ctx$dataModel$getUni, _ctx$dataModel$getUni2, _ctx$dataModel, _viewport$width2, _viewport$height2, _getPositionHorizon2, _getPositionVertical2;
|
|
14455
14523
|
const { drawingOrigin } = drawing;
|
|
14456
14524
|
if (!drawingOrigin) continue;
|
|
14457
14525
|
const { docTransform } = drawingOrigin;
|
|
14458
14526
|
const { positionH, positionV, size, angle } = docTransform;
|
|
14459
|
-
const { width
|
|
14460
|
-
|
|
14527
|
+
const { width, height } = size;
|
|
14528
|
+
const fallbackWidth = width !== null && width !== void 0 ? width : 0;
|
|
14529
|
+
const fallbackHeight = height !== null && height !== void 0 ? height : 0;
|
|
14530
|
+
const viewport = drawingOrigin.layoutType === PositionedObjectLayoutType.WRAP_TOP_AND_BOTTOM ? getDocsCustomBlockRenderViewport((_ctx$dataModel$getUni = (_ctx$dataModel$getUni2 = (_ctx$dataModel = ctx.dataModel).getUnitId) === null || _ctx$dataModel$getUni2 === void 0 ? void 0 : _ctx$dataModel$getUni2.call(_ctx$dataModel)) !== null && _ctx$dataModel$getUni !== void 0 ? _ctx$dataModel$getUni : "", drawing.drawingId, {
|
|
14531
|
+
fallbackHeight,
|
|
14532
|
+
fallbackWidth,
|
|
14533
|
+
pageMarginLeft: page.marginLeft,
|
|
14534
|
+
pageMarginRight: page.marginRight,
|
|
14535
|
+
pageWidth: page.pageWidth
|
|
14536
|
+
}) : null;
|
|
14537
|
+
const drawingWidth = (_viewport$width2 = viewport === null || viewport === void 0 ? void 0 : viewport.width) !== null && _viewport$width2 !== void 0 ? _viewport$width2 : fallbackWidth;
|
|
14538
|
+
const drawingHeight = (_viewport$height2 = viewport === null || viewport === void 0 ? void 0 : viewport.height) !== null && _viewport$height2 !== void 0 ? _viewport$height2 : fallbackHeight;
|
|
14539
|
+
let aLeft = (_getPositionHorizon2 = getPositionHorizon(positionH, column, page, drawingWidth, isPageBreak)) !== null && _getPositionHorizon2 !== void 0 ? _getPositionHorizon2 : 0;
|
|
14461
14540
|
if (positionH.relativeFrom === ObjectRelativeFromH.COLUMN && blockAnchorLeft > 0) {
|
|
14462
14541
|
const renderedColumnOrigin = isPageBreak ? 0 : column.left || page.marginLeft;
|
|
14463
14542
|
aLeft += blockAnchorLeft - renderedColumnOrigin;
|
|
14543
|
+
if (normalizeTraditionalColumnAnchor && ctx.dataModel.documentStyle.documentFlavor === DocumentFlavor.TRADITIONAL && positionV.relativeFrom === ObjectRelativeFromV.PARAGRAPH) aLeft -= page.marginLeft;
|
|
14464
14544
|
}
|
|
14465
14545
|
drawing.aLeft = aLeft;
|
|
14466
|
-
drawing.aTop = (_getPositionVertical2 = getPositionVertical(positionV, page, lineTop, lineHeight,
|
|
14467
|
-
drawing.width =
|
|
14468
|
-
drawing.height =
|
|
14546
|
+
drawing.aTop = (_getPositionVertical2 = getPositionVertical(positionV, page, lineTop, lineHeight, drawingHeight, blockAnchorTop, isPageBreak)) !== null && _getPositionVertical2 !== void 0 ? _getPositionVertical2 : 0;
|
|
14547
|
+
drawing.width = drawingWidth;
|
|
14548
|
+
drawing.height = drawingHeight;
|
|
14469
14549
|
drawing.angle = angle;
|
|
14550
|
+
drawing.customBlockRenderViewport = viewport ? {
|
|
14551
|
+
bleedLeft: viewport.bleedLeft,
|
|
14552
|
+
bleedWidth: viewport.bleedWidth,
|
|
14553
|
+
contentHeight: viewport.contentHeight,
|
|
14554
|
+
contentWidth: viewport.contentWidth,
|
|
14555
|
+
height: viewport.height,
|
|
14556
|
+
viewportHeight: viewport.viewportHeight
|
|
14557
|
+
} : void 0;
|
|
14470
14558
|
drawing.initialState = true;
|
|
14471
14559
|
drawing.columnLeft = column.left;
|
|
14472
14560
|
drawing.lineTop = lineTop;
|
|
@@ -14477,16 +14565,18 @@ function __getDrawingPosition(lineTop, lineHeight, column, isParagraphFirstShape
|
|
|
14477
14565
|
}
|
|
14478
14566
|
return drawings;
|
|
14479
14567
|
}
|
|
14480
|
-
function __updateDrawingPosition(column, drawings) {
|
|
14568
|
+
function __updateDrawingPosition(column, drawings, overwriteTopBottomPosition = false) {
|
|
14481
14569
|
var _column$parent4;
|
|
14482
14570
|
const page = (_column$parent4 = column.parent) === null || _column$parent4 === void 0 ? void 0 : _column$parent4.parent;
|
|
14483
14571
|
if (drawings == null || drawings.size === 0 || page == null) return;
|
|
14484
14572
|
for (const drawing of drawings.values()) {
|
|
14485
14573
|
const originDrawing = page.skeDrawings.get(drawing.drawingId);
|
|
14486
|
-
if (originDrawing) if (originDrawing.drawingOrigin.layoutType === PositionedObjectLayoutType.WRAP_TOP_AND_BOTTOM)
|
|
14574
|
+
if (originDrawing) if (originDrawing.drawingOrigin.layoutType === PositionedObjectLayoutType.WRAP_TOP_AND_BOTTOM) if (overwriteTopBottomPosition) page.skeDrawings.set(drawing.drawingId, drawing);
|
|
14575
|
+
else {
|
|
14487
14576
|
const lowerDrawing = originDrawing.aTop > drawing.aTop ? originDrawing : drawing;
|
|
14488
14577
|
page.skeDrawings.set(drawing.drawingId, lowerDrawing);
|
|
14489
|
-
}
|
|
14578
|
+
}
|
|
14579
|
+
else page.skeDrawings.set(drawing.drawingId, drawing);
|
|
14490
14580
|
else page.skeDrawings.set(drawing.drawingId, drawing);
|
|
14491
14581
|
}
|
|
14492
14582
|
}
|
|
@@ -14815,7 +14905,10 @@ function updateInlineDrawingCoordsAndBorder(ctx, pages) {
|
|
|
14815
14905
|
const affectInlineDrawings = paragraphConfig === null || paragraphConfig === void 0 ? void 0 : paragraphConfig.paragraphInlineSkeDrawings;
|
|
14816
14906
|
const affectNonInlineDrawings = paragraphConfig === null || paragraphConfig === void 0 ? void 0 : paragraphConfig.paragraphNonInlineSkeDrawings;
|
|
14817
14907
|
const drawingAnchor = (_ctx$skeletonResource = ctx.skeletonResourceReference) === null || _ctx$skeletonResource === void 0 || (_ctx$skeletonResource = _ctx$skeletonResource.drawingAnchor) === null || _ctx$skeletonResource === void 0 || (_ctx$skeletonResource = _ctx$skeletonResource.get(segmentId)) === null || _ctx$skeletonResource === void 0 ? void 0 : _ctx$skeletonResource.get(line.paragraphIndex);
|
|
14818
|
-
if (affectInlineDrawings && affectInlineDrawings.size > 0)
|
|
14908
|
+
if (affectInlineDrawings && affectInlineDrawings.size > 0) {
|
|
14909
|
+
var _ctx$dataModel$getUni, _ctx$dataModel$getUni2, _ctx$dataModel;
|
|
14910
|
+
updateInlineDrawingPosition(line, affectInlineDrawings, (_ctx$dataModel$getUni = (_ctx$dataModel$getUni2 = (_ctx$dataModel = ctx.dataModel).getUnitId) === null || _ctx$dataModel$getUni2 === void 0 ? void 0 : _ctx$dataModel$getUni2.call(_ctx$dataModel)) !== null && _ctx$dataModel$getUni !== void 0 ? _ctx$dataModel$getUni : "", drawingAnchor === null || drawingAnchor === void 0 ? void 0 : drawingAnchor.top, affectNonInlineDrawings);
|
|
14911
|
+
}
|
|
14819
14912
|
const paragraphStyle = paragraphConfig === null || paragraphConfig === void 0 ? void 0 : paragraphConfig.paragraphStyle;
|
|
14820
14913
|
const paragraphBackgroundColor = paragraphStyle === null || paragraphStyle === void 0 || (_paragraphStyle$shadi = paragraphStyle.shading) === null || _paragraphStyle$shadi === void 0 ? void 0 : _paragraphStyle$shadi.backgroundColor;
|
|
14821
14914
|
if (paragraphBackgroundColor) line.backgroundColor = paragraphBackgroundColor;
|
|
@@ -16144,22 +16237,66 @@ function _isDocxColumnBreakVisuallyBlankColumn(column) {
|
|
|
16144
16237
|
function _hasOnlyCustomBlockGlyphs(glyphs) {
|
|
16145
16238
|
return glyphs.length > 0 && glyphs.every((glyph) => glyph.streamType === DataStreamTreeTokenType.CUSTOM_BLOCK);
|
|
16146
16239
|
}
|
|
16147
|
-
function _mergeAdjacentCustomBlockShapedTexts(shapedTextList) {
|
|
16240
|
+
function _mergeAdjacentCustomBlockShapedTexts(shapedTextList, customBlockDrawings) {
|
|
16148
16241
|
const mergedShapedTextList = [];
|
|
16149
|
-
for (const
|
|
16150
|
-
const
|
|
16151
|
-
|
|
16152
|
-
lastShapedText.
|
|
16153
|
-
lastShapedText.glyphs.
|
|
16154
|
-
|
|
16155
|
-
|
|
16242
|
+
for (const originShapedText of shapedTextList) {
|
|
16243
|
+
const splitShapedTexts = _splitTopBottomCustomBlockShapedText(originShapedText, customBlockDrawings);
|
|
16244
|
+
for (const shapedText of splitShapedTexts) {
|
|
16245
|
+
const lastShapedText = mergedShapedTextList[mergedShapedTextList.length - 1];
|
|
16246
|
+
if (lastShapedText && _hasOnlyCustomBlockGlyphs(lastShapedText.glyphs) && _hasOnlyCustomBlockGlyphs(shapedText.glyphs) && !_hasTopBottomCustomBlockGlyph(lastShapedText.glyphs, customBlockDrawings) && !_hasTopBottomCustomBlockGlyph(shapedText.glyphs, customBlockDrawings)) {
|
|
16247
|
+
lastShapedText.text += shapedText.text;
|
|
16248
|
+
lastShapedText.glyphs.push(...shapedText.glyphs);
|
|
16249
|
+
lastShapedText.breakPointType = shapedText.breakPointType;
|
|
16250
|
+
continue;
|
|
16251
|
+
}
|
|
16252
|
+
mergedShapedTextList.push({
|
|
16253
|
+
...shapedText,
|
|
16254
|
+
glyphs: [...shapedText.glyphs]
|
|
16255
|
+
});
|
|
16156
16256
|
}
|
|
16157
|
-
|
|
16257
|
+
}
|
|
16258
|
+
return mergedShapedTextList;
|
|
16259
|
+
}
|
|
16260
|
+
function _splitTopBottomCustomBlockShapedText(shapedText, customBlockDrawings) {
|
|
16261
|
+
const splitShapedTexts = [];
|
|
16262
|
+
let pendingGlyphs = [];
|
|
16263
|
+
let pendingText = "";
|
|
16264
|
+
let textOffset = 0;
|
|
16265
|
+
const flushPending = () => {
|
|
16266
|
+
if (pendingGlyphs.length === 0) return;
|
|
16267
|
+
splitShapedTexts.push({
|
|
16158
16268
|
...shapedText,
|
|
16159
|
-
|
|
16269
|
+
text: pendingText,
|
|
16270
|
+
glyphs: pendingGlyphs
|
|
16160
16271
|
});
|
|
16272
|
+
pendingGlyphs = [];
|
|
16273
|
+
pendingText = "";
|
|
16274
|
+
};
|
|
16275
|
+
for (const glyph of shapedText.glyphs) {
|
|
16276
|
+
const glyphText = shapedText.text.slice(textOffset, textOffset + glyph.count);
|
|
16277
|
+
textOffset += glyph.count;
|
|
16278
|
+
if (_isTopBottomCustomBlockGlyph(glyph, customBlockDrawings)) {
|
|
16279
|
+
flushPending();
|
|
16280
|
+
splitShapedTexts.push({
|
|
16281
|
+
...shapedText,
|
|
16282
|
+
text: glyphText,
|
|
16283
|
+
glyphs: [glyph]
|
|
16284
|
+
});
|
|
16285
|
+
continue;
|
|
16286
|
+
}
|
|
16287
|
+
pendingGlyphs.push(glyph);
|
|
16288
|
+
pendingText += glyphText;
|
|
16161
16289
|
}
|
|
16162
|
-
|
|
16290
|
+
flushPending();
|
|
16291
|
+
return splitShapedTexts.length > 0 ? splitShapedTexts : [shapedText];
|
|
16292
|
+
}
|
|
16293
|
+
function _hasTopBottomCustomBlockGlyph(glyphs, customBlockDrawings) {
|
|
16294
|
+
return glyphs.some((glyph) => _isTopBottomCustomBlockGlyph(glyph, customBlockDrawings));
|
|
16295
|
+
}
|
|
16296
|
+
function _isTopBottomCustomBlockGlyph(glyph, customBlockDrawings) {
|
|
16297
|
+
var _customBlockDrawings$;
|
|
16298
|
+
if (glyph.streamType !== DataStreamTreeTokenType.CUSTOM_BLOCK || glyph.drawingId == null) return false;
|
|
16299
|
+
return ((_customBlockDrawings$ = customBlockDrawings.get(glyph.drawingId)) === null || _customBlockDrawings$ === void 0 ? void 0 : _customBlockDrawings$.drawingOrigin.layoutType) === PositionedObjectLayoutType.WRAP_TOP_AND_BOTTOM;
|
|
16163
16300
|
}
|
|
16164
16301
|
function _getListLevelAncestors(bullet, listLevel) {
|
|
16165
16302
|
if (!bullet || !listLevel) return;
|
|
@@ -16342,7 +16479,7 @@ function lineBreaking(ctx, viewModel, shapedTextList, curPage, paragraphNode, se
|
|
|
16342
16479
|
let allPages = [curPage];
|
|
16343
16480
|
let isParagraphFirstShapedText = true;
|
|
16344
16481
|
let shapedTextOffset = 0;
|
|
16345
|
-
for (const [_index, { text, glyphs, breakPointType }] of _mergeAdjacentCustomBlockShapedTexts(shapedTextList).entries()) {
|
|
16482
|
+
for (const [_index, { text, glyphs, breakPointType }] of _mergeAdjacentCustomBlockShapedTexts(shapedTextList, paragraphNonInlineSkeDrawingsByBlockId).entries()) {
|
|
16346
16483
|
const textStartIndex = paragraphNode.startIndex + shapedTextOffset;
|
|
16347
16484
|
const textGlyphCount = _glyphCount(glyphs);
|
|
16348
16485
|
const textEndIndex = textStartIndex + textGlyphCount;
|
|
@@ -17036,10 +17173,15 @@ function shaping(ctx, content, viewModel, paragraphNode, sectionBreakConfig, use
|
|
|
17036
17173
|
const { blockId } = customBlock;
|
|
17037
17174
|
const drawingOrigin = drawings[blockId];
|
|
17038
17175
|
if ((drawingOrigin === null || drawingOrigin === void 0 ? void 0 : drawingOrigin.layoutType) === PositionedObjectLayoutType.INLINE) {
|
|
17176
|
+
var _viewModel$getDataMod, _viewModel$getDataMod2, _viewModel$getDataMod3, _boundingBox$height, _boundingBox$width, _ref, _viewport$layoutWidth, _viewport$height;
|
|
17039
17177
|
const { angle } = drawingOrigin.docTransform;
|
|
17040
17178
|
const { width = 0, height = 0 } = drawingOrigin.docTransform.size;
|
|
17041
17179
|
const boundingBox = getBoundingBox(angle, 0, width, 0, height);
|
|
17042
|
-
|
|
17180
|
+
const viewport = getDocsCustomBlockRenderViewport((_viewModel$getDataMod = (_viewModel$getDataMod2 = (_viewModel$getDataMod3 = viewModel.getDataModel()).getUnitId) === null || _viewModel$getDataMod2 === void 0 ? void 0 : _viewModel$getDataMod2.call(_viewModel$getDataMod3)) !== null && _viewModel$getDataMod !== void 0 ? _viewModel$getDataMod : "", drawingOrigin.drawingId, {
|
|
17181
|
+
fallbackHeight: (_boundingBox$height = boundingBox.height) !== null && _boundingBox$height !== void 0 ? _boundingBox$height : 0,
|
|
17182
|
+
fallbackWidth: (_boundingBox$width = boundingBox.width) !== null && _boundingBox$width !== void 0 ? _boundingBox$width : 0
|
|
17183
|
+
});
|
|
17184
|
+
newGlyph = createSkeletonCustomBlockGlyph(config, (_ref = (_viewport$layoutWidth = viewport === null || viewport === void 0 ? void 0 : viewport.layoutWidth) !== null && _viewport$layoutWidth !== void 0 ? _viewport$layoutWidth : viewport === null || viewport === void 0 ? void 0 : viewport.width) !== null && _ref !== void 0 ? _ref : boundingBox.width, (_viewport$height = viewport === null || viewport === void 0 ? void 0 : viewport.height) !== null && _viewport$height !== void 0 ? _viewport$height : boundingBox.height, drawingOrigin.drawingId);
|
|
17043
17185
|
} else if (drawingOrigin != null) newGlyph = createSkeletonCustomBlockGlyph(config, 0, 0, drawingOrigin.drawingId);
|
|
17044
17186
|
}
|
|
17045
17187
|
if (newGlyph == null) newGlyph = createSkeletonLetterGlyph(char, config);
|
|
@@ -26530,7 +26672,7 @@ Engine = __decorate([__decorateParam(2, ICanvasColorService)], Engine);
|
|
|
26530
26672
|
//#endregion
|
|
26531
26673
|
//#region package.json
|
|
26532
26674
|
var name = "@univerjs/engine-render";
|
|
26533
|
-
var version = "1.0.0-
|
|
26675
|
+
var version = "1.0.0-insiders.20260701-0ef51b0";
|
|
26534
26676
|
|
|
26535
26677
|
//#endregion
|
|
26536
26678
|
//#region src/config/config.ts
|
|
@@ -27884,8 +28026,8 @@ var Transformer = class extends Disposable {
|
|
|
27884
28026
|
}
|
|
27885
28027
|
_getOutlinePosition(width, height, borderSpacing, borderStrokeWidth) {
|
|
27886
28028
|
return {
|
|
27887
|
-
left: borderSpacing - borderStrokeWidth,
|
|
27888
|
-
top: -borderSpacing -
|
|
28029
|
+
left: -borderSpacing - borderStrokeWidth,
|
|
28030
|
+
top: -borderSpacing - borderStrokeWidth,
|
|
27889
28031
|
width: width + borderSpacing * 2,
|
|
27890
28032
|
height: height + borderSpacing * 2
|
|
27891
28033
|
};
|
|
@@ -27961,7 +28103,7 @@ var Transformer = class extends Disposable {
|
|
|
27961
28103
|
top += -borderSpacing - borderStrokeWidth;
|
|
27962
28104
|
break;
|
|
27963
28105
|
case "__SpreadsheetTransformerResizeLM__":
|
|
27964
|
-
left += borderSpacing - borderStrokeWidth;
|
|
28106
|
+
left += -borderSpacing - borderStrokeWidth;
|
|
27965
28107
|
top += height / 2 - longEdge / 2;
|
|
27966
28108
|
break;
|
|
27967
28109
|
case "__SpreadsheetTransformerResizeRM__":
|
|
@@ -27969,7 +28111,7 @@ var Transformer = class extends Disposable {
|
|
|
27969
28111
|
top += height / 2 - longEdge / 2;
|
|
27970
28112
|
break;
|
|
27971
28113
|
case "__SpreadsheetTransformerResizeLB__":
|
|
27972
|
-
left += -
|
|
28114
|
+
left += -borderSpacing - borderStrokeWidth;
|
|
27973
28115
|
top += height + borderSpacing - borderStrokeWidth - longEdge;
|
|
27974
28116
|
break;
|
|
27975
28117
|
case "__SpreadsheetTransformerResizeCB__":
|
|
@@ -28013,7 +28155,7 @@ var Transformer = class extends Disposable {
|
|
|
28013
28155
|
top += -borderSpacing - borderStrokeWidth;
|
|
28014
28156
|
break;
|
|
28015
28157
|
case "__SpreadsheetTransformerResizeLM__":
|
|
28016
|
-
left += borderSpacing - borderStrokeWidth;
|
|
28158
|
+
left += -borderSpacing - borderStrokeWidth;
|
|
28017
28159
|
top += height / 2;
|
|
28018
28160
|
break;
|
|
28019
28161
|
case "__SpreadsheetTransformerResizeRM__":
|
|
@@ -28021,7 +28163,7 @@ var Transformer = class extends Disposable {
|
|
|
28021
28163
|
top += height / 2;
|
|
28022
28164
|
break;
|
|
28023
28165
|
case "__SpreadsheetTransformerResizeLB__":
|
|
28024
|
-
left += -
|
|
28166
|
+
left += -borderSpacing - borderStrokeWidth;
|
|
28025
28167
|
top += height + borderSpacing - borderStrokeWidth;
|
|
28026
28168
|
break;
|
|
28027
28169
|
case "__SpreadsheetTransformerResizeCB__":
|
|
@@ -29408,10 +29550,11 @@ let RenderUnit = class RenderUnit extends Disposable {
|
|
|
29408
29550
|
if (((_init$createUnitOptio = init.createUnitOptions) === null || _init$createUnitOptio === void 0 ? void 0 : _init$createUnitOptio.makeCurrent) === false) this.deactivate();
|
|
29409
29551
|
}
|
|
29410
29552
|
dispose() {
|
|
29411
|
-
this.
|
|
29412
|
-
super.dispose();
|
|
29553
|
+
if (this._disposed) return;
|
|
29413
29554
|
this._activated$.next(false);
|
|
29414
29555
|
this._activated$.complete();
|
|
29556
|
+
super.dispose();
|
|
29557
|
+
this._injector.dispose();
|
|
29415
29558
|
this._renderContext.unit = null;
|
|
29416
29559
|
this._renderContext.components.clear();
|
|
29417
29560
|
}
|
|
@@ -29422,7 +29565,10 @@ let RenderUnit = class RenderUnit extends Disposable {
|
|
|
29422
29565
|
* Get a dependency from the RenderUnit's injector.
|
|
29423
29566
|
*/
|
|
29424
29567
|
with(dependency) {
|
|
29425
|
-
return this._injector.get(dependency);
|
|
29568
|
+
return this._injector.get(dependency, LookUp.SELF);
|
|
29569
|
+
}
|
|
29570
|
+
getInjector() {
|
|
29571
|
+
return this._injector;
|
|
29426
29572
|
}
|
|
29427
29573
|
/**
|
|
29428
29574
|
* Add render dependencies to the RenderUnit's injector. Note that the dependencies would be initialized immediately
|
|
@@ -29433,15 +29579,16 @@ let RenderUnit = class RenderUnit extends Disposable {
|
|
|
29433
29579
|
}
|
|
29434
29580
|
_initDependencies(dependencies) {
|
|
29435
29581
|
const j = this._injector;
|
|
29436
|
-
dependencies
|
|
29582
|
+
const uniqueDependencies = dedupeRenderDependencies(dependencies);
|
|
29583
|
+
uniqueDependencies.forEach((dep) => {
|
|
29437
29584
|
const [identifier, implOrNull] = Array.isArray(dep) ? dep : [dep, null];
|
|
29438
29585
|
if (!implOrNull) j.add([identifier, { useFactory: () => j.createInstance(identifier, this._renderContext) }]);
|
|
29439
29586
|
else if (isClassDependencyItem(implOrNull)) j.add([identifier, { useFactory: () => j.createInstance(implOrNull.useClass, this._renderContext) }]);
|
|
29440
29587
|
else throw new Error("[RenderUnit]: render dependency could only be an class!");
|
|
29441
29588
|
});
|
|
29442
|
-
|
|
29589
|
+
uniqueDependencies.forEach((dep) => {
|
|
29443
29590
|
const [identifier] = Array.isArray(dep) ? dep : [dep, null];
|
|
29444
|
-
j.get(identifier);
|
|
29591
|
+
j.get(identifier, LookUp.SELF);
|
|
29445
29592
|
});
|
|
29446
29593
|
}
|
|
29447
29594
|
getRenderContext() {
|
|
@@ -29455,6 +29602,20 @@ let RenderUnit = class RenderUnit extends Disposable {
|
|
|
29455
29602
|
}
|
|
29456
29603
|
};
|
|
29457
29604
|
RenderUnit = __decorate([__decorateParam(1, Inject(Injector))], RenderUnit);
|
|
29605
|
+
function dedupeRenderDependencies(dependencies) {
|
|
29606
|
+
const seen = /* @__PURE__ */ new Set();
|
|
29607
|
+
return dependencies.filter((dependency) => {
|
|
29608
|
+
const key = getRenderDependencyIdentifierKey$1(Array.isArray(dependency) ? dependency[0] : dependency);
|
|
29609
|
+
if (seen.has(key)) return false;
|
|
29610
|
+
seen.add(key);
|
|
29611
|
+
return true;
|
|
29612
|
+
});
|
|
29613
|
+
}
|
|
29614
|
+
function getRenderDependencyIdentifierKey$1(identifier) {
|
|
29615
|
+
const decoratorName = identifier === null || identifier === void 0 ? void 0 : identifier.decoratorName;
|
|
29616
|
+
if (typeof decoratorName === "string" && decoratorName) return `identifier:${decoratorName}`;
|
|
29617
|
+
return identifier;
|
|
29618
|
+
}
|
|
29458
29619
|
|
|
29459
29620
|
//#endregion
|
|
29460
29621
|
//#region src/render-manager/render-manager.service.ts
|
|
@@ -29495,10 +29656,11 @@ let RenderManagerService = class RenderManagerService extends Disposable {
|
|
|
29495
29656
|
registerRenderModules(type, deps) {
|
|
29496
29657
|
if (!this._renderDependencies.has(type)) this._renderDependencies.set(type, []);
|
|
29497
29658
|
const dependencies = this._renderDependencies.get(type);
|
|
29498
|
-
|
|
29499
|
-
|
|
29659
|
+
const registeredDeps = deps.filter((dep) => !hasRenderDependency(dependencies, dep));
|
|
29660
|
+
dependencies.push(...registeredDeps);
|
|
29661
|
+
for (const [_, render] of this._renderMap) if (render.type === type) this._tryAddRenderDependencies(render, registeredDeps);
|
|
29500
29662
|
return toDisposable(() => {
|
|
29501
|
-
|
|
29663
|
+
registeredDeps.forEach((dep) => remove(dependencies, dep));
|
|
29502
29664
|
});
|
|
29503
29665
|
}
|
|
29504
29666
|
/**
|
|
@@ -29509,6 +29671,7 @@ let RenderManagerService = class RenderManagerService extends Disposable {
|
|
|
29509
29671
|
registerRenderModule(type, depCtor) {
|
|
29510
29672
|
if (!this._renderDependencies.has(type)) this._renderDependencies.set(type, []);
|
|
29511
29673
|
const dependencies = this._renderDependencies.get(type);
|
|
29674
|
+
if (hasRenderDependency(dependencies, depCtor)) return toDisposable(() => {});
|
|
29512
29675
|
dependencies.push(depCtor);
|
|
29513
29676
|
for (const [_, render] of this._renderMap) if (render.type === type) this._tryAddRenderDependencies(render, [depCtor]);
|
|
29514
29677
|
return toDisposable(() => remove(dependencies, depCtor));
|
|
@@ -29541,7 +29704,9 @@ let RenderManagerService = class RenderManagerService extends Disposable {
|
|
|
29541
29704
|
* @returns renderUnit:IRender
|
|
29542
29705
|
*/
|
|
29543
29706
|
createRender(unitId, createUnitOptions) {
|
|
29544
|
-
|
|
29707
|
+
var _createUnitOptions$re;
|
|
29708
|
+
const parentInjector = (_createUnitOptions$re = createUnitOptions === null || createUnitOptions === void 0 ? void 0 : createUnitOptions.renderParentInjector) !== null && _createUnitOptions$re !== void 0 ? _createUnitOptions$re : this._injector;
|
|
29709
|
+
const renderer = this._createRender(unitId, parentInjector.createInstance(Engine, unitId, void 0), (createUnitOptions === null || createUnitOptions === void 0 ? void 0 : createUnitOptions.embeddedRender) !== true, createUnitOptions, parentInjector);
|
|
29545
29710
|
this._renderCreated$.next(renderer);
|
|
29546
29711
|
return renderer;
|
|
29547
29712
|
}
|
|
@@ -29565,7 +29730,7 @@ let RenderManagerService = class RenderManagerService extends Disposable {
|
|
|
29565
29730
|
* @param isMainScene
|
|
29566
29731
|
* @returns renderUnit:IRender
|
|
29567
29732
|
*/
|
|
29568
|
-
_createRender(unitId, engine, isMainScene = true, createUnitOptions) {
|
|
29733
|
+
_createRender(unitId, engine, isMainScene = true, createUnitOptions, parentInjector = this._injector) {
|
|
29569
29734
|
const existItem = this.getRenderById(unitId);
|
|
29570
29735
|
let shouldDestroyEngine = true;
|
|
29571
29736
|
if (existItem != null) {
|
|
@@ -29582,7 +29747,7 @@ let RenderManagerService = class RenderManagerService extends Disposable {
|
|
|
29582
29747
|
if (unit) {
|
|
29583
29748
|
const type = this._univerInstanceService.getUnitType(unitId);
|
|
29584
29749
|
const ctorOfDeps = this._getRenderDepsByType(type);
|
|
29585
|
-
renderUnit =
|
|
29750
|
+
renderUnit = parentInjector.createInstance(RenderUnit, {
|
|
29586
29751
|
unit,
|
|
29587
29752
|
engine,
|
|
29588
29753
|
scene,
|
|
@@ -29590,7 +29755,16 @@ let RenderManagerService = class RenderManagerService extends Disposable {
|
|
|
29590
29755
|
createUnitOptions
|
|
29591
29756
|
});
|
|
29592
29757
|
this._addRenderUnit(unitId, renderUnit);
|
|
29593
|
-
|
|
29758
|
+
try {
|
|
29759
|
+
this._tryAddRenderDependencies(renderUnit, ctorOfDeps);
|
|
29760
|
+
} catch (error) {
|
|
29761
|
+
try {
|
|
29762
|
+
this._disposeItem(renderUnit);
|
|
29763
|
+
} finally {
|
|
29764
|
+
this._renderMap.delete(unitId);
|
|
29765
|
+
}
|
|
29766
|
+
throw error;
|
|
29767
|
+
}
|
|
29594
29768
|
} else {
|
|
29595
29769
|
renderUnit = {
|
|
29596
29770
|
isThumbNail: true,
|
|
@@ -29653,6 +29827,18 @@ RenderManagerService = __decorate([
|
|
|
29653
29827
|
__decorateParam(1, IUniverInstanceService),
|
|
29654
29828
|
__decorateParam(2, Inject(ThemeService))
|
|
29655
29829
|
], RenderManagerService);
|
|
29830
|
+
function hasRenderDependency(dependencies, dep) {
|
|
29831
|
+
const key = getRenderDependencyIdentifierKey(getRenderDependencyIdentifier(dep));
|
|
29832
|
+
return dependencies.some((registered) => getRenderDependencyIdentifierKey(getRenderDependencyIdentifier(registered)) === key);
|
|
29833
|
+
}
|
|
29834
|
+
function getRenderDependencyIdentifier(dep) {
|
|
29835
|
+
return Array.isArray(dep) ? dep[0] : dep;
|
|
29836
|
+
}
|
|
29837
|
+
function getRenderDependencyIdentifierKey(identifier) {
|
|
29838
|
+
const decoratorName = identifier.decoratorName;
|
|
29839
|
+
if (typeof decoratorName === "string" && decoratorName) return `identifier:${decoratorName}`;
|
|
29840
|
+
return identifier;
|
|
29841
|
+
}
|
|
29656
29842
|
const IRenderManagerService = createIdentifier("engine-render.render-manager.service");
|
|
29657
29843
|
function isDisposable(thing) {
|
|
29658
29844
|
return !!thing && typeof thing.dispose === "function";
|
|
@@ -30808,4 +30994,4 @@ var Viewport = class {
|
|
|
30808
30994
|
};
|
|
30809
30995
|
|
|
30810
30996
|
//#endregion
|
|
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 };
|
|
30997
|
+
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, getDocsCustomBlockRenderViewport, 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, setDocsCustomBlockRenderViewportProvider, setDocsTableRenderViewportProvider, setLineType, sheetContentViewportKeys, sheetHeaderViewportKeys, startWithEmoji, toPx, transformObjectOutOfGroup, withCurrentTypeOfRenderer };
|
|
@@ -233,6 +233,14 @@ export interface IDocumentSkeletonDrawing {
|
|
|
233
233
|
lineTop: number;
|
|
234
234
|
lineHeight: number;
|
|
235
235
|
blockAnchorTop: number;
|
|
236
|
+
customBlockRenderViewport?: {
|
|
237
|
+
bleedLeft?: number;
|
|
238
|
+
bleedWidth?: number;
|
|
239
|
+
contentHeight?: number;
|
|
240
|
+
contentWidth?: number;
|
|
241
|
+
height?: number;
|
|
242
|
+
viewportHeight?: number;
|
|
243
|
+
};
|
|
236
244
|
}
|
|
237
245
|
export interface IDocumentSkeletonFontStyle {
|
|
238
246
|
fontString: string;
|