@univerjs/engine-render 0.1.2 → 0.1.4
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 +2 -2
- package/lib/es/index.js +11751 -11496
- package/lib/types/basics/document-node-tools.d.ts +8 -8
- package/lib/types/basics/draw.d.ts +8 -1
- package/lib/types/basics/i-document-skeleton-cached.d.ts +13 -7
- package/lib/types/basics/interfaces.d.ts +3 -3
- package/lib/types/basics/text-rotation.d.ts +1 -1
- package/lib/types/basics/tools.d.ts +4 -0
- package/lib/types/{components/docs/block/index.d.ts → basics/viewport-subtract.d.ts} +2 -3
- package/lib/types/components/component.d.ts +2 -2
- package/lib/types/components/docs/doc-component.d.ts +4 -4
- package/lib/types/components/docs/doc-extension.d.ts +2 -2
- package/lib/types/components/docs/document.d.ts +2 -1
- package/lib/types/components/docs/extensions/background.d.ts +2 -2
- package/lib/types/components/docs/extensions/border.d.ts +2 -2
- package/lib/types/components/docs/extensions/font-and-base-line.d.ts +2 -2
- package/lib/types/components/docs/extensions/line.d.ts +2 -2
- package/lib/types/components/docs/{block → layout/block}/paragraph/bullet.d.ts +1 -1
- package/lib/types/components/docs/{block → layout/block}/paragraph/inline-drawing.d.ts +2 -2
- package/lib/types/components/docs/{block → layout/block}/paragraph/language-ruler.d.ts +7 -7
- package/lib/types/components/docs/{block → layout/block}/paragraph/layout-ruler.d.ts +3 -3
- package/lib/types/components/docs/{block/paragraph/paragraph.d.ts → layout/block/paragraph/layout.d.ts} +4 -4
- package/lib/types/components/docs/{block/paragraph/index.d.ts → layout/block/paragraph/line-adjustment.d.ts} +3 -6
- package/lib/types/components/docs/layout/block/paragraph/linebreaking.d.ts +21 -0
- package/lib/types/components/docs/layout/block/paragraph/shaping.d.ts +25 -0
- package/lib/types/components/docs/{block → layout/block}/section.d.ts +5 -5
- package/lib/types/components/docs/{doc-skeleton.d.ts → layout/doc-skeleton.d.ts} +9 -9
- package/lib/types/components/docs/layout/model/__test__/glyph.spec.d.ts +16 -0
- package/lib/types/components/docs/{common → layout/model}/column.d.ts +1 -1
- package/lib/types/components/docs/layout/model/glyph.d.ts +31 -0
- package/lib/types/components/docs/{common → layout/model}/line.d.ts +1 -1
- package/lib/types/components/docs/{common → layout/model}/page.d.ts +3 -3
- package/lib/types/components/docs/{common → layout/model}/section.d.ts +1 -1
- package/lib/types/components/docs/{common → layout}/tools.d.ts +4 -4
- package/lib/types/components/docs/{common/liquid.d.ts → liquid.d.ts} +4 -4
- package/lib/types/components/docs/{common → text-selection}/convert-cursor.d.ts +4 -4
- package/lib/types/components/docs/{common → text-selection}/text-range.d.ts +1 -1
- package/lib/types/components/docs/{text-selection-render-manager.d.ts → text-selection/text-selection-render-manager.d.ts} +14 -11
- package/lib/types/components/index.d.ts +1 -1
- package/lib/types/components/sheets/extensions/font.d.ts +10 -6
- package/lib/types/components/sheets/interfaces.d.ts +3 -2
- package/lib/types/components/sheets/sheet-skeleton.d.ts +23 -11
- package/lib/types/context.d.ts +71 -1
- package/lib/types/engine.d.ts +2 -0
- package/lib/types/index.d.ts +9 -1
- package/lib/types/layer.d.ts +1 -0
- package/lib/types/render-manager.service.d.ts +1 -0
- package/lib/types/scene.d.ts +2 -2
- package/lib/types/thin-scene.d.ts +4 -1
- package/lib/types/viewport.d.ts +0 -3
- package/lib/umd/index.js +2 -2
- package/package.json +11 -10
- package/lib/types/components/docs/common/index.d.ts +0 -24
- package/lib/types/components/docs/common/span.d.ts +0 -28
- package/lib/types/components/docs/index.d.ts +0 -22
- /package/lib/types/components/docs/{block → layout/block}/block-error.d.ts +0 -0
- /package/lib/types/components/docs/{block → layout/block}/paragraph/bullet-ruler.d.ts +0 -0
- /package/lib/types/components/docs/{linebreak → layout/linebreak}/__tests__/linebreak.spec.d.ts +0 -0
- /package/lib/types/components/docs/{linebreak → layout/linebreak}/break.d.ts +0 -0
- /package/lib/types/components/docs/{linebreak → layout/linebreak}/classes.d.ts +0 -0
- /package/lib/types/components/docs/{linebreak → layout/linebreak}/extensions/tab-linebreak-extension.d.ts +0 -0
- /package/lib/types/components/docs/{linebreak → layout/linebreak}/index.d.ts +0 -0
- /package/lib/types/components/docs/{linebreak → layout/linebreak}/linebreaker.d.ts +0 -0
- /package/lib/types/components/docs/{linebreak → layout/linebreak}/pairs.d.ts +0 -0
- /package/lib/types/components/docs/{linebreak → layout/linebreak}/rule.d.ts +0 -0
- /package/lib/types/components/docs/{linebreak → layout/linebreak}/swap.d.ts +0 -0
- /package/lib/types/components/docs/{linebreak → layout/linebreak}/tiny-inflate.d.ts +0 -0
- /package/lib/types/components/docs/{linebreak → layout/linebreak}/trie-data.d.ts +0 -0
- /package/lib/types/components/docs/{linebreak → layout/linebreak}/unicode-trie.d.ts +0 -0
- /package/lib/types/{scene.-transformer.d.ts → scene.transformer.d.ts} +0 -0
|
@@ -14,11 +14,11 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { IDocumentBody, Nullable } from '@univerjs/core';
|
|
17
|
-
import type {
|
|
18
|
-
export declare function
|
|
19
|
-
export declare function
|
|
20
|
-
export declare function
|
|
21
|
-
export declare function
|
|
22
|
-
export declare function
|
|
23
|
-
export declare function isPlaceholderOrSpace(
|
|
24
|
-
export declare function isSameLine(
|
|
17
|
+
import type { IDocumentSkeletonGlyph } from './i-document-skeleton-cached';
|
|
18
|
+
export declare function hasListGlyph(glyph: Nullable<IDocumentSkeletonGlyph>): boolean;
|
|
19
|
+
export declare function isIndentByGlyph(glyph: Nullable<IDocumentSkeletonGlyph>, body?: IDocumentBody): boolean;
|
|
20
|
+
export declare function isLastGlyph(glyph: Nullable<IDocumentSkeletonGlyph>): boolean;
|
|
21
|
+
export declare function isFirstGlyph(glyph: Nullable<IDocumentSkeletonGlyph>): boolean;
|
|
22
|
+
export declare function getParagraphByGlyph(glyph: Nullable<IDocumentSkeletonGlyph>, body?: IDocumentBody): import("@univerjs/core").IParagraph | undefined;
|
|
23
|
+
export declare function isPlaceholderOrSpace(glyph: Nullable<IDocumentSkeletonGlyph>): boolean;
|
|
24
|
+
export declare function isSameLine(glyph1: Nullable<IDocumentSkeletonGlyph>, glyph2: Nullable<IDocumentSkeletonGlyph>): boolean;
|
|
@@ -27,7 +27,14 @@ export interface IContext2D extends CanvasRenderingContext2D {
|
|
|
27
27
|
backingStorePixelRatio: number;
|
|
28
28
|
}
|
|
29
29
|
export declare function getDevicePixelRatio(): number;
|
|
30
|
-
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* @param ctx canvas context
|
|
33
|
+
* @param type top bottom left right
|
|
34
|
+
* @param lineWidthBuffer Solving the problem of mitered corners in the drawing of borders thicker than 2 pixels, caused by the line segments being centered.
|
|
35
|
+
* @param position border draw position
|
|
36
|
+
*/
|
|
37
|
+
export declare function drawLineByBorderType(ctx: UniverRenderingContext, type: BORDER_TYPE, lineWidthBuffer: number, position: IPosition): void;
|
|
31
38
|
export declare function drawDiagonalLineByBorderType(ctx: UniverRenderingContext, type: BORDER_TYPE, position: IPosition): void;
|
|
32
39
|
export declare function clearLineByBorderType(ctx: UniverRenderingContext, type: BORDER_TYPE, position: IPosition): void;
|
|
33
40
|
export declare function setLineType(ctx: UniverRenderingContext, style: BorderStyleTypes): void;
|
|
@@ -115,7 +115,7 @@ export interface IDocumentSkeletonLine {
|
|
|
115
115
|
parent?: IDocumentSkeletonColumn;
|
|
116
116
|
}
|
|
117
117
|
export interface IDocumentSkeletonDivide {
|
|
118
|
-
|
|
118
|
+
glyphGroup: IDocumentSkeletonGlyph[];
|
|
119
119
|
width: number;
|
|
120
120
|
left: number;
|
|
121
121
|
paddingLeft: number;
|
|
@@ -124,16 +124,22 @@ export interface IDocumentSkeletonDivide {
|
|
|
124
124
|
ed: number;
|
|
125
125
|
parent?: IDocumentSkeletonLine;
|
|
126
126
|
}
|
|
127
|
-
export interface
|
|
128
|
-
|
|
129
|
-
|
|
127
|
+
export interface IAdjustability {
|
|
128
|
+
stretchability: [number, number];
|
|
129
|
+
shrinkability: [number, number];
|
|
130
|
+
}
|
|
131
|
+
export interface IDocumentSkeletonGlyph {
|
|
132
|
+
glyphId?: string;
|
|
133
|
+
glyphType: GlyphType;
|
|
130
134
|
streamType: DataStreamTreeTokenType;
|
|
131
135
|
width: number;
|
|
132
136
|
bBox: IDocumentSkeletonBoundingBox;
|
|
133
|
-
|
|
137
|
+
xOffset: number;
|
|
134
138
|
left: number;
|
|
135
139
|
count: number;
|
|
136
140
|
content: string;
|
|
141
|
+
adjustability: IAdjustability;
|
|
142
|
+
isJustifiable: boolean;
|
|
137
143
|
ts?: ITextStyle;
|
|
138
144
|
fontStyle?: IDocumentSkeletonFontStyle;
|
|
139
145
|
parent?: IDocumentSkeletonDivide;
|
|
@@ -179,7 +185,7 @@ export interface IDocumentSkeletonBoundingBox {
|
|
|
179
185
|
spo: number;
|
|
180
186
|
}
|
|
181
187
|
export declare enum SkeletonType {
|
|
182
|
-
|
|
188
|
+
GLYPH = 0,
|
|
183
189
|
DIVIDE = 1,
|
|
184
190
|
LINE = 2,
|
|
185
191
|
COLUMN = 3,
|
|
@@ -200,7 +206,7 @@ export declare enum LineType {
|
|
|
200
206
|
PARAGRAPH = 0,
|
|
201
207
|
BLOCK = 1
|
|
202
208
|
}
|
|
203
|
-
export declare enum
|
|
209
|
+
export declare enum GlyphType {
|
|
204
210
|
LETTER = 0,
|
|
205
211
|
WORD = 1,
|
|
206
212
|
LIST = 2,
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import type { BooleanNumber, GridType, IDocStyleBase, IDocumentLayout, IOffset, IParagraphStyle, IReferenceSource, IScale, ISectionBreakBase, ISize, ITextStyle, ITransformState, LocaleService } from '@univerjs/core';
|
|
17
17
|
import type { DocumentViewModel } from '../components/docs/view-model/document-view-model';
|
|
18
|
-
import type { IDocumentSkeletonBullet, IDocumentSkeletonDrawing, IDocumentSkeletonDrawingAnchor, IDocumentSkeletonFontStyle, IDocumentSkeletonFooter,
|
|
18
|
+
import type { IDocumentSkeletonBullet, IDocumentSkeletonDrawing, IDocumentSkeletonDrawingAnchor, IDocumentSkeletonFontStyle, IDocumentSkeletonFooter, IDocumentSkeletonGlyph, IDocumentSkeletonHeader } from './i-document-skeleton-cached';
|
|
19
19
|
import type { Vector2 } from './vector2';
|
|
20
20
|
export interface IObjectFullState extends ITransformState {
|
|
21
21
|
strokeWidth?: number;
|
|
@@ -99,12 +99,12 @@ export interface IFontCreateConfig {
|
|
|
99
99
|
pageWidth?: number;
|
|
100
100
|
}
|
|
101
101
|
export interface INodeInfo {
|
|
102
|
-
node:
|
|
102
|
+
node: IDocumentSkeletonGlyph;
|
|
103
103
|
ratioX: number;
|
|
104
104
|
ratioY: number;
|
|
105
105
|
}
|
|
106
106
|
export interface INodeSearch {
|
|
107
|
-
|
|
107
|
+
glyph: number;
|
|
108
108
|
divide: number;
|
|
109
109
|
line: number;
|
|
110
110
|
column: number;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { type ITextRotation } from '@univerjs/core';
|
|
17
17
|
export declare const VERTICAL_ROTATE_ANGLE = 90;
|
|
18
|
-
export declare function convertTextRotation(textRotation
|
|
18
|
+
export declare function convertTextRotation(textRotation?: ITextRotation): {
|
|
19
19
|
centerAngle: number;
|
|
20
20
|
vertexAngle: number;
|
|
21
21
|
};
|
|
@@ -66,6 +66,7 @@ export declare function getFontStyleString(textStyle?: IStyleBase, localeService
|
|
|
66
66
|
};
|
|
67
67
|
export declare function hasCJKText(text: string): boolean;
|
|
68
68
|
export declare function hasCJK(text: string): boolean;
|
|
69
|
+
export declare function hasCJKPunctuation(text: string): boolean;
|
|
69
70
|
export declare function hasAllLatin(text: string): boolean;
|
|
70
71
|
export declare function hasBasicLatin(text: string): boolean;
|
|
71
72
|
export declare function hasLatinOneSupplement(text: string): boolean;
|
|
@@ -76,6 +77,9 @@ export declare function startWithEmoji(text: string): boolean;
|
|
|
76
77
|
export declare function hasArabic(text: string): boolean;
|
|
77
78
|
export declare function hasTibetan(text: string): boolean;
|
|
78
79
|
export declare function hasSpace(text: string): boolean;
|
|
80
|
+
export declare function isCjkLeftAlignedPunctuation(text: string): boolean;
|
|
81
|
+
export declare function isCjkRightAlignedPunctuation(text: string): boolean;
|
|
82
|
+
export declare function isCjkCenterAlignedPunctuation(text: string): boolean;
|
|
79
83
|
export declare function getDPI(): number;
|
|
80
84
|
export declare function ptToPx(pt: number): number;
|
|
81
85
|
export declare function pxToPt(px: number): number;
|
|
@@ -13,6 +13,5 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
|
|
17
|
-
export
|
|
18
|
-
export * from './section';
|
|
16
|
+
import type { IRange } from '@univerjs/core';
|
|
17
|
+
export declare function subtractViewportRange(range1: IRange, range2: IRange): IRange[];
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
import type { IDisposable } from '@wendellhu/redi';
|
|
16
17
|
import { BaseObject } from '../base-object';
|
|
17
18
|
import type { IViewportBound } from '../basics/vector2';
|
|
18
19
|
import type { UniverRenderingContext } from '../context';
|
|
@@ -20,8 +21,7 @@ import type { ComponentExtension } from './extension';
|
|
|
20
21
|
export declare class RenderComponent<T, U, V> extends BaseObject {
|
|
21
22
|
private _extensions;
|
|
22
23
|
get extensions(): Map<string, ComponentExtension<T, U, V>>;
|
|
23
|
-
register(...extensions: Array<ComponentExtension<T, U, V>>):
|
|
24
|
-
unRegister(...uKeys: string[]): void;
|
|
24
|
+
register(...extensions: Array<ComponentExtension<T, U, V>>): IDisposable;
|
|
25
25
|
getExtensionsByOrder(): ComponentExtension<T, U, V>[];
|
|
26
26
|
getExtensionByKey(uKey: string): ComponentExtension<T, U, V> | undefined;
|
|
27
27
|
draw(ctx: UniverRenderingContext, bounds?: IViewportBound): void;
|
|
@@ -14,15 +14,15 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { Nullable } from '@univerjs/core';
|
|
17
|
-
import type {
|
|
17
|
+
import type { IDocumentSkeletonGlyph, IDocumentSkeletonLine } from '../../basics/i-document-skeleton-cached';
|
|
18
18
|
import { PageLayoutType } from '../../basics/i-document-skeleton-cached';
|
|
19
19
|
import type { INodeInfo } from '../../basics/interfaces';
|
|
20
20
|
import type { IBoundRectNoAngle, IViewportBound } from '../../basics/vector2';
|
|
21
21
|
import type { UniverRenderingContext } from '../../context';
|
|
22
22
|
import { RenderComponent } from '../component';
|
|
23
23
|
import type { DOCS_EXTENSION_TYPE } from './doc-extension';
|
|
24
|
-
import type { DocumentSkeleton } from './doc-skeleton';
|
|
25
|
-
export declare class DocComponent extends RenderComponent<
|
|
24
|
+
import type { DocumentSkeleton } from './layout/doc-skeleton';
|
|
25
|
+
export declare class DocComponent extends RenderComponent<IDocumentSkeletonGlyph | IDocumentSkeletonLine, DOCS_EXTENSION_TYPE, IBoundRectNoAngle[]> {
|
|
26
26
|
private _skeleton?;
|
|
27
27
|
pageMarginLeft: number;
|
|
28
28
|
pageMarginTop: number;
|
|
@@ -39,7 +39,7 @@ export declare class DocComponent extends RenderComponent<IDocumentSkeletonSpan
|
|
|
39
39
|
syncSelection(): void;
|
|
40
40
|
remainActiveSelection(): void;
|
|
41
41
|
findNodeByCoord(offsetX: number, offsetY: number): Nullable<INodeInfo>;
|
|
42
|
-
findCoordByNode(
|
|
42
|
+
findCoordByNode(glyph: IDocumentSkeletonGlyph): void;
|
|
43
43
|
protected _getBounding(bounds?: IViewportBound): void;
|
|
44
44
|
protected _draw(ctx: UniverRenderingContext, bounds?: IViewportBound): void;
|
|
45
45
|
}
|
|
@@ -13,14 +13,14 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import type {
|
|
16
|
+
import type { IDocumentSkeletonGlyph, IDocumentSkeletonLine } from '../../basics/i-document-skeleton-cached';
|
|
17
17
|
import type { IBoundRectNoAngle } from '../../basics/vector2';
|
|
18
18
|
import { ComponentExtension } from '../extension';
|
|
19
19
|
export declare enum DOCS_EXTENSION_TYPE {
|
|
20
20
|
SPAN = 0,
|
|
21
21
|
LINE = 1
|
|
22
22
|
}
|
|
23
|
-
export declare class docExtension extends ComponentExtension<
|
|
23
|
+
export declare class docExtension extends ComponentExtension<IDocumentSkeletonGlyph | IDocumentSkeletonLine, DOCS_EXTENSION_TYPE, IBoundRectNoAngle> {
|
|
24
24
|
type: DOCS_EXTENSION_TYPE;
|
|
25
25
|
translateX: number;
|
|
26
26
|
translateY: number;
|
|
@@ -23,7 +23,7 @@ import type { IViewportBound } from '../../basics/vector2';
|
|
|
23
23
|
import type { UniverRenderingContext } from '../../context';
|
|
24
24
|
import type { Scene } from '../../scene';
|
|
25
25
|
import { DocComponent } from './doc-component';
|
|
26
|
-
import type { DocumentSkeleton } from './doc-skeleton';
|
|
26
|
+
import type { DocumentSkeleton } from './layout/doc-skeleton';
|
|
27
27
|
interface IPageMarginLayout {
|
|
28
28
|
pageMarginLeft: number;
|
|
29
29
|
pageMarginTop: number;
|
|
@@ -63,5 +63,6 @@ export declare class Documents extends DocComponent {
|
|
|
63
63
|
private _startRotation;
|
|
64
64
|
private _resetRotation;
|
|
65
65
|
private _initialDefaultExtension;
|
|
66
|
+
private _isSkipByDiffBounds;
|
|
66
67
|
}
|
|
67
68
|
export {};
|
|
@@ -14,13 +14,13 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { IScale } from '@univerjs/core';
|
|
17
|
-
import type {
|
|
17
|
+
import type { IDocumentSkeletonGlyph } from '../../../basics/i-document-skeleton-cached';
|
|
18
18
|
import type { UniverRenderingContext } from '../../../context';
|
|
19
19
|
import { docExtension } from '../doc-extension';
|
|
20
20
|
export declare class Background extends docExtension {
|
|
21
21
|
uKey: string;
|
|
22
22
|
Z_INDEX: number;
|
|
23
23
|
private _preBackgroundColor;
|
|
24
|
-
draw(ctx: UniverRenderingContext, parentScale: IScale, span:
|
|
24
|
+
draw(ctx: UniverRenderingContext, parentScale: IScale, span: IDocumentSkeletonGlyph): void;
|
|
25
25
|
clearCache(): void;
|
|
26
26
|
}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { IScale } from '@univerjs/core';
|
|
17
|
-
import type {
|
|
17
|
+
import type { IDocumentSkeletonGlyph } from '../../../basics/i-document-skeleton-cached';
|
|
18
18
|
import type { UniverRenderingContext } from '../../../context';
|
|
19
19
|
import { docExtension } from '../doc-extension';
|
|
20
20
|
export declare class Border extends docExtension {
|
|
@@ -22,7 +22,7 @@ export declare class Border extends docExtension {
|
|
|
22
22
|
Z_INDEX: number;
|
|
23
23
|
private _preBorderStyle;
|
|
24
24
|
private _preBorderColor;
|
|
25
|
-
draw(ctx: UniverRenderingContext, parentScale: IScale,
|
|
25
|
+
draw(ctx: UniverRenderingContext, parentScale: IScale, glyph: IDocumentSkeletonGlyph): void;
|
|
26
26
|
clearCache(): void;
|
|
27
27
|
private _createBorderCache;
|
|
28
28
|
}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { IScale } from '@univerjs/core';
|
|
17
|
-
import type {
|
|
17
|
+
import type { IDocumentSkeletonGlyph } from '../../../basics/i-document-skeleton-cached';
|
|
18
18
|
import type { UniverRenderingContext } from '../../../context';
|
|
19
19
|
import { docExtension } from '../doc-extension';
|
|
20
20
|
export declare class FontAndBaseLine extends docExtension {
|
|
@@ -22,7 +22,7 @@ export declare class FontAndBaseLine extends docExtension {
|
|
|
22
22
|
Z_INDEX: number;
|
|
23
23
|
private _preFontString;
|
|
24
24
|
private _preFontColor;
|
|
25
|
-
draw(ctx: UniverRenderingContext, parentScale: IScale,
|
|
25
|
+
draw(ctx: UniverRenderingContext, parentScale: IScale, glyph: IDocumentSkeletonGlyph): void;
|
|
26
26
|
private _fillText;
|
|
27
27
|
clearCache(): void;
|
|
28
28
|
}
|
|
@@ -14,14 +14,14 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { IScale } from '@univerjs/core';
|
|
17
|
-
import type {
|
|
17
|
+
import type { IDocumentSkeletonGlyph } from '../../../basics/i-document-skeleton-cached';
|
|
18
18
|
import type { UniverRenderingContext } from '../../../context';
|
|
19
19
|
import { docExtension } from '../doc-extension';
|
|
20
20
|
export declare class Line extends docExtension {
|
|
21
21
|
uKey: string;
|
|
22
22
|
Z_INDEX: number;
|
|
23
23
|
private _preBackgroundColor;
|
|
24
|
-
draw(ctx: UniverRenderingContext, parentScale: IScale, span:
|
|
24
|
+
draw(ctx: UniverRenderingContext, parentScale: IScale, span: IDocumentSkeletonGlyph): void;
|
|
25
25
|
clearCache(): void;
|
|
26
26
|
private _drawLine;
|
|
27
27
|
private _setLineType;
|
|
@@ -14,6 +14,6 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { IBullet, ILists, LocaleService, Nullable } from '@univerjs/core';
|
|
17
|
-
import type { IDocumentSkeletonBullet } from '
|
|
17
|
+
import type { IDocumentSkeletonBullet } from '../../../../../basics/i-document-skeleton-cached';
|
|
18
18
|
export declare function dealWithBullet(bullet?: IBullet, lists?: ILists, listLevelAncestors?: Array<Nullable<IDocumentSkeletonBullet>>, localeService?: LocaleService): IDocumentSkeletonBullet | undefined;
|
|
19
19
|
export declare function getDefaultBulletSke(listId: string, startIndex?: number): IDocumentSkeletonBullet;
|
|
@@ -14,6 +14,6 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { IDrawing, LocaleService } from '@univerjs/core';
|
|
17
|
-
import type { IDocumentSkeletonPage } from '
|
|
18
|
-
import type { IParagraphConfig, ISectionBreakConfig } from '
|
|
17
|
+
import type { IDocumentSkeletonPage } from '../../../../../basics/i-document-skeleton-cached';
|
|
18
|
+
import type { IParagraphConfig, ISectionBreakConfig } from '../../../../../basics/interfaces';
|
|
19
19
|
export declare function dealWidthInlineDrawing(drawing: IDrawing, sectionBreakConfig: ISectionBreakConfig, allPages?: IDocumentSkeletonPage[], paragraphConfig?: IParagraphConfig, localeService?: LocaleService): never[];
|
|
@@ -14,22 +14,22 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { IParagraphStyle } from '@univerjs/core';
|
|
17
|
-
import type { ISectionBreakConfig } from '
|
|
18
|
-
import type { DataStreamTreeNode } from '
|
|
19
|
-
import type { DocumentViewModel } from '
|
|
17
|
+
import type { ISectionBreakConfig } from '../../../../../basics/interfaces';
|
|
18
|
+
import type { DataStreamTreeNode } from '../../../view-model/data-stream-tree-node';
|
|
19
|
+
import type { DocumentViewModel } from '../../../view-model/document-view-model';
|
|
20
20
|
export declare function otherHandler(index: number, charArray: string, bodyModel: DocumentViewModel, paragraphNode: DataStreamTreeNode, sectionBreakConfig: ISectionBreakConfig, paragraphStyle: IParagraphStyle): {
|
|
21
21
|
step: number;
|
|
22
|
-
|
|
22
|
+
glyphGroup: import("../../../../..").IDocumentSkeletonGlyph[];
|
|
23
23
|
};
|
|
24
24
|
export declare function ArabicHandler(index: number, charArray: string, bodyModel: DocumentViewModel, paragraphNode: DataStreamTreeNode, sectionBreakConfig: ISectionBreakConfig, paragraphStyle: IParagraphStyle): {
|
|
25
25
|
step: number;
|
|
26
|
-
|
|
26
|
+
glyphGroup: import("../../../../..").IDocumentSkeletonGlyph[];
|
|
27
27
|
};
|
|
28
28
|
export declare function emojiHandler(index: number, charArray: string, bodyModel: DocumentViewModel, paragraphNode: DataStreamTreeNode, sectionBreakConfig: ISectionBreakConfig, paragraphStyle: IParagraphStyle): {
|
|
29
29
|
step: number;
|
|
30
|
-
|
|
30
|
+
glyphGroup: import("../../../../..").IDocumentSkeletonGlyph[];
|
|
31
31
|
};
|
|
32
32
|
export declare function TibetanHandler(index: number, charArray: string, bodyModel: DocumentViewModel, paragraphNode: DataStreamTreeNode, sectionBreakConfig: ISectionBreakConfig, paragraphStyle: IParagraphStyle): {
|
|
33
33
|
step: number;
|
|
34
|
-
|
|
34
|
+
glyphGroup: import("../../../../..").IDocumentSkeletonGlyph[];
|
|
35
35
|
};
|
|
@@ -13,6 +13,6 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import type {
|
|
17
|
-
import type { IParagraphConfig, ISectionBreakConfig } from '
|
|
18
|
-
export declare function
|
|
16
|
+
import type { IDocumentSkeletonGlyph, IDocumentSkeletonPage } from '../../../../../basics/i-document-skeleton-cached';
|
|
17
|
+
import type { IParagraphConfig, ISectionBreakConfig } from '../../../../../basics/interfaces';
|
|
18
|
+
export declare function layoutParagraph(glyphGroup: IDocumentSkeletonGlyph[], pages: IDocumentSkeletonPage[], sectionBreakConfig: ISectionBreakConfig, paragraphConfig: IParagraphConfig, paragraphStart?: boolean): IDocumentSkeletonPage[];
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import type { IDocumentSkeletonPage, ISkeletonResourceReference } from '
|
|
17
|
-
import type { ISectionBreakConfig } from '
|
|
18
|
-
import type { DataStreamTreeNode } from '
|
|
19
|
-
import type { DocumentViewModel } from '
|
|
16
|
+
import type { IDocumentSkeletonPage, ISkeletonResourceReference } from '../../../../../basics/i-document-skeleton-cached';
|
|
17
|
+
import type { ISectionBreakConfig } from '../../../../../basics/interfaces';
|
|
18
|
+
import type { DataStreamTreeNode } from '../../../view-model/data-stream-tree-node';
|
|
19
|
+
import type { DocumentViewModel } from '../../../view-model/document-view-model';
|
|
20
20
|
export declare function dealWidthParagraph(bodyModel: DocumentViewModel, paragraphNode: DataStreamTreeNode, curPage: IDocumentSkeletonPage, sectionBreakConfig: ISectionBreakConfig, skeletonResourceReference: ISkeletonResourceReference): IDocumentSkeletonPage[];
|
|
@@ -13,9 +13,6 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
export
|
|
19
|
-
export * from './language-ruler';
|
|
20
|
-
export * from './layout-ruler';
|
|
21
|
-
export * from './paragraph';
|
|
16
|
+
import type { IParagraph } from '@univerjs/core';
|
|
17
|
+
import type { IDocumentSkeletonPage } from '../../../../../basics/i-document-skeleton-cached';
|
|
18
|
+
export declare function lineAdjustment(pages: IDocumentSkeletonPage[], paragraph: IParagraph): void;
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
*/
|
|
16
|
+
import type { IDocumentSkeletonPage, ISkeletonResourceReference } from '../../../../../basics/i-document-skeleton-cached';
|
|
17
|
+
import type { DataStreamTreeNode } from '../../../view-model/data-stream-tree-node';
|
|
18
|
+
import type { DocumentViewModel } from '../../../view-model/document-view-model';
|
|
19
|
+
import type { ISectionBreakConfig } from '../../../../../basics/interfaces';
|
|
20
|
+
import type { IShapedText } from './shaping';
|
|
21
|
+
export declare function lineBreaking(shapedTextList: IShapedText[], curPage: IDocumentSkeletonPage, bodyModel: DocumentViewModel, paragraphNode: DataStreamTreeNode, sectionBreakConfig: ISectionBreakConfig, skeletonResourceReference: ISkeletonResourceReference): IDocumentSkeletonPage[];
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
*/
|
|
16
|
+
import type { IParagraphStyle } from '@univerjs/core';
|
|
17
|
+
import type { IDocumentSkeletonGlyph } from '../../../../../basics/i-document-skeleton-cached';
|
|
18
|
+
import type { DataStreamTreeNode } from '../../../view-model/data-stream-tree-node';
|
|
19
|
+
import type { DocumentViewModel } from '../../../view-model/document-view-model';
|
|
20
|
+
import type { ISectionBreakConfig } from '../../../../../basics/interfaces';
|
|
21
|
+
export interface IShapedText {
|
|
22
|
+
text: string;
|
|
23
|
+
glyphs: IDocumentSkeletonGlyph[];
|
|
24
|
+
}
|
|
25
|
+
export declare function shaping(content: string, bodyModel: DocumentViewModel, paragraphNode: DataStreamTreeNode, sectionBreakConfig: ISectionBreakConfig, paragraphStyle: IParagraphStyle): IShapedText[];
|
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import type { IDocumentSkeletonPage, ISkeletonResourceReference } from '
|
|
17
|
-
import type { ISectionBreakConfig } from '
|
|
18
|
-
import type { DataStreamTreeNode } from '
|
|
19
|
-
import type { DocumentViewModel } from '
|
|
20
|
-
export declare function dealWithSections(bodyModel: DocumentViewModel, sectionNode: DataStreamTreeNode, curPage: IDocumentSkeletonPage, sectionBreakConfig: ISectionBreakConfig, skeletonResourceReference: ISkeletonResourceReference,
|
|
16
|
+
import type { IDocumentSkeletonPage, ISkeletonResourceReference } from '../../../../basics/i-document-skeleton-cached';
|
|
17
|
+
import type { ISectionBreakConfig } from '../../../../basics/interfaces';
|
|
18
|
+
import type { DataStreamTreeNode } from '../../view-model/data-stream-tree-node';
|
|
19
|
+
import type { DocumentViewModel } from '../../view-model/document-view-model';
|
|
20
|
+
export declare function dealWithSections(bodyModel: DocumentViewModel, sectionNode: DataStreamTreeNode, curPage: IDocumentSkeletonPage, sectionBreakConfig: ISectionBreakConfig, skeletonResourceReference: ISkeletonResourceReference, _preRenderedBlockIdMap?: Map<string, boolean>): {
|
|
21
21
|
pages: IDocumentSkeletonPage[];
|
|
22
22
|
renderedBlockIdMap: Map<string, boolean>;
|
|
23
23
|
};
|
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { LocaleService, Nullable } from '@univerjs/core';
|
|
17
|
-
import type { IDocumentSkeletonCached,
|
|
18
|
-
import { PageLayoutType } from '
|
|
19
|
-
import type { INodeInfo, INodePosition, INodeSearch } from '
|
|
20
|
-
import type { IViewportBound, Vector2 } from '
|
|
21
|
-
import { Skeleton } from '
|
|
22
|
-
import type { DocumentViewModel } from '
|
|
17
|
+
import type { IDocumentSkeletonCached, IDocumentSkeletonGlyph } from '../../../basics/i-document-skeleton-cached';
|
|
18
|
+
import { PageLayoutType } from '../../../basics/i-document-skeleton-cached';
|
|
19
|
+
import type { INodeInfo, INodePosition, INodeSearch } from '../../../basics/interfaces';
|
|
20
|
+
import type { IViewportBound, Vector2 } from '../../../basics/vector2';
|
|
21
|
+
import { Skeleton } from '../../skeleton';
|
|
22
|
+
import type { DocumentViewModel } from '../view-model/document-view-model';
|
|
23
23
|
export declare enum DocumentSkeletonState {
|
|
24
24
|
PENDING = "pending",
|
|
25
25
|
CALCULATING = "calculating",
|
|
@@ -42,10 +42,10 @@ export declare class DocumentSkeleton extends Skeleton {
|
|
|
42
42
|
};
|
|
43
43
|
private _getPageActualWidth;
|
|
44
44
|
getPageSize(): import("@univerjs/core").ISize | undefined;
|
|
45
|
-
|
|
45
|
+
findPositionByGlyph(glyph: IDocumentSkeletonGlyph): Nullable<INodeSearch>;
|
|
46
46
|
findNodePositionByCharIndex(charIndex: number, isBack?: boolean): Nullable<INodePosition>;
|
|
47
|
-
findNodeByCharIndex(charIndex: number): Nullable<
|
|
48
|
-
|
|
47
|
+
findNodeByCharIndex(charIndex: number): Nullable<IDocumentSkeletonGlyph>;
|
|
48
|
+
findGlyphByPosition(position: Nullable<INodePosition>): IDocumentSkeletonGlyph | undefined;
|
|
49
49
|
findNodeByCoord(coord: Vector2, pageLayoutType: PageLayoutType, pageMarginLeft: number, pageMarginTop: number): Nullable<INodeInfo>;
|
|
50
50
|
private _getNearestNode;
|
|
51
51
|
private _getPageBoundingBox;
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
*/
|
|
16
|
+
export {};
|
|
@@ -15,5 +15,5 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import type { ISectionColumnProperties } from '@univerjs/core';
|
|
17
17
|
import { ColumnSeparatorType } from '@univerjs/core';
|
|
18
|
-
import type { IDocumentSkeletonColumn } from '
|
|
18
|
+
import type { IDocumentSkeletonColumn } from '../../../../basics/i-document-skeleton-cached';
|
|
19
19
|
export declare function createSkeletonColumn(columnIndex: number | undefined, columnProperties: ISectionColumnProperties[], columnSeparatorType?: ColumnSeparatorType, pageWidth?: number): IDocumentSkeletonColumn;
|
|
@@ -0,0 +1,31 @@
|
|
|
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
|
+
*/
|
|
16
|
+
import type { IAdjustability, IDocumentSkeletonBullet, IDocumentSkeletonDivide, IDocumentSkeletonGlyph } from '../../../../basics/i-document-skeleton-cached';
|
|
17
|
+
import { GlyphType } from '../../../../basics/i-document-skeleton-cached';
|
|
18
|
+
import type { IFontCreateConfig } from '../../../../basics/interfaces';
|
|
19
|
+
export declare function isSpace(char: string): boolean;
|
|
20
|
+
export declare function isJustifiable(content: string): boolean;
|
|
21
|
+
export declare function baseAdjustability(content: string, width: number): IAdjustability;
|
|
22
|
+
export declare function createSkeletonWordGlyph(content: string, config: IFontCreateConfig, glyphWidth?: number): IDocumentSkeletonGlyph;
|
|
23
|
+
export declare function createSkeletonLetterGlyph(content: string, config: IFontCreateConfig, glyphWidth?: number): IDocumentSkeletonGlyph;
|
|
24
|
+
export declare function createSkeletonTabGlyph(config: IFontCreateConfig, glyphWidth?: number): IDocumentSkeletonGlyph;
|
|
25
|
+
export declare function _createSkeletonWordOrLetter(glyphType: GlyphType, content: string, config: IFontCreateConfig, glyphWidth?: number): IDocumentSkeletonGlyph;
|
|
26
|
+
export declare function createSkeletonBulletGlyph(glyph: IDocumentSkeletonGlyph, bulletSkeleton: IDocumentSkeletonBullet, charSpaceApply: number): IDocumentSkeletonGlyph;
|
|
27
|
+
export declare function setGlyphGroupLeft(glyphGroup: IDocumentSkeletonGlyph[], left?: number): void;
|
|
28
|
+
export declare function setGlyphLeft(glyph: IDocumentSkeletonGlyph, left?: number): void;
|
|
29
|
+
export declare function addGlyphToDivide(divide: IDocumentSkeletonDivide, glyphGroup: IDocumentSkeletonGlyph[], offsetLeft?: number): void;
|
|
30
|
+
export declare function glyphShrinkRight(glyph: IDocumentSkeletonGlyph, amount: number): void;
|
|
31
|
+
export declare function glyphShrinkLeft(glyph: IDocumentSkeletonGlyph, amount: number): void;
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import type { IDocumentSkeletonDivide, IDocumentSkeletonDrawing, IDocumentSkeletonDrawingAnchor, IDocumentSkeletonLine, LineType } from '
|
|
16
|
+
import type { IDocumentSkeletonDivide, IDocumentSkeletonDrawing, IDocumentSkeletonDrawingAnchor, IDocumentSkeletonLine, LineType } from '../../../../basics/i-document-skeleton-cached';
|
|
17
17
|
interface ILineBoundingBox {
|
|
18
18
|
lineHeight: number;
|
|
19
19
|
lineTop: number;
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import type { IDocumentSkeletonPage, ISkeletonResourceReference } from '
|
|
17
|
-
import { BreakType } from '
|
|
18
|
-
import type { ISectionBreakConfig } from '
|
|
16
|
+
import type { IDocumentSkeletonPage, ISkeletonResourceReference } from '../../../../basics/i-document-skeleton-cached';
|
|
17
|
+
import { BreakType } from '../../../../basics/i-document-skeleton-cached';
|
|
18
|
+
import type { ISectionBreakConfig } from '../../../../basics/interfaces';
|
|
19
19
|
export declare function createSkeletonPage(sectionBreakConfig: ISectionBreakConfig, skeletonResourceReference: ISkeletonResourceReference, pageNumber?: number, breakType?: BreakType): IDocumentSkeletonPage;
|
|
@@ -15,6 +15,6 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import type { ISectionColumnProperties } from '@univerjs/core';
|
|
17
17
|
import { ColumnSeparatorType } from '@univerjs/core';
|
|
18
|
-
import type { IDocumentSkeletonColumn, IDocumentSkeletonSection } from '
|
|
18
|
+
import type { IDocumentSkeletonColumn, IDocumentSkeletonSection } from '../../../../basics/i-document-skeleton-cached';
|
|
19
19
|
export declare function createSkeletonSection(columnProperties?: ISectionColumnProperties[], columnSeparatorType?: ColumnSeparatorType, top?: number, left?: number, sectionWidth?: number, sectionHeight?: number): IDocumentSkeletonSection;
|
|
20
20
|
export declare function setColumnFullState(column: IDocumentSkeletonColumn, state: boolean): void;
|