@univerjs/engine-render 0.2.4-alpha.0 → 0.2.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 +5763 -5569
- package/lib/types/basics/i-document-skeleton-cached.d.ts +8 -1
- package/lib/types/basics/interfaces.d.ts +3 -3
- package/lib/types/components/component.d.ts +1 -1
- package/lib/types/components/docs/layout/doc-skeleton.d.ts +7 -1
- package/lib/types/components/docs/layout/hyphenation/hyphen.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/language-detector.d.ts +1 -1
- package/lib/types/components/docs/layout/line-breaker/line-breaker.d.ts +1 -0
- package/lib/types/components/docs/layout/line-breaker/rule.d.ts +4 -17
- package/lib/types/components/docs/layout/model/line.d.ts +4 -3
- package/lib/types/components/docs/layout/tools.d.ts +3 -4
- package/lib/types/components/docs/text-selection/convert-cursor.d.ts +1 -0
- package/lib/types/components/docs/text-selection/text-selection-render-manager.d.ts +2 -1
- package/lib/types/components/docs/view-model/document-view-model.d.ts +2 -1
- package/lib/types/render-engine.d.ts +3 -2
- package/lib/types/render-manager/render-manager.service.d.ts +3 -2
- package/lib/types/render-manager/render-unit.d.ts +2 -1
- package/lib/types/scene.d.ts +1 -1
- package/lib/types/thin-engine.d.ts +2 -1
- package/lib/umd/index.js +2 -2
- package/package.json +6 -4
|
@@ -12,13 +12,18 @@ export interface ISkeletonResourceReference {
|
|
|
12
12
|
skeHeaders: Map<string, Map<number, IDocumentSkeletonHeaderFooter>>;
|
|
13
13
|
skeFooters: Map<string, Map<number, IDocumentSkeletonHeaderFooter>>;
|
|
14
14
|
skeListLevel?: Map<string, IDocumentSkeletonBullet[]>;
|
|
15
|
-
drawingAnchor?: Map<number, IDocumentSkeletonDrawingAnchor
|
|
15
|
+
drawingAnchor?: Map<string, Map<number, IDocumentSkeletonDrawingAnchor>>;
|
|
16
16
|
}
|
|
17
17
|
export interface IDocumentSkeletonDrawingAnchor {
|
|
18
18
|
elements: IDocumentSkeletonLine[];
|
|
19
19
|
paragraphIndex: number;
|
|
20
20
|
top: number;
|
|
21
21
|
}
|
|
22
|
+
export declare enum DocumentSkeletonPageType {
|
|
23
|
+
BODY = 0,
|
|
24
|
+
HEADER = 1,
|
|
25
|
+
FOOTER = 2
|
|
26
|
+
}
|
|
22
27
|
export interface IDocumentSkeletonPage {
|
|
23
28
|
sections: IDocumentSkeletonSection[];
|
|
24
29
|
headerId: string;
|
|
@@ -42,6 +47,8 @@ export interface IDocumentSkeletonPage {
|
|
|
42
47
|
st: number;
|
|
43
48
|
ed: number;
|
|
44
49
|
skeDrawings: Map<string, IDocumentSkeletonDrawing>;
|
|
50
|
+
segmentId: string;
|
|
51
|
+
type: DocumentSkeletonPageType;
|
|
45
52
|
renderConfig?: IDocumentRenderConfig;
|
|
46
53
|
parent?: IDocumentSkeletonCached;
|
|
47
54
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
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 { IDocumentSkeletonBullet, IDocumentSkeletonDrawing, IDocumentSkeletonDrawingAnchor, IDocumentSkeletonFontStyle, IDocumentSkeletonGlyph, IDocumentSkeletonHeaderFooter } from './i-document-skeleton-cached';
|
|
3
|
+
import { DocumentSkeletonPageType, IDocumentSkeletonBullet, IDocumentSkeletonDrawing, IDocumentSkeletonDrawingAnchor, IDocumentSkeletonFontStyle, IDocumentSkeletonGlyph, IDocumentSkeletonHeaderFooter } from './i-document-skeleton-cached';
|
|
4
4
|
import { Vector2 } from './vector2';
|
|
5
5
|
import { ITransformerConfig } from './transformer-config';
|
|
6
6
|
|
|
@@ -64,7 +64,7 @@ export interface IParagraphConfig {
|
|
|
64
64
|
paragraphStyle?: IParagraphStyle;
|
|
65
65
|
skeHeaders: Map<string, Map<number, IDocumentSkeletonHeaderFooter>>;
|
|
66
66
|
skeFooters: Map<string, Map<number, IDocumentSkeletonHeaderFooter>>;
|
|
67
|
-
|
|
67
|
+
pDrawingAnchor?: Map<number, IDocumentSkeletonDrawingAnchor>;
|
|
68
68
|
}
|
|
69
69
|
export interface IFontCreateConfig {
|
|
70
70
|
fontStyle: IDocumentSkeletonFontStyle;
|
|
@@ -89,7 +89,7 @@ export interface INodeSearch {
|
|
|
89
89
|
section: number;
|
|
90
90
|
page: number;
|
|
91
91
|
segmentPage: number;
|
|
92
|
-
|
|
92
|
+
pageType: DocumentSkeletonPageType;
|
|
93
93
|
}
|
|
94
94
|
export interface INodePosition extends INodeSearch {
|
|
95
95
|
isBack: boolean;
|
|
@@ -11,6 +11,11 @@ export declare enum DocumentSkeletonState {
|
|
|
11
11
|
READY = "ready",
|
|
12
12
|
INVALID = "invalid"
|
|
13
13
|
}
|
|
14
|
+
export interface IFindNodeRestrictions {
|
|
15
|
+
strict: boolean;
|
|
16
|
+
segmentId: string;
|
|
17
|
+
segmentPage: number;
|
|
18
|
+
}
|
|
14
19
|
export declare class DocumentSkeleton extends Skeleton {
|
|
15
20
|
private _docViewModel;
|
|
16
21
|
private _skeletonData;
|
|
@@ -39,7 +44,8 @@ export declare class DocumentSkeleton extends Skeleton {
|
|
|
39
44
|
pageNumber: number;
|
|
40
45
|
page: Nullable<IDocumentSkeletonPage>;
|
|
41
46
|
};
|
|
42
|
-
findNodeByCoord(coord: Vector2, pageLayoutType: PageLayoutType, pageMarginLeft: number, pageMarginTop: number): Nullable<INodeInfo>;
|
|
47
|
+
findNodeByCoord(coord: Vector2, pageLayoutType: PageLayoutType, pageMarginLeft: number, pageMarginTop: number, restrictions?: IFindNodeRestrictions): Nullable<INodeInfo>;
|
|
48
|
+
private _collectNearestNode;
|
|
43
49
|
private _getNearestNode;
|
|
44
50
|
private _getPageBoundingBox;
|
|
45
51
|
private _translatePage;
|
|
@@ -1,23 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
-
*/
|
|
1
|
+
import { Nullable } from '@univerjs/core';
|
|
2
|
+
|
|
16
3
|
export interface ILineBreakRule {
|
|
17
|
-
(codePoint: number, className: number): boolean;
|
|
4
|
+
(codePoint: number, lastCodePoint: Nullable<number>, className: number): boolean;
|
|
18
5
|
}
|
|
19
6
|
export declare class Rule {
|
|
20
7
|
private _rules;
|
|
21
8
|
add(key: string, rule: ILineBreakRule): void;
|
|
22
|
-
shouldBreak(codePoint: number, className: number): boolean;
|
|
9
|
+
shouldBreak(codePoint: number, lastCodePoint: Nullable<number>, className: number): boolean;
|
|
23
10
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Nullable } from '@univerjs/core';
|
|
2
|
+
import { IDocumentSkeletonDivide, IDocumentSkeletonDrawing, IDocumentSkeletonDrawingAnchor, IDocumentSkeletonLine, IDocumentSkeletonPage, LineType } from '../../../../basics/i-document-skeleton-cached';
|
|
2
3
|
|
|
3
4
|
interface ILineBoundingBox {
|
|
4
5
|
lineHeight: number;
|
|
@@ -11,8 +12,8 @@ interface ILineBoundingBox {
|
|
|
11
12
|
marginTop?: number;
|
|
12
13
|
spaceBelowApply?: number;
|
|
13
14
|
}
|
|
14
|
-
export declare function createSkeletonLine(paragraphIndex: number, lineType: LineType, lineBoundingBox: ILineBoundingBox, columnWidth: number, lineIndex
|
|
15
|
-
export declare function calculateLineTopByDrawings(lineHeight
|
|
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;
|
|
16
|
+
export declare function calculateLineTopByDrawings(lineHeight: number | undefined, lineTop: number | undefined, page: IDocumentSkeletonPage, headerPage: Nullable<IDocumentSkeletonPage>, footerPage: Nullable<IDocumentSkeletonPage>): number;
|
|
16
17
|
export declare function updateDivideInfo(divide: IDocumentSkeletonDivide, states: Partial<IDocumentSkeletonDivide>): void;
|
|
17
18
|
export declare function setLineMarginBottom(line: IDocumentSkeletonLine, marginBottom: number): void;
|
|
18
19
|
export declare function collisionDetection(drawing: IDocumentSkeletonDrawing, lineHeight: number, lineTop: number, columnLeft: number, columnWidth: number): boolean;
|
|
@@ -81,9 +81,7 @@ export interface ILayoutContext {
|
|
|
81
81
|
dataModel: DocumentDataModel;
|
|
82
82
|
docsConfig: IDocsConfig;
|
|
83
83
|
skeleton: IDocumentSkeletonCached;
|
|
84
|
-
layoutStartPointer:
|
|
85
|
-
paragraphIndex: Nullable<number>;
|
|
86
|
-
};
|
|
84
|
+
layoutStartPointer: Record<string, Nullable<number>>;
|
|
87
85
|
isDirty: boolean;
|
|
88
86
|
skeletonResourceReference: ISkeletonResourceReference;
|
|
89
87
|
drawingsCache: Map<string, {
|
|
@@ -91,7 +89,7 @@ export interface ILayoutContext {
|
|
|
91
89
|
page: IDocumentSkeletonPage;
|
|
92
90
|
drawing: IDocumentSkeletonDrawing;
|
|
93
91
|
}>;
|
|
94
|
-
paragraphConfigCache: Map<number, IParagraphConfig
|
|
92
|
+
paragraphConfigCache: Map<string, Map<number, IParagraphConfig>>;
|
|
95
93
|
sectionBreakConfigCache: Map<number, ISectionBreakConfig>;
|
|
96
94
|
paragraphsOpenNewPage: Set<number>;
|
|
97
95
|
hyphen: Hyphen;
|
|
@@ -102,4 +100,5 @@ export declare const DEFAULT_PAGE_SIZE: {
|
|
|
102
100
|
height: number;
|
|
103
101
|
};
|
|
104
102
|
export declare function prepareSectionBreakConfig(ctx: ILayoutContext, nodeIndex: number): ISectionBreakConfig;
|
|
103
|
+
export declare function resetContext(ctx: ILayoutContext): void;
|
|
105
104
|
export {};
|
|
@@ -51,6 +51,7 @@ export declare class NodePositionConvertToCursor {
|
|
|
51
51
|
contentBoxPointGroup: IPoint[][];
|
|
52
52
|
cursorList: ITextRange[];
|
|
53
53
|
};
|
|
54
|
+
private _isValidPosition;
|
|
54
55
|
private _resetCurrentNodePositionState;
|
|
55
56
|
private _setNodePositionState;
|
|
56
57
|
private _checkPreviousNodePositionState;
|
|
@@ -53,6 +53,7 @@ export interface ITextSelectionRenderManager {
|
|
|
53
53
|
enableSelection(): void;
|
|
54
54
|
disableSelection(): void;
|
|
55
55
|
setSegment(id: string): void;
|
|
56
|
+
getSegment(): string;
|
|
56
57
|
setSegmentPage(pageIndex: number): void;
|
|
57
58
|
getSegmentPage(): number;
|
|
58
59
|
setStyle(style: ITextSelectionStyle): void;
|
|
@@ -178,4 +179,4 @@ export declare class TextSelectionRenderManager extends RxDisposable implements
|
|
|
178
179
|
private _detachEvent;
|
|
179
180
|
private _activeSelectionRefresh;
|
|
180
181
|
}
|
|
181
|
-
export declare const ITextSelectionRenderManager: import('@
|
|
182
|
+
export declare const ITextSelectionRenderManager: import('@wendellhu/redi').IdentifierDecorator<TextSelectionRenderManager>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ICustomDecorationForInterceptor, ICustomRangeForInterceptor,
|
|
1
|
+
import { ICustomDecorationForInterceptor, ICustomRangeForInterceptor, IDocumentBody, ITextRun, Nullable, DocumentDataModel } from '@univerjs/core';
|
|
2
|
+
import { IDisposable } from '@wendellhu/redi';
|
|
2
3
|
import { DataStreamTreeNode } from './data-stream-tree-node';
|
|
3
4
|
|
|
4
5
|
export interface ICustomRangeInterceptor {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Plugin } from '@univerjs/core';
|
|
2
|
+
import { Injector } from '@wendellhu/redi';
|
|
2
3
|
import { Engine } from './engine';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* The global rendering engine.
|
|
6
7
|
*/
|
|
7
|
-
export declare const IRenderingEngine: import('@
|
|
8
|
+
export declare const IRenderingEngine: import('@wendellhu/redi').IdentifierDecorator<Engine>;
|
|
8
9
|
export declare class UniverRenderEnginePlugin extends Plugin {
|
|
9
10
|
readonly _injector: Injector;
|
|
10
11
|
static pluginName: string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Nullable, UnitModel, UnitType, UniverInstanceType, Disposable, IUniverInstanceService } from '@univerjs/core';
|
|
2
|
+
import { Dependency, DependencyIdentifier, IDisposable, Injector } from '@wendellhu/redi';
|
|
2
3
|
import { Observable } from 'rxjs';
|
|
3
4
|
import { BaseObject } from '../base-object';
|
|
4
5
|
import { DocComponent } from '../components/docs/doc-component';
|
|
@@ -73,5 +74,5 @@ export declare class RenderManagerService extends Disposable implements IRenderM
|
|
|
73
74
|
getRenderAll(): Map<string, IRender>;
|
|
74
75
|
private _disposeItem;
|
|
75
76
|
}
|
|
76
|
-
export declare const IRenderManagerService: import('@
|
|
77
|
+
export declare const IRenderManagerService: import('@wendellhu/redi').IdentifierDecorator<IRenderManagerService>;
|
|
77
78
|
export declare function isDisposable(thing: unknown): thing is IDisposable;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Nullable, UnitModel, UnitType, Disposable } from '@univerjs/core';
|
|
2
|
+
import { Dependency, DependencyIdentifier, IDisposable, Injector } from '@wendellhu/redi';
|
|
2
3
|
import { Engine } from '../engine';
|
|
3
4
|
import { Scene } from '../scene';
|
|
4
5
|
import { RenderComponentType } from './render-manager.service';
|
package/lib/types/scene.d.ts
CHANGED
|
@@ -85,7 +85,7 @@ export declare class Scene extends ThinScene {
|
|
|
85
85
|
getAllObjectsByOrderForPick(isDesc?: boolean): BaseObject[];
|
|
86
86
|
getObject(oKey: string): BaseObject | undefined;
|
|
87
87
|
getObjectIncludeInGroup(oKey: string): BaseObject | undefined;
|
|
88
|
-
fuzzyMathObjects(oKey: string): BaseObject[];
|
|
88
|
+
fuzzyMathObjects(oKey: string, matchStart?: boolean): BaseObject[];
|
|
89
89
|
addViewport(...viewport: Viewport[]): this;
|
|
90
90
|
removeViewport(key: string): Viewport | undefined;
|
|
91
91
|
getViewports(): Viewport[];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Disposable, EventSubject
|
|
1
|
+
import { Disposable, EventSubject } from '@univerjs/core';
|
|
2
|
+
import { IDisposable } from '@wendellhu/redi';
|
|
2
3
|
import { CURSOR_TYPE, RENDER_CLASS_TYPE } from './basics/const';
|
|
3
4
|
import { IEvent } from './basics/i-events';
|
|
4
5
|
import { ITransformChangeState } from './basics/interfaces';
|