@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.
Files changed (228) hide show
  1. package/LICENSE.txt +178 -0
  2. package/README.md +1 -1
  3. package/lib/cjs/index.js +73 -23962
  4. package/lib/es/index.js +15060 -0
  5. package/lib/types/base-object.d.ts +21 -6
  6. package/lib/types/basics/cell-data.d.ts +15 -1
  7. package/lib/types/basics/const.d.ts +16 -154
  8. package/lib/types/basics/document-node-tools.d.ts +15 -1
  9. package/lib/types/basics/draw.d.ts +15 -1
  10. package/lib/types/basics/font-cache.d.ts +15 -1
  11. package/lib/types/basics/i-document-skeleton-cached.d.ts +17 -3
  12. package/lib/types/basics/i-events.d.ts +17 -6
  13. package/lib/types/basics/index.d.ts +15 -1
  14. package/lib/types/basics/interfaces.d.ts +15 -1
  15. package/lib/types/basics/path2.d.ts +15 -1
  16. package/lib/types/basics/performance-monitor.d.ts +15 -1
  17. package/lib/types/basics/position.d.ts +15 -1
  18. package/lib/types/basics/quick-event.d.ts +15 -1
  19. package/lib/types/basics/range.d.ts +20 -1
  20. package/lib/types/basics/scroll-xy.d.ts +15 -1
  21. package/lib/types/basics/tools.d.ts +22 -8
  22. package/lib/types/basics/transform.d.ts +15 -1
  23. package/lib/types/basics/unit-convert.d.ts +15 -1
  24. package/lib/types/basics/vector2.d.ts +23 -1
  25. package/lib/types/canvas.d.ts +15 -1
  26. package/lib/types/components/component.d.ts +22 -8
  27. package/lib/types/components/docs/block/block-error.d.ts +15 -1
  28. package/lib/types/components/docs/block/index.d.ts +15 -1
  29. package/lib/types/components/docs/block/paragraph/bullet-ruler.d.ts +15 -1
  30. package/lib/types/components/docs/block/paragraph/bullet.d.ts +16 -2
  31. package/lib/types/components/docs/block/paragraph/index.d.ts +15 -1
  32. package/lib/types/components/docs/block/paragraph/inline-drawing.d.ts +15 -1
  33. package/lib/types/components/docs/block/paragraph/language-ruler.d.ts +32 -9
  34. package/lib/types/components/docs/block/paragraph/layout-ruler.d.ts +15 -1
  35. package/lib/types/components/docs/block/paragraph/paragraph.d.ts +15 -1
  36. package/lib/types/components/docs/block/section.d.ts +15 -1
  37. package/lib/types/components/docs/common/column.d.ts +15 -1
  38. package/lib/types/components/docs/common/convert-cursor.d.ts +17 -3
  39. package/lib/types/components/docs/common/index.d.ts +15 -1
  40. package/lib/types/components/docs/common/line.d.ts +16 -2
  41. package/lib/types/components/docs/common/liquid.d.ts +15 -1
  42. package/lib/types/components/docs/common/page.d.ts +15 -1
  43. package/lib/types/components/docs/common/range.d.ts +17 -3
  44. package/lib/types/components/docs/common/section.d.ts +15 -1
  45. package/lib/types/components/docs/common/span.d.ts +17 -1
  46. package/lib/types/components/docs/common/tools.d.ts +15 -2
  47. package/lib/types/components/docs/doc-component.d.ts +21 -11
  48. package/lib/types/components/docs/doc-extension.d.ts +17 -2
  49. package/lib/types/components/docs/doc-skeleton.d.ts +18 -4
  50. package/lib/types/components/docs/document.d.ts +18 -7
  51. package/lib/types/components/docs/extensions/background.d.ts +15 -1
  52. package/lib/types/components/docs/extensions/border.d.ts +15 -1
  53. package/lib/types/components/docs/extensions/font-and-base-line.d.ts +16 -1
  54. package/lib/types/components/docs/extensions/index.d.ts +15 -1
  55. package/lib/types/components/docs/extensions/line.d.ts +16 -1
  56. package/lib/types/components/docs/horizon-bar.d.ts +15 -1
  57. package/lib/types/components/docs/index.d.ts +15 -1
  58. package/lib/types/components/docs/text-selection-render-manager.d.ts +41 -25
  59. package/lib/types/components/docs/vertical-bar.d.ts +15 -1
  60. package/lib/types/components/docs/view-model/data-stream-tree-node.d.ts +15 -1
  61. package/lib/types/components/docs/view-model/document-view-model.d.ts +15 -1
  62. package/lib/types/components/extension.d.ts +17 -3
  63. package/lib/types/components/index.d.ts +15 -1
  64. package/lib/types/components/sheets/column-header.d.ts +17 -3
  65. package/lib/types/components/sheets/extensions/background.d.ts +17 -3
  66. package/lib/types/components/sheets/extensions/border.d.ts +17 -3
  67. package/lib/types/components/sheets/extensions/column-header-layout.d.ts +15 -1
  68. package/lib/types/components/sheets/extensions/font.d.ts +17 -3
  69. package/lib/types/components/sheets/extensions/index.d.ts +15 -2
  70. package/lib/types/components/sheets/extensions/row-header-layout.d.ts +15 -1
  71. package/lib/types/components/sheets/extensions/sheet-extension.d.ts +19 -2
  72. package/lib/types/components/sheets/index.d.ts +15 -1
  73. package/lib/types/components/sheets/interfaces.d.ts +17 -2
  74. package/lib/types/components/sheets/row-header.d.ts +17 -3
  75. package/lib/types/components/sheets/sheet-component.d.ts +23 -9
  76. package/lib/types/components/sheets/sheet-skeleton.d.ts +43 -11
  77. package/lib/types/components/sheets/spreadsheet.d.ts +33 -17
  78. package/lib/types/components/skeleton.d.ts +15 -1
  79. package/lib/types/components/slides/index.d.ts +15 -1
  80. package/lib/types/components/slides/slide.d.ts +15 -1
  81. package/lib/types/custom/custom-object.d.ts +17 -3
  82. package/lib/types/custom/index.d.ts +15 -1
  83. package/lib/types/engine.d.ts +18 -4
  84. package/lib/types/group.d.ts +17 -3
  85. package/lib/types/index.d.ts +16 -2
  86. package/lib/types/layer.d.ts +29 -3
  87. package/lib/types/render-engine.d.ts +16 -2
  88. package/lib/types/render-manager.service.d.ts +15 -1
  89. package/lib/types/scene-viewer.d.ts +17 -3
  90. package/lib/types/scene.-transformer.d.ts +15 -1
  91. package/lib/types/scene.d.ts +18 -5
  92. package/lib/types/scene.input-manager.d.ts +19 -2
  93. package/lib/types/scroll-timer.d.ts +15 -1
  94. package/lib/types/services/object-transform-manager.service.d.ts +15 -1
  95. package/lib/types/shape/base-scroll-bar.d.ts +15 -1
  96. package/lib/types/shape/circle.d.ts +15 -1
  97. package/lib/types/shape/control.d.ts +15 -1
  98. package/lib/types/shape/drawing.d.ts +15 -1
  99. package/lib/types/shape/index.d.ts +15 -1
  100. package/lib/types/shape/path.d.ts +15 -1
  101. package/lib/types/shape/picture.d.ts +15 -1
  102. package/lib/types/shape/rect.d.ts +15 -1
  103. package/lib/types/shape/regular-polygon.d.ts +15 -1
  104. package/lib/types/shape/rich-text.d.ts +17 -6
  105. package/lib/types/shape/scroll-bar.d.ts +15 -1
  106. package/lib/types/shape/selection.d.ts +15 -1
  107. package/lib/types/shape/shape.d.ts +17 -11
  108. package/lib/types/thin-engine.d.ts +15 -1
  109. package/lib/types/thin-scene.d.ts +18 -3
  110. package/lib/types/viewport.d.ts +26 -11
  111. package/lib/umd/index.js +73 -0
  112. package/package.json +22 -14
  113. package/LICENSE +0 -21
  114. package/lib/esm/index.js +0 -23259
  115. package/lib/types/base-object.d.ts.map +0 -1
  116. package/lib/types/basics/cell-data.d.ts.map +0 -1
  117. package/lib/types/basics/const.d.ts.map +0 -1
  118. package/lib/types/basics/document-node-tools.d.ts.map +0 -1
  119. package/lib/types/basics/draw.d.ts.map +0 -1
  120. package/lib/types/basics/font-cache.d.ts.map +0 -1
  121. package/lib/types/basics/i-document-skeleton-cached.d.ts.map +0 -1
  122. package/lib/types/basics/i-events.d.ts.map +0 -1
  123. package/lib/types/basics/index.d.ts.map +0 -1
  124. package/lib/types/basics/interfaces.d.ts.map +0 -1
  125. package/lib/types/basics/path2.d.ts.map +0 -1
  126. package/lib/types/basics/performance-monitor.d.ts.map +0 -1
  127. package/lib/types/basics/position.d.ts.map +0 -1
  128. package/lib/types/basics/quick-event.d.ts.map +0 -1
  129. package/lib/types/basics/range.d.ts.map +0 -1
  130. package/lib/types/basics/scroll-xy.d.ts.map +0 -1
  131. package/lib/types/basics/tools.d.ts.map +0 -1
  132. package/lib/types/basics/transform.d.ts.map +0 -1
  133. package/lib/types/basics/unit-convert.d.ts.map +0 -1
  134. package/lib/types/basics/vector2.d.ts.map +0 -1
  135. package/lib/types/canvas.d.ts.map +0 -1
  136. package/lib/types/components/component.d.ts.map +0 -1
  137. package/lib/types/components/docs/block/block-error.d.ts.map +0 -1
  138. package/lib/types/components/docs/block/index.d.ts.map +0 -1
  139. package/lib/types/components/docs/block/paragraph/bullet-ruler.d.ts.map +0 -1
  140. package/lib/types/components/docs/block/paragraph/bullet.d.ts.map +0 -1
  141. package/lib/types/components/docs/block/paragraph/index.d.ts.map +0 -1
  142. package/lib/types/components/docs/block/paragraph/inline-drawing.d.ts.map +0 -1
  143. package/lib/types/components/docs/block/paragraph/language-ruler.d.ts.map +0 -1
  144. package/lib/types/components/docs/block/paragraph/layout-ruler.d.ts.map +0 -1
  145. package/lib/types/components/docs/block/paragraph/paragraph.d.ts.map +0 -1
  146. package/lib/types/components/docs/block/section.d.ts.map +0 -1
  147. package/lib/types/components/docs/block/table/table-cell.d.ts +0 -1
  148. package/lib/types/components/docs/block/table/table-cell.d.ts.map +0 -1
  149. package/lib/types/components/docs/block/table/table-row.d.ts +0 -1
  150. package/lib/types/components/docs/block/table/table-row.d.ts.map +0 -1
  151. package/lib/types/components/docs/block/table/table.d.ts +0 -1
  152. package/lib/types/components/docs/block/table/table.d.ts.map +0 -1
  153. package/lib/types/components/docs/common/column.d.ts.map +0 -1
  154. package/lib/types/components/docs/common/convert-cursor.d.ts.map +0 -1
  155. package/lib/types/components/docs/common/index.d.ts.map +0 -1
  156. package/lib/types/components/docs/common/line.d.ts.map +0 -1
  157. package/lib/types/components/docs/common/liquid.d.ts.map +0 -1
  158. package/lib/types/components/docs/common/page.d.ts.map +0 -1
  159. package/lib/types/components/docs/common/range.d.ts.map +0 -1
  160. package/lib/types/components/docs/common/section.d.ts.map +0 -1
  161. package/lib/types/components/docs/common/span.d.ts.map +0 -1
  162. package/lib/types/components/docs/common/tools.d.ts.map +0 -1
  163. package/lib/types/components/docs/doc-component.d.ts.map +0 -1
  164. package/lib/types/components/docs/doc-extension.d.ts.map +0 -1
  165. package/lib/types/components/docs/doc-skeleton.d.ts.map +0 -1
  166. package/lib/types/components/docs/document.d.ts.map +0 -1
  167. package/lib/types/components/docs/extensions/background.d.ts.map +0 -1
  168. package/lib/types/components/docs/extensions/border.d.ts.map +0 -1
  169. package/lib/types/components/docs/extensions/font-and-base-line.d.ts.map +0 -1
  170. package/lib/types/components/docs/extensions/index.d.ts.map +0 -1
  171. package/lib/types/components/docs/extensions/line.d.ts.map +0 -1
  172. package/lib/types/components/docs/horizon-bar.d.ts.map +0 -1
  173. package/lib/types/components/docs/index.d.ts.map +0 -1
  174. package/lib/types/components/docs/text-selection-render-manager.d.ts.map +0 -1
  175. package/lib/types/components/docs/vertical-bar.d.ts.map +0 -1
  176. package/lib/types/components/docs/view-model/data-stream-tree-node.d.ts.map +0 -1
  177. package/lib/types/components/docs/view-model/document-view-model.d.ts.map +0 -1
  178. package/lib/types/components/extension.d.ts.map +0 -1
  179. package/lib/types/components/index.d.ts.map +0 -1
  180. package/lib/types/components/sheets/column-header.d.ts.map +0 -1
  181. package/lib/types/components/sheets/extensions/background.d.ts.map +0 -1
  182. package/lib/types/components/sheets/extensions/border-auxiliary.d.ts +0 -13
  183. package/lib/types/components/sheets/extensions/border-auxiliary.d.ts.map +0 -1
  184. package/lib/types/components/sheets/extensions/border.d.ts.map +0 -1
  185. package/lib/types/components/sheets/extensions/column-header-layout.d.ts.map +0 -1
  186. package/lib/types/components/sheets/extensions/font.d.ts.map +0 -1
  187. package/lib/types/components/sheets/extensions/index.d.ts.map +0 -1
  188. package/lib/types/components/sheets/extensions/row-header-layout.d.ts.map +0 -1
  189. package/lib/types/components/sheets/extensions/sheet-extension.d.ts.map +0 -1
  190. package/lib/types/components/sheets/index.d.ts.map +0 -1
  191. package/lib/types/components/sheets/interfaces.d.ts.map +0 -1
  192. package/lib/types/components/sheets/row-header.d.ts.map +0 -1
  193. package/lib/types/components/sheets/sheet-component.d.ts.map +0 -1
  194. package/lib/types/components/sheets/sheet-skeleton.d.ts.map +0 -1
  195. package/lib/types/components/sheets/spreadsheet.d.ts.map +0 -1
  196. package/lib/types/components/skeleton.d.ts.map +0 -1
  197. package/lib/types/components/slides/index.d.ts.map +0 -1
  198. package/lib/types/components/slides/slide.d.ts.map +0 -1
  199. package/lib/types/custom/custom-object.d.ts.map +0 -1
  200. package/lib/types/custom/index.d.ts.map +0 -1
  201. package/lib/types/engine.d.ts.map +0 -1
  202. package/lib/types/group.d.ts.map +0 -1
  203. package/lib/types/index.d.ts.map +0 -1
  204. package/lib/types/layer.d.ts.map +0 -1
  205. package/lib/types/render-engine.d.ts.map +0 -1
  206. package/lib/types/render-manager.service.d.ts.map +0 -1
  207. package/lib/types/scene-viewer.d.ts.map +0 -1
  208. package/lib/types/scene.-transformer.d.ts.map +0 -1
  209. package/lib/types/scene.d.ts.map +0 -1
  210. package/lib/types/scene.input-manager.d.ts.map +0 -1
  211. package/lib/types/scroll-timer.d.ts.map +0 -1
  212. package/lib/types/services/object-transform-manager.service.d.ts.map +0 -1
  213. package/lib/types/shape/base-scroll-bar.d.ts.map +0 -1
  214. package/lib/types/shape/circle.d.ts.map +0 -1
  215. package/lib/types/shape/control.d.ts.map +0 -1
  216. package/lib/types/shape/drawing.d.ts.map +0 -1
  217. package/lib/types/shape/index.d.ts.map +0 -1
  218. package/lib/types/shape/path.d.ts.map +0 -1
  219. package/lib/types/shape/picture.d.ts.map +0 -1
  220. package/lib/types/shape/rect.d.ts.map +0 -1
  221. package/lib/types/shape/regular-polygon.d.ts.map +0 -1
  222. package/lib/types/shape/rich-text.d.ts.map +0 -1
  223. package/lib/types/shape/scroll-bar.d.ts.map +0 -1
  224. package/lib/types/shape/selection.d.ts.map +0 -1
  225. package/lib/types/shape/shape.d.ts.map +0 -1
  226. package/lib/types/thin-engine.d.ts.map +0 -1
  227. package/lib/types/thin-scene.d.ts.map +0 -1
  228. 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 { IBoundRect } from '../basics/vector2';
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?: IBoundRect): this;
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 { IBoundRect, Vector2 } from '../basics/vector2';
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?: IBoundRect): this;
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 { IBoundRect, Vector2 } from './basics/vector2';
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?: IBoundRect): void;
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
@@ -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 { IBoundRect } from './basics/vector2';
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(isMouseFix?: boolean): Transform;
166
- render(parentCtx?: CanvasRenderingContext2D): void;
167
- getBounding(): IBoundRect;
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("@univerjs/engine-render").Rect<import("@univerjs/engine-render").IRectProps> | null | undefined;
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 drawScrollbar;
188
- private _applyCache;
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