@univerjs/engine-render 1.0.0-alpha.7 → 1.0.0-beta.0

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.
Files changed (126) hide show
  1. package/lib/af-DK_CjRn6.js +210 -0
  2. package/lib/as-BPtSu6VN.js +24 -0
  3. package/lib/be-CrQ0smca.js +24 -0
  4. package/lib/bg-CrQqGwni.js +24 -0
  5. package/lib/bn-NCLZcWHi.js +24 -0
  6. package/lib/ca-SUf6Y2Om.js +51 -0
  7. package/lib/cjs/index.js +2710 -2446
  8. package/lib/cop-C3sk0IUo.js +24 -0
  9. package/lib/cs-CmAteokq.js +30 -0
  10. package/lib/cu-CBUlrW6Y.js +45 -0
  11. package/lib/cy-BBPa6z2x.js +24 -0
  12. package/lib/da-CCDXfXtG.js +24 -0
  13. package/lib/de-1901-CWoAOigE.js +24 -0
  14. package/lib/de-1996-BL6awyxG.js +24 -0
  15. package/lib/de-ch-1901-hVThVHVb.js +24 -0
  16. package/lib/el-monoton-D3aKqTz2.js +24 -0
  17. package/lib/el-polyton-ogVWcTzh.js +24 -0
  18. package/lib/en-gb-B7Al27b_.js +34 -0
  19. package/lib/es/index.js +2696 -2446
  20. package/lib/es-DcaaHPU_.js +24 -0
  21. package/lib/et-B_spaleu.js +24 -0
  22. package/lib/eu-Ctv_kq9Z.js +24 -0
  23. package/lib/fi-RW5VB8Yp.js +24 -0
  24. package/lib/fr-BC2onEz9.js +24 -0
  25. package/lib/fur-AC12wySk.js +24 -0
  26. package/lib/ga-Cn6LkudM.js +71 -0
  27. package/lib/gl-DZGc-K_G.js +24 -0
  28. package/lib/grc-DOlGgO8T.js +24 -0
  29. package/lib/gu-Bjl0l-cf.js +24 -0
  30. package/lib/hi-DsAaTPCC.js +24 -0
  31. package/lib/hr-DT1SBBes.js +24 -0
  32. package/lib/hsb-DC_ITc1e.js +59 -0
  33. package/lib/hu-DVk7Y_ka.js +24 -0
  34. package/lib/hy-e995ysyO.js +24 -0
  35. package/lib/ia-Cr4TJH0c.js +35 -0
  36. package/lib/id-DifDyWg9.js +71 -0
  37. package/lib/index.js +32339 -0
  38. package/lib/is-BT8UVRze.js +24 -0
  39. package/lib/it-Bt_Meacx.js +24 -0
  40. package/lib/ka-jyoLzyDE.js +24 -0
  41. package/lib/kmr-Cfwhwuff.js +24 -0
  42. package/lib/kn-C6Lov-DP.js +24 -0
  43. package/lib/la-DuvHjUWw.js +24 -0
  44. package/lib/la-x-classic-yTyAOQEt.js +24 -0
  45. package/lib/la-x-liturgic-CXeQb4FY.js +24 -0
  46. package/lib/lt-BBe8DlDF.js +24 -0
  47. package/lib/lv-Q2BBHnzp.js +24 -0
  48. package/lib/ml-2xLVYkVY.js +24 -0
  49. package/lib/mn-cyrl-lHM4n0oC.js +24 -0
  50. package/lib/mn-cyrl-x-lmc-3aetruI8.js +24 -0
  51. package/lib/mr-CjWJPVmH.js +24 -0
  52. package/lib/mul-ethi-D_CMSMEq.js +24 -0
  53. package/lib/nb-DI8u59ch.js +135 -0
  54. package/lib/nl-BHQJ6Gvn.js +65 -0
  55. package/lib/nn-ntZvarUK.js +135 -0
  56. package/lib/no-B8ItS0F3.js +133 -0
  57. package/lib/oc-P_i3-xLA.js +24 -0
  58. package/lib/or-50rxpoq4.js +24 -0
  59. package/lib/pa-C54UG8eN.js +24 -0
  60. package/lib/pi-B9cgjyG1.js +24 -0
  61. package/lib/pl-9fg-ESVt.js +45 -0
  62. package/lib/pms-BRGfm5gS.js +24 -0
  63. package/lib/pt-Cum2_NUC.js +24 -0
  64. package/lib/rm-C0MIK9N4.js +24 -0
  65. package/lib/ro-0fmdH0HA.js +24 -0
  66. package/lib/ru-v4l-ayaq.js +209 -0
  67. package/lib/sa-CKY9c_Vq.js +24 -0
  68. package/lib/sh-cyrl-BpCRFOmq.js +141 -0
  69. package/lib/sh-latn-sRy4Tuaj.js +141 -0
  70. package/lib/sk-_iOeDNrQ.js +30 -0
  71. package/lib/sl-DpiklF-D.js +24 -0
  72. package/lib/sr-cyrl-Dpzrbd0W.js +155 -0
  73. package/lib/sv-CFm5y56M.js +24 -0
  74. package/lib/ta-BcghgTbD.js +24 -0
  75. package/lib/te-B5Spl2Jk.js +24 -0
  76. package/lib/th-DWX5iPSo.js +24 -0
  77. package/lib/tk-BMbKB10q.js +24 -0
  78. package/lib/tr-CIHIuzqc.js +24 -0
  79. package/lib/types/alignment-snap.d.ts +67 -0
  80. package/lib/types/base-object.d.ts +8 -0
  81. package/lib/types/basics/document-node-tools.d.ts +1 -0
  82. package/lib/types/basics/drawing-effect.d.ts +34 -0
  83. package/lib/types/basics/i-document-skeleton-cached.d.ts +7 -0
  84. package/lib/types/basics/i-events.d.ts +0 -6
  85. package/lib/types/basics/interfaces.d.ts +9 -0
  86. package/lib/types/basics/tools.d.ts +2 -22
  87. package/lib/types/components/docs/custom-block-render-viewport.d.ts +2 -0
  88. package/lib/types/components/docs/document.d.ts +4 -1
  89. package/lib/types/components/docs/extensions/line.d.ts +5 -1
  90. package/lib/types/components/docs/layout/block/paragraph/bullet.d.ts +2 -2
  91. package/lib/types/components/docs/layout/block/paragraph/layout-ruler.d.ts +1 -1
  92. package/lib/types/components/docs/layout/block/paragraph/shaping.d.ts +1 -1
  93. package/lib/types/components/docs/layout/doc-no-wrap-measure.d.ts +5 -0
  94. package/lib/types/components/docs/layout/doc-skeleton.d.ts +8 -0
  95. package/lib/types/components/docs/layout/line-breaker/enhancers/hyphen-enhancer.d.ts +2 -2
  96. package/lib/types/components/docs/layout/line-breaker/enhancers/link-enhancer.d.ts +2 -2
  97. package/lib/types/components/docs/layout/line-breaker/enhancers/whole-entity-enhancer.d.ts +33 -0
  98. package/lib/types/{basics/unit-convert.d.ts → components/docs/layout/line-breaker/extensions/east-asian-quote-linebreak-extension.d.ts} +2 -2
  99. package/lib/types/components/docs/layout/line-breaker/line-breaker.d.ts +1 -0
  100. package/lib/types/components/docs/layout/model/glyph.d.ts +15 -3
  101. package/lib/types/components/docs/layout/shaping-engine/font-cache.d.ts +0 -13
  102. package/lib/types/components/docs/layout/tools.d.ts +33 -1
  103. package/lib/types/components/docs/table-render-viewport.d.ts +2 -0
  104. package/lib/types/components/sheets/index.d.ts +2 -0
  105. package/lib/types/components/sheets/sheet.render-skeleton.d.ts +3 -94
  106. package/lib/types/components/sheets/spreadsheet.d.ts +4 -2
  107. package/lib/types/components/sheets/util.d.ts +10 -0
  108. package/lib/types/drawing-group.d.ts +4 -2
  109. package/lib/types/engine.d.ts +0 -7
  110. package/lib/types/index.d.ts +7 -3
  111. package/lib/types/plugin.d.ts +0 -7
  112. package/lib/types/render-manager/render-manager.service.d.ts +0 -21
  113. package/lib/types/scene.d.ts +1 -30
  114. package/lib/types/scene.input-manager.d.ts +1 -3
  115. package/lib/types/shape/index.d.ts +1 -0
  116. package/lib/types/shape/line.d.ts +50 -0
  117. package/lib/types/shape/scroll-bar.d.ts +6 -0
  118. package/lib/types/shape/shape.d.ts +7 -1
  119. package/lib/types/viewport.d.ts +1 -5
  120. package/lib/uk-Dir3oxLs.js +24 -0
  121. package/lib/umd/index.js +2 -3
  122. package/lib/zh-latn-pinyin-BdYb-Ey_.js +24 -0
  123. package/package.json +7 -9
  124. package/lib/types/components/docs/layout/shaping-engine/font-library.d.ts +0 -60
  125. package/lib/types/components/docs/layout/shaping-engine/text-shaping.d.ts +0 -34
  126. package/lib/types/services/render-config.service.d.ts +0 -28
