@univerjs/engine-render 0.2.15 → 0.3.0-alpha.1
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 +2172 -2167
- 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 +31 -6
- 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,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { DocumentSkeleton } from '../docs/layout/doc-skeleton';
|
|
3
|
-
import { Skeleton } from '../skeleton';
|
|
1
|
+
import { ICellData, IColumnRange, IPaddingData, IPosition, IRange, IRowAutoHeightInfo, IRowRange, ISelectionCellWithMergeInfo, ISize, IStyleData, ITextRotation, IWorksheetData, Nullable, Styles, Worksheet, BooleanNumber, DocumentDataModel, HorizontalAlign, IContextService, LocaleService, ObjectMatrix, VerticalAlign, WrapStrategy } from '@univerjs/core';
|
|
4
2
|
import { IBoundRectNoAngle, IViewportInfo } from '../../basics/vector2';
|
|
5
3
|
import { IFontCacheItem, IStylesCache } from './interfaces';
|
|
4
|
+
import { DocumentSkeleton } from '../docs/layout/doc-skeleton';
|
|
5
|
+
import { Skeleton } from '../skeleton';
|
|
6
6
|
/**
|
|
7
7
|
* Obtain the height and width of a cell's text, taking into account scenarios with rotated text.
|
|
8
8
|
* @param documentSkeleton Data of the document's ViewModel
|
|
@@ -55,7 +55,9 @@ 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 _handleBgMatrix;
|
|
59
|
+
private _handleBorderMatrix;
|
|
60
|
+
private _handleFontMatrix;
|
|
59
61
|
private _showGridlines;
|
|
60
62
|
private _marginTop;
|
|
61
63
|
private _marginLeft;
|
|
@@ -211,6 +213,13 @@ export declare class SpreadsheetSkeleton extends Skeleton {
|
|
|
211
213
|
getSelectionMergeBounding(startRow: number, startColumn: number, endRow: number, endColumn: number): IRange;
|
|
212
214
|
getBlankCellDocumentModel(cell: Nullable<ICellData>): IDocumentLayoutObject;
|
|
213
215
|
getCellDocumentModelWithFormula(cell: ICellData): Nullable<IDocumentLayoutObject>;
|
|
216
|
+
/**
|
|
217
|
+
* This method generates a document model based on the cell's properties and handles the associated styles and configurations.
|
|
218
|
+
* If the cell does not exist, it will return null.
|
|
219
|
+
* PS: This method has significant impact on performance.
|
|
220
|
+
* @param cell
|
|
221
|
+
* @param options
|
|
222
|
+
*/
|
|
214
223
|
private _getCellDocumentModel;
|
|
215
224
|
getDecomposedOffset(offsetX: number, offsetY: number): {
|
|
216
225
|
row: number;
|
|
@@ -237,19 +246,29 @@ export declare class SpreadsheetSkeleton extends Skeleton {
|
|
|
237
246
|
private _getOverflowBound;
|
|
238
247
|
intersectMergeRange(row: number, column: number): boolean;
|
|
239
248
|
/**
|
|
249
|
+
* @deprecated use _getCellMergeInfo instead.
|
|
240
250
|
* get the current row and column segment visible merge data
|
|
241
251
|
* @returns {IRange} The visible merge data
|
|
242
252
|
*/
|
|
243
253
|
getCurrentRowColumnSegmentMergeData(range?: IRange): IRange[];
|
|
244
254
|
private _calculateStylesCache;
|
|
255
|
+
resetCache(): void;
|
|
245
256
|
/**
|
|
246
257
|
* Any changes to sheet model would reset cache.
|
|
247
258
|
*/
|
|
248
259
|
private _resetCache;
|
|
249
|
-
resetCache(): void;
|
|
250
260
|
private _makeDocumentSkeletonDirty;
|
|
261
|
+
_setBorderStylesCache(row: number, col: number, style: Nullable<IStyleData>, options: {
|
|
262
|
+
mergeRange?: IRange;
|
|
263
|
+
cacheItem?: ICacheItem;
|
|
264
|
+
} | undefined): void;
|
|
265
|
+
_setBgStylesCache(row: number, col: number, style: Nullable<IStyleData>, options: {
|
|
266
|
+
mergeRange?: IRange;
|
|
267
|
+
cacheItem?: ICacheItem;
|
|
268
|
+
} | undefined): void;
|
|
269
|
+
_setFontStylesCache(row: number, col: number, cell: Nullable<ICellData>): void;
|
|
251
270
|
/**
|
|
252
|
-
* Set border background and font to this._stylesCache
|
|
271
|
+
* Set border background and font to this._stylesCache
|
|
253
272
|
* @param row {number}
|
|
254
273
|
* @param col {number}
|
|
255
274
|
* @param options {{ mergeRange: IRange; cacheItem: ICacheItem } | undefined}
|
|
@@ -265,6 +284,12 @@ export declare class SpreadsheetSkeleton extends Skeleton {
|
|
|
265
284
|
private _setBorderProps;
|
|
266
285
|
private _getFontFormat;
|
|
267
286
|
private _getOtherStyle;
|
|
287
|
+
/**
|
|
288
|
+
* New version to get merge data.
|
|
289
|
+
* @param row
|
|
290
|
+
* @param column
|
|
291
|
+
* @returns {ISelectionCell} The cell info with merge data
|
|
292
|
+
*/
|
|
268
293
|
private _getCellMergeInfo;
|
|
269
294
|
/**
|
|
270
295
|
* 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';
|