@univerjs/engine-render 0.2.6 → 0.2.8
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 +6581 -5298
- package/lib/types/base-object.d.ts +4 -1
- package/lib/types/basics/cell-data.d.ts +0 -1
- package/lib/types/basics/document-node-tools.d.ts +7 -2
- 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 +30 -4
- package/lib/types/basics/i-events.d.ts +0 -1
- package/lib/types/basics/interfaces.d.ts +8 -2
- 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 +4 -2
- 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 +3 -1
- 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 +0 -1
- package/lib/types/components/docs/layout/block/paragraph/layout-ruler.d.ts +0 -1
- 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 +3 -3
- package/lib/types/components/docs/layout/block/paragraph/{layout.d.ts → 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 +12 -0
- package/lib/types/components/docs/layout/doc-skeleton.d.ts +1 -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 +3 -3
- package/lib/types/components/docs/layout/model/page.d.ts +4 -1
- package/lib/types/components/docs/layout/model/section.d.ts +0 -1
- package/lib/types/components/docs/layout/model/table.d.ts +15 -0
- 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 -2
- package/lib/types/components/docs/liquid.d.ts +0 -1
- package/lib/types/components/docs/text-selection/convert-rect-range.d.ts +29 -0
- package/lib/types/components/docs/text-selection/{convert-cursor.d.ts → convert-text-range.d.ts} +7 -3
- package/lib/types/components/docs/text-selection/range-interface.d.ts +21 -0
- package/lib/types/components/docs/text-selection/rect-range.d.ts +48 -0
- package/lib/types/components/docs/text-selection/selection-utils.d.ts +27 -0
- package/lib/types/components/docs/text-selection/text-range.d.ts +8 -5
- package/lib/types/components/docs/text-selection/text-selection-render-manager.d.ts +28 -21
- 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 +4 -6
- 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 +1 -1
- package/lib/types/components/sheets/spreadsheet.d.ts +0 -1
- 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 +5 -1
- package/lib/types/floating/util.d.ts +0 -1
- package/lib/types/group.d.ts +0 -1
- package/lib/types/index.d.ts +11 -3
- package/lib/types/layer.d.ts +4 -1
- package/lib/types/render-engine.d.ts +0 -1
- package/lib/types/render-manager/render-manager.service.d.ts +49 -3
- package/lib/types/render-manager/render-unit.d.ts +4 -3
- package/lib/types/scene-viewer.d.ts +0 -1
- package/lib/types/scene.d.ts +13 -1
- package/lib/types/scene.input-manager.d.ts +0 -1
- package/lib/types/scene.transformer.d.ts +5 -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 +67 -6
- 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 +0 -1
- package/lib/umd/index.js +4 -2
- package/package.json +6 -6
|
@@ -7,7 +7,6 @@ import { IViewportInfo, Vector2 } from './basics/vector2';
|
|
|
7
7
|
import { UniverRenderingContext } from './context';
|
|
8
8
|
import { Layer } from './layer';
|
|
9
9
|
import { ITransformerConfig } from './basics/transformer-config';
|
|
10
|
-
|
|
11
10
|
export declare const BASE_OBJECT_ARRAY: string[];
|
|
12
11
|
export declare enum ObjectType {
|
|
13
12
|
UNKNOWN = 0,
|
|
@@ -134,6 +133,10 @@ export declare abstract class BaseObject extends Disposable {
|
|
|
134
133
|
scale(scaleX?: number, scaleY?: number): this;
|
|
135
134
|
skew(skewX?: number, skewY?: number): this;
|
|
136
135
|
flip(flipX?: boolean, flipY?: boolean): this;
|
|
136
|
+
/**
|
|
137
|
+
* this[pKey] = option[pKey]
|
|
138
|
+
* @param option
|
|
139
|
+
*/
|
|
137
140
|
transformByState(option: IObjectFullState): this | undefined;
|
|
138
141
|
isRender(bounds?: IViewportInfo): boolean | undefined;
|
|
139
142
|
getParent(): any;
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { IDocumentBody, Nullable } from '@univerjs/core';
|
|
2
2
|
import { IDocumentSkeletonGlyph } from './i-document-skeleton-cached';
|
|
3
|
-
|
|
4
3
|
export declare function hasListGlyph(glyph: Nullable<IDocumentSkeletonGlyph>): boolean;
|
|
5
4
|
export declare function isIndentByGlyph(glyph: Nullable<IDocumentSkeletonGlyph>, body?: IDocumentBody): boolean;
|
|
6
5
|
export declare function isLastGlyph(glyph: Nullable<IDocumentSkeletonGlyph>): boolean;
|
|
7
6
|
export declare function isFirstGlyph(glyph: Nullable<IDocumentSkeletonGlyph>): boolean;
|
|
8
|
-
export declare function getParagraphByGlyph(glyph: Nullable<IDocumentSkeletonGlyph>, body?: IDocumentBody):
|
|
7
|
+
export declare function getParagraphByGlyph(glyph: Nullable<IDocumentSkeletonGlyph>, body?: IDocumentBody): {
|
|
8
|
+
paragraphStart: number;
|
|
9
|
+
paragraphEnd: number;
|
|
10
|
+
startIndex: number;
|
|
11
|
+
paragraphStyle?: import('@univerjs/core').IParagraphStyle;
|
|
12
|
+
bullet?: import('@univerjs/core').IBullet;
|
|
13
|
+
} | undefined;
|
|
9
14
|
export declare function isPlaceholderOrSpace(glyph: Nullable<IDocumentSkeletonGlyph>): boolean;
|
|
10
15
|
export declare function isSameLine(glyph1: Nullable<IDocumentSkeletonGlyph>, glyph2: Nullable<IDocumentSkeletonGlyph>): boolean;
|
|
@@ -3,7 +3,6 @@ import { UniverRenderingContext } from '../context';
|
|
|
3
3
|
import { BORDER_TYPE, ORIENTATION_TYPE } from './const';
|
|
4
4
|
import { IDocumentSkeletonLine } from './i-document-skeleton-cached';
|
|
5
5
|
import { Vector2 } from './vector2';
|
|
6
|
-
|
|
7
6
|
export interface IContext2D extends CanvasRenderingContext2D {
|
|
8
7
|
webkitBackingStorePixelRatio: number;
|
|
9
8
|
mozBackingStorePixelRatio: number;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { BulletAlignment, ColumnSeparatorType, DataStreamTreeTokenType, IDocDrawingBase, IDocumentRenderConfig, INestingLevel, IParagraphProperties, ITextStyle, PageOrientType } from '@univerjs/core';
|
|
1
|
+
import { BulletAlignment, ColumnSeparatorType, DataStreamTreeTokenType, IDocDrawingBase, IDocumentRenderConfig, INestingLevel, IParagraphProperties, ITable, ITextStyle, PageOrientType } from '@univerjs/core';
|
|
2
2
|
import { BreakPointType } from '../components/docs/layout/line-breaker/break';
|
|
3
|
-
|
|
4
3
|
export interface IDocumentSkeletonCached extends ISkeletonResourceReference {
|
|
5
4
|
pages: IDocumentSkeletonPage[];
|
|
6
5
|
left: number;
|
|
7
6
|
top: number;
|
|
8
7
|
st: number;
|
|
9
8
|
ed?: number;
|
|
9
|
+
parent?: unknown;
|
|
10
10
|
}
|
|
11
11
|
export interface ISkeletonResourceReference {
|
|
12
12
|
skeHeaders: Map<string, Map<number, IDocumentSkeletonHeaderFooter>>;
|
|
@@ -22,7 +22,8 @@ export interface IDocumentSkeletonDrawingAnchor {
|
|
|
22
22
|
export declare enum DocumentSkeletonPageType {
|
|
23
23
|
BODY = 0,
|
|
24
24
|
HEADER = 1,
|
|
25
|
-
FOOTER = 2
|
|
25
|
+
FOOTER = 2,
|
|
26
|
+
CELL = 3
|
|
26
27
|
}
|
|
27
28
|
export interface IDocumentSkeletonPage {
|
|
28
29
|
sections: IDocumentSkeletonSection[];
|
|
@@ -37,6 +38,7 @@ export interface IDocumentSkeletonPage {
|
|
|
37
38
|
marginTop: number;
|
|
38
39
|
originMarginBottom: number;
|
|
39
40
|
marginBottom: number;
|
|
41
|
+
left: number;
|
|
40
42
|
pageNumber: number;
|
|
41
43
|
pageNumberStart: number;
|
|
42
44
|
verticalAlign: boolean;
|
|
@@ -47,10 +49,11 @@ export interface IDocumentSkeletonPage {
|
|
|
47
49
|
st: number;
|
|
48
50
|
ed: number;
|
|
49
51
|
skeDrawings: Map<string, IDocumentSkeletonDrawing>;
|
|
52
|
+
skeTables: Map<string, IDocumentSkeletonTable>;
|
|
50
53
|
segmentId: string;
|
|
51
54
|
type: DocumentSkeletonPageType;
|
|
52
55
|
renderConfig?: IDocumentRenderConfig;
|
|
53
|
-
parent?: IDocumentSkeletonCached;
|
|
56
|
+
parent?: IDocumentSkeletonCached | IDocumentSkeletonRow;
|
|
54
57
|
}
|
|
55
58
|
export interface IDocumentSkeletonHeaderFooter extends IDocumentSkeletonPage {
|
|
56
59
|
}
|
|
@@ -63,6 +66,27 @@ export interface IDocumentSkeletonSection {
|
|
|
63
66
|
ed: number;
|
|
64
67
|
parent?: IDocumentSkeletonPage;
|
|
65
68
|
}
|
|
69
|
+
export interface IDocumentSkeletonTable {
|
|
70
|
+
rows: IDocumentSkeletonRow[];
|
|
71
|
+
width: number;
|
|
72
|
+
height: number;
|
|
73
|
+
top: number;
|
|
74
|
+
left: number;
|
|
75
|
+
st: number;
|
|
76
|
+
ed: number;
|
|
77
|
+
tableId: string;
|
|
78
|
+
tableSource: ITable;
|
|
79
|
+
parent?: IDocumentSkeletonPage;
|
|
80
|
+
}
|
|
81
|
+
export interface IDocumentSkeletonRow {
|
|
82
|
+
cells: IDocumentSkeletonPage[];
|
|
83
|
+
index: number;
|
|
84
|
+
height: number;
|
|
85
|
+
top: number;
|
|
86
|
+
st: number;
|
|
87
|
+
ed: number;
|
|
88
|
+
parent?: IDocumentSkeletonTable;
|
|
89
|
+
}
|
|
66
90
|
export interface IDocumentSkeletonColumn {
|
|
67
91
|
lines: IDocumentSkeletonLine[];
|
|
68
92
|
left: number;
|
|
@@ -97,6 +121,8 @@ export interface IDocumentSkeletonLine {
|
|
|
97
121
|
lineIndex: number;
|
|
98
122
|
bullet?: IDocumentSkeletonBullet;
|
|
99
123
|
paragraphStart: boolean;
|
|
124
|
+
isBehindTable: boolean;
|
|
125
|
+
tableId: string;
|
|
100
126
|
parent?: IDocumentSkeletonColumn;
|
|
101
127
|
}
|
|
102
128
|
export interface IDocumentSkeletonDivide {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { BooleanNumber, GridType, IDocStyleBase, IDocumentLayout, IOffset, IParagraphStyle, IReferenceSource, IScale, ISectionBreakBase, ISize, ITextStyle, ITransformState, LocaleService } from '@univerjs/core';
|
|
2
2
|
import { DocumentViewModel } from '../components/docs/view-model/document-view-model';
|
|
3
|
-
import { DocumentSkeletonPageType, IDocumentSkeletonBullet, IDocumentSkeletonDrawing, IDocumentSkeletonDrawingAnchor, IDocumentSkeletonFontStyle, IDocumentSkeletonGlyph, IDocumentSkeletonHeaderFooter } from './i-document-skeleton-cached';
|
|
3
|
+
import { DocumentSkeletonPageType, IDocumentSkeletonBullet, IDocumentSkeletonDrawing, IDocumentSkeletonDrawingAnchor, IDocumentSkeletonFontStyle, IDocumentSkeletonGlyph, IDocumentSkeletonHeaderFooter, IDocumentSkeletonTable } from './i-document-skeleton-cached';
|
|
4
4
|
import { Vector2 } from './vector2';
|
|
5
5
|
import { ITransformerConfig } from './transformer-config';
|
|
6
|
-
|
|
7
6
|
export interface IObjectFullState extends ITransformState {
|
|
8
7
|
strokeWidth?: number;
|
|
9
8
|
zIndex?: number;
|
|
@@ -56,10 +55,16 @@ export interface ISectionBreakConfig extends IDocStyleBase, ISectionBreakBase, I
|
|
|
56
55
|
useFirstPageHeaderFooter?: BooleanNumber;
|
|
57
56
|
evenAndOddHeaders?: BooleanNumber;
|
|
58
57
|
}
|
|
58
|
+
export interface IParagraphTableCache {
|
|
59
|
+
tableId: string;
|
|
60
|
+
table: IDocumentSkeletonTable;
|
|
61
|
+
hasPositioned: boolean;
|
|
62
|
+
}
|
|
59
63
|
export interface IParagraphConfig {
|
|
60
64
|
paragraphIndex: number;
|
|
61
65
|
paragraphAffectSkeDrawings?: Map<string, IDocumentSkeletonDrawing>;
|
|
62
66
|
paragraphInlineSkeDrawings?: Map<string, IDocumentSkeletonDrawing>;
|
|
67
|
+
skeTablesInParagraph?: IParagraphTableCache[];
|
|
63
68
|
bulletSkeleton?: IDocumentSkeletonBullet;
|
|
64
69
|
paragraphStyle?: IParagraphStyle;
|
|
65
70
|
skeHeaders: Map<string, Map<number, IDocumentSkeletonHeaderFooter>>;
|
|
@@ -90,6 +95,7 @@ export interface INodeSearch {
|
|
|
90
95
|
page: number;
|
|
91
96
|
segmentPage: number;
|
|
92
97
|
pageType: DocumentSkeletonPageType;
|
|
98
|
+
path: (string | number)[];
|
|
93
99
|
}
|
|
94
100
|
export interface INodePosition extends INodeSearch {
|
|
95
101
|
isBack: boolean;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import { BaseObject } from '../base-object';
|
|
2
2
|
import { IMouseEvent, IPointerEvent } from './i-events';
|
|
3
|
-
|
|
4
3
|
export declare function attachObjectHover(o: BaseObject, hoverIn: (o: any, evt: IPointerEvent | IMouseEvent) => void, hoverOut: (o: any, evt: IPointerEvent | IMouseEvent) => void): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ITextRangeParam } from '@univerjs/core';
|
|
2
|
-
|
|
2
|
+
import { DOC_RANGE_TYPE } from '../components/docs/text-selection/range-interface';
|
|
3
3
|
export interface ITextSelectionStyle {
|
|
4
4
|
strokeWidth: number;
|
|
5
5
|
stroke: string;
|
|
@@ -9,13 +9,15 @@ export interface ITextSelectionStyle {
|
|
|
9
9
|
export declare const NORMAL_TEXT_SELECTION_PLUGIN_STYLE: ITextSelectionStyle;
|
|
10
10
|
export interface ITextRangeWithStyle extends ITextRangeParam {
|
|
11
11
|
style?: ITextSelectionStyle;
|
|
12
|
+
rangeType?: DOC_RANGE_TYPE;
|
|
12
13
|
}
|
|
13
|
-
export interface
|
|
14
|
+
export interface ISuccinctDocRangeParam {
|
|
14
15
|
startOffset: number;
|
|
15
16
|
endOffset: number;
|
|
16
17
|
segmentId?: string;
|
|
17
18
|
segmentPage?: number;
|
|
18
19
|
style?: ITextSelectionStyle;
|
|
20
|
+
rangeType?: DOC_RANGE_TYPE;
|
|
19
21
|
}
|
|
20
22
|
export declare enum RANGE_DIRECTION {
|
|
21
23
|
NONE = "none",
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { IRange, IRangeWithCoord, IScale, ISelectionCellWithMergeInfo, IStyleBase, LocaleService, Nullable } from '@univerjs/core';
|
|
2
2
|
import { IBoundRectNoAngle } from './vector2';
|
|
3
3
|
import { IDocumentSkeletonFontStyle } from './i-document-skeleton-cached';
|
|
4
|
-
|
|
5
4
|
export declare const getColor: (RgbArray: number[], opacity?: number) => string;
|
|
6
5
|
export declare const toPx: (num: number | string, ReferenceValue: Nullable<number>) => number;
|
|
7
6
|
/**
|
package/lib/types/canvas.d.ts
CHANGED
|
@@ -3,7 +3,6 @@ import { BaseObject } from '../base-object';
|
|
|
3
3
|
import { IViewportInfo } from '../basics/vector2';
|
|
4
4
|
import { UniverRenderingContext } from '../context';
|
|
5
5
|
import { ComponentExtension } from './extension';
|
|
6
|
-
|
|
7
6
|
export declare class RenderComponent<T, U, V> extends BaseObject {
|
|
8
7
|
private _extensions;
|
|
9
8
|
get extensions(): Map<string, ComponentExtension<T, U, V>>;
|
|
@@ -2,7 +2,6 @@ import { IViewportInfo } from '../../basics/vector2';
|
|
|
2
2
|
import { UniverRenderingContext } from '../../context';
|
|
3
3
|
import { IDocumentsConfig, DocComponent } from './doc-component';
|
|
4
4
|
import { DocumentSkeleton } from './layout/doc-skeleton';
|
|
5
|
-
|
|
6
5
|
export declare class DocBackground extends DocComponent {
|
|
7
6
|
private _drawLiquid;
|
|
8
7
|
constructor(oKey: string, documentSkeleton?: DocumentSkeleton, config?: IDocumentsConfig);
|
|
@@ -4,7 +4,6 @@ import { UniverRenderingContext } from '../../context';
|
|
|
4
4
|
import { RenderComponent } from '../component';
|
|
5
5
|
import { DOCS_EXTENSION_TYPE } from './doc-extension';
|
|
6
6
|
import { DocumentSkeleton } from './layout/doc-skeleton';
|
|
7
|
-
|
|
8
7
|
export interface IPageMarginLayout {
|
|
9
8
|
pageMarginLeft: number;
|
|
10
9
|
pageMarginTop: number;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { IDocumentSkeletonGlyph, IDocumentSkeletonLine } from '../../basics/i-document-skeleton-cached';
|
|
2
2
|
import { IBoundRectNoAngle } from '../../basics/vector2';
|
|
3
3
|
import { ComponentExtension } from '../extension';
|
|
4
|
-
|
|
5
4
|
export declare enum DOCS_EXTENSION_TYPE {
|
|
6
5
|
SPAN = 0,
|
|
7
6
|
LINE = 1
|
|
@@ -6,7 +6,6 @@ import { UniverRenderingContext } from '../../context';
|
|
|
6
6
|
import { Scene } from '../../scene';
|
|
7
7
|
import { IDocumentsConfig, IPageMarginLayout, DocComponent } from './doc-component';
|
|
8
8
|
import { DocumentSkeleton } from './layout/doc-skeleton';
|
|
9
|
-
|
|
10
9
|
export interface IPageRenderConfig {
|
|
11
10
|
page: IDocumentSkeletonPage;
|
|
12
11
|
pageLeft: number;
|
|
@@ -32,6 +31,9 @@ export declare class Documents extends DocComponent {
|
|
|
32
31
|
changeSkeleton(newSkeleton: DocumentSkeleton): this;
|
|
33
32
|
protected _draw(ctx: UniverRenderingContext, bounds?: IViewportInfo): void;
|
|
34
33
|
draw(ctx: UniverRenderingContext, bounds?: IViewportInfo): void;
|
|
34
|
+
private _drawTable;
|
|
35
|
+
private _drawTableCell;
|
|
36
|
+
private _drawTableCellBorders;
|
|
35
37
|
private _drawHeaderFooter;
|
|
36
38
|
private _horizontalHandler;
|
|
37
39
|
private _verticalHandler;
|
|
@@ -2,7 +2,6 @@ import { IScale } from '@univerjs/core';
|
|
|
2
2
|
import { IDocumentSkeletonGlyph } from '../../../basics/i-document-skeleton-cached';
|
|
3
3
|
import { UniverRenderingContext } from '../../../context';
|
|
4
4
|
import { docExtension } from '../doc-extension';
|
|
5
|
-
|
|
6
5
|
export declare class Background extends docExtension {
|
|
7
6
|
uKey: string;
|
|
8
7
|
Z_INDEX: number;
|
|
@@ -2,7 +2,6 @@ import { IScale } from '@univerjs/core';
|
|
|
2
2
|
import { IDocumentSkeletonGlyph } from '../../../basics/i-document-skeleton-cached';
|
|
3
3
|
import { UniverRenderingContext } from '../../../context';
|
|
4
4
|
import { docExtension } from '../doc-extension';
|
|
5
|
-
|
|
6
5
|
export declare class Border extends docExtension {
|
|
7
6
|
uKey: string;
|
|
8
7
|
Z_INDEX: number;
|
|
@@ -2,7 +2,6 @@ import { IScale } from '@univerjs/core';
|
|
|
2
2
|
import { IDocumentSkeletonGlyph } from '../../../basics/i-document-skeleton-cached';
|
|
3
3
|
import { UniverRenderingContext } from '../../../context';
|
|
4
4
|
import { docExtension } from '../doc-extension';
|
|
5
|
-
|
|
6
5
|
export declare class FontAndBaseLine extends docExtension {
|
|
7
6
|
uKey: string;
|
|
8
7
|
Z_INDEX: number;
|
|
@@ -2,7 +2,6 @@ import { IScale } from '@univerjs/core';
|
|
|
2
2
|
import { IDocumentSkeletonGlyph } from '../../../basics/i-document-skeleton-cached';
|
|
3
3
|
import { UniverRenderingContext } from '../../../context';
|
|
4
4
|
import { docExtension } from '../doc-extension';
|
|
5
|
-
|
|
6
5
|
export declare class Line extends docExtension {
|
|
7
6
|
uKey: string;
|
|
8
7
|
Z_INDEX: number;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { IBullet, ILists, LocaleService, Nullable } from '@univerjs/core';
|
|
2
2
|
import { IDocumentSkeletonBullet } from '../../../../../basics/i-document-skeleton-cached';
|
|
3
|
-
|
|
4
3
|
export declare function dealWithBullet(bullet?: IBullet, lists?: ILists, listLevelAncestors?: Array<Nullable<IDocumentSkeletonBullet>>, localeService?: LocaleService): IDocumentSkeletonBullet | undefined;
|
|
5
4
|
export declare function getDefaultBulletSke(listId: string, startIndex?: number): IDocumentSkeletonBullet;
|
|
@@ -2,7 +2,6 @@ import { IParagraphStyle } from '@univerjs/core';
|
|
|
2
2
|
import { ISectionBreakConfig } from '../../../../../basics/interfaces';
|
|
3
3
|
import { DataStreamTreeNode } from '../../../view-model/data-stream-tree-node';
|
|
4
4
|
import { DocumentViewModel } from '../../../view-model/document-view-model';
|
|
5
|
-
|
|
6
5
|
export declare function otherHandler(index: number, charArray: string, viewModel: DocumentViewModel, paragraphNode: DataStreamTreeNode, sectionBreakConfig: ISectionBreakConfig, paragraphStyle: IParagraphStyle): {
|
|
7
6
|
step: number;
|
|
8
7
|
glyphGroup: import('../../../../..').IDocumentSkeletonGlyph[];
|
|
@@ -2,6 +2,5 @@ import { IDocumentSkeletonDrawing, IDocumentSkeletonGlyph, IDocumentSkeletonLine
|
|
|
2
2
|
import { IParagraphConfig, ISectionBreakConfig } from '../../../../../basics/interfaces';
|
|
3
3
|
import { ILayoutContext } from '../../tools';
|
|
4
4
|
import { BreakPointType } from '../../line-breaker/break';
|
|
5
|
-
|
|
6
5
|
export declare function layoutParagraph(ctx: ILayoutContext, glyphGroup: IDocumentSkeletonGlyph[], pages: IDocumentSkeletonPage[], sectionBreakConfig: ISectionBreakConfig, paragraphConfig: IParagraphConfig, paragraphStart?: boolean, breakPointType?: BreakPointType): IDocumentSkeletonPage[];
|
|
7
6
|
export declare function updateInlineDrawingPosition(line: IDocumentSkeletonLine, paragraphInlineSkeDrawings?: Map<string, IDocumentSkeletonDrawing>, blockAnchorTop?: number): void;
|
|
@@ -2,5 +2,4 @@ import { IDocumentSkeletonPage } from '../../../../../basics/i-document-skeleton
|
|
|
2
2
|
import { DocumentViewModel } from '../../../view-model/document-view-model';
|
|
3
3
|
import { DataStreamTreeNode } from '../../../view-model/data-stream-tree-node';
|
|
4
4
|
import { ISectionBreakConfig } from '../../../../../basics';
|
|
5
|
-
|
|
6
5
|
export declare function lineAdjustment(pages: IDocumentSkeletonPage[], viewModel: DocumentViewModel, paragraphNode: DataStreamTreeNode, sectionBreakConfig: ISectionBreakConfig): void;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Nullable } from '@univerjs/core';
|
|
2
|
+
import { IDocumentSkeletonPage, IDocumentSkeletonTable } from '../../../../../basics/i-document-skeleton-cached';
|
|
2
3
|
import { ILayoutContext } from '../../tools';
|
|
3
4
|
import { DataStreamTreeNode } from '../../../view-model/data-stream-tree-node';
|
|
4
5
|
import { ISectionBreakConfig } from '../../../../../basics/interfaces';
|
|
5
6
|
import { DocumentViewModel } from '../../../view-model/document-view-model';
|
|
6
7
|
import { IShapedText } from './shaping';
|
|
7
|
-
|
|
8
|
-
export declare function lineBreaking(ctx: ILayoutContext, viewModel: DocumentViewModel, shapedTextList: IShapedText[], curPage: IDocumentSkeletonPage, paragraphNode: DataStreamTreeNode, sectionBreakConfig: ISectionBreakConfig): IDocumentSkeletonPage[];
|
|
8
|
+
export declare function lineBreaking(ctx: ILayoutContext, viewModel: DocumentViewModel, shapedTextList: IShapedText[], curPage: IDocumentSkeletonPage, paragraphNode: DataStreamTreeNode, sectionBreakConfig: ISectionBreakConfig, tableSkeleton: Nullable<IDocumentSkeletonTable>): IDocumentSkeletonPage[];
|
package/lib/types/components/docs/layout/block/paragraph/{layout.d.ts → paragraph-layout.d.ts}
RENAMED
|
@@ -3,5 +3,4 @@ import { ISectionBreakConfig } from '../../../../../basics/interfaces';
|
|
|
3
3
|
import { ILayoutContext } from '../../tools';
|
|
4
4
|
import { DataStreamTreeNode } from '../../../view-model/data-stream-tree-node';
|
|
5
5
|
import { DocumentViewModel } from '../../../view-model/document-view-model';
|
|
6
|
-
|
|
7
6
|
export declare function dealWidthParagraph(ctx: ILayoutContext, viewModel: DocumentViewModel, paragraphNode: DataStreamTreeNode, curPage: IDocumentSkeletonPage, sectionBreakConfig: ISectionBreakConfig): IDocumentSkeletonPage[];
|
|
@@ -4,7 +4,6 @@ import { DataStreamTreeNode } from '../../../view-model/data-stream-tree-node';
|
|
|
4
4
|
import { DocumentViewModel } from '../../../view-model/document-view-model';
|
|
5
5
|
import { ISectionBreakConfig } from '../../../../../basics/interfaces';
|
|
6
6
|
import { BreakPointType } from '../../line-breaker/break';
|
|
7
|
-
|
|
8
7
|
export interface IShapedText {
|
|
9
8
|
text: string;
|
|
10
9
|
glyphs: IDocumentSkeletonGlyph[];
|
|
@@ -4,7 +4,6 @@ import { ISectionBreakConfig } from '../../../../basics/interfaces';
|
|
|
4
4
|
import { DataStreamTreeNode } from '../../view-model/data-stream-tree-node';
|
|
5
5
|
import { DocumentViewModel } from '../../view-model/document-view-model';
|
|
6
6
|
import { ILayoutContext } from '../tools';
|
|
7
|
-
|
|
8
7
|
export declare function dealWithSection(ctx: ILayoutContext, viewModel: DocumentViewModel, sectionNode: DataStreamTreeNode, curPage: IDocumentSkeletonPage, sectionBreakConfig: ISectionBreakConfig, layoutAnchor: Nullable<number>): {
|
|
9
8
|
pages: IDocumentSkeletonPage[];
|
|
10
9
|
renderedBlockIdMap: Map<string, boolean>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ITable } from '@univerjs/core';
|
|
2
|
+
import { IDocumentSkeletonPage, IDocumentSkeletonTable, ISectionBreakConfig } from '../../../../basics';
|
|
3
|
+
import { DataStreamTreeNode } from '../../view-model/data-stream-tree-node';
|
|
4
|
+
import { DocumentViewModel } from '../../view-model/document-view-model';
|
|
5
|
+
import { ILayoutContext } from '../tools';
|
|
6
|
+
export declare function createTableSkeleton(ctx: ILayoutContext, curPage: IDocumentSkeletonPage, viewModel: DocumentViewModel, tableNode: DataStreamTreeNode, sectionBreakConfig: ISectionBreakConfig): IDocumentSkeletonTable;
|
|
7
|
+
export declare function getNullTableSkeleton(st: number, ed: number, table: ITable): IDocumentSkeletonTable;
|
|
8
|
+
export declare function getTableSliceId(tableId: string, sliceIndex: number): string;
|
|
9
|
+
export declare function getTableIdAndSliceIndex(tableSliceId: string): {
|
|
10
|
+
tableId: string;
|
|
11
|
+
sliceIndex: number;
|
|
12
|
+
};
|
|
@@ -4,7 +4,6 @@ import { INodeInfo, INodePosition, INodeSearch } from '../../../basics/interface
|
|
|
4
4
|
import { IViewportInfo, Vector2 } from '../../../basics/vector2';
|
|
5
5
|
import { Skeleton } from '../../skeleton';
|
|
6
6
|
import { DocumentViewModel, DocumentEditArea } from '../view-model/document-view-model';
|
|
7
|
-
|
|
8
7
|
export declare enum DocumentSkeletonState {
|
|
9
8
|
PENDING = "pending",
|
|
10
9
|
CALCULATING = "calculating",
|
|
@@ -36,6 +35,7 @@ export declare class DocumentSkeleton extends Skeleton {
|
|
|
36
35
|
private _getPageActualWidth;
|
|
37
36
|
getPageSize(): import('@univerjs/core').ISize | undefined;
|
|
38
37
|
findPositionByGlyph(glyph: IDocumentSkeletonGlyph, segmentPage: number): Nullable<INodeSearch>;
|
|
38
|
+
findCharIndexByPosition(position: INodePosition): Nullable<number>;
|
|
39
39
|
findNodePositionByCharIndex(charIndex: number, isBack?: boolean, segmentId?: string, segmentPIndex?: number): Nullable<INodePosition>;
|
|
40
40
|
findNodeByCharIndex(charIndex: number, segmentId?: string, segmentPageIndex?: number): Nullable<IDocumentSkeletonGlyph>;
|
|
41
41
|
findGlyphByPosition(position: Nullable<INodePosition>): IDocumentSkeletonGlyph | undefined;
|
|
@@ -3,7 +3,6 @@ import { Break } from '../break';
|
|
|
3
3
|
import { IBreakPoints, LineBreaker } from '../line-breaker';
|
|
4
4
|
import { Hyphen } from '../../hyphenation/hyphen';
|
|
5
5
|
import { Lang } from '../../hyphenation/lang';
|
|
6
|
-
|
|
7
6
|
export declare function isLetter(char: string): boolean;
|
|
8
7
|
export declare class LineBreakerHyphenEnhancer implements IBreakPoints {
|
|
9
8
|
private _lineBreaker;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import { ISectionColumnProperties, ColumnSeparatorType } from '@univerjs/core';
|
|
2
2
|
import { IDocumentSkeletonColumn } from '../../../../basics/i-document-skeleton-cached';
|
|
3
|
-
|
|
4
3
|
export declare function createSkeletonColumn(columnIndex: number | undefined, columnProperties: ISectionColumnProperties[], columnSeparatorType?: ColumnSeparatorType, pageWidth?: number): IDocumentSkeletonColumn;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { IAdjustability, IDocumentSkeletonBullet, IDocumentSkeletonDivide, IDocumentSkeletonGlyph, GlyphType } from '../../../../basics/i-document-skeleton-cached';
|
|
2
2
|
import { IFontCreateConfig } from '../../../../basics/interfaces';
|
|
3
3
|
import { IOpenTypeGlyphInfo } from '../shaping-engine/text-shaping';
|
|
4
|
-
|
|
5
4
|
export declare function isSpace(char: string): boolean;
|
|
6
5
|
export declare function isJustifiable(content: string): boolean;
|
|
7
6
|
export declare function baseAdjustability(content: string, width: number): IAdjustability;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Nullable } from '@univerjs/core';
|
|
2
2
|
import { IDocumentSkeletonDivide, IDocumentSkeletonDrawing, IDocumentSkeletonDrawingAnchor, IDocumentSkeletonLine, IDocumentSkeletonPage, LineType } from '../../../../basics/i-document-skeleton-cached';
|
|
3
|
-
|
|
3
|
+
import { IParagraphConfig } from '../../../../basics';
|
|
4
4
|
interface ILineBoundingBox {
|
|
5
5
|
lineHeight: number;
|
|
6
6
|
lineTop: number;
|
|
@@ -12,11 +12,11 @@ interface ILineBoundingBox {
|
|
|
12
12
|
marginTop?: number;
|
|
13
13
|
spaceBelowApply?: number;
|
|
14
14
|
}
|
|
15
|
-
export declare function createSkeletonLine(paragraphIndex: number, lineType: LineType, lineBoundingBox: ILineBoundingBox, columnWidth: number, lineIndex: number | undefined, isParagraphStart: boolean | undefined, page: IDocumentSkeletonPage, headerPage: Nullable<IDocumentSkeletonPage>, footerPage: Nullable<IDocumentSkeletonPage>): IDocumentSkeletonLine;
|
|
15
|
+
export declare function createSkeletonLine(paragraphIndex: number, lineType: LineType, lineBoundingBox: ILineBoundingBox, columnWidth: number, lineIndex: number | undefined, isParagraphStart: boolean | undefined, paragraphConfig: IParagraphConfig, page: IDocumentSkeletonPage, headerPage: Nullable<IDocumentSkeletonPage>, footerPage: Nullable<IDocumentSkeletonPage>): IDocumentSkeletonLine;
|
|
16
16
|
export declare function calculateLineTopByDrawings(lineHeight: number | undefined, lineTop: number | undefined, page: IDocumentSkeletonPage, headerPage: Nullable<IDocumentSkeletonPage>, footerPage: Nullable<IDocumentSkeletonPage>): number;
|
|
17
17
|
export declare function updateDivideInfo(divide: IDocumentSkeletonDivide, states: Partial<IDocumentSkeletonDivide>): void;
|
|
18
18
|
export declare function setLineMarginBottom(line: IDocumentSkeletonLine, marginBottom: number): void;
|
|
19
19
|
export declare function collisionDetection(drawing: IDocumentSkeletonDrawing, lineHeight: number, lineTop: number, columnLeft: number, columnWidth: number): boolean;
|
|
20
|
-
export declare function getBoundingBox(angle: number, left: number, width: number, top: number, height: number): import('
|
|
20
|
+
export declare function getBoundingBox(angle: number, left: number, width: number, top: number, height: number): import('../../../../basics').IRect;
|
|
21
21
|
export declare function createAndUpdateBlockAnchor(paragraphIndex: number, line: IDocumentSkeletonLine, top: number, drawingAnchor?: Map<number, IDocumentSkeletonDrawingAnchor>): void;
|
|
22
22
|
export {};
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import { ITable } from '@univerjs/core';
|
|
1
2
|
import { IDocumentSkeletonPage, ISkeletonResourceReference, BreakType } from '../../../../basics/i-document-skeleton-cached';
|
|
2
3
|
import { ISectionBreakConfig } from '../../../../basics/interfaces';
|
|
4
|
+
import { DocumentViewModel } from '../../view-model/document-view-model';
|
|
3
5
|
import { ILayoutContext } from '../tools';
|
|
4
|
-
|
|
6
|
+
import { DataStreamTreeNode } from '../../view-model/data-stream-tree-node';
|
|
5
7
|
export declare function createSkeletonPage(ctx: ILayoutContext, sectionBreakConfig: ISectionBreakConfig, skeletonResourceReference: ISkeletonResourceReference, pageNumber?: number, breakType?: BreakType): IDocumentSkeletonPage;
|
|
8
|
+
export declare function createSkeletonCellPage(ctx: ILayoutContext, viewModel: DocumentViewModel, cellNode: DataStreamTreeNode, sectionBreakConfig: ISectionBreakConfig, tableConfig: ITable, row: number, col: number): IDocumentSkeletonPage;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ISectionColumnProperties, ColumnSeparatorType } from '@univerjs/core';
|
|
2
2
|
import { IDocumentSkeletonColumn, IDocumentSkeletonSection } from '../../../../basics/i-document-skeleton-cached';
|
|
3
|
-
|
|
4
3
|
export declare function createSkeletonSection(columnProperties?: ISectionColumnProperties[], columnSeparatorType?: ColumnSeparatorType, top?: number, left?: number, sectionWidth?: number, sectionHeight?: number): IDocumentSkeletonSection;
|
|
5
4
|
export declare function setColumnFullState(column: IDocumentSkeletonColumn, state: boolean): void;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
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
|
+
*/
|