@univerjs/engine-render 0.2.7 → 0.2.9
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 +4 -2
- package/lib/es/index.js +339 -189
- package/lib/types/base-object.d.ts +4 -3
- package/lib/types/basics/cell-data.d.ts +0 -1
- package/lib/types/basics/document-node-tools.d.ts +0 -1
- package/lib/types/basics/draw.d.ts +0 -1
- package/lib/types/basics/group-transform.d.ts +0 -1
- package/lib/types/basics/i-document-skeleton-cached.d.ts +0 -1
- package/lib/types/basics/i-events.d.ts +0 -1
- package/lib/types/basics/interfaces.d.ts +0 -1
- package/lib/types/basics/offset-rotation-axis.d.ts +0 -1
- package/lib/types/basics/path2.d.ts +0 -1
- package/lib/types/basics/position.d.ts +0 -1
- package/lib/types/basics/quick-event.d.ts +0 -1
- package/lib/types/basics/range.d.ts +0 -1
- package/lib/types/basics/text-rotation.d.ts +0 -1
- package/lib/types/basics/tools.d.ts +0 -1
- package/lib/types/basics/transform.d.ts +0 -1
- package/lib/types/basics/transformer-config.d.ts +0 -1
- package/lib/types/basics/vector2.d.ts +0 -1
- package/lib/types/basics/viewport-subtract.d.ts +0 -1
- package/lib/types/canvas.d.ts +0 -1
- package/lib/types/components/component.d.ts +0 -1
- package/lib/types/components/docs/doc-background.d.ts +0 -1
- package/lib/types/components/docs/doc-component.d.ts +0 -1
- package/lib/types/components/docs/doc-extension.d.ts +0 -1
- package/lib/types/components/docs/document.d.ts +1 -3
- package/lib/types/components/docs/extensions/background.d.ts +0 -1
- package/lib/types/components/docs/extensions/border.d.ts +0 -1
- package/lib/types/components/docs/extensions/font-and-base-line.d.ts +0 -1
- package/lib/types/components/docs/extensions/line.d.ts +0 -1
- package/lib/types/components/docs/layout/block/paragraph/bullet-ruler.d.ts +0 -1
- package/lib/types/components/docs/layout/block/paragraph/bullet.d.ts +0 -1
- package/lib/types/components/docs/layout/block/paragraph/language-ruler.d.ts +5 -6
- package/lib/types/components/docs/layout/block/paragraph/layout-ruler.d.ts +1 -2
- package/lib/types/components/docs/layout/block/paragraph/line-adjustment.d.ts +0 -1
- package/lib/types/components/docs/layout/block/paragraph/linebreaking.d.ts +0 -1
- package/lib/types/components/docs/layout/block/paragraph/paragraph-layout.d.ts +0 -1
- package/lib/types/components/docs/layout/block/paragraph/shaping.d.ts +0 -1
- package/lib/types/components/docs/layout/block/section.d.ts +0 -1
- package/lib/types/components/docs/layout/block/table.d.ts +0 -1
- package/lib/types/components/docs/layout/doc-skeleton.d.ts +2 -1
- package/lib/types/components/docs/layout/hyphenation/hyphen.d.ts +0 -1
- package/lib/types/components/docs/layout/hyphenation/language-detector.d.ts +0 -1
- package/lib/types/components/docs/layout/line-breaker/enhancers/hyphen-enhancer.d.ts +0 -1
- package/lib/types/components/docs/layout/line-breaker/extensions/custom-block-linebreak-extension.d.ts +0 -1
- package/lib/types/components/docs/layout/line-breaker/extensions/tab-linebreak-extension.d.ts +0 -1
- package/lib/types/components/docs/layout/line-breaker/line-breaker.d.ts +0 -1
- package/lib/types/components/docs/layout/line-breaker/rule.d.ts +0 -1
- package/lib/types/components/docs/layout/model/column.d.ts +0 -1
- package/lib/types/components/docs/layout/model/glyph.d.ts +0 -1
- package/lib/types/components/docs/layout/model/line.d.ts +0 -1
- package/lib/types/components/docs/layout/model/page.d.ts +0 -1
- package/lib/types/components/docs/layout/model/section.d.ts +0 -1
- package/lib/types/components/docs/layout/shaping-engine/font-cache.d.ts +0 -1
- package/lib/types/components/docs/layout/shaping-engine/font-library.d.ts +0 -1
- package/lib/types/components/docs/layout/shaping-engine/text-shaping.d.ts +0 -1
- package/lib/types/components/docs/layout/shaping-engine/utils.d.ts +0 -1
- package/lib/types/components/docs/layout/style/custom-decoration.d.ts +0 -1
- package/lib/types/components/docs/layout/style/custom-range.d.ts +0 -1
- package/lib/types/components/docs/layout/tools.d.ts +2 -3
- package/lib/types/components/docs/liquid.d.ts +1 -2
- package/lib/types/components/docs/text-selection/convert-rect-range.d.ts +0 -1
- package/lib/types/components/docs/text-selection/convert-text-range.d.ts +0 -1
- package/lib/types/components/docs/text-selection/range-interface.d.ts +0 -1
- package/lib/types/components/docs/text-selection/rect-range.d.ts +0 -1
- package/lib/types/components/docs/text-selection/selection-utils.d.ts +0 -1
- package/lib/types/components/docs/text-selection/text-range.d.ts +0 -1
- package/lib/types/components/docs/text-selection/text-selection-render-manager.d.ts +1 -2
- package/lib/types/components/docs/view-model/data-stream-tree-node.d.ts +0 -1
- package/lib/types/components/docs/view-model/document-view-model.d.ts +2 -1
- package/lib/types/components/extension.d.ts +0 -1
- package/lib/types/components/sheets/column-header.d.ts +0 -1
- package/lib/types/components/sheets/extensions/background.d.ts +0 -1
- package/lib/types/components/sheets/extensions/border.d.ts +0 -1
- package/lib/types/components/sheets/extensions/column-header-layout.d.ts +0 -1
- package/lib/types/components/sheets/extensions/custom.d.ts +0 -1
- package/lib/types/components/sheets/extensions/font.d.ts +0 -1
- package/lib/types/components/sheets/extensions/marker.d.ts +0 -1
- package/lib/types/components/sheets/extensions/row-header-layout.d.ts +0 -1
- package/lib/types/components/sheets/extensions/sheet-extension.d.ts +0 -1
- package/lib/types/components/sheets/interfaces.d.ts +0 -1
- package/lib/types/components/sheets/row-header.d.ts +0 -1
- package/lib/types/components/sheets/sheet-component.d.ts +0 -1
- package/lib/types/components/sheets/sheet-skeleton.d.ts +10 -2
- package/lib/types/components/sheets/spreadsheet.d.ts +0 -3
- package/lib/types/components/skeleton.d.ts +0 -1
- package/lib/types/components/slides/slide.d.ts +6 -2
- package/lib/types/custom/custom-object.d.ts +0 -1
- package/lib/types/engine.d.ts +0 -1
- package/lib/types/floating/util.d.ts +0 -1
- package/lib/types/group.d.ts +0 -1
- package/lib/types/layer.d.ts +0 -1
- package/lib/types/render-engine.d.ts +0 -1
- package/lib/types/render-manager/render-manager.service.d.ts +44 -3
- package/lib/types/render-manager/render-unit.d.ts +17 -4
- package/lib/types/scene-viewer.d.ts +0 -1
- package/lib/types/scene.d.ts +17 -7
- package/lib/types/scene.input-manager.d.ts +0 -1
- package/lib/types/scene.transformer.d.ts +0 -1
- package/lib/types/scroll-timer.d.ts +0 -1
- package/lib/types/shape/base-scroll-bar.d.ts +0 -1
- package/lib/types/shape/checkbox.d.ts +0 -1
- package/lib/types/shape/circle.d.ts +0 -1
- package/lib/types/shape/dashedrect.d.ts +0 -1
- package/lib/types/shape/dropdown-item.d.ts +0 -1
- package/lib/types/shape/image.d.ts +0 -1
- package/lib/types/shape/path.d.ts +0 -1
- package/lib/types/shape/rect.d.ts +0 -1
- package/lib/types/shape/regular-polygon.d.ts +0 -1
- package/lib/types/shape/rich-text.d.ts +3 -7
- package/lib/types/shape/scroll-bar.d.ts +0 -1
- package/lib/types/shape/shape.d.ts +0 -1
- package/lib/types/shape/text.d.ts +0 -1
- package/lib/types/thin-engine.d.ts +0 -1
- package/lib/types/thin-scene.d.ts +0 -1
- package/lib/types/viewport.d.ts +15 -34
- package/lib/umd/index.js +4 -2
- package/package.json +7 -7
|
@@ -8,7 +8,6 @@ import { ThinScene } from '../../../thin-scene';
|
|
|
8
8
|
import { DocumentSkeleton } from '../layout/doc-skeleton';
|
|
9
9
|
import { Documents } from '../document';
|
|
10
10
|
import { IDocRange, DOC_RANGE_TYPE } from './range-interface';
|
|
11
|
-
|
|
12
11
|
export declare const TEXT_RANGE_LAYER_INDEX = 3;
|
|
13
12
|
export declare function cursorConvertToTextRange(scene: Scene, range: ISuccinctDocRangeParam, docSkeleton: DocumentSkeleton, document: Documents): Nullable<TextRange>;
|
|
14
13
|
export declare function getAnchorBounding(pointsGroup: IPoint[][]): {
|
|
@@ -9,7 +9,6 @@ import { DocumentSkeleton, IFindNodeRestrictions } from '../layout/doc-skeleton'
|
|
|
9
9
|
import { Documents } from '../document';
|
|
10
10
|
import { TextRange } from './text-range';
|
|
11
11
|
import { RectRange } from './rect-range';
|
|
12
|
-
|
|
13
12
|
export interface ITextSelectionInnerParam {
|
|
14
13
|
textRanges: TextRange[];
|
|
15
14
|
rectRanges: RectRange[];
|
|
@@ -178,7 +177,7 @@ export declare class TextSelectionRenderManager extends RxDisposable implements
|
|
|
178
177
|
private _addTextRange;
|
|
179
178
|
private _addRectRangesToCache;
|
|
180
179
|
private _addRectRanges;
|
|
181
|
-
private
|
|
180
|
+
private _createTextRangeByAnchorPosition;
|
|
182
181
|
private _updateActiveRangePosition;
|
|
183
182
|
private _isEmpty;
|
|
184
183
|
private _getCanvasOffset;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ICustomDecorationForInterceptor, ICustomRangeForInterceptor, IDisposable, IDocumentBody, ITextRun, Nullable, DocumentDataModel } from '@univerjs/core';
|
|
2
2
|
import { DataStreamTreeNode } from './data-stream-tree-node';
|
|
3
|
-
|
|
4
3
|
export interface ICustomRangeInterceptor {
|
|
5
4
|
getCustomRange: (index: number) => Nullable<ICustomRangeForInterceptor>;
|
|
6
5
|
getCustomDecoration: (index: number) => Nullable<ICustomDecorationForInterceptor>;
|
|
@@ -26,6 +25,8 @@ export declare class DocumentViewModel implements IDisposable {
|
|
|
26
25
|
readonly editAreaChange$: import('rxjs').Observable<Nullable<DocumentEditArea>>;
|
|
27
26
|
headerTreeMap: Map<string, DocumentViewModel>;
|
|
28
27
|
footerTreeMap: Map<string, DocumentViewModel>;
|
|
28
|
+
private readonly _segmentViewModels$;
|
|
29
|
+
readonly segmentViewModels$: import('rxjs').Observable<DocumentViewModel[]>;
|
|
29
30
|
constructor(_documentDataModel: DocumentDataModel);
|
|
30
31
|
registerCustomRangeInterceptor(interceptor: ICustomRangeInterceptor): IDisposable;
|
|
31
32
|
dispose(): void;
|
|
@@ -2,7 +2,6 @@ import { IDocumentRenderConfig, IRange, IScale, Nullable, Registry } from '@univ
|
|
|
2
2
|
import { BaseObject } from '../base-object';
|
|
3
3
|
import { Vector2 } from '../basics/vector2';
|
|
4
4
|
import { UniverRenderingContext } from '../context';
|
|
5
|
-
|
|
6
5
|
export interface IExtensionConfig {
|
|
7
6
|
originTranslate?: Vector2;
|
|
8
7
|
spanStartPoint?: Vector2;
|
|
@@ -4,7 +4,6 @@ import { UniverRenderingContext } from '../../context';
|
|
|
4
4
|
import { ColumnHeaderLayout, IColumnsHeaderCfgParam } from './extensions/column-header-layout';
|
|
5
5
|
import { SpreadsheetHeader } from './sheet-component';
|
|
6
6
|
import { SpreadsheetSkeleton } from './sheet-skeleton';
|
|
7
|
-
|
|
8
7
|
export declare class SpreadsheetColumnHeader extends SpreadsheetHeader {
|
|
9
8
|
getDocuments(): void;
|
|
10
9
|
getNoMergeCellPositionByIndex(rowIndex: number, columnIndex: number): Nullable<{
|
|
@@ -3,7 +3,6 @@ import { UniverRenderingContext } from '../../../context';
|
|
|
3
3
|
import { IDrawInfo } from '../../extension';
|
|
4
4
|
import { SpreadsheetSkeleton } from '../sheet-skeleton';
|
|
5
5
|
import { SheetExtension } from './sheet-extension';
|
|
6
|
-
|
|
7
6
|
export declare class Background extends SheetExtension {
|
|
8
7
|
uKey: string;
|
|
9
8
|
Z_INDEX: number;
|
|
@@ -2,7 +2,6 @@ import { IRange, IScale } from '@univerjs/core';
|
|
|
2
2
|
import { UniverRenderingContext } from '../../../context';
|
|
3
3
|
import { SpreadsheetSkeleton } from '../sheet-skeleton';
|
|
4
4
|
import { SheetExtension } from './sheet-extension';
|
|
5
|
-
|
|
6
5
|
export declare class Border extends SheetExtension {
|
|
7
6
|
uKey: string;
|
|
8
7
|
Z_INDEX: number;
|
|
@@ -3,7 +3,6 @@ import { UniverRenderingContext } from '../../../context';
|
|
|
3
3
|
import { SpreadsheetSkeleton } from '../sheet-skeleton';
|
|
4
4
|
import { IAColumnCfg, IAColumnCfgObj, IColumnStyleCfg } from '../interfaces';
|
|
5
5
|
import { SheetExtension } from './sheet-extension';
|
|
6
|
-
|
|
7
6
|
export interface IColumnsHeaderCfgParam {
|
|
8
7
|
headerStyle?: Partial<IColumnStyleCfg>;
|
|
9
8
|
columnsCfg?: IAColumnCfg[];
|
|
@@ -2,7 +2,6 @@ import { IRange, IScale } from '@univerjs/core';
|
|
|
2
2
|
import { UniverRenderingContext } from '../../../context';
|
|
3
3
|
import { SpreadsheetSkeleton } from '../sheet-skeleton';
|
|
4
4
|
import { SheetExtension } from './sheet-extension';
|
|
5
|
-
|
|
6
5
|
export declare class Custom extends SheetExtension {
|
|
7
6
|
protected Z_INDEX: number;
|
|
8
7
|
uKey: string;
|
|
@@ -3,7 +3,6 @@ import { UniverRenderingContext } from '../../../context';
|
|
|
3
3
|
import { IDrawInfo } from '../../extension';
|
|
4
4
|
import { SpreadsheetSkeleton } from '../sheet-skeleton';
|
|
5
5
|
import { SheetExtension } from './sheet-extension';
|
|
6
|
-
|
|
7
6
|
export interface ISheetFontRenderExtension {
|
|
8
7
|
fontRenderExtension?: {
|
|
9
8
|
leftOffset?: number;
|
|
@@ -2,7 +2,6 @@ import { IRange, IScale } from '@univerjs/core';
|
|
|
2
2
|
import { UniverRenderingContext } from '../../../context';
|
|
3
3
|
import { SpreadsheetSkeleton } from '../sheet-skeleton';
|
|
4
4
|
import { SheetExtension } from './sheet-extension';
|
|
5
|
-
|
|
6
5
|
export declare class Marker extends SheetExtension {
|
|
7
6
|
protected Z_INDEX: number;
|
|
8
7
|
uKey: string;
|
|
@@ -3,7 +3,6 @@ import { UniverRenderingContext } from '../../../context';
|
|
|
3
3
|
import { SpreadsheetSkeleton } from '../sheet-skeleton';
|
|
4
4
|
import { IARowCfg, IARowCfgObj, IColumnStyleCfg, IRowStyleCfg } from '../interfaces.ts';
|
|
5
5
|
import { SheetExtension } from './sheet-extension';
|
|
6
|
-
|
|
7
6
|
export interface IRowsHeaderCfgParam {
|
|
8
7
|
headerStyle?: Partial<IRowStyleCfg>;
|
|
9
8
|
rowsCfg?: IARowCfg[];
|
|
@@ -3,7 +3,6 @@ import { BORDER_TYPE } from '../../basics/const';
|
|
|
3
3
|
import { DocumentSkeleton } from '../docs/layout/doc-skeleton';
|
|
4
4
|
import { Canvas } from '../../canvas';
|
|
5
5
|
import { UniverRenderingContext } from '../../context';
|
|
6
|
-
|
|
7
6
|
export interface BorderCache {
|
|
8
7
|
[key: string]: BorderCacheItem | {};
|
|
9
8
|
}
|
|
@@ -4,7 +4,6 @@ import { UniverRenderingContext } from '../../context';
|
|
|
4
4
|
import { IRowsHeaderCfgParam, RowHeaderLayout } from './extensions/row-header-layout';
|
|
5
5
|
import { SpreadsheetHeader } from './sheet-component';
|
|
6
6
|
import { SpreadsheetSkeleton } from './sheet-skeleton';
|
|
7
|
-
|
|
8
7
|
export declare class SpreadsheetRowHeader extends SpreadsheetHeader {
|
|
9
8
|
getDocuments(): void;
|
|
10
9
|
getNoMergeCellPositionByIndex(rowIndex: number, columnIndex: number): Nullable<{
|
|
@@ -4,7 +4,6 @@ import { UniverRenderingContext } from '../../context';
|
|
|
4
4
|
import { RenderComponent } from '../component';
|
|
5
5
|
import { SHEET_EXTENSION_TYPE } from './extensions/sheet-extension';
|
|
6
6
|
import { SpreadsheetSkeleton } from './sheet-skeleton';
|
|
7
|
-
|
|
8
7
|
export declare abstract class SheetComponent extends RenderComponent<SpreadsheetSkeleton, SHEET_EXTENSION_TYPE, IRange[]> {
|
|
9
8
|
private _skeleton?;
|
|
10
9
|
constructor(oKey: string, _skeleton?: SpreadsheetSkeleton | undefined);
|
|
@@ -3,7 +3,6 @@ import { IBoundRectNoAngle, IViewportInfo } from '../../basics/vector2';
|
|
|
3
3
|
import { DocumentSkeleton } from '../docs/layout/doc-skeleton';
|
|
4
4
|
import { Skeleton } from '../skeleton';
|
|
5
5
|
import { IStylesCache } from './interfaces';
|
|
6
|
-
|
|
7
6
|
/**
|
|
8
7
|
* Obtain the height and width of a cell's text, taking into account scenarios with rotated text.
|
|
9
8
|
* @param documentSkeleton Data of the document's ViewModel
|
|
@@ -36,6 +35,10 @@ export declare const DEFAULT_PADDING_DATA: {
|
|
|
36
35
|
r: number;
|
|
37
36
|
};
|
|
38
37
|
export declare const RENDER_RAW_FORMULA_KEY = "RENDER_RAW_FORMULA";
|
|
38
|
+
export interface ICacheItem {
|
|
39
|
+
bg: boolean;
|
|
40
|
+
border: boolean;
|
|
41
|
+
}
|
|
39
42
|
export declare class SpreadsheetSkeleton extends Skeleton {
|
|
40
43
|
readonly worksheet: Worksheet;
|
|
41
44
|
/**
|
|
@@ -107,6 +110,10 @@ export declare class SpreadsheetSkeleton extends Skeleton {
|
|
|
107
110
|
calculate(bounds?: IViewportInfo): this;
|
|
108
111
|
calculateAutoHeightInRange(ranges: Nullable<IRange[]>): IRowAutoHeightInfo[];
|
|
109
112
|
private _calculateRowAutoHeight;
|
|
113
|
+
/**
|
|
114
|
+
* Calculate data for row col & cell position, then update position value to this._rowHeaderWidth & this._rowHeightAccumulation & this._columnHeaderHeight & this._columnWidthAccumulation.
|
|
115
|
+
* @returns this
|
|
116
|
+
*/
|
|
110
117
|
private _updateLayout;
|
|
111
118
|
private _dynamicallyUpdateRowHeaderWidth;
|
|
112
119
|
getRowColumnSegment(bounds?: IViewportInfo): IRange;
|
|
@@ -274,8 +281,9 @@ export declare class SpreadsheetSkeleton extends Skeleton {
|
|
|
274
281
|
intersectMergeRange(row: number, column: number): boolean;
|
|
275
282
|
private _calculateStylesCache;
|
|
276
283
|
private _resetCache;
|
|
284
|
+
resetCache(): void;
|
|
277
285
|
private _makeDocumentSkeletonDirty;
|
|
278
|
-
private
|
|
286
|
+
private _setCellStylesCache;
|
|
279
287
|
private _updateConfigAndGetDocumentModel;
|
|
280
288
|
private _getDocumentDataByStyle;
|
|
281
289
|
/**
|
|
@@ -9,7 +9,6 @@ import { Font } from './extensions/font';
|
|
|
9
9
|
import { SheetComponent } from './sheet-component';
|
|
10
10
|
import { SpreadsheetSkeleton } from './sheet-skeleton';
|
|
11
11
|
import { IPaintForRefresh, IPaintForScrolling, SHEET_VIEWPORT_KEY } from './interfaces';
|
|
12
|
-
|
|
13
12
|
export declare class Spreadsheet extends SheetComponent {
|
|
14
13
|
private _allowCache;
|
|
15
14
|
private _backgroundExtension;
|
|
@@ -33,8 +32,6 @@ export declare class Spreadsheet extends SheetComponent {
|
|
|
33
32
|
dispose(): void;
|
|
34
33
|
/**
|
|
35
34
|
* draw by viewport
|
|
36
|
-
* cacheBound ---> viewBound
|
|
37
|
-
* diffCacheBounds ---> diffRange
|
|
38
35
|
* @param ctx
|
|
39
36
|
* @param viewportInfo
|
|
40
37
|
*/
|
|
@@ -2,16 +2,20 @@ import { Nullable, EventSubject } from '@univerjs/core';
|
|
|
2
2
|
import { UniverRenderingContext } from '../../context';
|
|
3
3
|
import { Scene } from '../../scene';
|
|
4
4
|
import { SceneViewer } from '../../scene-viewer';
|
|
5
|
-
|
|
6
5
|
export declare enum SLIDE_NAVIGATION_KEY {
|
|
7
6
|
LEFT = "__slideNavigationLeft__",
|
|
8
7
|
RIGHT = "__slideNavigationRight__"
|
|
9
8
|
}
|
|
10
9
|
export declare class Slide extends SceneViewer {
|
|
11
10
|
slideChangePageByNavigation$: EventSubject<Nullable<string>>;
|
|
11
|
+
subSceneChanged$: EventSubject<Scene>;
|
|
12
12
|
private _navigationEnabled;
|
|
13
13
|
activeFirstPage(): void;
|
|
14
|
-
|
|
14
|
+
/**
|
|
15
|
+
* add pageScene to this._subScenes
|
|
16
|
+
* @param pageScene
|
|
17
|
+
*/
|
|
18
|
+
addPageScene(pageScene: Scene): void;
|
|
15
19
|
changePage(id?: string): void;
|
|
16
20
|
hasPage(key: string): import('../../thin-scene').ThinScene | undefined;
|
|
17
21
|
addNavigation(): void;
|
package/lib/types/engine.d.ts
CHANGED
|
@@ -3,7 +3,6 @@ import { CURSOR_TYPE } from './basics/const';
|
|
|
3
3
|
import { Canvas, CanvasRenderMode } from './canvas';
|
|
4
4
|
import { Scene } from './scene';
|
|
5
5
|
import { ThinEngine } from './thin-engine';
|
|
6
|
-
|
|
7
6
|
export declare class Engine extends ThinEngine<Scene> {
|
|
8
7
|
renderEvenInBackground: boolean;
|
|
9
8
|
private readonly _beginFrame$;
|
package/lib/types/group.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { BaseObject } from './base-object';
|
|
|
2
2
|
import { CURSOR_TYPE, RENDER_CLASS_TYPE } from './basics/const';
|
|
3
3
|
import { IViewportInfo, Vector2 } from './basics/vector2';
|
|
4
4
|
import { UniverRenderingContext } from './context';
|
|
5
|
-
|
|
6
5
|
export declare class Group extends BaseObject {
|
|
7
6
|
private _objects;
|
|
8
7
|
private _selfSizeMode;
|
package/lib/types/layer.d.ts
CHANGED
|
@@ -6,12 +6,16 @@ import { SheetComponent } from '../components/sheets/sheet-component';
|
|
|
6
6
|
import { Slide } from '../components/slides/slide';
|
|
7
7
|
import { Engine } from '../engine';
|
|
8
8
|
import { IRender, RenderUnit } from './render-unit';
|
|
9
|
-
|
|
10
9
|
export type RenderComponentType = SheetComponent | DocComponent | Slide | BaseObject;
|
|
11
10
|
export interface IRenderManagerService extends IDisposable {
|
|
12
11
|
/** @deprecated */
|
|
13
12
|
currentRender$: Observable<Nullable<string>>;
|
|
14
13
|
addRender(unitId: string, renderer: IRender): void;
|
|
14
|
+
/**
|
|
15
|
+
* create renderUnit & init deps from renderDependencies by renderUnit's type.
|
|
16
|
+
* @param unitId
|
|
17
|
+
* @returns renderUnit:IRender
|
|
18
|
+
*/
|
|
15
19
|
createRender(unitId: string): IRender;
|
|
16
20
|
removeRender(unitId: string): void;
|
|
17
21
|
setCurrent(unitId: string): void;
|
|
@@ -36,6 +40,11 @@ export interface IRenderManagerService extends IDisposable {
|
|
|
36
40
|
getFirst(): Nullable<IRender>;
|
|
37
41
|
has(unitId: string): boolean;
|
|
38
42
|
withCurrentTypeOfUnit<T>(type: UniverInstanceType, id: DependencyIdentifier<T>): Nullable<T>;
|
|
43
|
+
/**
|
|
44
|
+
* add dep to _renderDependencies(type, dep)
|
|
45
|
+
* @param type
|
|
46
|
+
* @param depCtor
|
|
47
|
+
*/
|
|
39
48
|
registerRenderModule<T extends UnitModel>(type: UnitType, dep: Dependency<T>): IDisposable;
|
|
40
49
|
}
|
|
41
50
|
export declare class RenderManagerService extends Disposable implements IRenderManagerService {
|
|
@@ -58,14 +67,41 @@ export declare class RenderManagerService extends Disposable implements IRenderM
|
|
|
58
67
|
constructor(_injector: Injector, _univerInstanceService: IUniverInstanceService);
|
|
59
68
|
dispose(): void;
|
|
60
69
|
registerRenderModules(type: UnitType, deps: Dependency[]): IDisposable;
|
|
61
|
-
|
|
62
|
-
|
|
70
|
+
/**
|
|
71
|
+
* add dep to _renderDependencies(type, dep)
|
|
72
|
+
* @param type
|
|
73
|
+
* @param depCtor
|
|
74
|
+
*/
|
|
75
|
+
registerRenderModule(type: UnitType, depCtor: Dependency): IDisposable;
|
|
76
|
+
/**
|
|
77
|
+
* get render dependencies from _renderDependencies
|
|
78
|
+
* @param type
|
|
79
|
+
* @returns Dependency[]
|
|
80
|
+
*/
|
|
81
|
+
private _getRenderDepsByType;
|
|
63
82
|
create(unitId: string): void;
|
|
83
|
+
/**
|
|
84
|
+
* create renderUnit & init deps from renderDependencies
|
|
85
|
+
* @param unitId
|
|
86
|
+
* @returns renderUnit:IRender
|
|
87
|
+
*/
|
|
64
88
|
createRender(unitId: string): IRender;
|
|
65
89
|
getAllRenderersOfType(type: UniverInstanceType): RenderUnit[];
|
|
66
90
|
getCurrentTypeOfRenderer(type: UniverInstanceType): Nullable<RenderUnit>;
|
|
67
91
|
withCurrentTypeOfUnit<T>(type: UniverInstanceType, id: DependencyIdentifier<T>): Nullable<T>;
|
|
92
|
+
/**
|
|
93
|
+
* init deps by injector.get(dep), and injector derives from renderer.
|
|
94
|
+
* @param renderer
|
|
95
|
+
* @param deps
|
|
96
|
+
*/
|
|
68
97
|
private _tryAddRenderDependencies;
|
|
98
|
+
/**
|
|
99
|
+
* create renderUnit & init deps from renderDependencies by renderUnit's type
|
|
100
|
+
* @param unitId
|
|
101
|
+
* @param engine
|
|
102
|
+
* @param isMainScene
|
|
103
|
+
* @returns renderUnit:IRender
|
|
104
|
+
*/
|
|
69
105
|
private _createRender;
|
|
70
106
|
addRender(unitId: string, item: IRender): void;
|
|
71
107
|
private _addRenderUnit;
|
|
@@ -74,6 +110,11 @@ export declare class RenderManagerService extends Disposable implements IRenderM
|
|
|
74
110
|
setCurrent(unitId: string): void;
|
|
75
111
|
getCurrent(): IRender | undefined;
|
|
76
112
|
getFirst(): IRender;
|
|
113
|
+
/**
|
|
114
|
+
* get RenderUnit from this._renderMap
|
|
115
|
+
* @param unitId
|
|
116
|
+
* @returns RenderUnit, aka IRender
|
|
117
|
+
*/
|
|
77
118
|
getRenderById(unitId: string): Nullable<IRender>;
|
|
78
119
|
getRenderAll(): Map<string, IRender>;
|
|
79
120
|
private _disposeItem;
|
|
@@ -2,7 +2,11 @@ import { Dependency, DependencyIdentifier, IDisposable, Nullable, UnitModel, Uni
|
|
|
2
2
|
import { Engine } from '../engine';
|
|
3
3
|
import { Scene } from '../scene';
|
|
4
4
|
import { RenderComponentType } from './render-manager.service';
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Public interface of a {@link RenderUnit}.
|
|
7
|
+
*
|
|
8
|
+
* @property {string} unitId - The id of the RenderUnit.
|
|
9
|
+
*/
|
|
6
10
|
export interface IRender {
|
|
7
11
|
unitId: string;
|
|
8
12
|
type: UniverInstanceType;
|
|
@@ -14,17 +18,22 @@ export interface IRender {
|
|
|
14
18
|
isThumbNail?: boolean;
|
|
15
19
|
with<T>(dependency: DependencyIdentifier<T>): T;
|
|
16
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* Every render module should implement this interface.
|
|
23
|
+
*/
|
|
17
24
|
export interface IRenderModule extends IDisposable {
|
|
18
25
|
}
|
|
19
26
|
/**
|
|
20
|
-
* This
|
|
27
|
+
* Necessary context for a render module.This interface would be the first argument of render modules' constructor
|
|
28
|
+
* functions.
|
|
21
29
|
*/
|
|
22
30
|
export interface IRenderContext<T extends UnitModel = UnitModel> extends Omit<IRender, 'with'> {
|
|
23
31
|
unit: T;
|
|
24
32
|
type: UnitType;
|
|
25
33
|
}
|
|
26
34
|
/**
|
|
27
|
-
* This class is
|
|
35
|
+
* This class is necessary for Univer to render several units in the same webpage. It encapsulates the rendering
|
|
36
|
+
* context and rendering modules for a specific unit.
|
|
28
37
|
*/
|
|
29
38
|
export declare class RenderUnit extends Disposable implements IRender {
|
|
30
39
|
readonly isRenderUnit: boolean;
|
|
@@ -44,9 +53,13 @@ export declare class RenderUnit extends Disposable implements IRender {
|
|
|
44
53
|
constructor(init: Pick<IRenderContext, 'engine' | 'scene' | 'isMainScene' | 'unit'>, parentInjector: Injector);
|
|
45
54
|
dispose(): void;
|
|
46
55
|
/**
|
|
47
|
-
* Get
|
|
56
|
+
* Get a dependency from the RenderUnit's injector.
|
|
48
57
|
*/
|
|
49
58
|
with<T>(dependency: DependencyIdentifier<T>): T;
|
|
59
|
+
/**
|
|
60
|
+
* Add render dependencies to the RenderUnit's injector. Note that the dependencies would be initialized immediately
|
|
61
|
+
* after being added.
|
|
62
|
+
*/
|
|
50
63
|
addRenderDependencies(dependencies: Dependency[]): void;
|
|
51
64
|
private _initDependencies;
|
|
52
65
|
}
|
|
@@ -5,7 +5,6 @@ import { IObjectFullState } from './basics/interfaces';
|
|
|
5
5
|
import { IViewportInfo, Vector2 } from './basics/vector2';
|
|
6
6
|
import { UniverRenderingContext } from './context';
|
|
7
7
|
import { ThinScene } from './thin-scene';
|
|
8
|
-
|
|
9
8
|
export declare class SceneViewer extends BaseObject {
|
|
10
9
|
private _subScenes;
|
|
11
10
|
private _activeSubScene;
|
package/lib/types/scene.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ import { ThinEngine } from './thin-engine';
|
|
|
12
12
|
import { ThinScene } from './thin-scene';
|
|
13
13
|
import { Viewport } from './viewport';
|
|
14
14
|
import { ITransformerConfig } from './basics/transformer-config';
|
|
15
|
-
|
|
15
|
+
import { Engine } from './engine';
|
|
16
16
|
export declare class Scene extends ThinScene {
|
|
17
17
|
private _parent;
|
|
18
18
|
private _layers;
|
|
@@ -49,8 +49,10 @@ export declare class Scene extends ThinScene {
|
|
|
49
49
|
resize(width?: number, height?: number): this;
|
|
50
50
|
setScaleValue(scaleX: number, scaleY: number): void;
|
|
51
51
|
/**
|
|
52
|
-
* scale to
|
|
53
|
-
*
|
|
52
|
+
* Set scale, and then emit event to update Viewport scroll state.
|
|
53
|
+
* @param scaleX
|
|
54
|
+
* @param scaleY
|
|
55
|
+
* @returns Scene
|
|
54
56
|
*/
|
|
55
57
|
scale(scaleX?: number, scaleY?: number): this;
|
|
56
58
|
/**
|
|
@@ -58,19 +60,23 @@ export declare class Scene extends ThinScene {
|
|
|
58
60
|
*/
|
|
59
61
|
scaleBy(scaleX?: number, scaleY?: number): this;
|
|
60
62
|
/**
|
|
61
|
-
*
|
|
62
|
-
* scene._setTransForm --> viewport@resetCanvasSizeAndUpdateScrollBar ---> scrollTo ---> limitedScroll ---> onScrollBeforeObserver ---> setScrollInfo
|
|
63
|
-
* scrollInfo needs accurate scene width & height, limitedScroll depends on scene & engine's width & height
|
|
63
|
+
* Reset canvas size and update scroll
|
|
64
64
|
* @param state
|
|
65
65
|
*/
|
|
66
66
|
transformByState(state: ISceneTransformState): void;
|
|
67
67
|
getParent(): ThinEngine<Scene> | SceneViewer;
|
|
68
|
-
getEngine(): Nullable<
|
|
68
|
+
getEngine(): Nullable<Engine>;
|
|
69
69
|
getLayers(): Layer[];
|
|
70
70
|
getLayer(zIndex?: number): Layer;
|
|
71
71
|
getLayerMaxZIndex(): number;
|
|
72
72
|
addLayer(...argument: Layer[]): void;
|
|
73
73
|
addObjects(objects: BaseObject[], zIndex?: number): this;
|
|
74
|
+
/**
|
|
75
|
+
* Add object to Layer (Layer is specified by zIndex).
|
|
76
|
+
* @param o
|
|
77
|
+
* @param zIndex layer index
|
|
78
|
+
* @returns scene
|
|
79
|
+
*/
|
|
74
80
|
addObject(o: BaseObject, zIndex?: number): this;
|
|
75
81
|
/**
|
|
76
82
|
* make object parent to scene
|
|
@@ -101,6 +107,10 @@ export declare class Scene extends ThinScene {
|
|
|
101
107
|
getViewport(key: string): Viewport | undefined;
|
|
102
108
|
render(parentCtx?: UniverRenderingContext): void;
|
|
103
109
|
requestRender(parentCtx?: UniverRenderingContext): Promise<unknown>;
|
|
110
|
+
/**
|
|
111
|
+
* create transformer if not exist, and then transformer attach to object that passed in by parameter.
|
|
112
|
+
* @param o
|
|
113
|
+
*/
|
|
104
114
|
attachTransformerTo(o: BaseObject): void;
|
|
105
115
|
detachTransformerFrom(o: BaseObject): void;
|
|
106
116
|
initTransformer(config?: ITransformerConfig): void;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Disposable } from '@univerjs/core';
|
|
2
2
|
import { IMouseEvent } from './basics/i-events';
|
|
3
3
|
import { ThinScene } from './thin-scene';
|
|
4
|
-
|
|
5
4
|
export declare class InputManager extends Disposable {
|
|
6
5
|
/** The distance in pixel that you have to move to prevent some events */
|
|
7
6
|
static DragMovementThreshold: number;
|
|
@@ -4,7 +4,6 @@ import { IMouseEvent, IPointerEvent } from './basics/i-events';
|
|
|
4
4
|
import { Group } from './group';
|
|
5
5
|
import { Scene } from './scene';
|
|
6
6
|
import { ITransformerConfig } from './basics/transformer-config';
|
|
7
|
-
|
|
8
7
|
declare enum MoveObserverType {
|
|
9
8
|
MOVE_START = 0,
|
|
10
9
|
MOVING = 1,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { IViewportInfo } from '../basics/vector2';
|
|
2
2
|
import { UniverRenderingContext } from '../context';
|
|
3
3
|
import { IRectProps, Rect } from './rect';
|
|
4
|
-
|
|
5
4
|
export declare class DashedRect extends Rect {
|
|
6
5
|
static drawWith(ctx: UniverRenderingContext, props: IRectProps | Rect): void;
|
|
7
6
|
protected _draw(ctx: UniverRenderingContext, viewportInfo?: IViewportInfo): void;
|
|
@@ -3,7 +3,6 @@ import { UniverRenderingContext } from '../context';
|
|
|
3
3
|
import { IObjectFullState, IViewportInfo, RENDER_CLASS_TYPE } from '../basics';
|
|
4
4
|
import { ObjectType } from '../base-object';
|
|
5
5
|
import { IShapeProps, Shape } from './shape';
|
|
6
|
-
|
|
7
6
|
export interface IImageProps extends IShapeProps {
|
|
8
7
|
image?: HTMLImageElement;
|
|
9
8
|
url?: string;
|
|
@@ -2,7 +2,6 @@ import { UniverRenderingContext } from '../context';
|
|
|
2
2
|
import { IViewportInfo } from '../basics/vector2';
|
|
3
3
|
import { ObjectType } from '../base-object';
|
|
4
4
|
import { IShapeProps, Shape } from './shape';
|
|
5
|
-
|
|
6
5
|
export interface IRectProps extends IShapeProps {
|
|
7
6
|
radius?: number;
|
|
8
7
|
}
|
|
@@ -2,7 +2,6 @@ import { IObjectFullState } from '../basics/interfaces';
|
|
|
2
2
|
import { IPoint, Vector2 } from '../basics/vector2';
|
|
3
3
|
import { UniverRenderingContext } from '../context';
|
|
4
4
|
import { IShapeProps, Shape } from './shape';
|
|
5
|
-
|
|
6
5
|
export interface IRegularPolygonProps extends IShapeProps {
|
|
7
6
|
pointsGroup: IPoint[][];
|
|
8
7
|
}
|