@@ -13,7 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import type { ICellData, ICellDataForSheetInterceptor, ICellInfo, ICellWithCoord, IColAutoWidthInfo, IColumnRange, IDocumentData, IGetRowColByPosOptions, IPaddingData, IRange, IRowAutoHeightInfo, IRowRange, ISize, IStyleData, ITextRotation, Nullable, Styles, Worksheet } from '@univerjs/core';
16
+ import type { ICellDataForSheetInterceptor, ICellInfo, IColAutoWidthInfo, IColumnRange, IDocumentData, IPaddingData, IRange, IRowAutoHeightInfo, IRowRange, ISize, IStyleData, ITextRotation, Nullable, Styles, Worksheet } from '@univerjs/core';
17
17
  import type { IBoundRectNoAngle, IPoint, IViewportInfo } from '../../basics/vector2';
18
18
  import type { Scene } from '../../scene';
19
19
  import type { IFontCacheItem, IStylesCache } from './interfaces';
@@ -40,6 +40,7 @@ export declare const DEFAULT_PADDING_DATA: {
40
40
  };
41
41
  export declare const RENDER_RAW_FORMULA_KEY = "RENDER_RAW_FORMULA";
42
42
  export declare function getShrinkToFitScale(contentWidth: number, availableWidth: number, fontSize: number): number;
