@univerjs/engine-render 0.2.15 → 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.
- package/lib/cjs/index.js +1 -1
- package/lib/es/index.js +2167 -2164
- package/lib/types/basics/index.d.ts +3 -3
- package/lib/types/components/docs/document.d.ts +1 -1
- package/lib/types/components/docs/layout/block/paragraph/line-adjustment.d.ts +2 -2
- package/lib/types/components/docs/layout/block/paragraph/linebreaking.d.ts +2 -2
- package/lib/types/components/docs/layout/block/paragraph/paragraph-layout.d.ts +1 -1
- package/lib/types/components/docs/layout/block/paragraph/shaping.d.ts +3 -3
- package/lib/types/components/docs/layout/doc-skeleton.d.ts +4 -0
- package/lib/types/components/docs/layout/tools.d.ts +1 -1
- package/lib/types/components/extension.d.ts +1 -1
- package/lib/types/components/index.d.ts +1 -1
- package/lib/types/components/sheets/extensions/index.d.ts +2 -2
- package/lib/types/components/sheets/interfaces.d.ts +5 -5
- package/lib/types/components/sheets/sheet-skeleton.d.ts +28 -4
- package/lib/types/scene.d.ts +3 -0
- package/lib/types/shape/index.d.ts +3 -3
- package/lib/umd/index.js +1 -1
- package/package.json +6 -6
|
@@ -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 '
|
|
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';
|
|
@@ -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,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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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
|
|
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,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';
|
|
@@ -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
|
|
23
|
-
type fontCache = Record<string, ObjectMatrix<IFontCacheItem>>;
|
|
22
|
+
type colorString = string;
|
|
24
23
|
export interface IStylesCache {
|
|
25
|
-
background?:
|
|
24
|
+
background?: Record<colorString, ObjectMatrix<string>>;
|
|
26
25
|
backgroundPositions?: ObjectMatrix<ISelectionCellWithMergeInfo>;
|
|
27
|
-
font?:
|
|
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';
|
|
@@ -55,7 +55,8 @@ export declare class SpreadsheetSkeleton extends Skeleton {
|
|
|
55
55
|
private _overflowCache;
|
|
56
56
|
private _stylesCache;
|
|
57
57
|
/** A matrix to store if a (row, column) position has render cache. */
|
|
58
|
-
private
|
|
58
|
+
private _cellBgCacheMatrix;
|
|
59
|
+
private _cellBorderCacheMatrix;
|
|
59
60
|
private _showGridlines;
|
|
60
61
|
private _marginTop;
|
|
61
62
|
private _marginLeft;
|
|
@@ -211,6 +212,13 @@ export declare class SpreadsheetSkeleton extends Skeleton {
|
|
|
211
212
|
getSelectionMergeBounding(startRow: number, startColumn: number, endRow: number, endColumn: number): IRange;
|
|
212
213
|
getBlankCellDocumentModel(cell: Nullable<ICellData>): IDocumentLayoutObject;
|
|
213
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
|
+
*/
|
|
214
222
|
private _getCellDocumentModel;
|
|
215
223
|
getDecomposedOffset(offsetX: number, offsetY: number): {
|
|
216
224
|
row: number;
|
|
@@ -237,19 +245,29 @@ export declare class SpreadsheetSkeleton extends Skeleton {
|
|
|
237
245
|
private _getOverflowBound;
|
|
238
246
|
intersectMergeRange(row: number, column: number): boolean;
|
|
239
247
|
/**
|
|
248
|
+
* @deprecated use _getCellMergeInfo instead.
|
|
240
249
|
* get the current row and column segment visible merge data
|
|
241
250
|
* @returns {IRange} The visible merge data
|
|
242
251
|
*/
|
|
243
252
|
getCurrentRowColumnSegmentMergeData(range?: IRange): IRange[];
|
|
244
253
|
private _calculateStylesCache;
|
|
254
|
+
resetCache(): void;
|
|
245
255
|
/**
|
|
246
256
|
* Any changes to sheet model would reset cache.
|
|
247
257
|
*/
|
|
248
258
|
private _resetCache;
|
|
249
|
-
resetCache(): void;
|
|
250
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;
|
|
251
269
|
/**
|
|
252
|
-
* Set border background and font to this._stylesCache
|
|
270
|
+
* Set border background and font to this._stylesCache
|
|
253
271
|
* @param row {number}
|
|
254
272
|
* @param col {number}
|
|
255
273
|
* @param options {{ mergeRange: IRange; cacheItem: ICacheItem } | undefined}
|
|
@@ -265,6 +283,12 @@ export declare class SpreadsheetSkeleton extends Skeleton {
|
|
|
265
283
|
private _setBorderProps;
|
|
266
284
|
private _getFontFormat;
|
|
267
285
|
private _getOtherStyle;
|
|
286
|
+
/**
|
|
287
|
+
* New version to get merge data.
|
|
288
|
+
* @param row
|
|
289
|
+
* @param column
|
|
290
|
+
* @returns {ISelectionCell} The cell info with merge data
|
|
291
|
+
*/
|
|
268
292
|
private _getCellMergeInfo;
|
|
269
293
|
/**
|
|
270
294
|
* Cache the merged cells on the current screen to improve computational performance.
|
package/lib/types/scene.d.ts
CHANGED
|
@@ -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
|
|
@@ -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';
|