@univerjs/engine-render 0.2.14 → 0.3.0-alpha.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 (29) hide show
  1. package/lib/cjs/index.js +1 -1
  2. package/lib/es/index.js +2415 -2460
  3. package/lib/types/basics/i-document-skeleton-cached.d.ts +0 -1
  4. package/lib/types/basics/index.d.ts +3 -3
  5. package/lib/types/basics/tools.d.ts +14 -20
  6. package/lib/types/components/docs/document.d.ts +1 -1
  7. package/lib/types/components/docs/extensions/font-and-base-line.d.ts +1 -1
  8. package/lib/types/components/docs/layout/block/paragraph/layout-ruler.d.ts +1 -1
  9. package/lib/types/components/docs/layout/block/paragraph/line-adjustment.d.ts +2 -2
  10. package/lib/types/components/docs/layout/block/paragraph/linebreaking.d.ts +2 -2
  11. package/lib/types/components/docs/layout/block/paragraph/paragraph-layout.d.ts +1 -1
  12. package/lib/types/components/docs/layout/block/paragraph/shaping.d.ts +3 -3
  13. package/lib/types/components/docs/layout/doc-skeleton.d.ts +4 -0
  14. package/lib/types/components/docs/layout/model/glyph.d.ts +1 -1
  15. package/lib/types/components/docs/layout/tools.d.ts +1 -1
  16. package/lib/types/components/extension.d.ts +1 -1
  17. package/lib/types/components/index.d.ts +1 -1
  18. package/lib/types/components/sheets/extensions/index.d.ts +2 -2
  19. package/lib/types/components/sheets/extensions/sheet-extension.d.ts +1 -0
  20. package/lib/types/components/sheets/interfaces.d.ts +5 -5
  21. package/lib/types/components/sheets/sheet-skeleton.d.ts +34 -8
  22. package/lib/types/scene.d.ts +3 -0
  23. package/lib/types/shape/base-scroll-bar.d.ts +2 -2
  24. package/lib/types/shape/index.d.ts +3 -3
  25. package/lib/types/shape/scroll-bar.d.ts +3 -3
  26. package/lib/types/thin-scene.d.ts +4 -4
  27. package/lib/types/viewport.d.ts +5 -16
  28. package/lib/umd/index.js +1 -1
  29. package/package.json +6 -6
