@univerjs/engine-render 0.1.3 → 0.1.5

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 (126) hide show
  1. package/lib/cjs/index.js +2 -2
  2. package/lib/es/index.js +10914 -10855
  3. package/lib/types/base-object.d.ts +7 -23
  4. package/lib/types/basics/cell-data.d.ts +2 -16
  5. package/lib/types/basics/document-node-tools.d.ts +10 -24
  6. package/lib/types/basics/draw.d.ts +5 -20
  7. package/lib/types/basics/font-cache.d.ts +4 -18
  8. package/lib/types/basics/i-document-skeleton-cached.d.ts +15 -23
  9. package/lib/types/basics/i-events.d.ts +2 -16
  10. package/lib/types/basics/interfaces.d.ts +7 -21
  11. package/lib/types/basics/path2.d.ts +2 -16
  12. package/lib/types/basics/position.d.ts +3 -17
  13. package/lib/types/basics/quick-event.d.ts +3 -17
  14. package/lib/types/basics/range.d.ts +2 -16
  15. package/lib/types/basics/text-rotation.d.ts +2 -16
  16. package/lib/types/basics/tools.d.ts +10 -20
  17. package/lib/types/basics/transform.d.ts +3 -17
  18. package/lib/types/basics/vector2.d.ts +2 -16
  19. package/lib/types/basics/viewport-subtract.d.ts +3 -0
  20. package/lib/types/canvas.d.ts +1 -15
  21. package/lib/types/components/component.d.ts +5 -19
  22. package/lib/types/components/docs/doc-component.d.ts +10 -25
  23. package/lib/types/components/docs/doc-extension.d.ts +4 -18
  24. package/lib/types/components/docs/document.d.ts +10 -26
  25. package/lib/types/components/docs/extensions/background.d.ts +5 -19
  26. package/lib/types/components/docs/extensions/border.d.ts +5 -19
  27. package/lib/types/components/docs/extensions/font-and-base-line.d.ts +5 -19
  28. package/lib/types/components/docs/extensions/line.d.ts +5 -19
  29. package/lib/types/components/docs/layout/block/paragraph/bullet-ruler.d.ts +3 -0
  30. package/lib/types/components/docs/layout/block/paragraph/bullet.d.ts +5 -0
  31. package/lib/types/components/docs/layout/block/paragraph/inline-drawing.d.ts +5 -0
  32. package/lib/types/components/docs/layout/block/paragraph/language-ruler.d.ts +21 -0
  33. package/lib/types/components/docs/layout/block/paragraph/layout-ruler.d.ts +4 -0
  34. package/lib/types/components/docs/layout/block/paragraph/layout.d.ts +6 -0
  35. package/lib/types/components/docs/layout/block/paragraph/line-adjustment.d.ts +4 -0
  36. package/lib/types/components/docs/layout/block/paragraph/linebreaking.d.ts +7 -0
  37. package/lib/types/components/docs/layout/block/paragraph/shaping.d.ts +11 -0
  38. package/lib/types/components/docs/layout/block/section.d.ts +10 -0
  39. package/lib/types/components/docs/{doc-skeleton.d.ts → layout/doc-skeleton.d.ts} +11 -26
  40. package/lib/types/components/docs/layout/linebreak/extensions/tab-linebreak-extension.d.ts +3 -0
  41. package/lib/types/components/docs/layout/linebreak/linebreaker.d.ts +27 -0
  42. package/lib/types/components/docs/layout/model/__test__/glyph.spec.d.ts +16 -0
  43. package/lib/types/components/docs/layout/model/column.d.ts +4 -0
  44. package/lib/types/components/docs/layout/model/glyph.d.ts +16 -0
  45. package/lib/types/components/docs/{common → layout/model}/line.d.ts +2 -16
  46. package/lib/types/components/docs/layout/model/page.d.ts +4 -0
  47. package/lib/types/components/docs/layout/model/section.d.ts +5 -0
  48. package/lib/types/components/docs/{common → layout}/tools.d.ts +10 -25
  49. package/lib/types/components/docs/{common/liquid.d.ts → liquid.d.ts} +4 -19
  50. package/lib/types/components/docs/{common → text-selection}/convert-cursor.d.ts +9 -23
  51. package/lib/types/components/docs/{common → text-selection}/text-range.d.ts +10 -25
  52. package/lib/types/components/docs/{text-selection-render-manager.d.ts → text-selection/text-selection-render-manager.d.ts} +15 -28
  53. package/lib/types/components/docs/view-model/data-stream-tree-node.d.ts +2 -17
  54. package/lib/types/components/docs/view-model/document-view-model.d.ts +8 -23
  55. package/lib/types/components/extension.d.ts +5 -20
  56. package/lib/types/components/index.d.ts +0 -1
  57. package/lib/types/components/sheets/column-header.d.ts +5 -19
  58. package/lib/types/components/sheets/extensions/background.d.ts +4 -18
  59. package/lib/types/components/sheets/extensions/border.d.ts +4 -18
  60. package/lib/types/components/sheets/extensions/column-header-layout.d.ts +4 -18
  61. package/lib/types/components/sheets/extensions/font.d.ts +4 -18
  62. package/lib/types/components/sheets/extensions/row-header-layout.d.ts +4 -18
  63. package/lib/types/components/sheets/extensions/sheet-extension.d.ts +4 -18
  64. package/lib/types/components/sheets/interfaces.d.ts +4 -18
  65. package/lib/types/components/sheets/row-header.d.ts +5 -19
  66. package/lib/types/components/sheets/sheet-component.d.ts +6 -20
  67. package/lib/types/components/sheets/sheet-skeleton.d.ts +8 -23
  68. package/lib/types/components/sheets/spreadsheet.d.ts +8 -22
  69. package/lib/types/components/skeleton.d.ts +2 -16
  70. package/lib/types/components/slides/slide.d.ts +5 -20
  71. package/lib/types/context.d.ts +4 -0
  72. package/lib/types/custom/custom-object.d.ts +3 -17
  73. package/lib/types/engine.d.ts +9 -19
  74. package/lib/types/group.d.ts +4 -19
  75. package/lib/types/index.d.ts +9 -1
  76. package/lib/types/layer.d.ts +5 -18
  77. package/lib/types/render-engine.d.ts +4 -18
  78. package/lib/types/render-manager.service.d.ts +10 -23
  79. package/lib/types/scene-viewer.d.ts +7 -21
  80. package/lib/types/scene.d.ts +14 -29
  81. package/lib/types/scene.input-manager.d.ts +3 -17
  82. package/lib/types/scene.transformer.d.ts +5 -20
  83. package/lib/types/scroll-timer.d.ts +4 -18
  84. package/lib/types/services/object-transform-manager.service.d.ts +4 -18
  85. package/lib/types/shape/base-scroll-bar.d.ts +7 -21
  86. package/lib/types/shape/circle.d.ts +3 -18
  87. package/lib/types/shape/path.d.ts +3 -18
  88. package/lib/types/shape/picture.d.ts +4 -19
  89. package/lib/types/shape/rect.d.ts +3 -18
  90. package/lib/types/shape/regular-polygon.d.ts +5 -20
  91. package/lib/types/shape/rich-text.d.ts +4 -18
  92. package/lib/types/shape/scroll-bar.d.ts +6 -21
  93. package/lib/types/shape/shape.d.ts +5 -19
  94. package/lib/types/thin-engine.d.ts +6 -21
  95. package/lib/types/thin-scene.d.ts +11 -24
  96. package/lib/types/viewport.d.ts +9 -28
  97. package/lib/umd/index.js +2 -2
  98. package/package.json +10 -9
  99. package/lib/types/components/docs/block/index.d.ts +0 -18
  100. package/lib/types/components/docs/block/paragraph/bullet-ruler.d.ts +0 -17
  101. package/lib/types/components/docs/block/paragraph/bullet.d.ts +0 -19
  102. package/lib/types/components/docs/block/paragraph/index.d.ts +0 -21
  103. package/lib/types/components/docs/block/paragraph/inline-drawing.d.ts +0 -19
  104. package/lib/types/components/docs/block/paragraph/language-ruler.d.ts +0 -35
  105. package/lib/types/components/docs/block/paragraph/layout-ruler.d.ts +0 -18
  106. package/lib/types/components/docs/block/paragraph/paragraph.d.ts +0 -20
  107. package/lib/types/components/docs/block/section.d.ts +0 -24
  108. package/lib/types/components/docs/common/column.d.ts +0 -19
  109. package/lib/types/components/docs/common/index.d.ts +0 -24
  110. package/lib/types/components/docs/common/page.d.ts +0 -19
  111. package/lib/types/components/docs/common/section.d.ts +0 -20
  112. package/lib/types/components/docs/common/span.d.ts +0 -28
  113. package/lib/types/components/docs/index.d.ts +0 -22
  114. package/lib/types/components/docs/linebreak/extensions/tab-linebreak-extension.d.ts +0 -17
  115. package/lib/types/components/docs/linebreak/linebreaker.d.ts +0 -41
  116. /package/lib/types/components/docs/{block → layout/block}/block-error.d.ts +0 -0
  117. /package/lib/types/components/docs/{linebreak → layout/linebreak}/__tests__/linebreak.spec.d.ts +0 -0
  118. /package/lib/types/components/docs/{linebreak → layout/linebreak}/break.d.ts +0 -0
  119. /package/lib/types/components/docs/{linebreak → layout/linebreak}/classes.d.ts +0 -0
  120. /package/lib/types/components/docs/{linebreak → layout/linebreak}/index.d.ts +0 -0
  121. /package/lib/types/components/docs/{linebreak → layout/linebreak}/pairs.d.ts +0 -0
  122. /package/lib/types/components/docs/{linebreak → layout/linebreak}/rule.d.ts +0 -0
  123. /package/lib/types/components/docs/{linebreak → layout/linebreak}/swap.d.ts +0 -0
  124. /package/lib/types/components/docs/{linebreak → layout/linebreak}/tiny-inflate.d.ts +0 -0
  125. /package/lib/types/components/docs/{linebreak → layout/linebreak}/trie-data.d.ts +0 -0
  126. /package/lib/types/components/docs/{linebreak → layout/linebreak}/unicode-trie.d.ts +0 -0
