@univerjs/engine-render 1.0.0-alpha.1 → 1.0.0-insiders.20260701-0ef51b0
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 +245 -57
- package/lib/es/index.js +245 -59
- package/lib/types/basics/i-document-skeleton-cached.d.ts +8 -0
- package/lib/types/basics/interfaces.d.ts +1 -0
- package/lib/types/components/docs/custom-block-render-viewport.d.ts +37 -0
- package/lib/types/components/docs/layout/block/paragraph/layout-ruler.d.ts +1 -1
- package/lib/types/index.d.ts +2 -0
- package/lib/types/render-manager/render-manager.service.d.ts +1 -1
- package/lib/types/render-manager/render-unit.d.ts +2 -0
- package/lib/umd/index.js +2 -2
- package/package.json +2 -2
- package/LICENSE +0 -176
|
@@ -96,6 +96,7 @@ export interface IParagraphConfig {
|
|
|
96
96
|
docxFallbackAnchorLeft?: IParagraphStyle['indentStart'];
|
|
97
97
|
paragraphNonInlineSkeDrawings?: Map<string, IDocumentSkeletonDrawing>;
|
|
98
98
|
paragraphInlineSkeDrawings?: Map<string, IDocumentSkeletonDrawing>;
|
|
99
|
+
topBottomCustomBlockFlowBottom?: number;
|
|
99
100
|
skeTablesInParagraph?: IParagraphTableCache[];
|
|
100
101
|
bulletSkeleton?: IDocumentSkeletonBullet;
|
|
101
102
|
paragraphStyle?: IParagraphStyle;
|
|
@@ -0,0 +1,37 @@
|
|
|
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 IDocsCustomBlockRenderViewportInput {
|
|
17
|
+
blockLeft?: number;
|
|
18
|
+
fallbackHeight: number;
|
|
19
|
+
fallbackWidth: number;
|
|
20
|
+
pageMarginLeft?: number;
|
|
21
|
+
pageMarginRight?: number;
|
|
22
|
+
pageWidth?: number;
|
|
23
|
+
}
|
|
24
|
+
export interface IDocsCustomBlockRenderViewport {
|
|
25
|
+
bleedLeft?: number;
|
|
26
|
+
bleedWidth?: number;
|
|
27
|
+
contentHeight?: number;
|
|
28
|
+
contentWidth?: number;
|
|
29
|
+
height: number;
|
|
30
|
+
layoutWidth?: number;
|
|
31
|
+
offsetLeft?: number;
|
|
32
|
+
viewportHeight?: number;
|
|
33
|
+
width: number;
|
|
34
|
+
}
|
|
35
|
+
export type DocsCustomBlockRenderViewportProvider = (unitId: string, blockId: string, input: IDocsCustomBlockRenderViewportInput) => IDocsCustomBlockRenderViewport | null | undefined;
|
|
36
|
+
export declare function setDocsCustomBlockRenderViewportProvider(provider: DocsCustomBlockRenderViewportProvider | null): () => void;
|
|
37
|
+
export declare function getDocsCustomBlockRenderViewport(unitId: string, blockId: string, input: IDocsCustomBlockRenderViewportInput): IDocsCustomBlockRenderViewport | null;
|
|
@@ -31,5 +31,5 @@ export declare function getLineHeightMetrics(glyphLineHeight: number, paragraphL
|
|
|
31
31
|
contentHeight: number;
|
|
32
32
|
lineSpacingApply: number;
|
|
33
33
|
};
|
|
34
|
-
export declare function updateInlineDrawingPosition(line: IDocumentSkeletonLine, paragraphInlineSkeDrawings?: Map<string, IDocumentSkeletonDrawing>, blockAnchorTop?: number, paragraphNonInlineSkeDrawings?: Map<string, IDocumentSkeletonDrawing>): void;
|
|
34
|
+
export declare function updateInlineDrawingPosition(line: IDocumentSkeletonLine, paragraphInlineSkeDrawings?: Map<string, IDocumentSkeletonDrawing>, unitId?: string, blockAnchorTop?: number, paragraphNonInlineSkeDrawings?: Map<string, IDocumentSkeletonDrawing>): void;
|
|
35
35
|
export {};
|
package/lib/types/index.d.ts
CHANGED
|
@@ -18,6 +18,8 @@ export * from './basics';
|
|
|
18
18
|
export { getOffsetRectForDom } from './basics/position';
|
|
19
19
|
export * from './canvas';
|
|
20
20
|
export * from './components';
|
|
21
|
+
export type { DocsCustomBlockRenderViewportProvider, IDocsCustomBlockRenderViewport, IDocsCustomBlockRenderViewportInput } from './components/docs/custom-block-render-viewport';
|
|
22
|
+
export { getDocsCustomBlockRenderViewport, setDocsCustomBlockRenderViewportProvider } from './components/docs/custom-block-render-viewport';
|
|
21
23
|
export { DocBackground } from './components/docs/doc-background';
|
|
22
24
|
export { Documents } from './components/docs/document';
|
|
23
25
|
export type { IPageRenderConfig } from './components/docs/document';
|
|
@@ -113,7 +113,7 @@ export declare class RenderManagerService extends Disposable implements IRenderM
|
|
|
113
113
|
* @param isMainScene
|
|
114
114
|
* @returns renderUnit:IRender
|
|
115
115
|
*/
|
|
116
|
-
protected _createRender(unitId: string, engine: Engine, isMainScene?: boolean, createUnitOptions?: ICreateUnitOptions): IRender;
|
|
116
|
+
protected _createRender(unitId: string, engine: Engine, isMainScene?: boolean, createUnitOptions?: ICreateUnitOptions, parentInjector?: Injector): IRender;
|
|
117
117
|
addRender(unitId: string, renderUnit: IRender): void;
|
|
118
118
|
private _addRenderUnit;
|
|
119
119
|
removeRender(unitId: string): void;
|
|
@@ -39,6 +39,7 @@ export interface IRender {
|
|
|
39
39
|
*/
|
|
40
40
|
activated$: Observable<boolean>;
|
|
41
41
|
with<T>(dependency: DependencyIdentifier<T>): T;
|
|
42
|
+
getInjector?(): Injector;
|
|
42
43
|
getRenderContext?(): IRenderContext;
|
|
43
44
|
/**
|
|
44
45
|
* Deactivate the render unit, means the render unit would be freezed and not updated,
|
|
@@ -95,6 +96,7 @@ export declare class RenderUnit extends Disposable implements IRender {
|
|
|
95
96
|
* Get a dependency from the RenderUnit's injector.
|
|
96
97
|
*/
|
|
97
98
|
with<T>(dependency: DependencyIdentifier<T>): T;
|
|
99
|
+
getInjector(): Injector;
|
|
98
100
|
/**
|
|
99
101
|
* Add render dependencies to the RenderUnit's injector. Note that the dependencies would be initialized immediately
|
|
100
102
|
* after being added.
|