@univerjs/engine-render 0.4.0-alpha.1 → 0.4.0-experimental.20241017-da434a2

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/es/index.js CHANGED
@@ -4286,6 +4286,9 @@ const _Canvas = class _Canvas {
4286
4286
  getHeight() {
4287
4287
  return this._height;
4288
4288
  }
4289
+ setId(id) {
4290
+ this._canvasEle.id = id;
4291
+ }
4289
4292
  setSize(width, height, pixelRatioParam) {
4290
4293
  var _a10;
4291
4294
  this._pixelRatio = pixelRatioParam || getDevicePixelRatio();
@@ -7252,6 +7255,7 @@ function getBulletParagraphTextStyle(bullet, viewModel) {
7252
7255
  return (_a10 = viewModel.getDataModel().getBulletPresetList()[listType].nestingLevel[0].paragraphProperties) == null ? void 0 : _a10.textStyle;
7253
7256
  }
7254
7257
  __name(getBulletParagraphTextStyle, "getBulletParagraphTextStyle");
7258
+ const DEFAULT_TEXT_RUN = { ts: {}, st: 0, ed: 0 };
7255
7259
  function getFontCreateConfig(index2, viewModel, paragraphNode, sectionBreakConfig, paragraph) {
7256
7260
  const {
7257
7261
  gridType = GridType.LINES,
@@ -7265,10 +7269,10 @@ function getFontCreateConfig(index2, viewModel, paragraphNode, sectionBreakConfi
7265
7269
  marginLeft = 0,
7266
7270
  localeService,
7267
7271
  renderConfig = {}
7268
- } = sectionBreakConfig, { paragraphStyle = {}, bullet } = paragraph, { isRenderStyle } = renderConfig, { startIndex } = paragraphNode, textRun = isRenderStyle === BooleanNumber.FALSE ? { ts: {}, st: 0, ed: 0 } : viewModel.getTextRun(index2 + startIndex) || { ts: {}, st: 0, ed: 0 }, customDecoration = viewModel.getCustomDecoration(index2 + startIndex), showCustomDecoration = customDecoration && customDecoration.show !== !1, customDecorationStyle = showCustomDecoration ? getCustomDecorationStyle(customDecoration) : null, customRange = viewModel.getCustomRange(index2 + startIndex), showCustomRange = customRange && customRange.show !== !1, customRangeStyle = showCustomRange ? getCustomRangeStyle(customRange) : null, hasAddonStyle = showCustomRange || showCustomDecoration, { st, ed } = textRun;
7272
+ } = sectionBreakConfig, { paragraphStyle = {}, bullet } = paragraph, { isRenderStyle } = renderConfig, { startIndex } = paragraphNode, originTextRun = viewModel.getTextRun(index2 + startIndex), textRun = isRenderStyle === BooleanNumber.FALSE ? DEFAULT_TEXT_RUN : originTextRun != null ? originTextRun : DEFAULT_TEXT_RUN, customDecoration = viewModel.getCustomDecoration(index2 + startIndex), showCustomDecoration = customDecoration && customDecoration.show !== !1, customDecorationStyle = showCustomDecoration ? getCustomDecorationStyle(customDecoration) : null, customRange = viewModel.getCustomRange(index2 + startIndex), showCustomRange = customRange && customRange.show !== !1, customRangeStyle = showCustomRange ? getCustomRangeStyle(customRange) : null, hasAddonStyle = showCustomRange || showCustomDecoration || !!bullet, { st, ed } = textRun;
7269
7273
  let { ts: textStyle = {} } = textRun;
7270
7274
  const cache = fontCreateConfigCache.getValue(st, ed);
7271
- if (cache && !hasAddonStyle)
7275
+ if (cache && !hasAddonStyle && originTextRun)
7272
7276
  return cache;
7273
7277
  const { snapToGrid = BooleanNumber.TRUE } = paragraphStyle, bulletTextStyle = bullet ? getBulletParagraphTextStyle(bullet, viewModel) : null;
7274
7278
  textStyle = {
@@ -7289,7 +7293,7 @@ function getFontCreateConfig(index2, viewModel, paragraphNode, sectionBreakConfi
7289
7293
  snapToGrid,
7290
7294
  pageWidth
7291
7295
  };
7292
- return hasAddonStyle || fontCreateConfigCache.setValue(st, ed, result), result;
7296
+ return !hasAddonStyle && originTextRun && fontCreateConfigCache.setValue(st, ed, result), result;
7293
7297
  }
7294
7298
  __name(getFontCreateConfig, "getFontCreateConfig");
7295
7299
  function getNullSkeleton() {
@@ -25808,9 +25812,9 @@ const UNIQUE_KEY$6 = "DefaultFontExtension", _Font = class _Font extends SheetEx
25808
25812
  renderFontContext.cellInfo = cellInfo, this.renderFontEachCell(renderFontContext, range.startRow, range.startColumn, fontMatrix);
25809
25813
  }), ctx.restore();
25810
25814
  }
25811
- renderFontEachCell(renderFontContext, row, col, fontMatrix) {
25815
+ renderFontEachCell(renderFontCtx, row, col, fontMatrix) {
25812
25816
  var _a10;
25813
- const { ctx, viewRanges, diffRanges, spreadsheetSkeleton, cellInfo } = renderFontContext;
25817
+ const { ctx, viewRanges, diffRanges, spreadsheetSkeleton, cellInfo } = renderFontCtx;
25814
25818
  let { startY, endY, startX, endX } = cellInfo;
25815
25819
  const { isMerged, isMergedMainCell, mergeInfo } = cellInfo;
25816
25820
  if (isMerged && !isMergedMainCell)
@@ -25826,9 +25830,16 @@ const UNIQUE_KEY$6 = "DefaultFontExtension", _Font = class _Font extends SheetEx
25826
25830
  const cellData = spreadsheetSkeleton.worksheet.getCell(row, col) || {};
25827
25831
  if ((_a10 = cellData.fontRenderExtension) != null && _a10.isSkip)
25828
25832
  return !0;
25829
- ctx.save(), ctx.beginPath(), renderFontContext.overflowRectangle = overflowRange, renderFontContext.cellData = cellData, renderFontContext.startX = startX, renderFontContext.startY = startY, renderFontContext.endX = endX, renderFontContext.endY = endY, this._clipTextOverflow(renderFontContext, row, col, fontMatrix), ctx.translate(startX + FIX_ONE_PIXEL_BLUR_OFFSET, startY + FIX_ONE_PIXEL_BLUR_OFFSET), this._renderDocuments(ctx, fontsConfig, startX, startY, endX, endY, row, col, spreadsheetSkeleton.overflowCache), ctx.closePath(), ctx.restore();
25833
+ ctx.save(), ctx.beginPath(), renderFontCtx.overflowRectangle = overflowRange, renderFontCtx.cellData = cellData, renderFontCtx.startX = startX, renderFontCtx.startY = startY, renderFontCtx.endX = endX, renderFontCtx.endY = endY, this._setFontRenderBounds(renderFontCtx, row, col, fontMatrix), ctx.translate(startX + FIX_ONE_PIXEL_BLUR_OFFSET, startY + FIX_ONE_PIXEL_BLUR_OFFSET), this._renderDocuments(ctx, fontsConfig, renderFontCtx.startX, renderFontCtx.startY, renderFontCtx.endX, renderFontCtx.endY, row, col, spreadsheetSkeleton.overflowCache), ctx.closePath(), ctx.restore();
25830
25834
  }
25831
- _clipTextOverflow(renderFontContext, row, col, fontMatrix) {
25835
+ /**
25836
+ * Change font render bounds, for overflow and filter icon & custom render.
25837
+ * @param renderFontContext
25838
+ * @param row
25839
+ * @param col
25840
+ * @param fontMatrix
25841
+ */
25842
+ _setFontRenderBounds(renderFontContext, row, col, fontMatrix) {
25832
25843
  var _a10, _b, _c, _d;
25833
25844
  const { ctx, scale, overflowRectangle, rowHeightAccumulation, columnWidthAccumulation, cellData } = renderFontContext;
25834
25845
  let { startX, endX, startY, endY } = renderFontContext;
@@ -25876,14 +25887,15 @@ const UNIQUE_KEY$6 = "DefaultFontExtension", _Font = class _Font extends SheetEx
25876
25887
  );
25877
25888
  } else
25878
25889
  ctx.rectByPrecision(startX + 1 / scale, startY + 1 / scale, cellWidth - 2 / scale, cellHeight - 2 / scale), ctx.clip();
25890
+ renderFontContext.startX = startX, renderFontContext.startY = startY, renderFontContext.endX = endX, renderFontContext.endY = endY;
25879
25891
  }
25880
- _renderDocuments(ctx, docsConfig, startX, startY, endX, endY, row, column, overflowCache) {
25892
+ _renderDocuments(ctx, docsConfig, startX, startY, endX, endY, row, col, overflowCache) {
25881
25893
  const documents = this.getDocuments();
25882
25894
  if (documents == null)
25883
25895
  throw new Error("documents is null");
25884
25896
  const { documentSkeleton, vertexAngle = 0, wrapStrategy } = docsConfig, cellHeight = endY - startY, cellWidth = endX - startX;
25885
25897
  wrapStrategy === WrapStrategy.WRAP && vertexAngle === 0 ? (documentSkeleton.getViewModel().getDataModel().updateDocumentDataPageSize(cellWidth), documentSkeleton.calculate()) : documentSkeleton.getViewModel().getDataModel().updateDocumentDataPageSize(Number.POSITIVE_INFINITY);
25886
- const overflowRectangle = overflowCache.getValue(row, column);
25898
+ const overflowRectangle = overflowCache.getValue(row, col);
25887
25899
  if (!(wrapStrategy === WrapStrategy.WRAP && !overflowRectangle && vertexAngle === 0)) {
25888
25900
  const contentSize = getDocsSkeletonPageSize(documentSkeleton), documentStyle = documentSkeleton.getViewModel().getDataModel().getSnapshot().documentStyle;
25889
25901
  if (contentSize && documentStyle) {
@@ -26232,7 +26244,7 @@ const UNIQUE_KEY$2 = "DefaultDocsBorderExtension", _Border = class _Border exten
26232
26244
  __name(_Border, "Border");
26233
26245
  let Border = _Border;
26234
26246
  DocumentsSpanAndLineExtensionRegistry.add(new Border());
26235
- const SHAPE_OBJECT_ARRAY = [
26247
+ const BASE_OBJECT_ARRAY_Set = new Set(BASE_OBJECT_ARRAY), SHAPE_OBJECT_ARRAY = [
26236
26248
  "hoverCursor",
26237
26249
  "moveCursor",
26238
26250
  "fillRule",
@@ -26410,7 +26422,7 @@ const SHAPE_OBJECT_ARRAY = [
26410
26422
  return themeKeys.length === 0 ? this : (themeKeys.forEach((key) => {
26411
26423
  if (props[key] === void 0)
26412
26424
  return !0;
26413
- BASE_OBJECT_ARRAY.indexOf(key) === -1 && (this[`_${key}`] = props[key]);
26425
+ BASE_OBJECT_ARRAY_Set.has(key) || (this[`_${key}`] = props[key]);
26414
26426
  }), this.makeDirty(!0), this);
26415
26427
  }
26416
26428
  toJson() {
@@ -26432,10 +26444,15 @@ const SHAPE_OBJECT_ARRAY = [
26432
26444
  return;
26433
26445
  const transformState = {};
26434
26446
  let hasTransformState = !1;
26447
+ const hasRotateEnabled = (props == null ? void 0 : props.rotateEnabled) !== void 0, hasResizeEnabled = (props == null ? void 0 : props.resizeEnabled) !== void 0;
26448
+ if (hasRotateEnabled || hasResizeEnabled) {
26449
+ const transformerConfig = this.transformerConfig || {};
26450
+ hasRotateEnabled && (transformerConfig.rotateEnabled = props == null ? void 0 : props.rotateEnabled), hasResizeEnabled && (transformerConfig.resizeEnabled = props == null ? void 0 : props.resizeEnabled), this.transformerConfig = { ...transformerConfig };
26451
+ }
26435
26452
  themeKeys.forEach((key) => {
26436
26453
  if (props[key] === void 0)
26437
26454
  return !0;
26438
- BASE_OBJECT_ARRAY.indexOf(key) > -1 ? (transformState[key] = props[key], hasTransformState = !0) : this[`_${key}`] = props[key];
26455
+ BASE_OBJECT_ARRAY_Set.has(key) ? (transformState[key] = props[key], hasTransformState = !0) : this[`_${key}`] = props[key];
26439
26456
  }), hasTransformState && this.transformByState(transformState), this.makeDirty(!0);
26440
26457
  }
26441
26458
  };
@@ -27907,9 +27924,10 @@ const UNIQUE_KEY$1 = "DefaultDocsFontAndBaseLineExtension", DOC_EXTENSION_Z_INDE
27907
27924
  else {
27908
27925
  const CHECKED_GLYPH = "☑";
27909
27926
  if ((content === "☐" || content === CHECKED_GLYPH) && glyph.glyphType === GlyphType.LIST) {
27910
- ctx.save();
27911
27927
  const size = Math.ceil(((_b = (_a10 = glyph.ts) == null ? void 0 : _a10.fs) != null ? _b : 12) * 1.2);
27912
- ctx.translate(spanPointWithFont.x, spanPointWithFont.y - size), Checkbox.drawWith(ctx, {
27928
+ ctx.save();
27929
+ const fontHeight = glyph.bBox.aba - glyph.bBox.abd, bottom = spanPointWithFont.y, top = bottom - fontHeight, left = spanPointWithFont.x, topOffset = top + (bottom - top - size) / 2, leftOffset = left, BORDER_WIDTH = 1;
27930
+ ctx.translate(leftOffset - BORDER_WIDTH / 2, topOffset - BORDER_WIDTH / 2), Checkbox.drawWith(ctx, {
27913
27931
  width: size,
27914
27932
  height: size,
27915
27933
  checked: content === CHECKED_GLYPH
@@ -27934,11 +27952,11 @@ const UNIQUE_KEY = "DefaultDocsLineExtension", DOC_EXTENSION_Z_INDEX = 40, _Line
27934
27952
  }
27935
27953
  draw(ctx, parentScale, glyph) {
27936
27954
  var _a10;
27937
- const line2 = (_a10 = glyph.parent) == null ? void 0 : _a10.parent, { ts: textStyle, bBox, content } = glyph;
27955
+ const line2 = (_a10 = glyph.parent) == null ? void 0 : _a10.parent, { renderConfig } = this.extensionOffset, vertexAngle = (renderConfig == null ? void 0 : renderConfig.vertexAngle) || 0, drawStrikeAndUnderline = !(((renderConfig == null ? void 0 : renderConfig.centerAngle) || 0) === 0 && vertexAngle !== 0 && vertexAngle % 90 === 0), { ts: textStyle, bBox, content } = glyph;
27938
27956
  if (line2 == null || textStyle == null || content === "\r")
27939
27957
  return;
27940
27958
  const { asc, dsc } = line2, { sp: strikeoutPosition, spo, sbo, bd } = bBox, scale = getScale(parentScale), DELTA = 0.5, { ul: underline, st: strikethrough, ol: overline, va: baselineOffset, bbl: bottomBorderLine } = textStyle;
27941
- if (underline) {
27959
+ if (drawStrikeAndUnderline && underline) {
27942
27960
  const startY = asc + dsc;
27943
27961
  this._drawLine(ctx, glyph, underline, startY, scale);
27944
27962
  }
@@ -27946,7 +27964,7 @@ const UNIQUE_KEY = "DefaultDocsLineExtension", DOC_EXTENSION_Z_INDEX = 40, _Line
27946
27964
  const startY = asc + dsc + 3;
27947
27965
  this._drawLine(ctx, glyph, bottomBorderLine, startY, scale, 2);
27948
27966
  }
27949
- if (strikethrough) {
27967
+ if (drawStrikeAndUnderline && strikethrough) {
27950
27968
  let startY = asc + bd - strikeoutPosition - DELTA;
27951
27969
  baselineOffset === BaselineOffset.SUPERSCRIPT ? startY -= spo : baselineOffset === BaselineOffset.SUBSCRIPT && (startY += sbo), this._drawLine(ctx, glyph, strikethrough, startY, scale);
27952
27970
  }
@@ -29428,6 +29446,7 @@ const _ThinEngine = class _ThinEngine extends Disposable {
29428
29446
  __name(_ThinEngine, "ThinEngine");
29429
29447
  let ThinEngine = _ThinEngine;
29430
29448
  const _Engine = class _Engine extends ThinEngine {
29449
+ // unitId
29431
29450
  constructor(elemWidth = 1, elemHeight = 1, pixelRatio, mode) {
29432
29451
  super();
29433
29452
  __publicField(this, "renderEvenInBackground", !0);
@@ -29479,6 +29498,7 @@ const _Engine = class _Engine extends ThinEngine {
29479
29498
  __publicField(this, "_isUsingFirefox", navigator.userAgent.indexOf("Firefox") !== -1);
29480
29499
  __publicField(this, "_previousWidth", -1e3);
29481
29500
  __publicField(this, "_previousHeight", -1e3);
29501
+ __publicField(this, "_unitId", "");
29482
29502
  this._canvas = new Canvas({
29483
29503
  mode,
29484
29504
  width: elemWidth,
@@ -31322,7 +31342,7 @@ const TransformerManagerTypeArray = [
31322
31342
  }), this._transformerControlMap.clear();
31323
31343
  }
31324
31344
  _createControl(applyObject, isSkipOnCropper = !0) {
31325
- const { left = 0, top = 0, height = 0, width = 0 } = applyObject.getState(), angle = applyObject.angle, { isCropper, resizeEnabled, rotateAnchorOffset, rotateSize, rotateCornerRadius, borderEnabled, borderStroke, borderStrokeWidth, borderSpacing, enabledAnchors } = this._getConfig(applyObject);
31345
+ const { left = 0, top = 0, height = 0, width = 0 } = applyObject.getState(), angle = applyObject.angle, { isCropper, resizeEnabled, rotateEnabled, rotateAnchorOffset, rotateSize, rotateCornerRadius, borderEnabled, borderStroke, borderStrokeWidth, borderSpacing, enabledAnchors } = this._getConfig(applyObject);
31326
31346
  if (isSkipOnCropper && isCropper)
31327
31347
  return;
31328
31348
  const oKey = applyObject.oKey, zIndex = this._selectedObjectMap.size + applyObject.maxZIndex + DEFAULT_CONTROL_PLUS_INDEX, layerIndex = applyObject.getLayerIndex() || DEFAULT_TRANSFORMER_LAYER_INDEX, groupElements = [];
@@ -31342,29 +31362,32 @@ const TransformerManagerTypeArray = [
31342
31362
  height,
31343
31363
  width,
31344
31364
  applyObject
31345
- ), rotateLine = new Rect(`__SpreadsheetTransformerRotateLine___${zIndex}`, {
31346
- zIndex: zIndex - 1,
31347
- evented: !1,
31348
- left: lineLeft,
31349
- top: lineTop,
31350
- height: rotateAnchorOffset,
31351
- width: 1,
31352
- strokeWidth: borderStrokeWidth,
31353
- stroke: borderStroke
31354
- }), { left: left2, top: top2 } = this._getRotateAnchorPosition("__SpreadsheetTransformerRotate__", height, width, applyObject), cursor = this._getRotateAnchorCursor(
31355
- "__SpreadsheetTransformerRotate__"
31356
- /* ROTATE */
31357
- ), rotate = new Rect(`__SpreadsheetTransformerRotate___${zIndex}`, {
31358
- zIndex: zIndex - 1,
31359
- left: left2,
31360
- top: top2,
31361
- height: rotateSize,
31362
- width: rotateSize,
31363
- radius: rotateCornerRadius,
31364
- strokeWidth: borderStrokeWidth * 2,
31365
- stroke: borderStroke
31366
- });
31367
- this._attachEventToRotate(rotate, applyObject), this._attachHover(rotate, cursor, CURSOR_TYPE.DEFAULT), groupElements.push(rotateLine, rotate);
31365
+ );
31366
+ if (rotateEnabled) {
31367
+ const rotateLine = new Rect(`__SpreadsheetTransformerRotateLine___${zIndex}`, {
31368
+ zIndex: zIndex - 1,
31369
+ evented: !1,
31370
+ left: lineLeft,
31371
+ top: lineTop,
31372
+ height: rotateAnchorOffset,
31373
+ width: 1,
31374
+ strokeWidth: borderStrokeWidth,
31375
+ stroke: borderStroke
31376
+ }), { left: left2, top: top2 } = this._getRotateAnchorPosition("__SpreadsheetTransformerRotate__", height, width, applyObject), cursor = this._getRotateAnchorCursor(
31377
+ "__SpreadsheetTransformerRotate__"
31378
+ /* ROTATE */
31379
+ ), rotate = new Rect(`__SpreadsheetTransformerRotate___${zIndex}`, {
31380
+ zIndex: zIndex - 1,
31381
+ left: left2,
31382
+ top: top2,
31383
+ height: rotateSize,
31384
+ width: rotateSize,
31385
+ radius: rotateCornerRadius,
31386
+ strokeWidth: borderStrokeWidth * 2,
31387
+ stroke: borderStroke
31388
+ });
31389
+ this._attachEventToRotate(rotate, applyObject), this._attachHover(rotate, cursor, CURSOR_TYPE.DEFAULT), groupElements.push(rotateLine, rotate);
31390
+ }
31368
31391
  }
31369
31392
  if (resizeEnabled)
31370
31393
  for (let i = 0, len = enabledAnchors.length; i < len; i++) {
@@ -19,6 +19,7 @@ interface ICanvasProps {
19
19
  height?: number;
20
20
  pixelRatio?: number;
21
21
  mode?: CanvasRenderMode;
22
+ id?: string;
22
23
  }
23
24
  /**
24
25
  * View Renderer constructor. It is a wrapper around native canvas element.
@@ -48,6 +49,7 @@ export declare class Canvas {
48
49
  getPixelRatio(): number;
49
50
  getWidth(): number;
50
51
  getHeight(): number;
52
+ setId(id: string): void;
51
53
  setSize(width?: number, height?: number, pixelRatioParam?: number): void;
52
54
  setPixelRatio(pixelRatio: number): void;
53
55
  dispose(): void;
@@ -1,7 +1,7 @@
1
1
  import { IScale } from '@univerjs/core';
2
- import { docExtension } from '../doc-extension';
3
2
  import { IDocumentSkeletonGlyph } from '../../../basics/i-document-skeleton-cached';
4
3
  import { UniverRenderingContext } from '../../../context';
4
+ import { docExtension } from '../doc-extension';
5
5
  export declare class FontAndBaseLine extends docExtension {
6
6
  uKey: string;
7
7
  Z_INDEX: number;
@@ -28,8 +28,15 @@ export declare class Font extends SheetExtension {
28
28
  Z_INDEX: number;
29
29
  getDocuments(): any;
30
30
  draw(ctx: UniverRenderingContext, parentScale: IScale, spreadsheetSkeleton: SpreadsheetSkeleton, diffRanges: IRange[], moreBoundsInfo: IDrawInfo): void;
31
- renderFontEachCell(renderFontContext: IRenderFontContext, row: number, col: number, fontMatrix: ObjectMatrix<IFontCacheItem>): true | undefined;
32
- private _clipTextOverflow;
31
+ renderFontEachCell(renderFontCtx: IRenderFontContext, row: number, col: number, fontMatrix: ObjectMatrix<IFontCacheItem>): true | undefined;
32
+ /**
33
+ * Change font render bounds, for overflow and filter icon & custom render.
34
+ * @param renderFontContext
35
+ * @param row
36
+ * @param col
37
+ * @param fontMatrix
38
+ */
39
+ private _setFontRenderBounds;
33
40
  private _renderDocuments;
34
41
  private _clipRectangleForOverflow;
35
42
  }
@@ -54,6 +54,7 @@ export declare class Engine extends ThinEngine<Scene> {
54
54
  private _isUsingFirefox;
55
55
  private _previousWidth;
56
56
  private _previousHeight;
57
+ private _unitId;
57
58
  constructor(elemWidth?: number, elemHeight?: number, pixelRatio?: number, mode?: CanvasRenderMode);
58
59
  _init(): void;
59
60
  get elapsedTime(): number;
@@ -1,11 +1,11 @@
1
- import { Disposable, Injector, IUniverInstanceService, UniverInstanceType, Dependency, DependencyIdentifier, IDisposable, Nullable, UnitModel, UnitType } from '@univerjs/core';
1
+ import { Dependency, DependencyIdentifier, IDisposable, Nullable, UnitModel, UnitType, Disposable, Injector, IUniverInstanceService, UniverInstanceType } from '@univerjs/core';
2
2
  import { Observable } from 'rxjs';
3
- import { Engine } from '../engine';
4
- import { IRender, RenderUnit } from './render-unit';
5
3
  import { BaseObject } from '../base-object';
6
4
  import { DocComponent } from '../components/docs/doc-component';
7
5
  import { SheetComponent } from '../components/sheets/sheet-component';
8
6
  import { Slide } from '../components/slides/slide';
7
+ import { Engine } from '../engine';
8
+ import { IRender, RenderUnit } from './render-unit';
9
9
  export type RenderComponentType = SheetComponent | DocComponent | Slide | BaseObject;
10
10
  export interface IRenderManagerService extends IDisposable {
11
11
  /** @deprecated */
@@ -1,9 +1,9 @@
1
1
  import { Nullable, Disposable } from '@univerjs/core';
2
2
  import { BaseObject } from './base-object';
3
3
  import { IMouseEvent, IPointerEvent } from './basics/i-events';
4
- import { Group } from './group';
5
- import { Scene } from './scene';
6
4
  import { ITransformerConfig } from './basics/transformer-config';
5
+ import { Scene } from './scene';
6
+ import { Group } from './group';
7
7
  declare enum MoveObserverType {
8
8
  MOVE_START = 0,
9
9
  MOVING = 1,
@@ -1,7 +1,7 @@
1
1
  import { Nullable } from '@univerjs/core';
2
- import { ObjectType } from '../base-object';
3
- import { Shape, IShapeProps } from './shape';
4
2
  import { UniverRenderingContext } from '../context';
3
+ import { IShapeProps, Shape } from './shape';
4
+ import { ObjectType } from '../base-object';
5
5
  export interface IRectProps extends IShapeProps {
6
6
  radius?: number;
7
7
  visualHeight?: number;
@@ -1,12 +1,14 @@
1
1
  import { IOffset, IScale, ISize, Nullable } from '@univerjs/core';
2
- import { BaseObject, ObjectType } from '../base-object';
3
2
  import { IObjectFullState } from '../basics/interfaces';
4
3
  import { IViewportInfo, Vector2 } from '../basics/vector2';
5
4
  import { UniverRenderingContext } from '../context';
5
+ import { BaseObject, ObjectType } from '../base-object';
6
6
  export type LineJoin = 'round' | 'bevel' | 'miter';
7
7
  export type LineCap = 'butt' | 'round' | 'square';
8
8
  export type PaintFirst = 'fill' | 'stroke';
9
9
  export interface IShapeProps extends IObjectFullState, ISize, IOffset, IScale {
10
+ rotateEnabled?: boolean;
11
+ resizeEnabled?: boolean;
10
12
  hoverCursor?: Nullable<string>;
11
13
  moveCursor?: string | null;
12
14
  fillRule?: string;