@@ -1,29 +1,12 @@
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
- */
16
- import './extensions';
17
- import type { Nullable } from '@univerjs/core';
18
- import { Observable } from '@univerjs/core';
19
- import type { IDocumentSkeletonPage } from '../../basics/i-document-skeleton-cached';
20
- import { PageLayoutType } from '../../basics/i-document-skeleton-cached';
21
- import type { Transform } from '../../basics/transform';
22
- import type { IViewportBound } from '../../basics/vector2';
23
- import type { UniverRenderingContext } from '../../context';
24
- import type { Scene } from '../../scene';
1
+ import { DocumentSkeleton } from './layout/doc-skeleton';
25
2
  import { DocComponent } from './doc-component';
26
- import type { DocumentSkeleton } from './doc-skeleton';
3
+ import { Scene } from '../../scene';
4
+ import { UniverRenderingContext } from '../../context';
5
+ import { IViewportBound } from '../../basics/vector2';
6
+ import { Transform } from '../../basics/transform';
7
+ import { IDocumentSkeletonPage, PageLayoutType } from '../../basics/i-document-skeleton-cached';
8
+ import { Nullable, Observable } from '@univerjs/core';
9
+
27
10
  interface IPageMarginLayout {
28
11
  pageMarginLeft: number;
29
12
  pageMarginTop: number;
@@ -54,7 +37,7 @@ export declare class Documents extends DocComponent {
54
37
  static create(oKey: string, documentSkeleton?: DocumentSkeleton, config?: IDocumentsConfig): Documents;
55
38
  setConfig(config?: IDocumentsConfig): void;
56
39
  getOffsetConfig(): IDocumentOffsetConfig;
57
- getEngine(): Nullable<import("../../thin-engine").ThinEngine<Scene>>;
40
+ getEngine(): Nullable<import('../../thin-engine').ThinEngine<Scene>>;
58
41
  draw(ctx: UniverRenderingContext, bounds?: IViewportBound): void;
59
42
  changeSkeleton(newSkeleton: DocumentSkeleton): this;
60
43
  protected _draw(ctx: UniverRenderingContext, bounds?: IViewportBound): void;
@@ -63,5 +46,6 @@ export declare class Documents extends DocComponent {
63
46
  private _startRotation;
64
47
  private _resetRotation;
65
48
  private _initialDefaultExtension;
49
+ private _isSkipByDiffBounds;
66
50
  }
67
51
  export {};
@@ -1,26 +1,12 @@
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
- */
16
- import type { IScale } from '@univerjs/core';
17
- import type { IDocumentSkeletonSpan } from '../../../basics/i-document-skeleton-cached';
18
- import type { UniverRenderingContext } from '../../../context';
19
1
  import { docExtension } from '../doc-extension';
2
+ import { UniverRenderingContext } from '../../../context';
3
+ import { IDocumentSkeletonGlyph } from '../../../basics/i-document-skeleton-cached';
4
+ import { IScale } from '@univerjs/core';
5
+
20
6
  export declare class Background extends docExtension {
21
7
  uKey: string;
22
8
  Z_INDEX: number;
23
9
  private _preBackgroundColor;
24
- draw(ctx: UniverRenderingContext, parentScale: IScale, span: IDocumentSkeletonSpan): void;
10
+ draw(ctx: UniverRenderingContext, parentScale: IScale, span: IDocumentSkeletonGlyph): void;
25
11
  clearCache(): void;
26
12
  }
@@ -1,28 +1,14 @@
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
- */
16
- import type { IScale } from '@univerjs/core';
17
- import type { IDocumentSkeletonSpan } from '../../../basics/i-document-skeleton-cached';
18
- import type { UniverRenderingContext } from '../../../context';
19
1
  import { docExtension } from '../doc-extension';
2
+ import { UniverRenderingContext } from '../../../context';
3
+ import { IDocumentSkeletonGlyph } from '../../../basics/i-document-skeleton-cached';
4
+ import { IScale } from '@univerjs/core';
5
+
20
6
  export declare class Border extends docExtension {
21
7
  uKey: string;
22
8
  Z_INDEX: number;
23
9
  private _preBorderStyle;
24
10
  private _preBorderColor;
25
- draw(ctx: UniverRenderingContext, parentScale: IScale, span: IDocumentSkeletonSpan): void;
11
+ draw(ctx: UniverRenderingContext, parentScale: IScale, glyph: IDocumentSkeletonGlyph): void;
26
12
  clearCache(): void;
27
13
  private _createBorderCache;
28
14
  }
@@ -1,28 +1,14 @@
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
- */
16
- import type { IScale } from '@univerjs/core';
17
- import type { IDocumentSkeletonSpan } from '../../../basics/i-document-skeleton-cached';
18
- import type { UniverRenderingContext } from '../../../context';
19
1
  import { docExtension } from '../doc-extension';
2
+ import { UniverRenderingContext } from '../../../context';
3
+ import { IDocumentSkeletonGlyph } from '../../../basics/i-document-skeleton-cached';
4
+ import { IScale } from '@univerjs/core';
5
+
20
6
  export declare class FontAndBaseLine extends docExtension {
21
7
  uKey: string;
22
8
  Z_INDEX: number;
23
9
  private _preFontString;
24
10
  private _preFontColor;
25
- draw(ctx: UniverRenderingContext, parentScale: IScale, span: IDocumentSkeletonSpan): void;
11
+ draw(ctx: UniverRenderingContext, parentScale: IScale, glyph: IDocumentSkeletonGlyph): void;
26
12
  private _fillText;
27
13
  clearCache(): void;
28
14
  }
@@ -1,27 +1,13 @@
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
- */
16
- import type { IScale } from '@univerjs/core';
17
- import type { IDocumentSkeletonSpan } from '../../../basics/i-document-skeleton-cached';
18
- import type { UniverRenderingContext } from '../../../context';
19
1
  import { docExtension } from '../doc-extension';
2
+ import { UniverRenderingContext } from '../../../context';
3
+ import { IDocumentSkeletonGlyph } from '../../../basics/i-document-skeleton-cached';
4
+ import { IScale } from '@univerjs/core';
5
+
20
6
  export declare class Line extends docExtension {
21
7
  uKey: string;
22
8
  Z_INDEX: number;
23
9
  private _preBackgroundColor;
24
- draw(ctx: UniverRenderingContext, parentScale: IScale, span: IDocumentSkeletonSpan): void;
10
+ draw(ctx: UniverRenderingContext, parentScale: IScale, span: IDocumentSkeletonGlyph): void;
25
11
  clearCache(): void;
26
12
  private _drawLine;
27
13
  private _setLineType;
@@ -0,0 +1,3 @@
1
+ import { GlyphType } from '@univerjs/core';
2
+
3
+ export declare function getBulletOrderedSymbol(startIndex: number, startNumber: number, glyphType: GlyphType | string): string;
@@ -0,0 +1,5 @@
1
+ import { IDocumentSkeletonBullet } from '../../../../../basics/i-document-skeleton-cached';
2
+ import { IBullet, ILists, LocaleService, Nullable } from '@univerjs/core';
3
+
4
+ export declare function dealWithBullet(bullet?: IBullet, lists?: ILists, listLevelAncestors?: Array<Nullable<IDocumentSkeletonBullet>>, localeService?: LocaleService): IDocumentSkeletonBullet | undefined;
5
+ export declare function getDefaultBulletSke(listId: string, startIndex?: number): IDocumentSkeletonBullet;
@@ -0,0 +1,5 @@
1
+ import { IParagraphConfig, ISectionBreakConfig } from '../../../../../basics/interfaces';
2
+ import { IDocumentSkeletonPage } from '../../../../../basics/i-document-skeleton-cached';
3
+ import { IDrawing, LocaleService } from '@univerjs/core';
4
+
5
+ export declare function dealWidthInlineDrawing(drawing: IDrawing, sectionBreakConfig: ISectionBreakConfig, allPages?: IDocumentSkeletonPage[], paragraphConfig?: IParagraphConfig, localeService?: LocaleService): never[];
@@ -0,0 +1,21 @@
1
+ import { DocumentViewModel } from '../../../view-model/document-view-model';
2
+ import { DataStreamTreeNode } from '../../../view-model/data-stream-tree-node';
3
+ import { ISectionBreakConfig } from '../../../../../basics/interfaces';
4
+ import { IParagraphStyle } from '@univerjs/core';
5
+
6
+ export declare function otherHandler(index: number, charArray: string, bodyModel: DocumentViewModel, paragraphNode: DataStreamTreeNode, sectionBreakConfig: ISectionBreakConfig, paragraphStyle: IParagraphStyle): {
7
+ step: number;
8
+ glyphGroup: import('../../../../..').IDocumentSkeletonGlyph[];
9
+ };
10
+ export declare function ArabicHandler(index: number, charArray: string, bodyModel: DocumentViewModel, paragraphNode: DataStreamTreeNode, sectionBreakConfig: ISectionBreakConfig, paragraphStyle: IParagraphStyle): {
11
+ step: number;
12
+ glyphGroup: import('../../../../..').IDocumentSkeletonGlyph[];
13
+ };
14
+ export declare function emojiHandler(index: number, charArray: string, bodyModel: DocumentViewModel, paragraphNode: DataStreamTreeNode, sectionBreakConfig: ISectionBreakConfig, paragraphStyle: IParagraphStyle): {
15
+ step: number;
16
+ glyphGroup: import('../../../../..').IDocumentSkeletonGlyph[];
17
+ };
18
+ export declare function TibetanHandler(index: number, charArray: string, bodyModel: DocumentViewModel, paragraphNode: DataStreamTreeNode, sectionBreakConfig: ISectionBreakConfig, paragraphStyle: IParagraphStyle): {
19
+ step: number;
20
+ glyphGroup: import('../../../../..').IDocumentSkeletonGlyph[];
21
+ };
@@ -0,0 +1,4 @@
1
+ import { IParagraphConfig, ISectionBreakConfig } from '../../../../../basics/interfaces';
2
+ import { IDocumentSkeletonGlyph, IDocumentSkeletonPage } from '../../../../../basics/i-document-skeleton-cached';
3
+
4
+ export declare function layoutParagraph(glyphGroup: IDocumentSkeletonGlyph[], pages: IDocumentSkeletonPage[], sectionBreakConfig: ISectionBreakConfig, paragraphConfig: IParagraphConfig, paragraphStart?: boolean): IDocumentSkeletonPage[];
@@ -0,0 +1,6 @@
1
+ import { DocumentViewModel } from '../../../view-model/document-view-model';
2
+ import { DataStreamTreeNode } from '../../../view-model/data-stream-tree-node';
3
+ import { ISectionBreakConfig } from '../../../../../basics/interfaces';
4
+ import { IDocumentSkeletonPage, ISkeletonResourceReference } from '../../../../../basics/i-document-skeleton-cached';
5
+
6
+ export declare function dealWidthParagraph(bodyModel: DocumentViewModel, paragraphNode: DataStreamTreeNode, curPage: IDocumentSkeletonPage, sectionBreakConfig: ISectionBreakConfig, skeletonResourceReference: ISkeletonResourceReference): IDocumentSkeletonPage[];
@@ -0,0 +1,4 @@
1
+ import { IDocumentSkeletonPage } from '../../../../../basics/i-document-skeleton-cached';
2
+ import { IParagraph } from '@univerjs/core';
3
+
4
+ export declare function lineAdjustment(pages: IDocumentSkeletonPage[], paragraph: IParagraph): void;
@@ -0,0 +1,7 @@
1
+ import { IShapedText } from './shaping';
2
+ import { ISectionBreakConfig } from '../../../../../basics/interfaces';
3
+ import { DocumentViewModel } from '../../../view-model/document-view-model';
4
+ import { DataStreamTreeNode } from '../../../view-model/data-stream-tree-node';
5
+ import { IDocumentSkeletonPage, ISkeletonResourceReference } from '../../../../../basics/i-document-skeleton-cached';
6
+
7
+ export declare function lineBreaking(shapedTextList: IShapedText[], curPage: IDocumentSkeletonPage, bodyModel: DocumentViewModel, paragraphNode: DataStreamTreeNode, sectionBreakConfig: ISectionBreakConfig, skeletonResourceReference: ISkeletonResourceReference): IDocumentSkeletonPage[];
@@ -0,0 +1,11 @@
1
+ import { ISectionBreakConfig } from '../../../../../basics/interfaces';
2
+ import { DocumentViewModel } from '../../../view-model/document-view-model';
3
+ import { DataStreamTreeNode } from '../../../view-model/data-stream-tree-node';
4
+ import { IDocumentSkeletonGlyph } from '../../../../../basics/i-document-skeleton-cached';
5
+ import { IParagraphStyle } from '@univerjs/core';
6
+
7
+ export interface IShapedText {
8
+ text: string;
9
+ glyphs: IDocumentSkeletonGlyph[];
10
+ }
11
+ export declare function shaping(content: string, bodyModel: DocumentViewModel, paragraphNode: DataStreamTreeNode, sectionBreakConfig: ISectionBreakConfig, paragraphStyle: IParagraphStyle): IShapedText[];
@@ -0,0 +1,10 @@
1
+ import { DocumentViewModel } from '../../view-model/document-view-model';
2
+ import { DataStreamTreeNode } from '../../view-model/data-stream-tree-node';
3
+ import { ISectionBreakConfig } from '../../../../basics/interfaces';
4
+ import { IDocumentSkeletonPage, ISkeletonResourceReference } from '../../../../basics/i-document-skeleton-cached';
5
+
6
+ export declare function dealWithSections(bodyModel: DocumentViewModel, sectionNode: DataStreamTreeNode, curPage: IDocumentSkeletonPage, sectionBreakConfig: ISectionBreakConfig, skeletonResourceReference: ISkeletonResourceReference, _preRenderedBlockIdMap?: Map<string, boolean>): {
7
+ pages: IDocumentSkeletonPage[];
8
+ renderedBlockIdMap: Map<string, boolean>;
9
+ };
10
+ export declare function dealWidthBlocksByMultiColumnAndContinuous(): void;
@@ -1,25 +1,10 @@
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
- */
16
- import type { LocaleService, Nullable } from '@univerjs/core';
17
- import type { IDocumentSkeletonCached, IDocumentSkeletonSpan } from '../../basics/i-document-skeleton-cached';
18
- import { PageLayoutType } from '../../basics/i-document-skeleton-cached';
19
- import type { INodeInfo, INodePosition, INodeSearch } from '../../basics/interfaces';
20
- import type { IViewportBound, Vector2 } from '../../basics/vector2';
21
- import { Skeleton } from '../skeleton';
22
- import type { DocumentViewModel } from './view-model/document-view-model';
1
+ import { DocumentViewModel } from '../view-model/document-view-model';
2
+ import { Skeleton } from '../../skeleton';
3
+ import { IViewportBound, Vector2 } from '../../../basics/vector2';
4
+ import { INodeInfo, INodePosition, INodeSearch } from '../../../basics/interfaces';
5
+ import { IDocumentSkeletonCached, IDocumentSkeletonGlyph, PageLayoutType } from '../../../basics/i-document-skeleton-cached';
6
+ import { LocaleService, Nullable } from '@univerjs/core';
7
+
23
8
  export declare enum DocumentSkeletonState {
24
9
  PENDING = "pending",
25
10
  CALCULATING = "calculating",
@@ -41,11 +26,11 @@ export declare class DocumentSkeleton extends Skeleton {
41
26
  actualHeight: number;
42
27
  };
43
28
  private _getPageActualWidth;
44
- getPageSize(): import("@univerjs/core").ISize | undefined;
45
- findPositionBySpan(span: IDocumentSkeletonSpan): Nullable<INodeSearch>;
29
+ getPageSize(): import('@univerjs/core').ISize | undefined;
30
+ findPositionByGlyph(glyph: IDocumentSkeletonGlyph): Nullable<INodeSearch>;
46
31
  findNodePositionByCharIndex(charIndex: number, isBack?: boolean): Nullable<INodePosition>;
47
- findNodeByCharIndex(charIndex: number): Nullable<IDocumentSkeletonSpan>;
48
- findSpanByPosition(position: Nullable<INodePosition>): IDocumentSkeletonSpan | undefined;
32
+ findNodeByCharIndex(charIndex: number): Nullable<IDocumentSkeletonGlyph>;
33
+ findGlyphByPosition(position: Nullable<INodePosition>): IDocumentSkeletonGlyph | undefined;
49
34
  findNodeByCoord(coord: Vector2, pageLayoutType: PageLayoutType, pageMarginLeft: number, pageMarginTop: number): Nullable<INodeInfo>;
50
35
  private _getNearestNode;
51
36
  private _getPageBoundingBox;
@@ -0,0 +1,3 @@
1
+ import { LineBreaker } from '../linebreaker';
2
+
3
+ export declare function tabLineBreakExtension(breaker: LineBreaker): void;
@@ -0,0 +1,27 @@
1
+ import { ILineBreakRule } from './rule';
2
+ import { Break } from './break';
3
+
4
+ interface ILineBreakExtension {
5
+ (breaker: LineBreaker): void;
6
+ }
7
+ export declare class LineBreaker {
8
+ string: string;
9
+ private _pos;
10
+ private _lastPos;
11
+ private _curClass;
12
+ private _codePoint;
13
+ private _nextClass;
14
+ private _LB8a;
15
+ private _LB21a;
16
+ private _LB30a;
17
+ private _rule;
18
+ constructor(string: string);
19
+ use(extension: ILineBreakExtension): this;
20
+ addRule(key: string, rule: ILineBreakRule): this;
21
+ nextBreak(): Break | null;
22
+ private _getNextCodePoint;
23
+ private _nextCharClass;
24
+ private _getSimpleBreak;
25
+ private _getPairTableBreak;
26
+ }
27
+ export {};
@@ -0,0 +1,16 @@
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
+ */
16
+ export {};
@@ -0,0 +1,4 @@
1
+ import { IDocumentSkeletonColumn } from '../../../../basics/i-document-skeleton-cached';
2
+ import { ISectionColumnProperties, ColumnSeparatorType } from '@univerjs/core';
3
+
4
+ export declare function createSkeletonColumn(columnIndex: number | undefined, columnProperties: ISectionColumnProperties[], columnSeparatorType?: ColumnSeparatorType, pageWidth?: number): IDocumentSkeletonColumn;
@@ -0,0 +1,16 @@
1
+ import { IFontCreateConfig } from '../../../../basics/interfaces';
2
+ import { IAdjustability, IDocumentSkeletonBullet, IDocumentSkeletonDivide, IDocumentSkeletonGlyph, GlyphType } from '../../../../basics/i-document-skeleton-cached';
3
+
4
+ export declare function isSpace(char: string): boolean;
5
+ export declare function isJustifiable(content: string): boolean;
6
+ export declare function baseAdjustability(content: string, width: number): IAdjustability;
7
+ export declare function createSkeletonWordGlyph(content: string, config: IFontCreateConfig, glyphWidth?: number): IDocumentSkeletonGlyph;
8
+ export declare function createSkeletonLetterGlyph(content: string, config: IFontCreateConfig, glyphWidth?: number): IDocumentSkeletonGlyph;
9
+ export declare function createSkeletonTabGlyph(config: IFontCreateConfig, glyphWidth?: number): IDocumentSkeletonGlyph;
10
+ export declare function _createSkeletonWordOrLetter(glyphType: GlyphType, content: string, config: IFontCreateConfig, glyphWidth?: number): IDocumentSkeletonGlyph;
11
+ export declare function createSkeletonBulletGlyph(glyph: IDocumentSkeletonGlyph, bulletSkeleton: IDocumentSkeletonBullet, charSpaceApply: number): IDocumentSkeletonGlyph;
12
+ export declare function setGlyphGroupLeft(glyphGroup: IDocumentSkeletonGlyph[], left?: number): void;
13
+ export declare function setGlyphLeft(glyph: IDocumentSkeletonGlyph, left?: number): void;
14
+ export declare function addGlyphToDivide(divide: IDocumentSkeletonDivide, glyphGroup: IDocumentSkeletonGlyph[], offsetLeft?: number): void;
15
+ export declare function glyphShrinkRight(glyph: IDocumentSkeletonGlyph, amount: number): void;
16
+ export declare function glyphShrinkLeft(glyph: IDocumentSkeletonGlyph, amount: number): void;
@@ -1,19 +1,5 @@
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
- */
16
- import type { IDocumentSkeletonDivide, IDocumentSkeletonDrawing, IDocumentSkeletonDrawingAnchor, IDocumentSkeletonLine, LineType } from '../../../basics/i-document-skeleton-cached';
1
+ import { IDocumentSkeletonDivide, IDocumentSkeletonDrawing, IDocumentSkeletonDrawingAnchor, IDocumentSkeletonLine, LineType } from '../../../../basics/i-document-skeleton-cached';
2
+
17
3
  interface ILineBoundingBox {
18
4
  lineHeight: number;
19
5
  lineTop: number;
@@ -0,0 +1,4 @@
1
+ import { ISectionBreakConfig } from '../../../../basics/interfaces';
2
+ import { IDocumentSkeletonPage, ISkeletonResourceReference, BreakType } from '../../../../basics/i-document-skeleton-cached';
3
+
4
+ export declare function createSkeletonPage(sectionBreakConfig: ISectionBreakConfig, skeletonResourceReference: ISkeletonResourceReference, pageNumber?: number, breakType?: BreakType): IDocumentSkeletonPage;
@@ -0,0 +1,5 @@
1
+ import { IDocumentSkeletonColumn, IDocumentSkeletonSection } from '../../../../basics/i-document-skeleton-cached';
2
+ import { ISectionColumnProperties, ColumnSeparatorType } from '@univerjs/core';
3
+
4
+ export declare function createSkeletonSection(columnProperties?: ISectionColumnProperties[], columnSeparatorType?: ColumnSeparatorType, top?: number, left?: number, sectionWidth?: number, sectionHeight?: number): IDocumentSkeletonSection;
5
+ export declare function setColumnFullState(column: IDocumentSkeletonColumn, state: boolean): void;
@@ -1,26 +1,11 @@
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
- */
16
- import type { INumberUnit, IParagraphStyle, ITextStyle, ObjectPositionH, ObjectPositionV } from '@univerjs/core';
17
- import { BooleanNumber, GridType, SpacingRule } from '@univerjs/core';
18
- import type { IDocumentSkeletonColumn, IDocumentSkeletonDivide, IDocumentSkeletonLine, IDocumentSkeletonPage, IDocumentSkeletonSpan } from '../../../basics/i-document-skeleton-cached';
19
- import type { IParagraphConfig, ISectionBreakConfig } from '../../../basics/interfaces';
20
- import type { DataStreamTreeNode } from '../view-model/data-stream-tree-node';
21
- import type { DocumentViewModel } from '../view-model/document-view-model';
1
+ import { DocumentViewModel } from '../view-model/document-view-model';
2
+ import { DataStreamTreeNode } from '../view-model/data-stream-tree-node';
3
+ import { IParagraphConfig, ISectionBreakConfig } from '../../../basics/interfaces';
4
+ import { IDocumentSkeletonColumn, IDocumentSkeletonDivide, IDocumentSkeletonGlyph, IDocumentSkeletonLine, IDocumentSkeletonPage } from '../../../basics/i-document-skeleton-cached';
5
+ import { INumberUnit, IParagraphStyle, ITextStyle, ObjectPositionH, ObjectPositionV, BooleanNumber, GridType, SpacingRule } from '@univerjs/core';
6
+
22
7
  export declare function getLastPage(pages: IDocumentSkeletonPage[]): IDocumentSkeletonPage;
23
- export declare function getLastSection(page: IDocumentSkeletonPage): import("../../../basics/i-document-skeleton-cached").IDocumentSkeletonSection;
8
+ export declare function getLastSection(page: IDocumentSkeletonPage): import('../../../basics/i-document-skeleton-cached').IDocumentSkeletonSection;
24
9
  export declare function getLastColumn(page: IDocumentSkeletonPage): IDocumentSkeletonColumn;
25
10
  export declare function getLastLine(page: IDocumentSkeletonPage): IDocumentSkeletonLine | undefined;
26
11
  export declare function getLastLineByColumn(column: IDocumentSkeletonColumn): IDocumentSkeletonLine;
@@ -39,7 +24,7 @@ export declare function getLastNotFullDivideInfo(page: IDocumentSkeletonPage): {
39
24
  } | undefined;
40
25
  export declare function getNextDivide(curLine: IDocumentSkeletonLine, curDivide: IDocumentSkeletonDivide): IDocumentSkeletonDivide | undefined;
41
26
  export declare function getLastRemainingDivide(curLine: IDocumentSkeletonLine): IDocumentSkeletonDivide | undefined;
42
- export declare function getLastSpan(page: IDocumentSkeletonPage): IDocumentSkeletonSpan | undefined;
27
+ export declare function getLastSpan(page: IDocumentSkeletonPage): IDocumentSkeletonGlyph | undefined;
43
28
  export declare function isColumnFull(page: IDocumentSkeletonPage): boolean;
44
29
  export declare function isBlankPage(page: IDocumentSkeletonPage): boolean;
45
30
  export declare function isBlankColumn(column: IDocumentSkeletonColumn): boolean;
@@ -62,12 +47,12 @@ export declare function getCharSpaceConfig(sectionBreakConfig: ISectionBreakConf
62
47
  snapToGrid: BooleanNumber;
63
48
  };
64
49
  export declare function updateBlockIndex(pages: IDocumentSkeletonPage[], start?: number): void;
65
- export declare function spanIterator(pages: IDocumentSkeletonPage[], iteratorFunction: (span: IDocumentSkeletonSpan) => void): void;
50
+ export declare function spanIterator(pages: IDocumentSkeletonPage[], iteratorFunction: (glyph: IDocumentSkeletonGlyph) => void): void;
66
51
  export declare function lineIterator(pages: IDocumentSkeletonPage[], iteratorFunction: (line: IDocumentSkeletonLine) => void): void;
67
52
  export declare function columnIterator(pages: IDocumentSkeletonPage[], iteratorFunction: (column: IDocumentSkeletonColumn) => void): void;
68
53
  export declare function getPositionHorizon(positionH: ObjectPositionH, column: IDocumentSkeletonColumn, page: IDocumentSkeletonPage, objectWidth: number, isPageBreak?: boolean): number | undefined;
69
54
  export declare function getPositionVertical(positionV: ObjectPositionV, page: IDocumentSkeletonPage, lineTop: number, lineHeight: number, objectHeight: number, blockAnchorTop?: number, isPageBreak?: boolean): number | undefined;
70
- export declare function getSpanGroupWidth(divide: IDocumentSkeletonDivide): number;
55
+ export declare function getGlyphGroupWidth(divide: IDocumentSkeletonDivide): number;
71
56
  interface IFontCreateConfig {
72
57
  fontStyle: {
73
58
  fontString: string;
@@ -1,20 +1,5 @@
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
- */
16
- import type { IDocumentSkeletonColumn, IDocumentSkeletonDivide, IDocumentSkeletonLine, IDocumentSkeletonPage, IDocumentSkeletonSection, IDocumentSkeletonSpan } from '../../../basics/i-document-skeleton-cached';
17
- import { PageLayoutType } from '../../../basics/i-document-skeleton-cached';
1
+ import { IDocumentSkeletonColumn, IDocumentSkeletonDivide, IDocumentSkeletonGlyph, IDocumentSkeletonLine, IDocumentSkeletonPage, IDocumentSkeletonSection, PageLayoutType } from '../../basics/i-document-skeleton-cached';
2
+
18
3
  export declare class Liquid {
19
4
  private _translateX;
20
5
  private _translateY;
@@ -28,7 +13,7 @@ export declare class Liquid {
28
13
  translateRestore(): void;
29
14
  translatePagePadding(page: IDocumentSkeletonPage): void;
30
15
  restorePagePadding(page: IDocumentSkeletonPage): void;
31
- translatePage(page: IDocumentSkeletonPage, type?: PageLayoutType, left?: number, top?: number, right?: number, bottom?: number): {
16
+ translatePage(page: IDocumentSkeletonPage, type?: PageLayoutType, left?: number, top?: number, _right?: number, _bottom?: number): {
32
17
  x: number;
33
18
  y: number;
34
19
  };
@@ -48,7 +33,7 @@ export declare class Liquid {
48
33
  x: number;
49
34
  y: number;
50
35
  };
51
- translateSpan(span: IDocumentSkeletonSpan): {
36
+ translateSpan(glyph: IDocumentSkeletonGlyph): {
52
37
  x: number;
53
38
  y: number;
54
39
  };
@@ -1,23 +1,9 @@
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
- */
16
- import type { ITextRange, Nullable } from '@univerjs/core';
17
- import type { INodePosition } from '../../../basics/interfaces';
18
- import type { IPoint } from '../../../basics/vector2';
19
- import type { DocumentSkeleton } from '../doc-skeleton';
20
- import type { IDocumentOffsetConfig } from '../document';
1
+ import { IDocumentOffsetConfig } from '../document';
2
+ import { DocumentSkeleton } from '../layout/doc-skeleton';
3
+ import { IPoint } from '../../../basics/vector2';
4
+ import { INodePosition } from '../../../basics/interfaces';
5
+ import { ITextRange, Nullable } from '@univerjs/core';
6
+
21
7
  export declare enum NodePositionStateType {
22
8
  NORMAL = 0,
23
9
  START = 1,
@@ -29,7 +15,7 @@ export declare enum NodePositionType {
29
15
  column = 2,
30
16
  line = 3,
31
17
  divide = 4,
32
- span = 5
18
+ glyph = 5
33
19
  }
34
20
  export interface ICurrentNodePositionState {
35
21
  page: NodePositionStateType;
@@ -37,7 +23,7 @@ export interface ICurrentNodePositionState {
37
23
  column: NodePositionStateType;
38
24
  line: NodePositionStateType;
39
25
  divide: NodePositionStateType;
40
- span: NodePositionStateType;
26
+ glyph: NodePositionStateType;
41
27
  }
42
28
  export declare const NodePositionMap: {
43
29
  page: number;
@@ -45,7 +31,7 @@ export declare const NodePositionMap: {
45
31
  column: number;
46
32
  line: number;
47
33
  divide: number;
48
- span: number;
34
+ glyph: number;
49
35
  };
50
36
  export declare function compareNodePositionLogic(pos1: INodePosition, pos2: INodePosition): boolean;
51
37
  export declare function compareNodePosition(pos1: INodePosition, pos2: INodePosition): {