@univerjs/engine-render 0.2.7 → 0.2.9
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 +339 -189
- package/lib/types/base-object.d.ts +4 -3
- package/lib/types/basics/cell-data.d.ts +0 -1
- package/lib/types/basics/document-node-tools.d.ts +0 -1
- 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 +0 -1
- package/lib/types/basics/i-events.d.ts +0 -1
- package/lib/types/basics/interfaces.d.ts +0 -1
- 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 +0 -1
- 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 +1 -3
- 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 +5 -6
- package/lib/types/components/docs/layout/block/paragraph/layout-ruler.d.ts +1 -2
- 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 +0 -1
- package/lib/types/components/docs/layout/block/paragraph/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 +0 -1
- package/lib/types/components/docs/layout/doc-skeleton.d.ts +2 -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 +0 -1
- package/lib/types/components/docs/layout/model/page.d.ts +0 -1
- package/lib/types/components/docs/layout/model/section.d.ts +0 -1
- 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 -3
- package/lib/types/components/docs/liquid.d.ts +1 -2
- package/lib/types/components/docs/text-selection/convert-rect-range.d.ts +0 -1
- package/lib/types/components/docs/text-selection/convert-text-range.d.ts +0 -1
- package/lib/types/components/docs/text-selection/range-interface.d.ts +0 -1
- package/lib/types/components/docs/text-selection/rect-range.d.ts +0 -1
- package/lib/types/components/docs/text-selection/selection-utils.d.ts +0 -1
- package/lib/types/components/docs/text-selection/text-range.d.ts +0 -1
- package/lib/types/components/docs/text-selection/text-selection-render-manager.d.ts +1 -2
- 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 +2 -1
- 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 +10 -2
- package/lib/types/components/sheets/spreadsheet.d.ts +0 -3
- 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 +0 -1
- package/lib/types/floating/util.d.ts +0 -1
- package/lib/types/group.d.ts +0 -1
- package/lib/types/layer.d.ts +0 -1
- package/lib/types/render-engine.d.ts +0 -1
- package/lib/types/render-manager/render-manager.service.d.ts +44 -3
- package/lib/types/render-manager/render-unit.d.ts +17 -4
- package/lib/types/scene-viewer.d.ts +0 -1
- package/lib/types/scene.d.ts +17 -7
- package/lib/types/scene.input-manager.d.ts +0 -1
- package/lib/types/scene.transformer.d.ts +0 -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 +3 -7
- 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 +15 -34
- package/lib/umd/index.js +4 -2
- package/package.json +7 -7
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { IDocumentData, IStyleBase, ITransformState, LocaleService } from '@univerjs/core';
|
|
1
|
+
import { IDocumentData, IStyleBase, ITransformState, LocaleService, DocumentDataModel } from '@univerjs/core';
|
|
2
2
|
import { BASE_OBJECT_ARRAY, BaseObject, ObjectType } from '../base-object';
|
|
3
3
|
import { IViewportInfo } from '../basics/vector2';
|
|
4
4
|
import { UniverRenderingContext } from '../context';
|
|
5
|
-
|
|
6
5
|
export interface IRichTextProps extends ITransformState, IStyleBase {
|
|
7
6
|
text?: string;
|
|
8
7
|
richText?: IDocumentData;
|
|
@@ -22,6 +21,7 @@ export declare class RichText extends BaseObject {
|
|
|
22
21
|
private _documentData;
|
|
23
22
|
private _documentSkeleton;
|
|
24
23
|
private _documents;
|
|
24
|
+
documentModel: DocumentDataModel;
|
|
25
25
|
/**
|
|
26
26
|
* fontFamily
|
|
27
27
|
*/
|
|
@@ -90,11 +90,7 @@ export declare class RichText extends BaseObject {
|
|
|
90
90
|
private _convertToDocumentData;
|
|
91
91
|
private _initialProps;
|
|
92
92
|
/**
|
|
93
|
-
*
|
|
94
|
-
* it should be invoked when _documentData changed.
|
|
95
|
-
* _documentData changed ---> update _documentSkeleton & _documentSkeleton
|
|
96
|
-
*
|
|
97
|
-
* now it is invoked when transformByState(change editor size) & end of editing
|
|
93
|
+
* After changing editor size & end of editing, update skeleton of doc.
|
|
98
94
|
*/
|
|
99
95
|
refreshDocumentByDocData(): void;
|
|
100
96
|
/**
|
|
@@ -3,7 +3,6 @@ import { UniverRenderingContext } from '../context';
|
|
|
3
3
|
import { Viewport } from '../viewport';
|
|
4
4
|
import { IScrollBarProps, BaseScrollBar } from './base-scroll-bar';
|
|
5
5
|
import { Rect } from './rect';
|
|
6
|
-
|
|
7
6
|
export declare class ScrollBar extends BaseScrollBar {
|
|
8
7
|
protected _view: Viewport;
|
|
9
8
|
private _mainScene;
|
|
@@ -3,7 +3,6 @@ import { BaseObject, ObjectType } from '../base-object';
|
|
|
3
3
|
import { IObjectFullState } from '../basics/interfaces';
|
|
4
4
|
import { IViewportInfo, Vector2 } from '../basics/vector2';
|
|
5
5
|
import { UniverRenderingContext } from '../context';
|
|
6
|
-
|
|
7
6
|
export type LineJoin = 'round' | 'bevel' | 'miter';
|
|
8
7
|
export type LineCap = 'butt' | 'round' | 'square';
|
|
9
8
|
export type PaintFirst = 'fill' | 'stroke';
|
|
@@ -3,7 +3,6 @@ import { CURSOR_TYPE, RENDER_CLASS_TYPE } from './basics/const';
|
|
|
3
3
|
import { IEvent } from './basics/i-events';
|
|
4
4
|
import { ITransformChangeState } from './basics/interfaces';
|
|
5
5
|
import { Canvas } from './canvas';
|
|
6
|
-
|
|
7
6
|
export declare abstract class ThinEngine<T extends IDisposable> extends Disposable {
|
|
8
7
|
onInputChanged$: EventSubject<IEvent>;
|
|
9
8
|
onTransformChange$: EventSubject<ITransformChangeState>;
|
|
@@ -8,7 +8,6 @@ import { Vector2 } from './basics/vector2';
|
|
|
8
8
|
import { UniverRenderingContext } from './context';
|
|
9
9
|
import { ThinEngine } from './thin-engine';
|
|
10
10
|
import { Scene } from './scene';
|
|
11
|
-
|
|
12
11
|
export declare abstract class ThinScene extends Disposable {
|
|
13
12
|
onTransformChange$: EventSubject<ITransformChangeState>;
|
|
14
13
|
onFileLoaded$: EventSubject<string>;
|
package/lib/types/viewport.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ import { IBoundRectNoAngle, IViewportInfo, Vector2 } from './basics/vector2';
|
|
|
6
6
|
import { UniverRenderingContext } from './context';
|
|
7
7
|
import { BaseScrollBar } from './shape/base-scroll-bar';
|
|
8
8
|
import { ThinScene } from './thin-scene';
|
|
9
|
-
|
|
10
9
|
interface IViewPosition {
|
|
11
10
|
top?: number;
|
|
12
11
|
left?: number;
|
|
@@ -196,10 +195,6 @@ export declare class Viewport {
|
|
|
196
195
|
set preCacheBound(val: IBoundRectNoAngle | null);
|
|
197
196
|
enable(): void;
|
|
198
197
|
disable(): void;
|
|
199
|
-
/**
|
|
200
|
-
* invoked when canvas element size change
|
|
201
|
-
* engineResizeObserver --> engine.resizeBySize --> scene._setTransForm
|
|
202
|
-
*/
|
|
203
198
|
resetCanvasSizeAndUpdateScroll(): void;
|
|
204
199
|
setScrollBar(instance: BaseScrollBar): void;
|
|
205
200
|
removeScrollBar(): void;
|
|
@@ -217,32 +212,8 @@ export declare class Viewport {
|
|
|
217
212
|
setPadding(param: IPosition): void;
|
|
218
213
|
resetPadding(): void;
|
|
219
214
|
/**
|
|
220
|
-
*
|
|
221
|
-
*
|
|
222
|
-
* 1. changing the frozen row & col settings
|
|
223
|
-
* 2. changing curr skeleton
|
|
224
|
-
* 3. changing selection which cross viewport
|
|
225
|
-
* 4. changing the viewport size (also include change window size)
|
|
226
|
-
* 5. changing the scroll bar position
|
|
227
|
-
*
|
|
228
|
-
* when scrolling by trackpad:
|
|
229
|
-
* scene.input-manager@_onMouseWheel --> scene@triggerMouseWheel --> sheet-render.controller@scene.onMouseWheel$.add -->
|
|
230
|
-
* set-scroll.command.ts --> scroll.operation.ts -->
|
|
231
|
-
* scrollManagerService.setScrollInfoAndEmitEvent
|
|
232
|
-
*
|
|
233
|
-
* when change skelenton:
|
|
234
|
-
* _currentSkeletonBefore$ ---> scroll.render-controller@_updateSceneSize --> setSearchParam --> scene@_setTransForm ---> viewport.resetCanvasSizeAndUpdateScrollBar ---> scrollToXX
|
|
235
|
-
* --> onScrollAfterObserver.notifyObservers --> scroll.render-controller@onScrollAfterObserver ---> setScrollInfoToCurrSheetWithoutNotify ---> sms._setScrollInfo
|
|
236
|
-
*
|
|
237
|
-
* _currentSkeleton$ ---> selection.render-controller ---> formula@_autoScroll ---> viewport.resize ---> get scrollXY by viewportScrollXY ---> scrollTo
|
|
238
|
-
* _currentSkeleton$ ---> selection.render-controller ---> setCurrentSelection ---> formula@_autoScroll ---> scrollTo
|
|
239
|
-
* _currentSkeleton$ ---> freeze.render-controller@_refreshFreeze --> viewport.resize ---> scrollTo ---> _scroll
|
|
240
|
-
*
|
|
241
|
-
* Debug
|
|
242
|
-
* window.scene.getViewports()[0].scrollTo({x: 14.2, y: 1.8}, true)
|
|
243
|
-
*
|
|
244
|
-
* @param pos
|
|
245
|
-
*
|
|
215
|
+
* ScrollBar scroll to certain position.
|
|
216
|
+
* @param pos position of scrollBar
|
|
246
217
|
*/
|
|
247
218
|
scrollToBarPos(pos: Partial<IScrollBarPosition>): {
|
|
248
219
|
scrollX: number;
|
|
@@ -263,6 +234,12 @@ export declare class Viewport {
|
|
|
263
234
|
isLimitedY: boolean;
|
|
264
235
|
} | undefined;
|
|
265
236
|
scrollByBar(delta: Partial<IScrollBarPosition>, isTrigger?: boolean): void;
|
|
237
|
+
/**
|
|
238
|
+
* Viewport scroll to certain position.
|
|
239
|
+
* @param pos
|
|
240
|
+
* @param isTrigger
|
|
241
|
+
* @returns IViewportScrollPosition
|
|
242
|
+
*/
|
|
266
243
|
scrollToViewportPos(pos: Partial<IViewportScrollPosition>, isTrigger?: boolean): {
|
|
267
244
|
viewportScrollX: number;
|
|
268
245
|
viewportScrollY: number;
|
|
@@ -304,12 +281,16 @@ export declare class Viewport {
|
|
|
304
281
|
y: number;
|
|
305
282
|
};
|
|
306
283
|
getScrollBar(): Nullable<BaseScrollBar>;
|
|
284
|
+
/**
|
|
285
|
+
* Just record state of scroll. This method won't scroll viewport and scrollbar.
|
|
286
|
+
* @param current
|
|
287
|
+
* @returns Viewport
|
|
288
|
+
*/
|
|
307
289
|
updateScrollVal(current: Partial<IScrollObserverParam>): this;
|
|
308
290
|
getScrollBarTransForm(): Transform;
|
|
309
291
|
shouldIntoRender(): boolean;
|
|
310
292
|
/**
|
|
311
|
-
*
|
|
312
|
-
* that means each layer call all viewports to render
|
|
293
|
+
* Render function in each render loop.
|
|
313
294
|
* @param parentCtx parentCtx is cacheCtx from layer when layer._allowCache is true
|
|
314
295
|
* @param objects
|
|
315
296
|
* @param isMaxLayer
|
|
@@ -366,7 +347,7 @@ export declare class Viewport {
|
|
|
366
347
|
*/
|
|
367
348
|
private _resizeCacheCanvas;
|
|
368
349
|
/**
|
|
369
|
-
*
|
|
350
|
+
* Update scroll when viewport is resizing and removing rol & col
|
|
370
351
|
*/
|
|
371
352
|
private _updateScrollByViewportScrollValue;
|
|
372
353
|
private _getViewPortSize;
|