43
+ export declare function getGeneralNumberDisplayText(value: number, displayText: string, fontString: string, availableWidth: number): string;
43
44
  export declare function scaleDocumentDataForShrinkToFit(documentData: IDocumentData, scale: number, fallbackFontSize: number): IDocumentData;
44
45
  export interface ICacheItem {
45
46
  bg: boolean;
@@ -98,10 +99,6 @@ export declare class SpreadsheetSkeleton extends SheetSkeleton {
98
99
  get showGridlines(): BooleanNumber;
99
100
  get gridlinesColor(): string | undefined;
100
101
  dispose(): void;
101
- /**
102
- * @deprecated should never expose a property that is provided by another module!
103
- */
104
- getStyles(): Styles;
105
102
  setOverflowCache(value: ObjectMatrix<IRange>): void;
106
103
  getFont(rowIndex: number, columnIndex: number): Nullable<IFontCacheItem>;
107
104
  /**
@@ -145,11 +142,6 @@ export declare class SpreadsheetSkeleton extends SheetSkeleton {
145
142
  * @returns {number} currColWidth
146
143
  */
147
144
  _getMeasuredWidthByCell(cell: ICellDataForSheetInterceptor, row: number, column: number, currColWidth: number): number;
148
- /**
149
- * @deprecated use `getRangeByViewport` instead.
150
- * @param bounds
151
- */
152
- getRangeByBounding(bounds?: IViewportInfo): IRange;
153
145
  getRangeByViewport(vpInfo?: IViewportInfo): IRange;
154
146
  getCacheRangeByViewport(vpInfo?: IViewportInfo, isPrinting?: boolean): IRange;
155
147
  getRangeByViewBound(bound?: IBoundRectNoAngle): IRange;
@@ -157,77 +149,7 @@ export declare class SpreadsheetSkeleton extends SheetSkeleton {
157
149
  getOverflowPosition(contentSize: Required<ISize>, horizontalAlign: HorizontalAlign, row: number, column: number, columnCount: number): IColumnRange;
158
150
  private _isOverflowBlockedByAdjacentCell;
159
151
  private _isOverflowSideBlocked;
160
- /**
161
- * Get cell by pos(offsetX, offsetY).
162
- * @deprecated Please use `getCellWithCoordByOffset` instead.
163
- */
164
- calculateCellIndexByPosition(offsetX: number, offsetY: number, scaleX: number, scaleY: number, scrollXY: {
165
- x: number;
166
- y: number;
167
- }): Nullable<ICellWithCoord>;
168
- /**
169
- * This method has the same implementation as `getCellIndexByOffset`,
170
- * but uses a different name to maintain backward compatibility with previous calls.
171
- *
172
- * @deprecated Please use `getCellIndexByOffset` method instead.
173
- */
174
- getCellPositionByOffset(offsetX: number, offsetY: number, scaleX: number, scaleY: number, scrollXY: {
175
- x: number;
176
- y: number;
177
- }, options?: IGetRowColByPosOptions): {
178
- row: number;
179
- column: number;
180
- };
181
152
  getCellWithMergeInfoByIndex(row: number, column: number): Nullable<ICellInfo>;
182
- /**
183
- * Same as getColumnIndexByOffsetX
184
- * @deprecated Please use `getColumnIndexByOffsetX` method instead.
185
- */
186
- getColumnPositionByOffsetX(offsetX: number, scaleX: number, scrollXY: {
187
- x: number;
188
- y: number;
189
- }, options?: IGetRowColByPosOptions): number;
190
- /**
191
- * Same as getRowIndexByOffsetY
192
- * @deprecated Please use `getRowIndexByOffsetY` method instead.
193
- */
194
- getRowPositionByOffsetY(offsetY: number, scaleY: number, scrollXY: {
195
- x: number;
196
- y: number;
197
- }, options?: IGetRowColByPosOptions): number;
198
- /**
199
- * Same as getCellWithCoordByIndex, but uses a different name to maintain backward compatibility with previous calls.
200
- * @deprecated Please use `getCellWithCoordByIndex` instead.
201
- */
202
- getCellByIndex(row: number, column: number): ICellWithCoord;
203
- /**
204
- * @deprecated Please use `getCellWithCoordByIndex(row, col, false)` instead.
205
- * @param row
206
- * @param column
207
- */
208
- getCellByIndexWithNoHeader(row: number, column: number): ICellWithCoord;
209
- /**
210
- * Only used for cell edit, and no need to rotate text when edit cell content!
211
- * @deprecated use same method in worksheet.
212
- * @param cell
213
- */
214
- getBlankCellDocumentModel(cell: Nullable<ICellData>): IDocumentLayoutObject;
215
- /**
216
- * Only used for cell edit, and no need to rotate text when edit cell content!
217
- * @deprecated use same method in worksheet.
218
- * @param cell
219
- */
220
- getCellDocumentModelWithFormula(cell: ICellData): Nullable<IDocumentLayoutObject>;
221
- /**
222
- * This method generates a document model based on the cell's properties and handles the associated styles and configurations.
223
- * If the cell does not exist, it will return null.
224
- *
225
- * @deprecated use same method in worksheet.
226
- * PS: This method has significant impact on performance.
227
- * @param cell
228
- * @param options
229
- */
230
- private _getCellDocumentModel;
231
153
  /**
232
154
  * Calculate the overflow of cell text. If there is no value on either side of the cell,
233
155
  * the text content of this cell can be drawn to both sides, not limited by the cell's width.
@@ -256,6 +178,7 @@ export declare class SpreadsheetSkeleton extends SheetSkeleton {
256
178
  _setBorderStylesCache(row: number, col: number, style: Nullable<IStyleData>, options: ISetStylesCacheForOneCellOptions | undefined): void;
257
179
  _setBgStylesCache(row: number, col: number, style: Nullable<IStyleData>, options: ISetStylesCacheForOneCellOptions | undefined): void;
258
180
  private _applyShrinkToFit;
181
+ private _applyGeneralNumberDisplay;
259
182
  _setFontStylesCache(row: number, col: number, cellData: Nullable<ICellDataForSheetInterceptor>, style: IStyleData, hasMergeData?: boolean): void;
260
183
  /**
261
184
  * Set border background and font to this._stylesCache cell by cell.
@@ -275,20 +198,6 @@ export declare class SpreadsheetSkeleton extends SheetSkeleton {
275
198
  rowStartY(row: number): number;
276
199
  getHiddenRowsInRange(range: IRowRange): number[];
277
200
  getHiddenColumnsInRange(range: IColumnRange): number[];
278
- /**
279
- * @deprecated use function `convertTransformToOffsetX` in same package.
280
- */
281
- convertTransformToOffsetX(offsetX: number, scaleX: number, scrollXY: {
282
- x: number;
283
- y: number;
284
- }): number;
285
- /**
286
- * @deprecated use function `convertTransformToOffsetY` in same package.
287
- */
288
- convertTransformToOffsetY(offsetY: number, scaleY: number, scrollXY: {
289
- x: number;
290
- y: number;
291
- }): number;
292
201
  }
293
202
  /**
294
203
  * convert canvas content position to physical position in screen
@@ -48,7 +48,7 @@ export declare class Spreadsheet extends SheetComponent {
48
48
  * @param ctx
49
49
  * @param viewportInfo
50
50
  */
51
- draw(ctx: UniverRenderingContext2D, viewportInfo: IViewportInfo): void;
51
+ draw(ctx: UniverRenderingContext2D, viewportInfo: IViewportInfo, isMergeRepair?: boolean): void;
52
52
  addRenderFrameTimeMetricToScene(timeKey: string, val: number, scene: Scene): void;
53
53
  addRenderTagToScene(renderKey: string, val: any, scene?: Scene): void;
54
54
  /**
@@ -77,7 +77,9 @@ export declare class Spreadsheet extends SheetComponent {
77
77
  makeDirty(state?: boolean): this;
78
78
  setDirtyArea(dirtyBounds: IBoundRectNoAngle[]): void;
79
79
  renderByViewports(mainCtx: UniverRenderingContext2D, viewportInfo: IViewportInfo, spreadsheetSkeleton: SpreadsheetSkeleton): void;
80
- paintNewAreaForScrolling(viewportInfo: IViewportInfo, param: IPaintForScrolling): void;
80
+ private _getMergeRepairBounds;
81
+ private _getRepaintBounds;
82
+ paintNewAreaForScrolling(viewportInfo: IViewportInfo, param: IPaintForScrolling, mergeRepairBounds?: IBoundRectNoAngle[]): void;
81
83
  /**
82
84
  * Redraw the entire viewport.
83
85
  */
@@ -14,7 +14,17 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import type { CellValueType, IPaddingData, IStyleBase, IStyleData, ITextRotation, ITextStyle, Nullable, TextDirection } from '@univerjs/core';
17
+ import type { IBoundRectNoAngle } from '../../basics';
17
18
  import { DocumentDataModel, HorizontalAlign, VerticalAlign, WrapStrategy } from '@univerjs/core';
19
+ export interface ICellImageRectConfig {
20
+ cellRect: IBoundRectNoAngle;
21
+ imageWidth: number;
22
+ imageHeight: number;
23
+ horizontalAlign: HorizontalAlign;
24
+ verticalAlign: VerticalAlign;
25
+ padding?: Nullable<IPaddingData>;
26
+ }
27
+ export declare function calculateCellImageRect(config: ICellImageRectConfig): IBoundRectNoAngle;
18
28
  export interface ICellStyle {
19
29
  textRotation?: ITextRotation;
20
30
  textDirection?: Nullable<TextDirection>;
@@ -13,7 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import type { IGroupBaseBound } from '@univerjs/core';
16
+ import type { IGlowEffect, IGroupBaseBound } from '@univerjs/core';
17
17
  import type { BaseObject } from './base-object';
18
18
  import type { IViewportInfo, Vector2 } from './basics';
19
19
  import type { UniverRenderingContext } from './context';
@@ -34,8 +34,10 @@ export declare class DrawingGroupObject extends Group {
34
34
  * When rendering, positions are mapped from baseBound space to the group's current transform.
35
35
  */
36
36
  private _baseBound;
37
- private _outerShadow?;
37
+ protected _outerShadow?: IDrawingGroupShadow;
38
+ private _glow?;
38
39
  setOuterShadow(shadow?: IDrawingGroupShadow): void;
40
+ setGlow(glow?: IGlowEffect): void;
39
41
  /**
40
42
  * Set the baseBound (chOff/chExt in OOXML) for this group.
41
43
  * This defines the coordinate space of children within the group.
@@ -126,13 +126,6 @@ export declare class Engine extends Disposable {
126
126
  * Unmount the canvas without disposing it so it can be mounted again.
127
127
  */
128
128
  unmount(): void;
129
- /**
130
- * Mount the canvas to the element so it would be rendered on UI.
131
- * @deprecated Please use `mount` instead.
132
- * @param {HTMLElement} element - The element the canvas will mount on.
133
- * @param {true} [resize] If should perform resize when mounted and observe resize event.
134
- */
135
- setContainer(element: HTMLElement, resize?: boolean): void;
136
129
  private _clearResizeListener;
137
130
  resize(): void;
138
131
  dprChange(): void;
@@ -13,8 +13,12 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+ export { AlignmentSnapSession, getAlignmentRectXAnchors, getAlignmentRectYAnchors, getClosestAlignmentOffset, normalizeAlignmentRect, } from './alignment-snap';
17
+ export type { AlignmentSnapAxis, IAlignmentRect, IAlignmentSnapAxisOptions, IAlignmentSnapAxisResult, IAlignmentSnapGuide, IAlignmentSnapSessionConfig, } from './alignment-snap';
16
18
  export * from './base-object';
17
19
  export * from './basics';
20
+ export { combineDrawingEffectFilter, createDrawingEffectFilter, expandDrawingEffectBounds, resolveDrawingEffectMasks, resolveGlowEffect, resolveOuterShadowEffect, } from './basics/drawing-effect';
21
+ export type { IResolvedDrawingShadow } from './basics/drawing-effect';
18
22
  export { getOffsetRectForDom } from './basics/position';
19
23
  export * from './canvas';
20
24
  export * from './components';
@@ -25,7 +29,7 @@ export { Documents } from './components/docs/document';
25
29
  export type { IPageRenderConfig } from './components/docs/document';
26
30
  export type { IDocumentOffsetConfig } from './components/docs/document';
27
31
  export { getTableIdAndSliceIndex } from './components/docs/layout/block/table';
28
- export { measureDocumentNoWrapTextRangeWidth, measureDocumentNoWrapTextWidth, measureDocumentUnbreakableTextWidth, } from './components/docs/layout/doc-no-wrap-measure';
32
+ export { measureDocumentNoWrapTextRangeWidth, measureDocumentNoWrapTextWidth, measureDocumentUnbreakableTextWidth, measureDocumentWrappedTextWidth, } from './components/docs/layout/doc-no-wrap-measure';
29
33
  export * from './components/docs/layout/doc-simple-skeleton';
30
34
  export { DocumentSkeleton } from './components/docs/layout/doc-skeleton';
31
35
  export type { IFindNodeRestrictions } from './components/docs/layout/doc-skeleton';
@@ -34,7 +38,7 @@ export type { IDocumentSkeletonColumnPagePathInfo, IDocumentSkeletonLineContext,
34
38
  export { getLastColumn } from './components/docs/layout/tools';
35
39
  export { Liquid } from './components/docs/liquid';
36
40
  export type { DocsTableRenderViewportProvider, IDocsTableRenderViewport, } from './components/docs/table-render-viewport';
37
- export { getDocsTableRenderViewport, setDocsTableRenderViewportProvider, } from './components/docs/table-render-viewport';
41
+ export { getDocsTableRenderViewport, getDocsTableViewportLeft, setDocsTableRenderViewportProvider, } from './components/docs/table-render-viewport';
38
42
  export { DataStreamTreeNode } from './components/docs/view-model/data-stream-tree-node';
39
43
  export { DocumentViewModel } from './components/docs/view-model/document-view-model';
40
44
  export { DocumentEditArea } from './components/docs/view-model/document-view-model';
@@ -48,7 +52,7 @@ export type { IDrawingGroupShadow } from './drawing-group';
48
52
  export * from './engine';
49
53
  export * from './group';
50
54
  export * from './layer';
51
- export { IRenderingEngine, UniverRenderEnginePlugin } from './plugin';
55
+ export { UniverRenderEnginePlugin } from './plugin';
52
56
  export { getCurrentTypeOfRenderer, IRenderManagerService, RenderManagerService, withCurrentTypeOfRenderer, } from './render-manager/render-manager.service';
53
57
  export { type RenderComponentType } from './render-manager/render-manager.service';
54
58
  export { RenderUnit } from './render-manager/render-unit';
@@ -15,13 +15,6 @@
15
15
  */
16
16
  import type { IUniverEngineRenderConfig } from './config/config';
17
17
  import { IConfigService, Injector, Plugin } from '@univerjs/core';
18
- import { Engine } from './engine';
19
- /**
20
- * The global rendering engine.
21
- *
22
- * @deprecated There will be no more default global render engine in the future.
23
- */
24
- export declare const IRenderingEngine: import("@wendellhu/redi").IdentifierDecorator<Engine>;
25
18
  export declare class UniverRenderEnginePlugin extends Plugin {
26
19
  private readonly _config;
27
20
  readonly _injector: Injector;
@@ -33,12 +33,6 @@ export interface IRenderManagerService extends IDisposable {
33
33
  */
34
34
  createRender(unitId: string, createUnitOptions?: ICreateUnitOptions): IRender;
35
35
  removeRender(unitId: string): void;
36
- /**
37
- * @deprecated use getRenderUnitById instead
38
- * Get RenderUnit By Id, RenderUnit implements IRender
39
- * @param unitId
40
- */
41
- getRenderById(unitId: string): Nullable<IRender>;
42
36
  /**
43
37
  * Get RenderUnit By Id, RenderUnit implements IRender
44
38
  * @param unitId
@@ -47,10 +41,6 @@ export interface IRenderManagerService extends IDisposable {
47
41
  getAllRenderersOfType(type: UniverInstanceType): RenderUnit[];
48
42
  getRenderAll(): Map<string, IRender>;
49
43
  defaultEngine: Engine;
50
- /** @deprecated */
51
- createRender$: Observable<string>;
52
- /** @deprecated this design is very very weird! Remove it. */
53
- create(unitId: string): void;
54
44
  created$: Observable<IRender>;
55
45
  disposed$: Observable<string>;
56
46
  has(unitId: string): boolean;
@@ -67,9 +57,6 @@ export declare class RenderManagerService extends Disposable implements IRenderM
67
57
  private readonly _themeService;
68
58
  private _defaultEngine;
69
59
  private _renderMap;
70
- private readonly _createRender$;
71
- /** @deprecated */
72
- readonly createRender$: Observable<string>;
73
60
  private readonly _renderCreated$;
74
61
  readonly created$: Observable<IRender>;
75
62
  private readonly _renderDisposed$;
@@ -92,7 +79,6 @@ export declare class RenderManagerService extends Disposable implements IRenderM
92
79
  */
93
80
  private _getRenderDepsByType;
94
81
  private _initDarkModeListener;
95
- create(unitId: string): void;
96
82
  /**
97
83
  * create renderUnit & init deps from renderDependencies
98
84
  * @param unitId
@@ -118,13 +104,6 @@ export declare class RenderManagerService extends Disposable implements IRenderM
118
104
  private _addRenderUnit;
119
105
  removeRender(unitId: string): void;
120
106
  has(unitId: string): boolean;
121
- /**
122
- * @deprecated use getRenderUnitById instead
123
- * Get RenderUnit from this._renderMap.
124
- * @param unitId
125
- * @returns RenderUnit, aka IRender
126
- */
127
- getRenderById(unitId: string): Nullable<IRender>;
128
107
  getRenderUnitById(unitId: string): Nullable<IRender>;
129
108
  getRenderAll(): Map<string, IRender>;
130
109
  private _disposeItem;
@@ -15,7 +15,7 @@
15
15
  */
16
16
  import type { Nullable } from '@univerjs/core';
17
17
  import type { BaseObject } from './base-object';
18
- import type { IDragEvent, IKeyboardEvent, IMouseEvent, IPointerEvent, IWheelEvent } from './basics/i-events';
18
+ import type { IDragEvent, IMouseEvent, IPointerEvent, IWheelEvent } from './basics/i-events';
19
19
  import type { ISceneTransformState, ITransformChangeState } from './basics/interfaces';
20
20
  import type { ITransformerConfig } from './basics/transformer-config';
21
21
  import type { Vector2 } from './basics/vector2';
@@ -77,14 +77,6 @@ export declare class Scene extends Disposable {
77
77
  onDblclick$: EventSubject<IMouseEvent | IPointerEvent>;
78
78
  onTripleClick$: EventSubject<IMouseEvent | IPointerEvent>;
79
79
  onMouseWheel$: EventSubject<IWheelEvent>;
80
- /**
81
- * @deprecated use `fromGlobalEvent('keydown')` from rx.js instead.
82
- */
83
- onKeyDown$: EventSubject<IKeyboardEvent>;
84
- /**
85
- * @deprecated use `fromGlobalEvent('keyup')` from rx.js instead.
86
- */
87
- onKeyUp$: EventSubject<IKeyboardEvent>;
88
80
  private _beforeRender$;
89
81
  readonly beforeRender$: import("rxjs").Observable<Nullable<Canvas>>;
90
82
  private _afterRender$;
@@ -137,12 +129,6 @@ export declare class Scene extends Disposable {
137
129
  resetCursor(): void;
138
130
  setCursor(val: CURSOR_TYPE): void;
139
131
  setDefaultCursor(val: CURSOR_TYPE): void;
140
- /**
141
- * @deprecated use transformByState instead.
142
- * @param width
143
- * @param height
144
- */
145
- resize(width?: number, height?: number): this;
146
132
  /**
147
133
  * Unlike @scale, this method doesn't emit event.
148
134
  * @param scaleX
@@ -252,15 +238,6 @@ export declare class Scene extends Disposable {
252
238
  */
253
239
  findViewportByPosToScene(coord: Vector2): Viewport | undefined;
254
240
  getActiveViewportByCoord(coord: Vector2): Viewport | undefined;
255
- /**
256
- * @deprecated use `getScrollXYInfoByViewport` instead.
257
- * @param pos
258
- * @param viewPort
259
- */
260
- getVpScrollXYInfoByPosToVp(pos: Vector2, viewPort?: Viewport): {
261
- x: number;
262
- y: number;
263
- };
264
241
  /**
265
242
  * getViewportScrollXYInfo by viewport under cursor position
266
243
  * prev getScrollXYByRelativeCoords
@@ -276,12 +253,6 @@ export declare class Scene extends Disposable {
276
253
  x: number;
277
254
  y: number;
278
255
  };
279
- /**
280
- * @deprecated use `getCoordRelativeToViewport` instead
281
- * @param coord
282
- * @returns
283
- */
284
- getRelativeToViewportCoord(coord: Vector2): Vector2;
285
256
  /**
286
257
  * Get coord to active viewport.
287
258
  * In a nested scene scenario, it is necessary to obtain the relative offsets layer by layer.
@@ -14,7 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import type { BaseObject } from './base-object';
17
- import type { IDragEvent, IKeyboardEvent, IMouseEvent, IPointerEvent, IWheelEvent } from './basics/i-events';
17
+ import type { IDragEvent, IMouseEvent, IPointerEvent, IWheelEvent } from './basics/i-events';
18
18
  import type { ISceneInputControlOptions, Scene } from './scene';
19
19
  import { Disposable } from '@univerjs/core';
20
20
  export declare class InputManager extends Disposable {
@@ -55,8 +55,6 @@ export declare class InputManager extends Disposable {
55
55
  _onPointerCancel(evt: IPointerEvent): void;
56
56
  _onPointerOut(evt: IPointerEvent): void;
57
57
  _onMouseWheel(evt: IWheelEvent): void;
58
- _onKeyDown(evt: IKeyboardEvent): void;
59
- _onKeyUp(evt: IKeyboardEvent): void;
60
58
  _onDragEnter(evt: IDragEvent): void;
61
59
  _onDragLeave(evt: IDragEvent): void;
62
60
  _onDragOver(evt: IDragEvent): void;
@@ -19,6 +19,7 @@ export * from './control';
19
19
  export * from './dashedrect';
20
20
  export * from './drawing';
21
21
  export * from './image';
22
+ export { type ILineProps, Line } from './line';
22
23
  export * from './path';
23
24
  export * from './rect';
24
25
  export * from './regular-polygon';
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type { IPosition } from '@univerjs/core';
17
+ import type { Vector2 } from '../basics/vector2';
18
+ import type { UniverRenderingContext } from '../context';
19
+ import type { IShapeProps } from './shape';
20
+ import { Shape } from './shape';
21
+ export interface ILineProps extends Omit<IShapeProps, 'left' | 'top' | 'width' | 'height'>, IPosition {
22
+ }
23
+ /**
24
+ * A line segment defined by two endpoints in its parent's coordinate system.
25
+ *
26
+ * The BaseObject bounds are derived internally so callers only describe line geometry.
27
+ */
28
+ export declare class Line extends Shape<ILineProps> {
29
+ private _startX;
30
+ private _startY;
31
+ private _endX;
32
+ private _endY;
33
+ constructor(key?: string, props?: ILineProps);
34
+ get startX(): number;
35
+ get startY(): number;
36
+ get endX(): number;
37
+ get endY(): number;
38
+ static drawWith(ctx: UniverRenderingContext, props: ILineProps): void;
39
+ setPoints(position: IPosition): this;
40
+ setProps(props?: Partial<ILineProps>): this;
41
+ isHit(coord: Vector2): boolean;
42
+ toJson(): {
43
+ startX: number;
44
+ startY: number;
45
+ endX: number;
46
+ endY: number;
47
+ };
48
+ protected _draw(ctx: UniverRenderingContext): void;
49
+ private static _drawSegment;
50
+ }
@@ -43,14 +43,18 @@ export interface IScrollBarProps {
43
43
  enableHorizontal?: boolean;
44
44
  /** Enable the vertical scroll bar. True by default. */
45
45
  enableVertical?: boolean;
46
+ /** Hide the track when the corresponding content axis does not overflow. False by default. */
47
+ hideTrackWhenUnscrollable?: boolean;
46
48
  /** The min width of horizon thumb. Default is 17 px. */
47
49
  minThumbSizeH?: number;
48
50
  /** The min height of vertical thumb. Default is 17 px. */
49
51
  minThumbSizeV?: number;
50
52
  }
51
53
  export declare class ScrollBar extends Disposable {
54
+ static readonly DEFAULT_TOTAL_SIZE: number;
52
55
  _enableHorizontal: boolean;
53
56
  _enableVertical: boolean;
57
+ private _hideTrackWhenUnscrollable;
54
58
  horizontalThumbSize: number;
55
59
  horizontalMinusMiniThumb: number;
56
60
  horizontalTrackWidth: number;
@@ -109,6 +113,8 @@ export declare class ScrollBar extends Disposable {
109
113
  set enableHorizontal(val: boolean);
110
114
  get enableVertical(): boolean;
111
115
  set enableVertical(val: boolean);
116
+ get hideTrackWhenUnscrollable(): boolean;
117
+ set hideTrackWhenUnscrollable(val: boolean);
112
118
  get limitX(): number;
113
119
  get limitY(): number;
114
120
  get ratioScrollX(): number;
@@ -15,7 +15,7 @@
15
15
  */
16
16
  import type { IOffset, IScale, ISize, Nullable } from '@univerjs/core';
17
17
  import type { IObjectFullState } from '../basics/interfaces';
18
- import type { IViewportInfo, Vector2 } from '../basics/vector2';
18
+ import type { IBoundRectNoAngle, IViewportInfo, Vector2 } from '../basics/vector2';
19
19
  import type { UniverRenderingContext } from '../context';
20
20
  import { BaseObject, ObjectType } from '../base-object';
21
21
  export type LineJoin = 'round' | 'bevel' | 'miter';
@@ -55,6 +55,9 @@ export interface IShapeProps extends IObjectFullState, ISize, IOffset, IScale {
55
55
  }
56
56
  export declare const SHAPE_OBJECT_ARRAY: string[];
57
57
  export declare abstract class Shape<T extends IShapeProps> extends BaseObject {
58
+ private _renderCacheCanvas;
59
+ private _renderCacheBounds;
60
+ private _renderCachePixelRatio;
58
61
  private _hoverCursor;
59
62
  private _moveCursor;
60
63
  private _fillRule;
@@ -129,6 +132,9 @@ export declare abstract class Shape<T extends IShapeProps> extends BaseObject {
129
132
  toJson(): {
130
133
  [x: string]: any;
131
134
  };
135
+ protected _renderWithCache(ctx: UniverRenderingContext, bounds: IBoundRectNoAngle, draw: (cacheContext: UniverRenderingContext) => void): void;
136
+ protected _releaseRenderCache(): void;
132
137
  protected _draw(ctx: UniverRenderingContext, bounds?: IViewportInfo): void;
133
138
  private _initialProps;
139
+ dispose(): void;
134
140
  }
@@ -99,6 +99,7 @@ export interface IViewportReSizeParam {
99
99
  }
100
100
  export declare class Viewport {
101
101
  private _viewportKey;
102
+ private _transformChangeSubscription?;
102
103
  /**
103
104
  * scrollX means scroll x value for scrollbar in viewMain
104
105
  * use getBarScroll to get scrolling value(scrollX, scrollY) for scrollbar
@@ -345,11 +346,6 @@ export declare class Viewport {
345
346
  render(parentCtx?: UniverRenderingContext, objects?: BaseObject[], isMaxLayer?: boolean): void;
346
347
  private _makeDefaultViewport;
347
348
  calcViewportInfo(): IViewportInfo;
348
- /**
349
- * Get viewport info
350
- * @deprecated use `calcViewportInfo`
351
- */
352
- getBounding(): IViewportInfo;
353
349
  /**
354
350
  * convert vector to scene coordinate, include row & col
355
351
  * @param vec