@univerjs/engine-render 0.23.0 → 0.24.0-insiders.20260528-29f582d
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 +540 -146
- package/lib/es/index.js +536 -146
- package/lib/types/basics/index.d.ts +1 -0
- package/lib/types/basics/tools.d.ts +1 -0
- package/lib/types/basics/zoom.d.ts +17 -0
- package/lib/types/components/docs/doc-background.d.ts +6 -0
- package/lib/types/components/docs/doc-component.d.ts +4 -0
- package/lib/types/components/docs/document.d.ts +6 -0
- package/lib/types/components/docs/layout/block/paragraph/language-ruler.d.ts +4 -0
- package/lib/types/components/docs/layout/model/page.d.ts +1 -0
- package/lib/types/components/docs/table-render-viewport.d.ts +23 -0
- package/lib/types/components/sheets/interfaces.d.ts +2 -2
- package/lib/types/index.d.ts +2 -0
- package/lib/umd/index.js +2 -2
- package/package.json +3 -3
- package/LICENSE +0 -176
|
@@ -71,6 +71,7 @@ export declare function isEmojiGrapheme(grapheme: string): boolean;
|
|
|
71
71
|
export declare function startWithEmoji(text: string): boolean;
|
|
72
72
|
export declare function hasArabic(text: string): boolean;
|
|
73
73
|
export declare function hasTibetan(text: string): boolean;
|
|
74
|
+
export declare function hasThai(text: string): boolean;
|
|
74
75
|
export declare function hasSpace(text: string): boolean;
|
|
75
76
|
export declare function isCjkLeftAlignedPunctuation(text: string): boolean;
|
|
76
77
|
export declare function isCjkRightAlignedPunctuation(text: string): boolean;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import type { IWheelEvent } from './i-events';
|
|
17
|
+
export declare function getNextWheelZoomRatio(currentRatio: number, event: Pick<IWheelEvent, 'deltaMode' | 'deltaX' | 'deltaY' | 'wheelDelta'>): number;
|
|
@@ -20,9 +20,15 @@ import type { DocumentSkeleton } from './layout/doc-skeleton';
|
|
|
20
20
|
import { DocComponent } from './doc-component';
|
|
21
21
|
export declare class DocBackground extends DocComponent {
|
|
22
22
|
private _drawLiquid;
|
|
23
|
+
private _backgroundFillColor?;
|
|
24
|
+
private _pageFillColor?;
|
|
25
|
+
private _pageStrokeColor?;
|
|
26
|
+
private _marginStrokeColor?;
|
|
23
27
|
constructor(oKey: string, documentSkeleton?: DocumentSkeleton, config?: IDocumentsConfig);
|
|
24
28
|
static create(oKey: string, documentSkeleton?: DocumentSkeleton, config?: IDocumentsConfig): DocBackground;
|
|
29
|
+
setFillColors(backgroundFillColor?: string, pageFillColor?: string, pageStrokeColor?: string, marginStrokeColor?: string): void;
|
|
25
30
|
draw(ctx: UniverRenderingContext, bounds?: IViewportInfo): void;
|
|
31
|
+
private _drawWorkspaceBackground;
|
|
26
32
|
changeSkeleton(newSkeleton: DocumentSkeleton): this;
|
|
27
33
|
protected _draw(ctx: UniverRenderingContext, bounds?: IViewportInfo): void;
|
|
28
34
|
}
|
|
@@ -27,6 +27,10 @@ export interface IPageMarginLayout {
|
|
|
27
27
|
}
|
|
28
28
|
export interface IDocumentsConfig extends IPageMarginLayout {
|
|
29
29
|
hasEditor?: boolean;
|
|
30
|
+
backgroundFillColor?: string;
|
|
31
|
+
pageFillColor?: string;
|
|
32
|
+
pageStrokeColor?: string;
|
|
33
|
+
marginStrokeColor?: string;
|
|
30
34
|
}
|
|
31
35
|
export declare abstract class DocComponent extends RenderComponent<IDocumentSkeletonGlyph | IDocumentSkeletonLine, DOCS_EXTENSION_TYPE, IBoundRectNoAngle[]> {
|
|
32
36
|
private _skeleton?;
|
|
@@ -46,9 +46,15 @@ export declare class Documents extends DocComponent {
|
|
|
46
46
|
protected _draw(ctx: UniverRenderingContext, bounds?: IViewportInfo): void;
|
|
47
47
|
draw(ctx: UniverRenderingContext, bounds?: IViewportInfo): void;
|
|
48
48
|
private _drawTable;
|
|
49
|
+
private _getTableViewport;
|
|
50
|
+
private _getRenderUnitId;
|
|
49
51
|
private _drawBorderBottom;
|
|
50
52
|
private _drawTableCell;
|
|
51
53
|
private _drawTableCellBordersAndBg;
|
|
54
|
+
private _getTableCellSource;
|
|
55
|
+
private _resolveTableCellBorder;
|
|
56
|
+
private _isDrawableTableCellBorder;
|
|
57
|
+
private _drawTableCellBorder;
|
|
52
58
|
private _drawHeaderFooter;
|
|
53
59
|
private _horizontalHandler;
|
|
54
60
|
private _verticalHandler;
|
|
@@ -33,3 +33,7 @@ export declare function TibetanHandler(index: number, charArray: string, viewMod
|
|
|
33
33
|
step: number;
|
|
34
34
|
glyphGroup: import("../../../../..").IDocumentSkeletonGlyph[];
|
|
35
35
|
};
|
|
36
|
+
export declare function ThaiHandler(index: number, charArray: string, viewModel: DocumentViewModel, paragraphNode: DataStreamTreeNode, sectionBreakConfig: ISectionBreakConfig, paragraph: IParagraph): {
|
|
37
|
+
step: number;
|
|
38
|
+
glyphGroup: import("../../../../..").IDocumentSkeletonGlyph[];
|
|
39
|
+
};
|
|
@@ -26,3 +26,4 @@ export declare function createNullCellPage(ctx: ILayoutContext, sectionBreakConf
|
|
|
26
26
|
sectionBreakConfig: ISectionBreakConfig;
|
|
27
27
|
};
|
|
28
28
|
export declare function createSkeletonCellPages(ctx: ILayoutContext, viewModel: DocumentViewModel, cellNode: DataStreamTreeNode, sectionBreakConfig: ISectionBreakConfig, tableConfig: ITable, row: number, col: number, availableHeight?: number, maxCellPageHeight?: number): IDocumentSkeletonPage[];
|
|
29
|
+
export declare function expandCellPageHeightForInlineDrawings(pages: IDocumentSkeletonPage[]): void;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export interface IDocsTableRenderViewport {
|
|
17
|
+
contentWidth: number;
|
|
18
|
+
scrollLeft: number;
|
|
19
|
+
viewportWidth: number;
|
|
20
|
+
}
|
|
21
|
+
export type DocsTableRenderViewportProvider = (unitId: string, tableId: string) => IDocsTableRenderViewport | null | undefined;
|
|
22
|
+
export declare function setDocsTableRenderViewportProvider(provider: DocsTableRenderViewportProvider | null): void;
|
|
23
|
+
export declare function getDocsTableRenderViewport(unitId: string, tableId: string): IDocsTableRenderViewport | null;
|
|
@@ -80,8 +80,8 @@ export interface IPaintForScrolling {
|
|
|
80
80
|
leftOrigin: number;
|
|
81
81
|
bufferEdgeX: number;
|
|
82
82
|
bufferEdgeY: number;
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
rowHeaderWidthAndMarginLeft: number;
|
|
84
|
+
columnHeaderHeightAndMarginTop: number;
|
|
85
85
|
scaleX: number;
|
|
86
86
|
scaleY: number;
|
|
87
87
|
}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -29,6 +29,8 @@ export type { IFindNodeRestrictions } from './components/docs/layout/doc-skeleto
|
|
|
29
29
|
export { getCharSpaceApply, getLastLine, getNumberUnitValue, getPageFromPath, glyphIterator, lineIterator } from './components/docs/layout/tools';
|
|
30
30
|
export { getLastColumn } from './components/docs/layout/tools';
|
|
31
31
|
export { Liquid } from './components/docs/liquid';
|
|
32
|
+
export type { DocsTableRenderViewportProvider, IDocsTableRenderViewport } from './components/docs/table-render-viewport';
|
|
33
|
+
export { getDocsTableRenderViewport, setDocsTableRenderViewportProvider } from './components/docs/table-render-viewport';
|
|
32
34
|
export { DataStreamTreeNode } from './components/docs/view-model/data-stream-tree-node';
|
|
33
35
|
export { DocumentViewModel } from './components/docs/view-model/document-view-model';
|
|
34
36
|
export { DocumentEditArea } from './components/docs/view-model/document-view-model';
|