@univerjs/engine-render 1.0.0-insiders.20260728-e98f416 → 1.0.0-insiders.20260729-84ae2bd

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 CHANGED
@@ -459,87 +459,6 @@ function getCellPositionByIndex(row, column, rowHeightAccumulation, columnWidthA
459
459
  endX
460
460
  };
461
461
  }
462
- /**
463
- * @deprecated use same function in @univerjs/core
464
- * @description Get the cell position information of the specified row and column, including the position information of the cell and the merge information of the cell
465
- * @param {number} row The row index of the cell
466
- * @param {number} column The column index of the cell
467
- * @param {number[]} rowHeightAccumulation The accumulated height of each row
468
- * @param {number[]} columnWidthAccumulation The accumulated width of each column
469
- * @param {ICellInfo} mergeDataInfo The merge information of the cell
470
- * @returns {ICellWithCoord} The cell position information of the specified row and column, including the position information of the cell and the merge information of the cell
471
- */
472
- function getCellWithCoordByIndexCore(row, column, rowHeightAccumulation, columnWidthAccumulation, mergeDataInfo) {
473
- row = _univerjs_core.Tools.clamp(row, 0, rowHeightAccumulation.length - 1);
474
- column = _univerjs_core.Tools.clamp(column, 0, columnWidthAccumulation.length - 1);
475
- let { startY, endY, startX, endX } = getCellPositionByIndex(row, column, rowHeightAccumulation, columnWidthAccumulation);
476
- const { isMerged, isMergedMainCell, startRow, startColumn, endRow, endColumn } = mergeDataInfo;
477
- let mergeInfo = {
478
- startRow,
479
- startColumn,
480
- endRow,
481
- endColumn,
482
- startY: 0,
483
- endY: 0,
484
- startX: 0,
485
- endX: 0
486
- };
487
- const rowAccumulationCount = rowHeightAccumulation.length - 1;
488
- const columnAccumulationCount = columnWidthAccumulation.length - 1;
489
- if (isMerged && startRow !== -1 && startColumn !== -1) {
490
- const mergeStartY = rowHeightAccumulation[startRow - 1] || 0;
491
- const mergeEndY = rowHeightAccumulation[endRow] || rowHeightAccumulation[rowAccumulationCount];
492
- const mergeStartX = columnWidthAccumulation[startColumn - 1] || 0;
493
- const mergeEndX = columnWidthAccumulation[endColumn] || columnWidthAccumulation[columnAccumulationCount];
494
- mergeInfo = {
495
- ...mergeInfo,
496
- startY: mergeStartY,
497
- endY: mergeEndY,
498
- startX: mergeStartX,
499
- endX: mergeEndX
500
- };
501
- } else if (!isMerged && endRow !== -1 && endColumn !== -1) {
502
- const mergeEndY = rowHeightAccumulation[endRow] || rowHeightAccumulation[rowAccumulationCount];
503
- const mergeEndX = columnWidthAccumulation[endColumn] || columnWidthAccumulation[columnAccumulationCount];
504
- mergeInfo = {
505
- ...mergeInfo,
506
- startY,
507
- endY: mergeEndY,
508
- startX,
509
- endX: mergeEndX
510
- };
511
- }
512
- return {
513
- isMerged,
514
- isMergedMainCell,
515
- actualRow: row,
516
- actualColumn: column,
517
- startY,
518
- endY,
519
- startX,
520
- endX,
521
- mergeInfo
522
- };
523
- }
524
- /**
525
- * @deprecated please use getCellWithCoordByIndexCore in @univerjs/core instead
526
- */
527
- const getCellByIndexWithMergeInfo = getCellWithCoordByIndexCore;
528
- /**
529
- * Determine whether there are any cells in a row that are not in the merged cells, mainly used for the calculation of auto height
530
- * @deprecated please use SpreadsheetSkeleton@_hasUnMergedCellInRow
531
- */
532
- function hasUnMergedCellInRow(row, startColumn, endColumn, mergeData) {
533
- let hasUnMergedCell = false;
534
- for (let colIndex = startColumn; colIndex <= endColumn; colIndex++) {
535
- const { isMerged, isMergedMainCell } = (0, _univerjs_core.getCellInfoInMergeData)(row, colIndex, mergeData);
536
- if (!isMerged && !isMergedMainCell) {
537
- hasUnMergedCell = true;
538
- break;
539
- }
540
- }
541
- return hasUnMergedCell;
542
- }
543
462
  function mergeInfoOffset(mergeInfo, offsetX, offsetY) {
544
463
  return {
545
464
  ...mergeInfo,
@@ -5273,7 +5192,7 @@ var Background = class extends SheetExtension {
5273
5192
  if (hasMergeData) {
5274
5193
  if (spreadsheetSkeleton.worksheet.getSpanModel().getMergeDataIndex(row, col) !== -1) return;
5275
5194
  }
5276
- const cellInfo = (_backgroundPositions$ = backgroundPositions === null || backgroundPositions === void 0 ? void 0 : backgroundPositions.getValue(row, col)) !== null && _backgroundPositions$ !== void 0 ? _backgroundPositions$ : spreadsheetSkeleton.getCellByIndexWithNoHeader(row, col);
5195
+ const cellInfo = (_backgroundPositions$ = backgroundPositions === null || backgroundPositions === void 0 ? void 0 : backgroundPositions.getValue(row, col)) !== null && _backgroundPositions$ !== void 0 ? _backgroundPositions$ : spreadsheetSkeleton.getCellWithCoordByIndex(row, col, false);
5277
5196
  if (!cellInfo) return;
5278
5197
  if (bgConfigParam || bgColorMatrix.getValue(row, col)) {
5279
5198
  renderBGContext.cellInfo = cellInfo;
@@ -5843,7 +5762,7 @@ var Custom = class extends SheetExtension {
5843
5762
  if (primaryWithCoord.isMerged) primaryWithCoord = skeleton.getCellWithCoordByIndex(mergeInfo.startRow, mergeInfo.startColumn, false);
5844
5763
  const renderInfo = {
5845
5764
  data: cellData,
5846
- style: skeleton.getStyles().getStyleByCell(cellData),
5765
+ style: worksheet.getComposedCellStyleByCellData(mergeInfo.startRow, mergeInfo.startColumn, cellData),
5847
5766
  primaryWithCoord,
5848
5767
  subUnitId,
5849
5768
  row,
@@ -19704,83 +19623,6 @@ var DocumentSkeleton = class DocumentSkeleton extends _univerjs_core.Skeleton {
19704
19623
  }
19705
19624
  };
19706
19625
 
19707
- //#endregion
19708
- //#region src/components/sheets/util.ts
19709
- function createDocumentModelWithStyle(content, textStyle, config = {}) {
19710
- const contentLength = content.length;
19711
- const { textRotation, paddingData, horizontalAlign = _univerjs_core.HorizontalAlign.UNSPECIFIED, verticalAlign = _univerjs_core.VerticalAlign.UNSPECIFIED, wrapStrategy = _univerjs_core.WrapStrategy.UNSPECIFIED, cellValueType } = config;
19712
- const { t: marginTop, r: marginRight, b: marginBottom, l: marginLeft } = paddingData || DEFAULT_PADDING_DATA;
19713
- const { vertexAngle, centerAngle } = convertTextRotation(textRotation);
19714
- return new _univerjs_core.DocumentDataModel({
19715
- id: "d",
19716
- body: {
19717
- dataStream: `${content}${_univerjs_core.DEFAULT_EMPTY_DOCUMENT_VALUE}`,
19718
- textRuns: [{
19719
- ts: textStyle,
19720
- st: 0,
19721
- ed: contentLength
19722
- }],
19723
- paragraphs: [{
19724
- startIndex: contentLength,
19725
- paragraphId: (0, _univerjs_core.createParagraphId)(/* @__PURE__ */ new Set()),
19726
- paragraphStyle: { horizontalAlign }
19727
- }],
19728
- sectionBreaks: [{
19729
- sectionId: (0, _univerjs_core.createSectionId)(/* @__PURE__ */ new Set()),
19730
- startIndex: contentLength + 1
19731
- }]
19732
- },
19733
- documentStyle: {
19734
- pageSize: {
19735
- width: Number.POSITIVE_INFINITY,
19736
- height: Number.POSITIVE_INFINITY
19737
- },
19738
- documentFlavor: _univerjs_core.DocumentFlavor.UNSPECIFIED,
19739
- marginTop,
19740
- marginBottom,
19741
- marginRight,
19742
- marginLeft,
19743
- paragraphLineGapDefault: 0,
19744
- renderConfig: {
19745
- horizontalAlign,
19746
- verticalAlign,
19747
- centerAngle,
19748
- vertexAngle,
19749
- wrapStrategy,
19750
- cellValueType
19751
- }
19752
- },
19753
- drawings: {},
19754
- drawingsOrder: []
19755
- });
19756
- }
19757
- function extractOtherStyle(style) {
19758
- if (!style) return {};
19759
- const { tr: textRotation, td: textDirection, ht: horizontalAlign, vt: verticalAlign, tb: wrapStrategy, pd: paddingData } = style;
19760
- return {
19761
- textRotation,
19762
- textDirection,
19763
- horizontalAlign,
19764
- verticalAlign,
19765
- wrapStrategy,
19766
- paddingData
19767
- };
19768
- }
19769
- function getFontFormat(format) {
19770
- if (!format) return {};
19771
- const { ff, fs, it, bl, ul, st, ol, cl } = format;
19772
- const style = {};
19773
- ff && (style.ff = ff);
19774
- fs && (style.fs = fs);
19775
- it && (style.it = it);
19776
- bl && (style.bl = bl);
19777
- ul && (style.ul = ul);
19778
- st && (style.st = st);
19779
- ol && (style.ol = ol);
19780
- cl && (style.cl = cl);
19781
- return style;
19782
- }
19783
-
19784
19626
  //#endregion
19785
19627
  //#region \0@oxc-project+runtime@0.140.0/helpers/esm/decorateParam.js
19786
19628
  function __decorateParam(paramIndex, decorator) {
@@ -19800,11 +19642,6 @@ function __decorate(decorators, target, key, desc) {
19800
19642
 
19801
19643
  //#endregion
19802
19644
  //#region src/components/sheets/sheet.render-skeleton.ts
19803
- const DEFAULT_CELL_DOCUMENT_MODEL_OPTION = {
19804
- isDeepClone: false,
19805
- displayRawFormula: false,
19806
- ignoreTextRotation: false
19807
- };
19808
19645
  const DEFAULT_PADDING_DATA = {
19809
19646
  t: 0,
19810
19647
  b: 2,
@@ -19963,12 +19800,6 @@ let SpreadsheetSkeleton = class SpreadsheetSkeleton extends _univerjs_core.Sheet
19963
19800
  this._handleBorderMatrix.reset();
19964
19801
  this._overflowCache.reset();
19965
19802
  }
19966
- /**
19967
- * @deprecated should never expose a property that is provided by another module!
19968
- */
19969
- getStyles() {
19970
- return this._styles;
19971
- }
19972
19803
  setOverflowCache(value) {
19973
19804
  this._overflowCache = value;
19974
19805
  }
@@ -20369,13 +20200,6 @@ let SpreadsheetSkeleton = class SpreadsheetSkeleton extends _univerjs_core.Sheet
20369
20200
  }
20370
20201
  return measuredWidth;
20371
20202
  }
20372
- /**
20373
- * @deprecated use `getRangeByViewport` instead.
20374
- * @param bounds
20375
- */
20376
- getRangeByBounding(bounds) {
20377
- return this._getRangeByViewBounding(this.rowHeightAccumulation, this.columnWidthAccumulation, bounds === null || bounds === void 0 ? void 0 : bounds.cacheBound);
20378
- }
20379
20203
  getRangeByViewport(vpInfo) {
20380
20204
  return this._getRangeByViewBounding(this.rowHeightAccumulation, this.columnWidthAccumulation, vpInfo === null || vpInfo === void 0 ? void 0 : vpInfo.viewBound);
20381
20205
  }
@@ -20424,171 +20248,10 @@ let SpreadsheetSkeleton = class SpreadsheetSkeleton extends _univerjs_core.Sheet
20424
20248
  const cachedAdjacentCell = (_this$_stylesCache$fo = this._stylesCache.fontMatrix.getValue(row, adjacentColumn)) === null || _this$_stylesCache$fo === void 0 ? void 0 : _this$_stylesCache$fo.cellData;
20425
20249
  return !(0, _univerjs_core.isCellCoverable)(cachedAdjacentCell !== null && cachedAdjacentCell !== void 0 ? cachedAdjacentCell : this.worksheet.getCell(row, adjacentColumn)) || hasMergeData && this.intersectMergeRange(row, adjacentColumn);
20426
20250
  }
20427
- /**
20428
- * Get cell by pos(offsetX, offsetY).
20429
- * @deprecated Please use `getCellWithCoordByOffset` instead.
20430
- */
20431
- calculateCellIndexByPosition(offsetX, offsetY, scaleX, scaleY, scrollXY) {
20432
- return this.getCellWithCoordByOffset(offsetX, offsetY, scaleX, scaleY, scrollXY);
20433
- }
20434
- /**
20435
- * This method has the same implementation as `getCellIndexByOffset`,
20436
- * but uses a different name to maintain backward compatibility with previous calls.
20437
- *
20438
- * @deprecated Please use `getCellIndexByOffset` method instead.
20439
- */
20440
- getCellPositionByOffset(offsetX, offsetY, scaleX, scaleY, scrollXY, options) {
20441
- return this.getCellIndexByOffset(offsetX, offsetY, scaleX, scaleY, scrollXY, options);
20442
- }
20443
20251
  getCellWithMergeInfoByIndex(row, column) {
20444
20252
  return this.worksheet.getCellInfoInMergeData(row, column);
20445
20253
  }
20446
20254
  /**
20447
- * Same as getColumnIndexByOffsetX
20448
- * @deprecated Please use `getColumnIndexByOffsetX` method instead.
20449
- */
20450
- getColumnPositionByOffsetX(offsetX, scaleX, scrollXY, options) {
20451
- return this.getColumnIndexByOffsetX(offsetX, scaleX, scrollXY, options);
20452
- }
20453
- /**
20454
- * Same as getRowIndexByOffsetY
20455
- * @deprecated Please use `getRowIndexByOffsetY` method instead.
20456
- */
20457
- getRowPositionByOffsetY(offsetY, scaleY, scrollXY, options) {
20458
- return this.getRowIndexByOffsetY(offsetY, scaleY, scrollXY, options);
20459
- }
20460
- /**
20461
- * Same as getCellWithCoordByIndex, but uses a different name to maintain backward compatibility with previous calls.
20462
- * @deprecated Please use `getCellWithCoordByIndex` instead.
20463
- */
20464
- getCellByIndex(row, column) {
20465
- return this.getCellWithCoordByIndex(row, column);
20466
- }
20467
- /**
20468
- * @deprecated Please use `getCellWithCoordByIndex(row, col, false)` instead.
20469
- * @param row
20470
- * @param column
20471
- */
20472
- getCellByIndexWithNoHeader(row, column) {
20473
- return this.getCellWithCoordByIndex(row, column, false);
20474
- }
20475
- /**
20476
- * Only used for cell edit, and no need to rotate text when edit cell content!
20477
- * @deprecated use same method in worksheet.
20478
- * @param cell
20479
- */
20480
- getBlankCellDocumentModel(cell) {
20481
- const documentModelObject = this._getCellDocumentModel(cell, { ignoreTextRotation: true });
20482
- const textStyle = getFontFormat(this._styles.getStyleByCell(cell));
20483
- if (documentModelObject != null) {
20484
- if (documentModelObject.documentModel == null) documentModelObject.documentModel = createDocumentModelWithStyle("", textStyle);
20485
- return documentModelObject;
20486
- }
20487
- const content = "";
20488
- let fontString = "document";
20489
- const textRotation = _univerjs_core.DEFAULT_STYLES.tr;
20490
- const horizontalAlign = _univerjs_core.DEFAULT_STYLES.ht;
20491
- const verticalAlign = _univerjs_core.DEFAULT_STYLES.vt;
20492
- const wrapStrategy = _univerjs_core.DEFAULT_STYLES.tb;
20493
- const paddingData = DEFAULT_PADDING_DATA;
20494
- fontString = getFontStyleString({}).fontCache;
20495
- return {
20496
- documentModel: createDocumentModelWithStyle(content, textStyle),
20497
- fontString,
20498
- textRotation,
20499
- wrapStrategy,
20500
- verticalAlign,
20501
- horizontalAlign,
20502
- paddingData
20503
- };
20504
- }
20505
- /**
20506
- * Only used for cell edit, and no need to rotate text when edit cell content!
20507
- * @deprecated use same method in worksheet.
20508
- * @param cell
20509
- */
20510
- getCellDocumentModelWithFormula(cell) {
20511
- return this._getCellDocumentModel(cell, {
20512
- isDeepClone: true,
20513
- displayRawFormula: true,
20514
- ignoreTextRotation: true
20515
- });
20516
- }
20517
- /**
20518
- * This method generates a document model based on the cell's properties and handles the associated styles and configurations.
20519
- * If the cell does not exist, it will return null.
20520
- *
20521
- * @deprecated use same method in worksheet.
20522
- * PS: This method has significant impact on performance.
20523
- * @param cell
20524
- * @param options
20525
- */
20526
- _getCellDocumentModel(cell, options = DEFAULT_CELL_DOCUMENT_MODEL_OPTION) {
20527
- var _style$bg;
20528
- const { isDeepClone, displayRawFormula, ignoreTextRotation } = {
20529
- ...DEFAULT_CELL_DOCUMENT_MODEL_OPTION,
20530
- ...options
20531
- };
20532
- const style = this._styles.getStyleByCell(cell);
20533
- if (!cell) return;
20534
- let documentModel;
20535
- let fontString = "document";
20536
- const cellOtherConfig = extractOtherStyle(style);
20537
- const textRotation = ignoreTextRotation ? _univerjs_core.DEFAULT_STYLES.tr : cellOtherConfig.textRotation || _univerjs_core.DEFAULT_STYLES.tr;
20538
- let horizontalAlign = cellOtherConfig.horizontalAlign || _univerjs_core.DEFAULT_STYLES.ht;
20539
- const verticalAlign = cellOtherConfig.verticalAlign || _univerjs_core.DEFAULT_STYLES.vt;
20540
- const wrapStrategy = cellOtherConfig.wrapStrategy || _univerjs_core.DEFAULT_STYLES.tb;
20541
- const paddingData = cellOtherConfig.paddingData || DEFAULT_PADDING_DATA;
20542
- if (cell.f && displayRawFormula) {
20543
- documentModel = createDocumentModelWithStyle(cell.f.toString(), {}, { verticalAlign });
20544
- horizontalAlign = _univerjs_core.DEFAULT_STYLES.ht;
20545
- } else if (cell.p) {
20546
- const { centerAngle, vertexAngle } = convertTextRotation(textRotation);
20547
- documentModel = this._updateConfigAndGetDocumentModel(isDeepClone ? _univerjs_core.Tools.deepClone(cell.p) : cell.p, horizontalAlign, paddingData, {
20548
- horizontalAlign,
20549
- verticalAlign,
20550
- centerAngle,
20551
- vertexAngle,
20552
- wrapStrategy,
20553
- zeroWidthParagraphBreak: 1
20554
- });
20555
- } else if (cell.v != null) {
20556
- const textStyle = getFontFormat(style);
20557
- fontString = getFontStyleString(textStyle).fontCache;
20558
- let cellText = (0, _univerjs_core.extractPureTextFromCell)(cell);
20559
- if (cell.t === _univerjs_core.CellValueType.FORCE_STRING && displayRawFormula) cellText = `'${cellText}`;
20560
- documentModel = createDocumentModelWithStyle(cellText, textStyle, {
20561
- ...cellOtherConfig,
20562
- textRotation,
20563
- cellValueType: cell.t
20564
- });
20565
- }
20566
- if (documentModel && cell.linkUrl && cell.linkId) (0, _univerjs_core.addLinkToDocumentModel)(documentModel, cell.linkUrl, cell.linkId);
20567
- /**
20568
- * the alignment mode is returned with respect to the offset of the sheet cell,
20569
- * because the document needs to render the layout for cells and
20570
- * support alignment across multiple cells (e.g., horizontal alignment of long text in overflow mode).
20571
- * The alignment mode of the document itself cannot meet this requirement,
20572
- * so an additional renderConfig needs to be added during the rendering of the document component.
20573
- * This means that there are two coexisting alignment modes.
20574
- * In certain cases, such as in an editor, conflicts may arise,
20575
- * requiring only one alignment mode to be retained.
20576
- * By removing the relevant configurations in renderConfig,
20577
- * the alignment mode of the sheet cell can be modified.
20578
- * The alternative alignment mode is applied to paragraphs within the document.
20579
- */
20580
- return {
20581
- documentModel,
20582
- fontString,
20583
- textRotation,
20584
- wrapStrategy,
20585
- verticalAlign,
20586
- horizontalAlign,
20587
- paddingData,
20588
- fill: style === null || style === void 0 || (_style$bg = style.bg) === null || _style$bg === void 0 ? void 0 : _style$bg.rgb
20589
- };
20590
- }
20591
- /**
20592
20255
  * Calculate the overflow of cell text. If there is no value on either side of the cell,
20593
20256
  * the text content of this cell can be drawn to both sides, not limited by the cell's width.
20594
20257
  * Overflow on the left or right is aligned according to the text's horizontal alignment.
@@ -21044,20 +20707,6 @@ let SpreadsheetSkeleton = class SpreadsheetSkeleton extends _univerjs_core.Sheet
21044
20707
  for (let i = range.startColumn; i <= range.endColumn; i++) if (!this.worksheet.getColVisible(i)) hiddenCols.push(i);
21045
20708
  return hiddenCols;
21046
20709
  }
21047
- /**
21048
- * @deprecated use function `convertTransformToOffsetX` in same package.
21049
- */
21050
- convertTransformToOffsetX(offsetX, scaleX, scrollXY) {
21051
- const { x: scrollX } = scrollXY;
21052
- return (offsetX - scrollX) * scaleX;
21053
- }
21054
- /**
21055
- * @deprecated use function `convertTransformToOffsetY` in same package.
21056
- */
21057
- convertTransformToOffsetY(offsetY, scaleY, scrollXY) {
21058
- const { y: scrollY } = scrollXY;
21059
- return (offsetY - scrollY) * scaleY;
21060
- }
21061
20710
  };
21062
20711
  SpreadsheetSkeleton = __decorate([
21063
20712
  __decorateParam(2, (0, _univerjs_core.Inject)(_univerjs_core.LocaleService)),
@@ -28039,24 +27688,6 @@ let Engine = class Engine extends _univerjs_core.Disposable {
28039
27688
  * @param {true} [resize] If should perform resize when mounted and observe resize event.
28040
27689
  */
28041
27690
  mount(element, resize = true) {
28042
- this.setContainer(element, resize);
28043
- }
28044
- /**
28045
- * Unmount the canvas without disposing it so it can be mounted again.
28046
- */
28047
- unmount() {
28048
- this._clearResizeListener();
28049
- if (!this._container) throw new Error("[Engine]: cannot unmount when container is not set!");
28050
- this._container.removeChild(this.getCanvasElement());
28051
- this._container = null;
28052
- }
28053
- /**
28054
- * Mount the canvas to the element so it would be rendered on UI.
28055
- * @deprecated Please use `mount` instead.
28056
- * @param {HTMLElement} element - The element the canvas will mount on.
28057
- * @param {true} [resize] If should perform resize when mounted and observe resize event.
28058
- */
28059
- setContainer(element, resize = true) {
28060
27691
  if (this._container === element) return;
28061
27692
  this._container = element;
28062
27693
  this._container.appendChild(this.getCanvasElement());
@@ -28077,6 +27708,15 @@ let Engine = class Engine extends _univerjs_core.Disposable {
28077
27708
  });
28078
27709
  }
28079
27710
  }
27711
+ /**
27712
+ * Unmount the canvas without disposing it so it can be mounted again.
27713
+ */
27714
+ unmount() {
27715
+ this._clearResizeListener();
27716
+ if (!this._container) throw new Error("[Engine]: cannot unmount when container is not set!");
27717
+ this._container.removeChild(this.getCanvasElement());
27718
+ this._container = null;
27719
+ }
28080
27720
  _clearResizeListener() {
28081
27721
  var _this$_resizeListener;
28082
27722
  (_this$_resizeListener = this._resizeListenerDisposable) === null || _this$_resizeListener === void 0 || _this$_resizeListener.dispose();
@@ -28505,7 +28145,7 @@ Engine = __decorate([__decorateParam(2, ICanvasColorService)], Engine);
28505
28145
  //#endregion
28506
28146
  //#region package.json
28507
28147
  var name = "@univerjs/engine-render";
28508
- var version = "1.0.0-insiders.20260728-e98f416";
28148
+ var version = "1.0.0-insiders.20260729-84ae2bd";
28509
28149
 
28510
28150
  //#endregion
28511
28151
  //#region src/config/config.ts
@@ -28565,8 +28205,6 @@ var InputManager = class InputManager extends _univerjs_core.Disposable {
28565
28205
  this._onPointerEnter = null;
28566
28206
  this._onPointerLeave = null;
28567
28207
  this._onMouseWheel = null;
28568
- this._onKeyDown = null;
28569
- this._onKeyUp = null;
28570
28208
  this._onDragEnter = null;
28571
28209
  this._onDragLeave = null;
28572
28210
  this._onDragOver = null;
@@ -28657,12 +28295,6 @@ var InputManager = class InputManager extends _univerjs_core.Disposable {
28657
28295
  this._scene.getMainViewport().onMouseWheel$.emitEvent(evt);
28658
28296
  if (!isStop && this._shouldDispatchEventToScene(currentObject)) this._scene.onMouseWheel$.emitEvent(evt);
28659
28297
  }
28660
- _onKeyDown(evt) {
28661
- this._scene.onKeyDown$.emitEvent(evt);
28662
- }
28663
- _onKeyUp(evt) {
28664
- this._scene.onKeyUp$.emitEvent(evt);
28665
- }
28666
28298
  _onDragEnter(evt) {
28667
28299
  var _this$_currentObject;
28668
28300
  this._currentObject = this._getObjectAtPos(evt.offsetX, evt.offsetY);
@@ -28700,14 +28332,6 @@ var InputManager = class InputManager extends _univerjs_core.Disposable {
28700
28332
  if (!engine) return;
28701
28333
  this._onInput$ = engine.onInputChanged$.subscribeEvent((eventData) => {
28702
28334
  const evt = eventData;
28703
- if (eventData.deviceType === 1) switch (eventData.type) {
28704
- case "keydown":
28705
- this._onKeyDown(evt);
28706
- break;
28707
- case "keyup":
28708
- this._onKeyUp(evt);
28709
- break;
28710
- }
28711
28335
  if (eventData.deviceType === 2 || eventData.deviceType === 3) switch (eventData.type) {
28712
28336
  case "wheel":
28713
28337
  case "DOMMouseScroll":
@@ -30465,22 +30089,6 @@ var Scene = class extends _univerjs_core.Disposable {
30465
30089
  _defineProperty(this, "onDblclick$", new _univerjs_core.EventSubject());
30466
30090
  _defineProperty(this, "onTripleClick$", new _univerjs_core.EventSubject());
30467
30091
  _defineProperty(this, "onMouseWheel$", new _univerjs_core.EventSubject());
30468
- _defineProperty(
30469
- this,
30470
- /**
30471
- * @deprecated use `fromGlobalEvent('keydown')` from rx.js instead.
30472
- */
30473
- "onKeyDown$",
30474
- new _univerjs_core.EventSubject()
30475
- );
30476
- _defineProperty(
30477
- this,
30478
- /**
30479
- * @deprecated use `fromGlobalEvent('keyup')` from rx.js instead.
30480
- */
30481
- "onKeyUp$",
30482
- new _univerjs_core.EventSubject()
30483
- );
30484
30092
  _defineProperty(this, "_beforeRender$", new rxjs.BehaviorSubject(null));
30485
30093
  _defineProperty(this, "beforeRender$", this._beforeRender$.asObservable());
30486
30094
  _defineProperty(this, "_afterRender$", new rxjs.BehaviorSubject(null));
@@ -30636,30 +30244,6 @@ var Scene = class extends _univerjs_core.Disposable {
30636
30244
  this.resetCursor();
30637
30245
  }
30638
30246
  /**
30639
- * @deprecated use transformByState instead.
30640
- * @param width
30641
- * @param height
30642
- */
30643
- resize(width, height) {
30644
- const preWidth = this.width;
30645
- if (width !== void 0) this.width = width;
30646
- const preHeight = this.height;
30647
- if (height !== void 0) this.height = height;
30648
- this._transformHandler();
30649
- this.onTransformChange$.emitEvent({
30650
- type: 1,
30651
- value: {
30652
- width: this.width,
30653
- height: this.height
30654
- },
30655
- preValue: {
30656
- width: preWidth,
30657
- height: preHeight
30658
- }
30659
- });
30660
- return this;
30661
- }
30662
- /**
30663
30247
  * Unlike @scale, this method doesn't emit event.
30664
30248
  * @param scaleX
30665
30249
  * @param scaleY
@@ -30977,14 +30561,6 @@ var Scene = class extends _univerjs_core.Disposable {
30977
30561
  return this.findViewportByPosToScene(coord);
30978
30562
  }
30979
30563
  /**
30980
- * @deprecated use `getScrollXYInfoByViewport` instead.
30981
- * @param pos
30982
- * @param viewPort
30983
- */
30984
- getVpScrollXYInfoByPosToVp(pos, viewPort) {
30985
- return this.getScrollXYInfoByViewport(pos, viewPort);
30986
- }
30987
- /**
30988
30564
  * getViewportScrollXYInfo by viewport under cursor position
30989
30565
  * prev getScrollXYByRelativeCoords
30990
30566
  * @param pos
@@ -31012,14 +30588,6 @@ var Scene = class extends _univerjs_core.Disposable {
31012
30588
  };
31013
30589
  }
31014
30590
  /**
31015
- * @deprecated use `getCoordRelativeToViewport` instead
31016
- * @param coord
31017
- * @returns
31018
- */
31019
- getRelativeToViewportCoord(coord) {
31020
- return this.getCoordRelativeToViewport(coord);
31021
- }
31022
- /**
31023
30591
  * Get coord to active viewport.
31024
30592
  * In a nested scene scenario, it is necessary to obtain the relative offsets layer by layer.
31025
30593
  *
@@ -31097,8 +30665,6 @@ var Scene = class extends _univerjs_core.Disposable {
31097
30665
  this.onDblclick$.complete();
31098
30666
  this.onTripleClick$.complete();
31099
30667
  this.onMouseWheel$.complete();
31100
- this.onKeyDown$.complete();
31101
- this.onKeyUp$.complete();
31102
30668
  this._addObject$.complete();
31103
30669
  super.dispose();
31104
30670
  }
@@ -31535,8 +31101,6 @@ let RenderManagerService = class RenderManagerService extends _univerjs_core.Dis
31535
31101
  this._themeService = _themeService;
31536
31102
  _defineProperty(this, "_defaultEngine", void 0);
31537
31103
  _defineProperty(this, "_renderMap", /* @__PURE__ */ new Map());
31538
- _defineProperty(this, "_createRender$", new rxjs.Subject());
31539
- _defineProperty(this, "createRender$", this._createRender$.asObservable());
31540
31104
  _defineProperty(this, "_renderCreated$", new rxjs.Subject());
31541
31105
  _defineProperty(this, "created$", this._renderCreated$.asObservable());
31542
31106
  _defineProperty(this, "_renderDisposed$", new rxjs.Subject());
@@ -31594,9 +31158,6 @@ let RenderManagerService = class RenderManagerService extends _univerjs_core.Dis
31594
31158
  });
31595
31159
  }));
31596
31160
  }
31597
- create(unitId) {
31598
- this._createRender$.next(unitId);
31599
- }
31600
31161
  /**
31601
31162
  * create renderUnit & init deps from renderDependencies
31602
31163
  * @param unitId
@@ -31744,40 +31305,8 @@ function withCurrentTypeOfRenderer(type, id, instanceService, renderManagerServi
31744
31305
  return null;
31745
31306
  }
31746
31307
 
31747
- //#endregion
31748
- //#region src/services/render-config.service.ts
31749
- /**
31750
- * This service carries managers render config that would be passed
31751
- * to every widget, so some rendering could be optimized.
31752
- *
31753
- * @deprecated Will be replaced by ICanvasColorService.
31754
- */
31755
- var UniverRenderConfigService = class {
31756
- constructor() {
31757
- _defineProperty(this, "_renderConfig", { ok: "111" });
31758
- _defineProperty(this, "_updateSignal$", new rxjs.Subject());
31759
- _defineProperty(this, "updateSignal$", this._updateSignal$.pipe((0, rxjs.debounceTime)(4)));
31760
- }
31761
- setRenderConfig(key, value) {
31762
- if (value == null) {
31763
- delete this._renderConfig[key];
31764
- return;
31765
- }
31766
- this._renderConfig[key] = value;
31767
- }
31768
- getRenderConfig() {
31769
- return this._renderConfig;
31770
- }
31771
- };
31772
-
31773
31308
  //#endregion
31774
31309
  //#region src/plugin.ts
31775
- /**
31776
- * The global rendering engine.
31777
- *
31778
- * @deprecated There will be no more default global render engine in the future.
31779
- */
31780
- const IRenderingEngine = (0, _univerjs_core.createIdentifier)("univer.render-engine");
31781
31310
  const PLUGIN_NAME = "UNIVER_RENDER_ENGINE_PLUGIN";
31782
31311
  let UniverRenderEnginePlugin = class UniverRenderEnginePlugin extends _univerjs_core.Plugin {
31783
31312
  constructor(_config = defaultPluginConfig, _injector, _configService) {
@@ -31789,12 +31318,7 @@ let UniverRenderEnginePlugin = class UniverRenderEnginePlugin extends _univerjs_
31789
31318
  this._configService.setConfig(ENGINE_RENDER_PLUGIN_CONFIG_KEY, rest);
31790
31319
  }
31791
31320
  onStarting() {
31792
- (0, _univerjs_core.registerDependencies)(this._injector, [
31793
- [UniverRenderConfigService],
31794
- [ICanvasColorService, { useClass: CanvasColorService }],
31795
- [IRenderingEngine, { useClass: Engine }],
31796
- [IRenderManagerService, { useClass: RenderManagerService }]
31797
- ]);
31321
+ (0, _univerjs_core.registerDependencies)(this._injector, [[ICanvasColorService, { useClass: CanvasColorService }], [IRenderManagerService, { useClass: RenderManagerService }]]);
31798
31322
  }
31799
31323
  };
31800
31324
  _defineProperty(UniverRenderEnginePlugin, "pluginName", PLUGIN_NAME);
@@ -31935,7 +31459,7 @@ var Viewport = class {
31935
31459
  this._isWheelPreventDefaultX = (props === null || props === void 0 ? void 0 : props.isWheelPreventDefaultX) || false;
31936
31460
  this._isWheelPreventDefaultY = (props === null || props === void 0 ? void 0 : props.isWheelPreventDefaultY) || false;
31937
31461
  this.resetCanvasSizeAndUpdateScroll();
31938
- this.getBounding();
31462
+ this.calcViewportInfo();
31939
31463
  this._transformChangeSubscription = (_this$scene$getEngine = this.scene.getEngine()) === null || _this$scene$getEngine === void 0 ? void 0 : _this$scene$getEngine.onTransformChange$.subscribeEvent(() => {
31940
31464
  this.markForceDirty(true);
31941
31465
  });
@@ -32452,13 +31976,6 @@ var Viewport = class {
32452
31976
  };
32453
31977
  }
32454
31978
  /**
32455
- * Get viewport info
32456
- * @deprecated use `calcViewportInfo`
32457
- */
32458
- getBounding() {
32459
- return this.calcViewportInfo();
32460
- }
32461
- /**
32462
31979
  * convert vector to scene coordinate, include row & col
32463
31980
  * @param vec
32464
31981
  * @returns Vector2
@@ -32963,7 +32480,6 @@ exports.ICanvasColorService = ICanvasColorService;
32963
32480
  exports.INITIAL_MATRIX = INITIAL_MATRIX;
32964
32481
  exports.INITIAL_Path2 = INITIAL_Path2;
32965
32482
  exports.IRenderManagerService = IRenderManagerService;
32966
- exports.IRenderingEngine = IRenderingEngine;
32967
32483
  exports.IWatermarkTypeEnum = IWatermarkTypeEnum;
32968
32484
  exports.Image = Image$1;
32969
32485
  exports.IsSafari = IsSafari;
@@ -33086,7 +32602,6 @@ exports.expandDrawingEffectBounds = expandDrawingEffectBounds;
33086
32602
  exports.expandRangeIfIntersects = expandRangeIfIntersects;
33087
32603
  exports.fixLineWidthByScale = fixLineWidthByScale;
33088
32604
  exports.generateRandomKey = generateRandomKey;
33089
- exports.getCellByIndexWithMergeInfo = getCellByIndexWithMergeInfo;
33090
32605
  exports.getCellPositionByIndex = getCellPositionByIndex;
33091
32606
  exports.getCharSpaceApply = getCharSpaceApply;
33092
32607
  exports.getColor = getColor;
@@ -33137,7 +32652,6 @@ exports.hasListGlyph = hasListGlyph;
33137
32652
  exports.hasSpace = hasSpace;
33138
32653
  exports.hasThai = hasThai;
33139
32654
  exports.hasTibetan = hasTibetan;
33140
- exports.hasUnMergedCellInRow = hasUnMergedCellInRow;
33141
32655
  exports.inViewRanges = inViewRanges;
33142
32656
  exports.injectStyle = injectStyle;
33143
32657
  exports.isArray = isArray;