@univerjs/engine-render
Advanced tools
Comparing version 0.2.15 to 0.3.0-alpha.0
@@ -16,2 +16,3 @@ /** | ||
*/ | ||
export * from '../components/docs/layout/shaping-engine/font-cache'; | ||
export * from './cell-data'; | ||
@@ -21,3 +22,3 @@ export * from './const'; | ||
export * from './draw'; | ||
export * from '../components/docs/layout/shaping-engine/font-cache'; | ||
export * from './group-transform'; | ||
export * from './i-document-skeleton-cached'; | ||
@@ -30,6 +31,5 @@ export * from './i-events'; | ||
export * from './scroll-xy'; | ||
export * from './text-rotation'; | ||
export * from './tools'; | ||
export * from './transform'; | ||
export * from './vector2'; | ||
export * from './text-rotation'; | ||
export * from './group-transform'; |
import { Nullable } from '@univerjs/core'; | ||
import { DocComponent, IDocumentsConfig, IPageMarginLayout } from './doc-component'; | ||
import { IDocumentSkeletonPage } from '../../basics/i-document-skeleton-cached'; | ||
@@ -6,3 +7,2 @@ import { Transform } from '../../basics/transform'; | ||
import { UniverRenderingContext } from '../../context'; | ||
import { IDocumentsConfig, IPageMarginLayout, DocComponent } from './doc-component'; | ||
import { DocumentSkeleton } from './layout/doc-skeleton'; | ||
@@ -9,0 +9,0 @@ export interface IPageRenderConfig { |
@@ -0,5 +1,5 @@ | ||
import { ISectionBreakConfig } from '../../../../../basics'; | ||
import { IDocumentSkeletonPage } from '../../../../../basics/i-document-skeleton-cached'; | ||
import { DataStreamTreeNode } from '../../../view-model/data-stream-tree-node'; | ||
import { DocumentViewModel } from '../../../view-model/document-view-model'; | ||
import { DataStreamTreeNode } from '../../../view-model/data-stream-tree-node'; | ||
import { ISectionBreakConfig } from '../../../../../basics'; | ||
export declare function lineAdjustment(pages: IDocumentSkeletonPage[], viewModel: DocumentViewModel, paragraphNode: DataStreamTreeNode, sectionBreakConfig: ISectionBreakConfig): void; |
import { Nullable } from '@univerjs/core'; | ||
import { IDocumentSkeletonPage, IDocumentSkeletonTable } from '../../../../../basics/i-document-skeleton-cached'; | ||
import { ILayoutContext } from '../../tools'; | ||
import { ISectionBreakConfig } from '../../../../../basics/interfaces'; | ||
import { DataStreamTreeNode } from '../../../view-model/data-stream-tree-node'; | ||
import { ISectionBreakConfig } from '../../../../../basics/interfaces'; | ||
import { DocumentViewModel } from '../../../view-model/document-view-model'; | ||
import { ILayoutContext } from '../../tools'; | ||
import { IShapedText } from './shaping'; | ||
export declare function lineBreaking(ctx: ILayoutContext, viewModel: DocumentViewModel, shapedTextList: IShapedText[], curPage: IDocumentSkeletonPage, paragraphNode: DataStreamTreeNode, sectionBreakConfig: ISectionBreakConfig, tableSkeleton: Nullable<IDocumentSkeletonTable>): IDocumentSkeletonPage[]; |
import { IDocumentSkeletonPage } from '../../../../../basics/i-document-skeleton-cached'; | ||
import { ISectionBreakConfig } from '../../../../../basics/interfaces'; | ||
import { ILayoutContext } from '../../tools'; | ||
import { DataStreamTreeNode } from '../../../view-model/data-stream-tree-node'; | ||
import { DocumentViewModel } from '../../../view-model/document-view-model'; | ||
import { ILayoutContext } from '../../tools'; | ||
export declare function dealWidthParagraph(ctx: ILayoutContext, viewModel: DocumentViewModel, paragraphNode: DataStreamTreeNode, curPage: IDocumentSkeletonPage, sectionBreakConfig: ISectionBreakConfig): IDocumentSkeletonPage[]; |
@@ -0,7 +1,7 @@ | ||
import { BreakPointType } from '../../line-breaker/break'; | ||
import { IDocumentSkeletonGlyph } from '../../../../../basics/i-document-skeleton-cached'; | ||
import { ILayoutContext } from '../../tools'; | ||
import { ISectionBreakConfig } from '../../../../../basics/interfaces'; | ||
import { DataStreamTreeNode } from '../../../view-model/data-stream-tree-node'; | ||
import { DocumentViewModel } from '../../../view-model/document-view-model'; | ||
import { ISectionBreakConfig } from '../../../../../basics/interfaces'; | ||
import { BreakPointType } from '../../line-breaker/break'; | ||
import { ILayoutContext } from '../../tools'; | ||
export interface IShapedText { | ||
@@ -8,0 +8,0 @@ text: string; |
@@ -31,2 +31,6 @@ import { LocaleService, Nullable } from '@univerjs/core'; | ||
getViewModel(): DocumentViewModel; | ||
/** | ||
* Layout the document. | ||
* PS: This method has significant impact on performance. | ||
*/ | ||
calculate(bounds?: IViewportInfo): void; | ||
@@ -33,0 +37,0 @@ getSkeletonData(): Nullable<IDocumentSkeletonCached>; |
@@ -1,2 +0,2 @@ | ||
import { BooleanNumber, GridType, SpacingRule, DocumentDataModel, INumberUnit, IObjectPositionH, IObjectPositionV, IParagraph, IParagraphStyle, ITextStyle, Nullable } from '@univerjs/core'; | ||
import { DocumentDataModel, INumberUnit, IObjectPositionH, IObjectPositionV, IParagraph, IParagraphStyle, ITextStyle, Nullable, BooleanNumber, GridType, SpacingRule } from '@univerjs/core'; | ||
import { IDocumentSkeletonCached, IDocumentSkeletonColumn, IDocumentSkeletonDivide, IDocumentSkeletonDrawing, IDocumentSkeletonFontStyle, IDocumentSkeletonGlyph, IDocumentSkeletonLine, IDocumentSkeletonPage, IDocumentSkeletonSection, ISkeletonResourceReference } from '../../../basics/i-document-skeleton-cached'; | ||
@@ -3,0 +3,0 @@ import { IDocsConfig, IParagraphConfig, ISectionBreakConfig } from '../../../basics/interfaces'; |
@@ -1,2 +0,2 @@ | ||
import { IDocumentRenderConfig, IRange, IScale, Nullable, Registry } from '@univerjs/core'; | ||
import { Registry, IDocumentRenderConfig, IRange, IScale, Nullable } from '@univerjs/core'; | ||
import { BaseObject } from '../base-object'; | ||
@@ -3,0 +3,0 @@ import { Vector2 } from '../basics/vector2'; |
@@ -19,4 +19,4 @@ /** | ||
export * from './sheets'; | ||
export { RENDER_RAW_FORMULA_KEY } from './sheets/sheet-skeleton'; | ||
export * from './skeleton'; | ||
export { RENDER_RAW_FORMULA_KEY } from './sheets/sheet-skeleton'; | ||
export * from './slides'; |
@@ -19,6 +19,6 @@ /** | ||
export * from './column-header-layout'; | ||
export * from './custom'; | ||
export * from './font'; | ||
export * from './marker'; | ||
export * from './row-header-layout'; | ||
export * from './sheet-extension'; | ||
export * from './marker'; | ||
export * from './custom'; |
import { BorderStyleTypes, HorizontalAlign, ISelectionCellWithMergeInfo, ObjectMatrix, VerticalAlign, WrapStrategy } from '@univerjs/core'; | ||
import { BORDER_TYPE } from '../../basics/const'; | ||
import { DocumentSkeleton } from '../docs/layout/doc-skeleton'; | ||
import { Canvas } from '../../canvas'; | ||
import { UniverRenderingContext } from '../../context'; | ||
import { DocumentSkeleton } from '../docs/layout/doc-skeleton'; | ||
export interface BorderCache { | ||
@@ -22,8 +22,8 @@ [key: string]: BorderCacheItem | {}; | ||
} | ||
type backgroundCache = Record<string, ObjectMatrix<string>>; | ||
type fontCache = Record<string, ObjectMatrix<IFontCacheItem>>; | ||
type colorString = string; | ||
export interface IStylesCache { | ||
background?: backgroundCache; | ||
background?: Record<colorString, ObjectMatrix<string>>; | ||
backgroundPositions?: ObjectMatrix<ISelectionCellWithMergeInfo>; | ||
font?: fontCache; | ||
font?: Record<string, ObjectMatrix<IFontCacheItem>>; | ||
fontMatrix: ObjectMatrix<IFontCacheItem>; | ||
border?: ObjectMatrix<BorderCache>; | ||
@@ -30,0 +30,0 @@ } |
@@ -1,2 +0,2 @@ | ||
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'; | ||
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'; | ||
import { DocumentSkeleton } from '../docs/layout/doc-skeleton'; | ||
@@ -58,3 +58,4 @@ import { Skeleton } from '../skeleton'; | ||
/** A matrix to store if a (row, column) position has render cache. */ | ||
private _cellBgAndBorderCache; | ||
private _cellBgCacheMatrix; | ||
private _cellBorderCacheMatrix; | ||
private _showGridlines; | ||
@@ -215,2 +216,9 @@ private _marginTop; | ||
getCellDocumentModelWithFormula(cell: ICellData): Nullable<IDocumentLayoutObject>; | ||
/** | ||
* This method generates a document model based on the cell's properties and handles the associated styles and configurations. | ||
* If the cell does not exist, it will return null. | ||
* PS: This method has significant impact on performance. | ||
* @param cell | ||
* @param options | ||
*/ | ||
private _getCellDocumentModel; | ||
@@ -242,2 +250,3 @@ getDecomposedOffset(offsetX: number, offsetY: number): { | ||
/** | ||
* @deprecated use _getCellMergeInfo instead. | ||
* get the current row and column segment visible merge data | ||
@@ -248,2 +257,3 @@ * @returns {IRange} The visible merge data | ||
private _calculateStylesCache; | ||
resetCache(): void; | ||
/** | ||
@@ -253,6 +263,14 @@ * Any changes to sheet model would reset cache. | ||
private _resetCache; | ||
resetCache(): void; | ||
private _makeDocumentSkeletonDirty; | ||
_setBorderStylesCache(row: number, col: number, style: Nullable<IStyleData>, options: { | ||
mergeRange?: IRange; | ||
cacheItem?: ICacheItem; | ||
} | undefined): void; | ||
_setBgStylesCache(row: number, col: number, style: Nullable<IStyleData>, options: { | ||
mergeRange?: IRange; | ||
cacheItem?: ICacheItem; | ||
} | undefined): void; | ||
_setFontStylesCache(cell: Nullable<ICellData>, row: number, col: number): void; | ||
/** | ||
* Set border background and font to this._stylesCache { border font background } | ||
* Set border background and font to this._stylesCache | ||
* @param row {number} | ||
@@ -273,2 +291,8 @@ * @param col {number} | ||
private _getOtherStyle; | ||
/** | ||
* New version to get merge data. | ||
* @param row | ||
* @param column | ||
* @returns {ISelectionCell} The cell info with merge data | ||
*/ | ||
private _getCellMergeInfo; | ||
@@ -275,0 +299,0 @@ /** |
@@ -11,2 +11,3 @@ import { Nullable } from '@univerjs/core'; | ||
import { Vector2 } from './basics/vector2'; | ||
import { Canvas } from './canvas'; | ||
import { UniverRenderingContext } from './context'; | ||
@@ -25,2 +26,4 @@ import { Engine } from './engine'; | ||
readonly addObject$: import('rxjs').Observable<Scene>; | ||
private _beforeRender$; | ||
readonly beforeRender$: import('rxjs').Observable<Nullable<Canvas>>; | ||
/** | ||
@@ -27,0 +30,0 @@ * Transformer constructor. Transformer is a special type of group that allow you transform |
@@ -16,7 +16,9 @@ /** | ||
*/ | ||
export * from './checkbox'; | ||
export * from './circle'; | ||
export * from './control'; | ||
export * from './dashedrect'; | ||
export * from './drawing'; | ||
export * from './image'; | ||
export * from './path'; | ||
export * from './image'; | ||
export * from './rect'; | ||
@@ -27,3 +29,1 @@ export * from './regular-polygon'; | ||
export * from './shape'; | ||
export * from './checkbox'; | ||
export * from './dashedrect'; |
{ | ||
"name": "@univerjs/engine-render", | ||
"version": "0.2.15", | ||
"version": "0.3.0-alpha.0", | ||
"private": false, | ||
@@ -50,3 +50,3 @@ "description": "UniverSheet normal base-render", | ||
"rxjs": ">=7.0.0", | ||
"@univerjs/core": "0.2.15" | ||
"@univerjs/core": "0.3.0-alpha.0" | ||
}, | ||
@@ -59,3 +59,3 @@ "dependencies": { | ||
"opentype.js": "^1.3.4", | ||
"@univerjs/core": "0.2.15" | ||
"@univerjs/core": "0.3.0-alpha.0" | ||
}, | ||
@@ -66,5 +66,5 @@ "devDependencies": { | ||
"typescript": "^5.6.2", | ||
"vite": "^5.4.4", | ||
"vitest": "^2.0.5", | ||
"@univerjs-infra/shared": "0.2.15" | ||
"vite": "^5.4.8", | ||
"vitest": "^2.1.1", | ||
"@univerjs-infra/shared": "0.3.0-alpha.0" | ||
}, | ||
@@ -71,0 +71,0 @@ "browser": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
18618895
88013
+ Added@univerjs/core@0.3.0-alpha.0(transitive)
+ Addedlodash-es@4.17.21(transitive)
- Removed@types/lodash@4.17.15(transitive)
- Removed@types/lodash.mergewith@4.6.9(transitive)
- Removed@univerjs/core@0.2.15(transitive)
- Removedlodash.mergewith@4.6.2(transitive)
Updated@univerjs/core@0.3.0-alpha.0