@@ -166,7 +166,6 @@ export interface IDocumentSkeletonBullet {
166
166
  ts: ITextStyle;
167
167
  fontStyle?: IDocumentSkeletonFontStyle;
168
168
  startIndexItem: number;
169
- bBox: IDocumentSkeletonBoundingBox;
170
169
  nestingLevel?: INestingLevel;
171
170
  bulletAlign?: BulletAlignment;
172
171
  bulletType?: boolean;
@@ -13,11 +13,12 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+ export * from '../components/docs/layout/shaping-engine/font-cache';
16
17
  export * from './cell-data';
17
18
  export * from './const';
18
19
  export * from './document-node-tools';
19
20
  export * from './draw';
20
- export * from '../components/docs/layout/shaping-engine/font-cache';
21
+ export * from './group-transform';
21
22
  export * from './i-document-skeleton-cached';
22
23
  export * from './i-events';
23
24
  export * from './interfaces';
@@ -25,8 +26,7 @@ export * from './path2';
25
26
  export * from './performance-monitor';
26
27
  export * from './range';
27
28
  export * from './scroll-xy';
29
+ export * from './text-rotation';
28
30
  export * from './tools';
29
31
  export * from './transform';
30
32
  export * from './vector2';
31
- export * from './text-rotation';
32
- export * from './group-transform';
@@ -71,28 +71,22 @@ export declare function getCellPositionByIndex(row: number, column: number, rowH
71
71
  startX: number;
72
72
  endX: number;
73
73
  };
74
- export declare function getCellByIndexWithMergeInfo(row: number, column: number, rowHeightAccumulation: number[], columnWidthAccumulation: number[], mergeDataInfo: ISelectionCell): {
75
- isMerged: boolean;
76
- isMergedMainCell: boolean;
77
- actualRow: number;
78
- actualColumn: number;
79
- startY: number;
80
- endY: number;
81
- startX: number;
82
- endX: number;
83
- mergeInfo: {
84
- startRow: number;
85
- startColumn: number;
86
- endRow: number;
87
- endColumn: number;
88
- startY: number;
89
- endY: number;
90
- startX: number;
91
- endX: number;
92
- };
93
- };
74
+ /**
75
+ * @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
76
+ * @param {number} row The row index of the cell
77
+ * @param {number} column The column index of the cell
78
+ * @param {number[]} rowHeightAccumulation The accumulated height of each row
79
+ * @param {number[]} columnWidthAccumulation The accumulated width of each column
80
+ * @param {ISelectionCell} mergeData The merge information of the cell
81
+ * @returns {ISelectionCellWithMergeInfo} The cell position information of the specified row and column, including the position information of the cell and the merge information of the cell
82
+ */
83
+ export declare function getCellByIndexWithMergeInfo(row: number, column: number, rowHeightAccumulation: number[], columnWidthAccumulation: number[], mergeDataInfo: ISelectionCell): ISelectionCellWithMergeInfo;
84
+ /**
85
+ * @deprecated please use getCellByIndexWithMergeInfo instead
86
+ */
94
87
  export declare function getCellByIndex(row: number, column: number, rowHeightAccumulation: number[], columnWidthAccumulation: number[], mergeData: IRange[]): ISelectionCellWithMergeInfo;
95
88
  /**
89
+ * @deprecated please use _hasUnMergedCellInRow in SpreadsheetSkeleton
96
90
  * Determine whether there are any cells in a row that are not in the merged cells, mainly used for the calculation of auto height
97
91
  */
98
92
  export declare function hasUnMergedCellInRow(row: number, startColumn: number, endColumn: number, mergeData: IRange[]): boolean;
@@ -1,9 +1,9 @@
1
1
  import { Nullable } from '@univerjs/core';
2
+ import { DocComponent, IDocumentsConfig, IPageMarginLayout } from './doc-component';
2
3
  import { IDocumentSkeletonPage } from '../../basics/i-document-skeleton-cached';
3
4
  import { Transform } from '../../basics/transform';
4
5
  import { IViewportInfo } from '../../basics/vector2';
5
6
  import { UniverRenderingContext } from '../../context';
6
- import { IDocumentsConfig, IPageMarginLayout, DocComponent } from './doc-component';
7
7
  import { DocumentSkeleton } from './layout/doc-skeleton';
8
8
  export interface IPageRenderConfig {
9
9
  page: IDocumentSkeletonPage;
@@ -1,7 +1,7 @@
1
1
  import { IScale } from '@univerjs/core';
2
+ import { docExtension } from '../doc-extension';
2
3
  import { IDocumentSkeletonGlyph } from '../../../basics/i-document-skeleton-cached';
3
4
  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;
@@ -1,6 +1,6 @@
1
+ import { BreakPointType } from '../../line-breaker/break';
1
2
  import { IDocumentSkeletonDrawing, IDocumentSkeletonGlyph, IDocumentSkeletonLine, IDocumentSkeletonPage } from '../../../../../basics/i-document-skeleton-cached';
2
3
  import { IParagraphConfig, ISectionBreakConfig } from '../../../../../basics/interfaces';
3
4
  import { ILayoutContext } from '../../tools';
4
- import { BreakPointType } from '../../line-breaker/break';
5
5
  export declare function layoutParagraph(ctx: ILayoutContext, glyphGroup: IDocumentSkeletonGlyph[], pages: IDocumentSkeletonPage[], sectionBreakConfig: ISectionBreakConfig, paragraphConfig: IParagraphConfig, isParagraphFirstShapedText: boolean, breakPointType?: BreakPointType): IDocumentSkeletonPage[];
6
6
  export declare function updateInlineDrawingPosition(line: IDocumentSkeletonLine, paragraphInlineSkeDrawings?: Map<string, IDocumentSkeletonDrawing>, blockAnchorTop?: number): void;
@@ -1,5 +1,5 @@
1
+ import { ISectionBreakConfig } from '../../../../../basics';
1
2
  import { IDocumentSkeletonPage } from '../../../../../basics/i-document-skeleton-cached';
2
- import { DocumentViewModel } from '../../../view-model/document-view-model';
3
3
  import { DataStreamTreeNode } from '../../../view-model/data-stream-tree-node';
4
- import { ISectionBreakConfig } from '../../../../../basics';
4
+ import { DocumentViewModel } from '../../../view-model/document-view-model';
5
5
  export declare function lineAdjustment(pages: IDocumentSkeletonPage[], viewModel: DocumentViewModel, paragraphNode: DataStreamTreeNode, sectionBreakConfig: ISectionBreakConfig): void;
@@ -1,8 +1,8 @@
1
1
  import { Nullable } from '@univerjs/core';
2
2
  import { IDocumentSkeletonPage, IDocumentSkeletonTable } from '../../../../../basics/i-document-skeleton-cached';
3
- import { ILayoutContext } from '../../tools';
4
- import { DataStreamTreeNode } from '../../../view-model/data-stream-tree-node';
5
3
  import { ISectionBreakConfig } from '../../../../../basics/interfaces';
4
+ import { DataStreamTreeNode } from '../../../view-model/data-stream-tree-node';
6
5
  import { DocumentViewModel } from '../../../view-model/document-view-model';
6
+ import { ILayoutContext } from '../../tools';
7
7
  import { IShapedText } from './shaping';
8
8
  export declare function lineBreaking(ctx: ILayoutContext, viewModel: DocumentViewModel, shapedTextList: IShapedText[], curPage: IDocumentSkeletonPage, paragraphNode: DataStreamTreeNode, sectionBreakConfig: ISectionBreakConfig, tableSkeleton: Nullable<IDocumentSkeletonTable>): IDocumentSkeletonPage[];
@@ -1,6 +1,6 @@
1
1
  import { IDocumentSkeletonPage } from '../../../../../basics/i-document-skeleton-cached';
2
2
  import { ISectionBreakConfig } from '../../../../../basics/interfaces';
3
- import { ILayoutContext } from '../../tools';
4
3
  import { DataStreamTreeNode } from '../../../view-model/data-stream-tree-node';
5
4
  import { DocumentViewModel } from '../../../view-model/document-view-model';
5
+ import { ILayoutContext } from '../../tools';
6
6
  export declare function dealWidthParagraph(ctx: ILayoutContext, viewModel: DocumentViewModel, paragraphNode: DataStreamTreeNode, curPage: IDocumentSkeletonPage, sectionBreakConfig: ISectionBreakConfig): IDocumentSkeletonPage[];
@@ -1,9 +1,9 @@
1
+ import { BreakPointType } from '../../line-breaker/break';
1
2
  import { IDocumentSkeletonGlyph } from '../../../../../basics/i-document-skeleton-cached';
2
- import { ILayoutContext } from '../../tools';
3
+ import { ISectionBreakConfig } from '../../../../../basics/interfaces';
3
4
  import { DataStreamTreeNode } from '../../../view-model/data-stream-tree-node';
4
5
  import { DocumentViewModel } from '../../../view-model/document-view-model';
5
- import { ISectionBreakConfig } from '../../../../../basics/interfaces';
6
- import { BreakPointType } from '../../line-breaker/break';
6
+ import { ILayoutContext } from '../../tools';
7
7
  export interface IShapedText {
8
8
  text: string;
9
9
  glyphs: IDocumentSkeletonGlyph[];
@@ -28,6 +28,10 @@ export declare class DocumentSkeleton extends Skeleton {
28
28
  static create(docViewModel: DocumentViewModel, localeService: LocaleService): DocumentSkeleton;
29
29
  dispose(): void;
30
30
  getViewModel(): DocumentViewModel;
31
+ /**
32
+ * Layout the document.
33
+ * PS: This method has significant impact on performance.
34
+ */
31
35
  calculate(bounds?: IViewportInfo): void;
32
36
  getSkeletonData(): Nullable<IDocumentSkeletonCached>;
33
37
  getActualSize(): {
@@ -1,4 +1,4 @@
1
- import { IAdjustability, IDocumentSkeletonBullet, IDocumentSkeletonDivide, IDocumentSkeletonGlyph, GlyphType } from '../../../../basics/i-document-skeleton-cached';
1
+ import { GlyphType, IAdjustability, IDocumentSkeletonBullet, IDocumentSkeletonDivide, IDocumentSkeletonGlyph } from '../../../../basics/i-document-skeleton-cached';
2
2
  import { IFontCreateConfig } from '../../../../basics/interfaces';
3
3
  import { IOpenTypeGlyphInfo } from '../shaping-engine/text-shaping';
4
4
  export declare function isSpace(char: string): boolean;
@@ -1,4 +1,4 @@
1
- import { BooleanNumber, GridType, SpacingRule, DocumentDataModel, INumberUnit, IObjectPositionH, IObjectPositionV, IParagraph, IParagraphStyle, ITextStyle, Nullable } from '@univerjs/core';
1
+ import { DocumentDataModel, INumberUnit, IObjectPositionH, IObjectPositionV, IParagraph, IParagraphStyle, ITextStyle, Nullable, BooleanNumber, GridType, SpacingRule } from '@univerjs/core';
2
2
  import { IDocumentSkeletonCached, IDocumentSkeletonColumn, IDocumentSkeletonDivide, IDocumentSkeletonDrawing, IDocumentSkeletonFontStyle, IDocumentSkeletonGlyph, IDocumentSkeletonLine, IDocumentSkeletonPage, IDocumentSkeletonSection, ISkeletonResourceReference } from '../../../basics/i-document-skeleton-cached';
3
3
  import { IDocsConfig, IParagraphConfig, ISectionBreakConfig } from '../../../basics/interfaces';
4
4
  import { DataStreamTreeNode } from '../view-model/data-stream-tree-node';
@@ -1,4 +1,4 @@
1
- import { IDocumentRenderConfig, IRange, IScale, Nullable, Registry } from '@univerjs/core';
1
+ import { Registry, IDocumentRenderConfig, IRange, IScale, Nullable } from '@univerjs/core';
2
2
  import { BaseObject } from '../base-object';
3
3
  import { Vector2 } from '../basics/vector2';
4
4
  import { UniverRenderingContext } from '../context';
@@ -16,6 +16,6 @@
16
16
  export * from './component';
17
17
  export * from './extension';
18
18
  export * from './sheets';
19
- export * from './skeleton';
20
19
  export { RENDER_RAW_FORMULA_KEY } from './sheets/sheet-skeleton';
20
+ export * from './skeleton';
21
21
  export * from './slides';
@@ -16,8 +16,8 @@
16
16
  export * from './background';
17
17
  export * from './border';
18
18
  export * from './column-header-layout';
19
+ export * from './custom';
19
20
  export * from './font';
21
+ export * from './marker';
20
22
  export * from './row-header-layout';
21
23
  export * from './sheet-extension';
22
- export * from './marker';
23
- export * from './custom';
@@ -11,6 +11,7 @@ export declare const SHEET_EXTENSION_PREFIX = "sheet-ext-";
11
11
  export declare class SheetExtension extends ComponentExtension<SpreadsheetSkeleton, SHEET_EXTENSION_TYPE, IRange[]> {
12
12
  type: SHEET_EXTENSION_TYPE;
13
13
  /**
14
+ * @deprecated The function maybe cause performance issue, use spreadsheetSkeleton.getCellByIndexWithNoHeader instead.
14
15
  * Get ISelectionCellWithMergeInfo by cell rowIndex and cell columnIndex.
15
16
  * The startXY in return value does not include rowHeader and columnHeader.
16
17
  * @param rowIndex
@@ -1,8 +1,8 @@
1
1
  import { BorderStyleTypes, HorizontalAlign, ISelectionCellWithMergeInfo, ObjectMatrix, VerticalAlign, WrapStrategy } from '@univerjs/core';
2
2
  import { BORDER_TYPE } from '../../basics/const';
3
- import { DocumentSkeleton } from '../docs/layout/doc-skeleton';
4
3
  import { Canvas } from '../../canvas';
5
4
  import { UniverRenderingContext } from '../../context';
5
+ import { DocumentSkeleton } from '../docs/layout/doc-skeleton';
6
6
  export interface BorderCache {
7
7
  [key: string]: BorderCacheItem | {};
8
8
  }
@@ -19,12 +19,12 @@ export interface IFontCacheItem {
19
19
  horizontalAlign: HorizontalAlign;
20
20
  wrapStrategy: WrapStrategy;
21
21
  }
22
- type backgroundCache = Record<string, ObjectMatrix<string>>;
23
- type fontCache = Record<string, ObjectMatrix<IFontCacheItem>>;
22
+ type colorString = string;
24
23
  export interface IStylesCache {
25
- background?: backgroundCache;
24
+ background?: Record<colorString, ObjectMatrix<string>>;
26
25
  backgroundPositions?: ObjectMatrix<ISelectionCellWithMergeInfo>;
27
- font?: fontCache;
26
+ font?: Record<string, ObjectMatrix<IFontCacheItem>>;
27
+ fontMatrix: ObjectMatrix<IFontCacheItem>;
28
28
  border?: ObjectMatrix<BorderCache>;
29
29
  }
30
30
  export declare enum ShowGridlinesState {
@@ -1,4 +1,4 @@
1
- import { BooleanNumber, DocumentDataModel, HorizontalAlign, IContextService, LocaleService, ObjectMatrix, VerticalAlign, WrapStrategy, ICellData, IColumnRange, IPaddingData, IPosition, IRange, IRowAutoHeightInfo, IRowRange, ISelectionCellWithMergeInfo, ISize, ITextRotation, IWorksheetData, Nullable, Styles, Worksheet } from '@univerjs/core';
1
+ import { BooleanNumber, DocumentDataModel, HorizontalAlign, IContextService, LocaleService, ObjectMatrix, VerticalAlign, WrapStrategy, ICellData, IColumnRange, IPaddingData, IPosition, IRange, IRowAutoHeightInfo, IRowRange, ISelectionCellWithMergeInfo, ISize, IStyleData, ITextRotation, IWorksheetData, Nullable, Styles, Worksheet } from '@univerjs/core';
2
2
  import { DocumentSkeleton } from '../docs/layout/doc-skeleton';
3
3
  import { Skeleton } from '../skeleton';
4
4
  import { IBoundRectNoAngle, IViewportInfo } from '../../basics/vector2';
@@ -52,12 +52,11 @@ export declare class SpreadsheetSkeleton extends Skeleton {
52
52
  * Range of visible area(range in viewBounds)
53
53
  */
54
54
  private _rowColumnSegment;
55
- private _dataMergeCache;
56
- private _dataMergeCacheMap;
57
55
  private _overflowCache;
58
56
  private _stylesCache;
59
57
  /** A matrix to store if a (row, column) position has render cache. */
60
- private _cellBgAndBorderCache;
58
+ private _cellBgCacheMatrix;
59
+ private _cellBorderCacheMatrix;
61
60
  private _showGridlines;
62
61
  private _marginTop;
63
62
  private _marginLeft;
@@ -78,7 +77,6 @@ export declare class SpreadsheetSkeleton extends Skeleton {
78
77
  * Range of visible area(range in viewBounds)
79
78
  */
80
79
  get rowColumnSegment(): IRowColumnRange;
81
- get dataMergeCache(): IRange[];
82
80
  get stylesCache(): IStylesCache;
83
81
  get overflowCache(): ObjectMatrix<IRange>;
84
82
  get showGridlines(): BooleanNumber;
@@ -109,6 +107,7 @@ export declare class SpreadsheetSkeleton extends Skeleton {
109
107
  calculateWithoutClearingCache(bounds?: IViewportInfo): Nullable<SpreadsheetSkeleton>;
110
108
  calculate(bounds?: IViewportInfo): Nullable<SpreadsheetSkeleton>;
111
109
  calculateAutoHeightInRange(ranges: Nullable<IRange[]>): IRowAutoHeightInfo[];
110
+ private _hasUnMergedCellInRow;
112
111
  private _calculateRowAutoHeight;
113
112
  /**
114
113
  * Calculate data for row col & cell position, then update position value to this._rowHeaderWidth & this._rowHeightAccumulation & this._columnHeaderHeight & this._columnWidthAccumulation.
@@ -213,6 +212,13 @@ export declare class SpreadsheetSkeleton extends Skeleton {
213
212
  getSelectionMergeBounding(startRow: number, startColumn: number, endRow: number, endColumn: number): IRange;
214
213
  getBlankCellDocumentModel(cell: Nullable<ICellData>): IDocumentLayoutObject;
215
214
  getCellDocumentModelWithFormula(cell: ICellData): Nullable<IDocumentLayoutObject>;
215
+ /**
216
+ * This method generates a document model based on the cell's properties and handles the associated styles and configurations.
217
+ * If the cell does not exist, it will return null.
218
+ * PS: This method has significant impact on performance.
219
+ * @param cell
220
+ * @param options
221
+ */
216
222
  private _getCellDocumentModel;
217
223
  getDecomposedOffset(offsetX: number, offsetY: number): {
218
224
  row: number;
@@ -238,15 +244,30 @@ export declare class SpreadsheetSkeleton extends Skeleton {
238
244
  private _generateColumnMatrixCache;
239
245
  private _getOverflowBound;
240
246
  intersectMergeRange(row: number, column: number): boolean;
247
+ /**
248
+ * @deprecated use _getCellMergeInfo instead.
249
+ * get the current row and column segment visible merge data
250
+ * @returns {IRange} The visible merge data
251
+ */
252
+ getCurrentRowColumnSegmentMergeData(range?: IRange): IRange[];
241
253
  private _calculateStylesCache;
254
+ resetCache(): void;
242
255
  /**
243
256
  * Any changes to sheet model would reset cache.
244
257
  */
245
258
  private _resetCache;
246
- resetCache(): void;
247
259
  private _makeDocumentSkeletonDirty;
260
+ _setBorderStylesCache(row: number, col: number, style: Nullable<IStyleData>, options: {
261
+ mergeRange?: IRange;
262
+ cacheItem?: ICacheItem;
263
+ } | undefined): void;
264
+ _setBgStylesCache(row: number, col: number, style: Nullable<IStyleData>, options: {
265
+ mergeRange?: IRange;
266
+ cacheItem?: ICacheItem;
267
+ } | undefined): void;
268
+ _setFontStylesCache(cell: Nullable<ICellData>, row: number, col: number): void;
248
269
  /**
249
- * Set border background and font to this._stylesCache { border font background }
270
+ * Set border background and font to this._stylesCache
250
271
  * @param row {number}
251
272
  * @param col {number}
252
273
  * @param options {{ mergeRange: IRange; cacheItem: ICacheItem } | undefined}
@@ -262,7 +283,12 @@ export declare class SpreadsheetSkeleton extends Skeleton {
262
283
  private _setBorderProps;
263
284
  private _getFontFormat;
264
285
  private _getOtherStyle;
265
- private _getMergeCellsCache;
286
+ /**
287
+ * New version to get merge data.
288
+ * @param row
289
+ * @param column
290
+ * @returns {ISelectionCell} The cell info with merge data
291
+ */
266
292
  private _getCellMergeInfo;
267
293
  /**
268
294
  * Cache the merged cells on the current screen to improve computational performance.
@@ -8,6 +8,7 @@ import { IDragEvent, IKeyboardEvent, IMouseEvent, IPointerEvent, IWheelEvent } f
8
8
  import { ISceneTransformState } from './basics/interfaces';
9
9
  import { ITransformerConfig } from './basics/transformer-config';
10
10
  import { Vector2 } from './basics/vector2';
11
+ import { Canvas } from './canvas';
11
12
  import { UniverRenderingContext } from './context';
12
13
  import { Engine } from './engine';
13
14
  import { SceneViewer } from './scene-viewer';
@@ -21,6 +22,8 @@ export declare class Scene extends ThinScene {
21
22
  private _defaultCursor;
22
23
  private _addObject$;
23
24
  readonly addObject$: import('rxjs').Observable<Scene>;
25
+ private _beforeRender$;
26
+ readonly beforeRender$: import('rxjs').Observable<Nullable<Canvas>>;
24
27
  /**
25
28
  * Transformer constructor. Transformer is a special type of group that allow you transform
26
29
  * primitives and shapes. Transforming tool is not changing `width` and `height` properties of nodes
@@ -26,9 +26,9 @@ export declare abstract class BaseScrollBar extends Disposable {
26
26
  verticalThumbHeight: number;
27
27
  verticalBarHeight: number;
28
28
  verticalMinusMiniThumb: number;
29
- horizonBarRect: Nullable<Rect>;
29
+ horizonScrollTrack: Nullable<Rect>;
30
30
  horizonThumbRect: Nullable<Rect>;
31
- verticalBarRect: Nullable<Rect>;
31
+ verticalScrollTrack: Nullable<Rect>;
32
32
  verticalThumbRect: Nullable<Rect>;
33
33
  placeholderBarRect: Nullable<Rect>;
34
34
  get limitX(): number;
@@ -13,15 +13,15 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+ export * from './checkbox';
16
17
  export * from './circle';
17
18
  export * from './control';
19
+ export * from './dashedrect';
18
20
  export * from './drawing';
19
- export * from './path';
20
21
  export * from './image';
22
+ export * from './path';
21
23
  export * from './rect';
22
24
  export * from './regular-polygon';
23
25
  export * from './rich-text';
24
26
  export * from './scroll-bar';
25
27
  export * from './shape';
26
- export * from './checkbox';
27
- export * from './dashedrect';
@@ -1,10 +1,10 @@
1
+ import { BaseScrollBar, IScrollBarProps } from './base-scroll-bar';
2
+ import { Rect } from './rect';
1
3
  import { Vector2 } from '../basics/vector2';
2
4
  import { UniverRenderingContext } from '../context';
3
5
  import { Viewport } from '../viewport';
4
- import { IScrollBarProps, BaseScrollBar } from './base-scroll-bar';
5
- import { Rect } from './rect';
6
6
  export declare class ScrollBar extends BaseScrollBar {
7
- protected _view: Viewport;
7
+ protected _viewport: Viewport;
8
8
  private _mainScene;
9
9
  private _lastX;
10
10
  private _lastY;
@@ -1,13 +1,13 @@
1
- import { Nullable, Disposable, EventSubject } from '@univerjs/core';
1
+ import { Disposable, EventSubject, Nullable } from '@univerjs/core';
2
+ import { RENDER_CLASS_TYPE, CURSOR_TYPE } from './basics/const';
3
+ import { Transform } from './basics/transform';
2
4
  import { BaseObject } from './base-object';
3
- import { CURSOR_TYPE, RENDER_CLASS_TYPE } from './basics/const';
4
5
  import { IDragEvent, IKeyboardEvent, IMouseEvent, IPointerEvent, IWheelEvent } from './basics/i-events';
5
6
  import { ITransformChangeState } from './basics/interfaces';
6
- import { Transform } from './basics/transform';
7
7
  import { Vector2 } from './basics/vector2';
8
8
  import { UniverRenderingContext } from './context';
9
- import { ThinEngine } from './thin-engine';
10
9
  import { Scene } from './scene';
10
+ import { ThinEngine } from './thin-engine';
11
11
  export declare abstract class ThinScene extends Disposable {
12
12
  onTransformChange$: EventSubject<ITransformChangeState>;
13
13
  onFileLoaded$: EventSubject<string>;
@@ -87,7 +87,6 @@ export declare class Viewport {
87
87
  private _sceneHeightAfterScale;
88
88
  onMouseWheel$: EventSubject<IWheelEvent>;
89
89
  onScrollAfter$: EventSubject<IScrollObserverParam>;
90
- onScrollBefore$: EventSubject<IScrollObserverParam>;
91
90
  onScrollEnd$: EventSubject<IScrollObserverParam>;
92
91
  onScrollByBar$: EventSubject<IScrollObserverParam>;
93
92
  private _viewportKey;
@@ -234,7 +233,7 @@ export declare class Viewport {
234
233
  isLimitedY: boolean;
235
234
  } | undefined;
236
235
  /**
237
- * scrolling by current position plus offset
236
+ * Srolling by current position plus delta.
238
237
  * the most common case is triggered by scroll-timer(in sheet)
239
238
  * @param delta
240
239
  * @returns isLimited
@@ -245,7 +244,6 @@ export declare class Viewport {
245
244
  isLimitedX: boolean;
246
245
  isLimitedY: boolean;
247
246
  } | undefined;
248
- scrollByBar(delta: Partial<IScrollBarPosition>, isTrigger?: boolean): void;
249
247
  /**
250
248
  * Viewport scroll to certain position.
251
249
  * @param pos
@@ -264,19 +262,6 @@ export declare class Viewport {
264
262
  isLimitedX: boolean;
265
263
  isLimitedY: boolean;
266
264
  } | undefined;
267
- /**
268
- * current position plus offset relatively
269
- * the caller no need to deal with the padding when frozen
270
- * @param offsetX
271
- * @param offsetY
272
- * @param isTrigger
273
- */
274
- scrollByOffset(offsetX?: number, offsetY?: number, isTrigger?: boolean): {
275
- scrollX: number;
276
- scrollY: number;
277
- isLimitedX: boolean;
278
- isLimitedY: boolean;
279
- } | undefined;
280
265
  transViewportScroll2ScrollValue(viewportScrollX: number, viewportScrollY: number): {
281
266
  x: number;
282
267
  y: number;
@@ -368,6 +353,10 @@ export declare class Viewport {
368
353
  * update pre scroll value has handled in updateScroll()
369
354
  */
370
355
  private _afterRender;
356
+ /**
357
+ * mock scrollend.
358
+ * @param scrollSubParam
359
+ */
371
360
  private _emitScrollEnd$;
372
361
  /**
373
362
  *