@univerjs/engine-render 0.1.0-alpha.1 → 0.1.0-alpha.3
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/LICENSE.txt +178 -0
- package/README.md +1 -1
- package/lib/cjs/index.js +73 -23962
- package/lib/es/index.js +15060 -0
- package/lib/types/base-object.d.ts +21 -6
- package/lib/types/basics/cell-data.d.ts +15 -1
- package/lib/types/basics/const.d.ts +16 -154
- package/lib/types/basics/document-node-tools.d.ts +15 -1
- package/lib/types/basics/draw.d.ts +15 -1
- package/lib/types/basics/font-cache.d.ts +15 -1
- package/lib/types/basics/i-document-skeleton-cached.d.ts +17 -3
- package/lib/types/basics/i-events.d.ts +17 -6
- package/lib/types/basics/index.d.ts +15 -1
- package/lib/types/basics/interfaces.d.ts +15 -1
- package/lib/types/basics/path2.d.ts +15 -1
- package/lib/types/basics/performance-monitor.d.ts +15 -1
- package/lib/types/basics/position.d.ts +15 -1
- package/lib/types/basics/quick-event.d.ts +15 -1
- package/lib/types/basics/range.d.ts +20 -1
- package/lib/types/basics/scroll-xy.d.ts +15 -1
- package/lib/types/basics/tools.d.ts +22 -8
- package/lib/types/basics/transform.d.ts +15 -1
- package/lib/types/basics/unit-convert.d.ts +15 -1
- package/lib/types/basics/vector2.d.ts +23 -1
- package/lib/types/canvas.d.ts +15 -1
- package/lib/types/components/component.d.ts +22 -8
- package/lib/types/components/docs/block/block-error.d.ts +15 -1
- package/lib/types/components/docs/block/index.d.ts +15 -1
- package/lib/types/components/docs/block/paragraph/bullet-ruler.d.ts +15 -1
- package/lib/types/components/docs/block/paragraph/bullet.d.ts +16 -2
- package/lib/types/components/docs/block/paragraph/index.d.ts +15 -1
- package/lib/types/components/docs/block/paragraph/inline-drawing.d.ts +15 -1
- package/lib/types/components/docs/block/paragraph/language-ruler.d.ts +32 -9
- package/lib/types/components/docs/block/paragraph/layout-ruler.d.ts +15 -1
- package/lib/types/components/docs/block/paragraph/paragraph.d.ts +15 -1
- package/lib/types/components/docs/block/section.d.ts +15 -1
- package/lib/types/components/docs/common/column.d.ts +15 -1
- package/lib/types/components/docs/common/convert-cursor.d.ts +17 -3
- package/lib/types/components/docs/common/index.d.ts +15 -1
- package/lib/types/components/docs/common/line.d.ts +16 -2
- package/lib/types/components/docs/common/liquid.d.ts +15 -1
- package/lib/types/components/docs/common/page.d.ts +15 -1
- package/lib/types/components/docs/common/range.d.ts +17 -3
- package/lib/types/components/docs/common/section.d.ts +15 -1
- package/lib/types/components/docs/common/span.d.ts +17 -1
- package/lib/types/components/docs/common/tools.d.ts +15 -2
- package/lib/types/components/docs/doc-component.d.ts +21 -11
- package/lib/types/components/docs/doc-extension.d.ts +17 -2
- package/lib/types/components/docs/doc-skeleton.d.ts +18 -4
- package/lib/types/components/docs/document.d.ts +18 -7
- package/lib/types/components/docs/extensions/background.d.ts +15 -1
- package/lib/types/components/docs/extensions/border.d.ts +15 -1
- package/lib/types/components/docs/extensions/font-and-base-line.d.ts +16 -1
- package/lib/types/components/docs/extensions/index.d.ts +15 -1
- package/lib/types/components/docs/extensions/line.d.ts +16 -1
- package/lib/types/components/docs/horizon-bar.d.ts +15 -1
- package/lib/types/components/docs/index.d.ts +15 -1
- package/lib/types/components/docs/text-selection-render-manager.d.ts +41 -25
- package/lib/types/components/docs/vertical-bar.d.ts +15 -1
- package/lib/types/components/docs/view-model/data-stream-tree-node.d.ts +15 -1
- package/lib/types/components/docs/view-model/document-view-model.d.ts +15 -1
- package/lib/types/components/extension.d.ts +17 -3
- package/lib/types/components/index.d.ts +15 -1
- package/lib/types/components/sheets/column-header.d.ts +17 -3
- package/lib/types/components/sheets/extensions/background.d.ts +17 -3
- package/lib/types/components/sheets/extensions/border.d.ts +17 -3
- package/lib/types/components/sheets/extensions/column-header-layout.d.ts +15 -1
- package/lib/types/components/sheets/extensions/font.d.ts +17 -3
- package/lib/types/components/sheets/extensions/index.d.ts +15 -2
- package/lib/types/components/sheets/extensions/row-header-layout.d.ts +15 -1
- package/lib/types/components/sheets/extensions/sheet-extension.d.ts +19 -2
- package/lib/types/components/sheets/index.d.ts +15 -1
- package/lib/types/components/sheets/interfaces.d.ts +17 -2
- package/lib/types/components/sheets/row-header.d.ts +17 -3
- package/lib/types/components/sheets/sheet-component.d.ts +23 -9
- package/lib/types/components/sheets/sheet-skeleton.d.ts +43 -11
- package/lib/types/components/sheets/spreadsheet.d.ts +33 -17
- package/lib/types/components/skeleton.d.ts +15 -1
- package/lib/types/components/slides/index.d.ts +15 -1
- package/lib/types/components/slides/slide.d.ts +15 -1
- package/lib/types/custom/custom-object.d.ts +17 -3
- package/lib/types/custom/index.d.ts +15 -1
- package/lib/types/engine.d.ts +18 -4
- package/lib/types/group.d.ts +17 -3
- package/lib/types/index.d.ts +16 -2
- package/lib/types/layer.d.ts +29 -3
- package/lib/types/render-engine.d.ts +16 -2
- package/lib/types/render-manager.service.d.ts +15 -1
- package/lib/types/scene-viewer.d.ts +17 -3
- package/lib/types/scene.-transformer.d.ts +15 -1
- package/lib/types/scene.d.ts +18 -5
- package/lib/types/scene.input-manager.d.ts +19 -2
- package/lib/types/scroll-timer.d.ts +15 -1
- package/lib/types/services/object-transform-manager.service.d.ts +15 -1
- package/lib/types/shape/base-scroll-bar.d.ts +15 -1
- package/lib/types/shape/circle.d.ts +15 -1
- package/lib/types/shape/control.d.ts +15 -1
- package/lib/types/shape/drawing.d.ts +15 -1
- package/lib/types/shape/index.d.ts +15 -1
- package/lib/types/shape/path.d.ts +15 -1
- package/lib/types/shape/picture.d.ts +15 -1
- package/lib/types/shape/rect.d.ts +15 -1
- package/lib/types/shape/regular-polygon.d.ts +15 -1
- package/lib/types/shape/rich-text.d.ts +17 -6
- package/lib/types/shape/scroll-bar.d.ts +15 -1
- package/lib/types/shape/selection.d.ts +15 -1
- package/lib/types/shape/shape.d.ts +17 -11
- package/lib/types/thin-engine.d.ts +15 -1
- package/lib/types/thin-scene.d.ts +18 -3
- package/lib/types/viewport.d.ts +26 -11
- package/lib/umd/index.js +73 -0
- package/package.json +22 -14
- package/LICENSE +0 -21
- package/lib/esm/index.js +0 -23259
- package/lib/types/base-object.d.ts.map +0 -1
- package/lib/types/basics/cell-data.d.ts.map +0 -1
- package/lib/types/basics/const.d.ts.map +0 -1
- package/lib/types/basics/document-node-tools.d.ts.map +0 -1
- package/lib/types/basics/draw.d.ts.map +0 -1
- package/lib/types/basics/font-cache.d.ts.map +0 -1
- package/lib/types/basics/i-document-skeleton-cached.d.ts.map +0 -1
- package/lib/types/basics/i-events.d.ts.map +0 -1
- package/lib/types/basics/index.d.ts.map +0 -1
- package/lib/types/basics/interfaces.d.ts.map +0 -1
- package/lib/types/basics/path2.d.ts.map +0 -1
- package/lib/types/basics/performance-monitor.d.ts.map +0 -1
- package/lib/types/basics/position.d.ts.map +0 -1
- package/lib/types/basics/quick-event.d.ts.map +0 -1
- package/lib/types/basics/range.d.ts.map +0 -1
- package/lib/types/basics/scroll-xy.d.ts.map +0 -1
- package/lib/types/basics/tools.d.ts.map +0 -1
- package/lib/types/basics/transform.d.ts.map +0 -1
- package/lib/types/basics/unit-convert.d.ts.map +0 -1
- package/lib/types/basics/vector2.d.ts.map +0 -1
- package/lib/types/canvas.d.ts.map +0 -1
- package/lib/types/components/component.d.ts.map +0 -1
- package/lib/types/components/docs/block/block-error.d.ts.map +0 -1
- package/lib/types/components/docs/block/index.d.ts.map +0 -1
- package/lib/types/components/docs/block/paragraph/bullet-ruler.d.ts.map +0 -1
- package/lib/types/components/docs/block/paragraph/bullet.d.ts.map +0 -1
- package/lib/types/components/docs/block/paragraph/index.d.ts.map +0 -1
- package/lib/types/components/docs/block/paragraph/inline-drawing.d.ts.map +0 -1
- package/lib/types/components/docs/block/paragraph/language-ruler.d.ts.map +0 -1
- package/lib/types/components/docs/block/paragraph/layout-ruler.d.ts.map +0 -1
- package/lib/types/components/docs/block/paragraph/paragraph.d.ts.map +0 -1
- package/lib/types/components/docs/block/section.d.ts.map +0 -1
- package/lib/types/components/docs/block/table/table-cell.d.ts +0 -1
- package/lib/types/components/docs/block/table/table-cell.d.ts.map +0 -1
- package/lib/types/components/docs/block/table/table-row.d.ts +0 -1
- package/lib/types/components/docs/block/table/table-row.d.ts.map +0 -1
- package/lib/types/components/docs/block/table/table.d.ts +0 -1
- package/lib/types/components/docs/block/table/table.d.ts.map +0 -1
- package/lib/types/components/docs/common/column.d.ts.map +0 -1
- package/lib/types/components/docs/common/convert-cursor.d.ts.map +0 -1
- package/lib/types/components/docs/common/index.d.ts.map +0 -1
- package/lib/types/components/docs/common/line.d.ts.map +0 -1
- package/lib/types/components/docs/common/liquid.d.ts.map +0 -1
- package/lib/types/components/docs/common/page.d.ts.map +0 -1
- package/lib/types/components/docs/common/range.d.ts.map +0 -1
- package/lib/types/components/docs/common/section.d.ts.map +0 -1
- package/lib/types/components/docs/common/span.d.ts.map +0 -1
- package/lib/types/components/docs/common/tools.d.ts.map +0 -1
- package/lib/types/components/docs/doc-component.d.ts.map +0 -1
- package/lib/types/components/docs/doc-extension.d.ts.map +0 -1
- package/lib/types/components/docs/doc-skeleton.d.ts.map +0 -1
- package/lib/types/components/docs/document.d.ts.map +0 -1
- package/lib/types/components/docs/extensions/background.d.ts.map +0 -1
- package/lib/types/components/docs/extensions/border.d.ts.map +0 -1
- package/lib/types/components/docs/extensions/font-and-base-line.d.ts.map +0 -1
- package/lib/types/components/docs/extensions/index.d.ts.map +0 -1
- package/lib/types/components/docs/extensions/line.d.ts.map +0 -1
- package/lib/types/components/docs/horizon-bar.d.ts.map +0 -1
- package/lib/types/components/docs/index.d.ts.map +0 -1
- package/lib/types/components/docs/text-selection-render-manager.d.ts.map +0 -1
- package/lib/types/components/docs/vertical-bar.d.ts.map +0 -1
- package/lib/types/components/docs/view-model/data-stream-tree-node.d.ts.map +0 -1
- package/lib/types/components/docs/view-model/document-view-model.d.ts.map +0 -1
- package/lib/types/components/extension.d.ts.map +0 -1
- package/lib/types/components/index.d.ts.map +0 -1
- package/lib/types/components/sheets/column-header.d.ts.map +0 -1
- package/lib/types/components/sheets/extensions/background.d.ts.map +0 -1
- package/lib/types/components/sheets/extensions/border-auxiliary.d.ts +0 -13
- package/lib/types/components/sheets/extensions/border-auxiliary.d.ts.map +0 -1
- package/lib/types/components/sheets/extensions/border.d.ts.map +0 -1
- package/lib/types/components/sheets/extensions/column-header-layout.d.ts.map +0 -1
- package/lib/types/components/sheets/extensions/font.d.ts.map +0 -1
- package/lib/types/components/sheets/extensions/index.d.ts.map +0 -1
- package/lib/types/components/sheets/extensions/row-header-layout.d.ts.map +0 -1
- package/lib/types/components/sheets/extensions/sheet-extension.d.ts.map +0 -1
- package/lib/types/components/sheets/index.d.ts.map +0 -1
- package/lib/types/components/sheets/interfaces.d.ts.map +0 -1
- package/lib/types/components/sheets/row-header.d.ts.map +0 -1
- package/lib/types/components/sheets/sheet-component.d.ts.map +0 -1
- package/lib/types/components/sheets/sheet-skeleton.d.ts.map +0 -1
- package/lib/types/components/sheets/spreadsheet.d.ts.map +0 -1
- package/lib/types/components/skeleton.d.ts.map +0 -1
- package/lib/types/components/slides/index.d.ts.map +0 -1
- package/lib/types/components/slides/slide.d.ts.map +0 -1
- package/lib/types/custom/custom-object.d.ts.map +0 -1
- package/lib/types/custom/index.d.ts.map +0 -1
- package/lib/types/engine.d.ts.map +0 -1
- package/lib/types/group.d.ts.map +0 -1
- package/lib/types/index.d.ts.map +0 -1
- package/lib/types/layer.d.ts.map +0 -1
- package/lib/types/render-engine.d.ts.map +0 -1
- package/lib/types/render-manager.service.d.ts.map +0 -1
- package/lib/types/scene-viewer.d.ts.map +0 -1
- package/lib/types/scene.-transformer.d.ts.map +0 -1
- package/lib/types/scene.d.ts.map +0 -1
- package/lib/types/scene.input-manager.d.ts.map +0 -1
- package/lib/types/scroll-timer.d.ts.map +0 -1
- package/lib/types/services/object-transform-manager.service.d.ts.map +0 -1
- package/lib/types/shape/base-scroll-bar.d.ts.map +0 -1
- package/lib/types/shape/circle.d.ts.map +0 -1
- package/lib/types/shape/control.d.ts.map +0 -1
- package/lib/types/shape/drawing.d.ts.map +0 -1
- package/lib/types/shape/index.d.ts.map +0 -1
- package/lib/types/shape/path.d.ts.map +0 -1
- package/lib/types/shape/picture.d.ts.map +0 -1
- package/lib/types/shape/rect.d.ts.map +0 -1
- package/lib/types/shape/regular-polygon.d.ts.map +0 -1
- package/lib/types/shape/rich-text.d.ts.map +0 -1
- package/lib/types/shape/scroll-bar.d.ts.map +0 -1
- package/lib/types/shape/selection.d.ts.map +0 -1
- package/lib/types/shape/shape.d.ts.map +0 -1
- package/lib/types/thin-engine.d.ts.map +0 -1
- package/lib/types/thin-scene.d.ts.map +0 -1
- package/lib/types/viewport.d.ts.map +0 -1
|
@@ -1,3 +1,18 @@
|
|
|
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
|
+
*/
|
|
1
16
|
import type { IShapeProps } from './shape';
|
|
2
17
|
import { Shape } from './shape';
|
|
3
18
|
interface IPathDataArray {
|
|
@@ -89,4 +104,3 @@ export declare class Path extends Shape<IPathProps> {
|
|
|
89
104
|
private _getSelfRect;
|
|
90
105
|
}
|
|
91
106
|
export {};
|
|
92
|
-
//# sourceMappingURL=path.d.ts.map
|
|
@@ -1,3 +1,18 @@
|
|
|
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
|
+
*/
|
|
1
16
|
import type { Nullable } from '@univerjs/core';
|
|
2
17
|
import type { IShapeProps } from './shape';
|
|
3
18
|
import { Shape } from './shape';
|
|
@@ -21,4 +36,3 @@ export declare class Picture extends Shape<IPictureProps> {
|
|
|
21
36
|
protected _draw(ctx: CanvasRenderingContext2D): void;
|
|
22
37
|
protected _init(): void;
|
|
23
38
|
}
|
|
24
|
-
//# sourceMappingURL=picture.d.ts.map
|
|
@@ -1,3 +1,18 @@
|
|
|
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
|
+
*/
|
|
1
16
|
import type { IShapeProps } from './shape';
|
|
2
17
|
import { Shape } from './shape';
|
|
3
18
|
export interface IRectProps extends IShapeProps {
|
|
@@ -14,4 +29,3 @@ export declare class Rect<T extends IRectProps = IRectProps> extends Shape<T> {
|
|
|
14
29
|
};
|
|
15
30
|
protected _draw(ctx: CanvasRenderingContext2D): void;
|
|
16
31
|
}
|
|
17
|
-
//# sourceMappingURL=rect.d.ts.map
|
|
@@ -1,3 +1,18 @@
|
|
|
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
|
+
*/
|
|
1
16
|
import type { IObjectFullState } from '../basics/interfaces';
|
|
2
17
|
import type { IPoint } from '../basics/vector2';
|
|
3
18
|
import type { IShapeProps } from './shape';
|
|
@@ -39,4 +54,3 @@ export declare class RegularPolygon extends Shape<IRegularPolygonProps> {
|
|
|
39
54
|
private _setFixBoundingBox;
|
|
40
55
|
private _getSelfRect;
|
|
41
56
|
}
|
|
42
|
-
//# sourceMappingURL=regular-polygon.d.ts.map
|
|
@@ -1,6 +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
|
+
*/
|
|
1
16
|
import type { IDocumentData, IStyleBase, ITransformState, LocaleService } from '@univerjs/core';
|
|
2
17
|
import { BaseObject } from '../base-object';
|
|
3
|
-
import type {
|
|
18
|
+
import type { IViewportBound } from '../basics/vector2';
|
|
4
19
|
export interface IRichTextProps extends ITransformState, IStyleBase {
|
|
5
20
|
text?: string;
|
|
6
21
|
richText?: IDocumentData;
|
|
@@ -12,8 +27,6 @@ export declare const RICHTEXT_OBJECT_ARRAY: string[];
|
|
|
12
27
|
export declare class RichText extends BaseObject {
|
|
13
28
|
private _localeService;
|
|
14
29
|
private _documentData;
|
|
15
|
-
private _allowCache;
|
|
16
|
-
private _cacheCanvas;
|
|
17
30
|
private _documentSkeleton;
|
|
18
31
|
private _documents;
|
|
19
32
|
private _ff?;
|
|
@@ -33,13 +46,11 @@ export declare class RichText extends BaseObject {
|
|
|
33
46
|
height: number;
|
|
34
47
|
} | undefined;
|
|
35
48
|
setProps(props?: IRichTextProps): this | undefined;
|
|
36
|
-
render(mainCtx: CanvasRenderingContext2D, bounds?:
|
|
49
|
+
render(mainCtx: CanvasRenderingContext2D, bounds?: IViewportBound): this;
|
|
37
50
|
toJson(): {
|
|
38
51
|
[x: string]: any;
|
|
39
52
|
};
|
|
40
53
|
protected _draw(ctx: CanvasRenderingContext2D): void;
|
|
41
54
|
private _convertToDocumentData;
|
|
42
55
|
private _initialProps;
|
|
43
|
-
private _applyCache;
|
|
44
56
|
}
|
|
45
|
-
//# sourceMappingURL=rich-text.d.ts.map
|
|
@@ -1,3 +1,18 @@
|
|
|
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
|
+
*/
|
|
1
16
|
import type { Vector2 } from '../basics/vector2';
|
|
2
17
|
import type { Viewport } from '../viewport';
|
|
3
18
|
import type { IScrollBarProps } from './base-scroll-bar';
|
|
@@ -42,4 +57,3 @@ export declare class ScrollBar extends BaseScrollBar {
|
|
|
42
57
|
private _hoverFunc;
|
|
43
58
|
private _initialHorizontalEvent;
|
|
44
59
|
}
|
|
45
|
-
//# sourceMappingURL=scroll-bar.d.ts.map
|
|
@@ -1,3 +1,17 @@
|
|
|
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
|
+
*/
|
|
1
16
|
export declare class Selection {
|
|
2
17
|
}
|
|
3
|
-
//# sourceMappingURL=selection.d.ts.map
|
|
@@ -1,8 +1,22 @@
|
|
|
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
|
+
*/
|
|
1
16
|
import type { IScale, Nullable } from '@univerjs/core';
|
|
2
17
|
import { BaseObject } from '../base-object';
|
|
3
18
|
import type { IObjectFullState } from '../basics/interfaces';
|
|
4
|
-
import type {
|
|
5
|
-
import { Canvas } from '../canvas';
|
|
19
|
+
import type { IViewportBound, Vector2 } from '../basics/vector2';
|
|
6
20
|
export type LineJoin = 'round' | 'bevel' | 'miter';
|
|
7
21
|
export type LineCap = 'butt' | 'round' | 'square';
|
|
8
22
|
export type PaintFirst = 'fill' | 'stroke';
|
|
@@ -13,7 +27,6 @@ export interface IShapeProps extends IObjectFullState {
|
|
|
13
27
|
globalCompositeOperation?: string;
|
|
14
28
|
evented?: boolean;
|
|
15
29
|
visible?: boolean;
|
|
16
|
-
allowCache?: boolean;
|
|
17
30
|
paintFirst?: PaintFirst;
|
|
18
31
|
stroke?: Nullable<string | CanvasGradient>;
|
|
19
32
|
strokeScaleEnabled?: boolean;
|
|
@@ -38,12 +51,10 @@ export interface IShapeProps extends IObjectFullState {
|
|
|
38
51
|
}
|
|
39
52
|
export declare const SHAPE_OBJECT_ARRAY: string[];
|
|
40
53
|
export declare abstract class Shape<T> extends BaseObject {
|
|
41
|
-
protected _cacheCanvas: Nullable<Canvas>;
|
|
42
54
|
private _hoverCursor;
|
|
43
55
|
private _moveCursor;
|
|
44
56
|
private _fillRule;
|
|
45
57
|
private _globalCompositeOperation;
|
|
46
|
-
private _allowCache;
|
|
47
58
|
private _paintFirst;
|
|
48
59
|
private _stroke;
|
|
49
60
|
private _strokeScaleEnabled;
|
|
@@ -69,7 +80,6 @@ export declare abstract class Shape<T> extends BaseObject {
|
|
|
69
80
|
get moveCursor(): string | null;
|
|
70
81
|
get fillRule(): string;
|
|
71
82
|
get globalCompositeOperation(): string;
|
|
72
|
-
get allowCache(): boolean;
|
|
73
83
|
get paintFirst(): PaintFirst;
|
|
74
84
|
get stroke(): Nullable<string | CanvasGradient>;
|
|
75
85
|
get strokeScaleEnabled(): boolean;
|
|
@@ -106,15 +116,11 @@ export declare abstract class Shape<T> extends BaseObject {
|
|
|
106
116
|
private static __setFillStyles;
|
|
107
117
|
private static __setStrokeStyles;
|
|
108
118
|
private static __setLineDash;
|
|
109
|
-
render(mainCtx: CanvasRenderingContext2D, bounds?:
|
|
119
|
+
render(mainCtx: CanvasRenderingContext2D, bounds?: IViewportBound): this;
|
|
110
120
|
setProps(props?: T): this | undefined;
|
|
111
|
-
resizeCacheCanvas(): void;
|
|
112
|
-
scaleCacheCanvas(): void;
|
|
113
121
|
toJson(): {
|
|
114
122
|
[x: string]: any;
|
|
115
123
|
};
|
|
116
|
-
protected _applyCache(ctx?: CanvasRenderingContext2D): void;
|
|
117
124
|
protected _draw(ctx: CanvasRenderingContext2D): void;
|
|
118
125
|
private _initialProps;
|
|
119
126
|
}
|
|
120
|
-
//# sourceMappingURL=shape.d.ts.map
|
|
@@ -1,3 +1,18 @@
|
|
|
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
|
+
*/
|
|
1
16
|
import { Disposable, Observable } from '@univerjs/core';
|
|
2
17
|
import type { IDisposable } from '@wendellhu/redi';
|
|
3
18
|
import type { CURSOR_TYPE } from './basics/const';
|
|
@@ -30,4 +45,3 @@ export declare abstract class ThinEngine<T extends IDisposable> extends Disposab
|
|
|
30
45
|
abstract setCanvasCursor(val: CURSOR_TYPE): void;
|
|
31
46
|
abstract getPixelRatio(): number;
|
|
32
47
|
}
|
|
33
|
-
//# sourceMappingURL=thin-engine.d.ts.map
|
|
@@ -1,3 +1,18 @@
|
|
|
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
|
+
*/
|
|
1
16
|
import type { EventState, Nullable, Observer } from '@univerjs/core';
|
|
2
17
|
import { Observable } from '@univerjs/core';
|
|
3
18
|
import type { BaseObject } from './base-object';
|
|
@@ -6,7 +21,7 @@ import { RENDER_CLASS_TYPE } from './basics/const';
|
|
|
6
21
|
import type { IKeyboardEvent, IMouseEvent, IPointerEvent, IWheelEvent } from './basics/i-events';
|
|
7
22
|
import type { ITransformChangeState } from './basics/interfaces';
|
|
8
23
|
import { Transform } from './basics/transform';
|
|
9
|
-
import type {
|
|
24
|
+
import type { IViewportBound, Vector2 } from './basics/vector2';
|
|
10
25
|
export declare abstract class ThinScene {
|
|
11
26
|
onTransformChangeObservable: Observable<ITransformChangeState>;
|
|
12
27
|
onPointerDownObserver: Observable<IMouseEvent | IPointerEvent>;
|
|
@@ -58,7 +73,7 @@ export declare abstract class ThinScene {
|
|
|
58
73
|
triggerPointerLeave(evt: IPointerEvent | IMouseEvent): void;
|
|
59
74
|
triggerPointerOver(evt: IPointerEvent | IMouseEvent): void;
|
|
60
75
|
triggerPointerEnter(evt: IPointerEvent | IMouseEvent): void;
|
|
61
|
-
renderObjects(ctx: CanvasRenderingContext2D, bounds?:
|
|
76
|
+
renderObjects(ctx: CanvasRenderingContext2D, bounds?: IViewportBound): void;
|
|
62
77
|
render(parentCtx?: CanvasRenderingContext2D): void;
|
|
63
78
|
getParent(): any;
|
|
64
79
|
dispose(): void;
|
|
@@ -69,8 +84,8 @@ export declare abstract class ThinScene {
|
|
|
69
84
|
setObjectBehavior(o: BaseObject): void;
|
|
70
85
|
applyTransformer(o: BaseObject): void;
|
|
71
86
|
makeDirtyNoParent(state?: boolean): this;
|
|
87
|
+
makeDirty(state?: boolean): this;
|
|
72
88
|
pick(coord: Vector2): Nullable<BaseObject | ThinScene>;
|
|
73
89
|
getViewports(): any[];
|
|
74
90
|
removeViewport(key: string): void;
|
|
75
91
|
}
|
|
76
|
-
//# sourceMappingURL=thin-scene.d.ts.map
|
package/lib/types/viewport.d.ts
CHANGED
|
@@ -1,8 +1,24 @@
|
|
|
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
|
+
*/
|
|
1
16
|
import type { EventState, IPosition, Nullable } from '@univerjs/core';
|
|
2
17
|
import { Observable } from '@univerjs/core';
|
|
18
|
+
import type { BaseObject } from './base-object';
|
|
3
19
|
import type { IWheelEvent } from './basics/i-events';
|
|
4
20
|
import { Transform } from './basics/transform';
|
|
5
|
-
import type {
|
|
21
|
+
import type { IViewportBound } from './basics/vector2';
|
|
6
22
|
import { Vector2 } from './basics/vector2';
|
|
7
23
|
import type { BaseScrollBar } from './shape/base-scroll-bar';
|
|
8
24
|
import type { ThinScene } from './thin-scene';
|
|
@@ -55,6 +71,7 @@ export declare class Viewport {
|
|
|
55
71
|
onScrollAfterObserver: Observable<IScrollObserverParam>;
|
|
56
72
|
onScrollBeforeObserver: Observable<IScrollObserverParam>;
|
|
57
73
|
onScrollStopObserver: Observable<IScrollObserverParam>;
|
|
74
|
+
onScrollByBarObserver: Observable<IScrollObserverParam>;
|
|
58
75
|
private _viewPortKey;
|
|
59
76
|
private _dirty;
|
|
60
77
|
private _topOrigin;
|
|
@@ -70,11 +87,9 @@ export declare class Viewport {
|
|
|
70
87
|
private _width;
|
|
71
88
|
private _height;
|
|
72
89
|
private _scene;
|
|
73
|
-
private _cacheCanvas;
|
|
74
90
|
private _scrollBar?;
|
|
75
91
|
private _isWheelPreventDefaultX;
|
|
76
92
|
private _isWheelPreventDefaultY;
|
|
77
|
-
private _allowCache;
|
|
78
93
|
private _scrollStopNum;
|
|
79
94
|
private _preScrollX;
|
|
80
95
|
private _preScrollY;
|
|
@@ -86,6 +101,7 @@ export declare class Viewport {
|
|
|
86
101
|
private _paddingEndY;
|
|
87
102
|
private _isRelativeX;
|
|
88
103
|
private _isRelativeY;
|
|
104
|
+
private _preViewportBound;
|
|
89
105
|
constructor(viewPortKey: string, scene: ThinScene, props?: IViewProps);
|
|
90
106
|
get scene(): ThinScene;
|
|
91
107
|
get width(): Nullable<number>;
|
|
@@ -136,6 +152,7 @@ export declare class Viewport {
|
|
|
136
152
|
isLimitedX: boolean;
|
|
137
153
|
isLimitedY: boolean;
|
|
138
154
|
} | undefined;
|
|
155
|
+
scrollByBar(pos: IScrollBarPosition, isTrigger?: boolean): void;
|
|
139
156
|
/**
|
|
140
157
|
* current position plus offset relatively
|
|
141
158
|
* the caller no need to deal with the padding when frozen
|
|
@@ -162,14 +179,14 @@ export declare class Viewport {
|
|
|
162
179
|
};
|
|
163
180
|
getScrollBar(): Nullable<BaseScrollBar>;
|
|
164
181
|
updateScroll(param: IScrollObserverParam): this;
|
|
165
|
-
getScrollBarTransForm(
|
|
166
|
-
render(parentCtx?: CanvasRenderingContext2D): void;
|
|
167
|
-
getBounding():
|
|
182
|
+
getScrollBarTransForm(): Transform;
|
|
183
|
+
render(parentCtx?: CanvasRenderingContext2D, objects?: BaseObject[], isMaxLayer?: boolean): void;
|
|
184
|
+
getBounding(): IViewportBound;
|
|
168
185
|
getRelativeVector(coord: Vector2): Vector2;
|
|
169
186
|
getAbsoluteVector(coord: Vector2): Vector2;
|
|
170
187
|
onMouseWheel(evt: IWheelEvent, state: EventState): void;
|
|
171
188
|
isHit(coord: Vector2): boolean | undefined;
|
|
172
|
-
pickScrollBar(coord: Vector2): import("
|
|
189
|
+
pickScrollBar(coord: Vector2): import("./shape").Rect<import("./shape").IRectProps> | null | undefined;
|
|
173
190
|
openClip(): void;
|
|
174
191
|
closeClip(): void;
|
|
175
192
|
dispose(): void;
|
|
@@ -179,15 +196,13 @@ export declare class Viewport {
|
|
|
179
196
|
} | undefined;
|
|
180
197
|
private _resizeCacheCanvasAndScrollBar;
|
|
181
198
|
private _getViewPortSize;
|
|
182
|
-
private _getApplyCanvasState;
|
|
183
199
|
private _scrollRendered;
|
|
184
200
|
private _triggerScrollStop;
|
|
185
201
|
private _scroll;
|
|
186
202
|
private _calViewportRelativeBounding;
|
|
187
|
-
private
|
|
188
|
-
private
|
|
203
|
+
private _diffViewBound;
|
|
204
|
+
private _drawScrollbar;
|
|
189
205
|
private _setWithAndHeight;
|
|
190
206
|
private _getBoundScale;
|
|
191
207
|
}
|
|
192
208
|
export {};
|
|
193
|
-
//# sourceMappingURL=viewport.d.ts.map
|