@univerjs/docs-ui 0.6.7 → 0.6.8

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.
@@ -1,6 +1,22 @@
1
- import { DocumentDataModel, ICustomRange, IParagraph, Nullable, Disposable } from '@univerjs/core';
1
+ import { DocumentDataModel, ICustomRange, IParagraph, IParagraphRange, Nullable, Disposable } from '@univerjs/core';
2
2
  import { Documents, DocumentSkeleton, IBoundRectNoAngle, IDocumentSkeletonGlyph, IRenderContext, IRenderModule } from '@univerjs/engine-render';
3
3
  import { DocSkeletonManagerService } from '@univerjs/docs';
4
+ export interface ICustomRangeBound {
5
+ customRange: ICustomRange;
6
+ rects: IBoundRectNoAngle[];
7
+ segmentId?: string;
8
+ segmentPageIndex: number;
9
+ }
10
+ export interface IBulletBound {
11
+ rect: IBoundRectNoAngle;
12
+ segmentId?: string;
13
+ segmentPageIndex: number;
14
+ paragraph: IParagraph;
15
+ }
16
+ export interface IParagraphBound {
17
+ rect: IBoundRectNoAngle;
18
+ paragraph: IParagraphRange;
19
+ }
4
20
  export declare const calcDocGlyphPosition: (glyph: IDocumentSkeletonGlyph, documents: Documents, skeleton: DocumentSkeleton, pageIndex?: number) => IBoundRectNoAngle | undefined;
5
21
  interface ICustomRangeActive {
6
22
  range: ICustomRange;
@@ -27,6 +43,7 @@ export declare class DocEventManagerService extends Disposable implements IRende
27
43
  readonly clickBullets$: import('rxjs').Observable<IBulletActive>;
28
44
  private _customRangeDirty;
29
45
  private _bulletDirty;
46
+ private _paragraphDirty;
30
47
  /**
31
48
  * cache the bounding of custom ranges,
32
49
  * it will be updated when the doc-skeleton is recalculated
@@ -37,6 +54,11 @@ export declare class DocEventManagerService extends Disposable implements IRende
37
54
  * it will be updated when the doc-skeleton is recalculated
38
55
  */
39
56
  private _bulletBounds;
57
+ /**
58
+ * cache the bounding of paragraphs,
59
+ * it will be updated when the doc-skeleton is recalculated
60
+ */
61
+ private _paragraphBounds;
40
62
  private get _skeleton();
41
63
  private get _documents();
42
64
  constructor(_context: IRenderContext<DocumentDataModel>, _docSkeletonManagerService: DocSkeletonManagerService);
@@ -50,5 +72,8 @@ export declare class DocEventManagerService extends Disposable implements IRende
50
72
  private _buildBulletBoundsBySegment;
51
73
  private _buildBulletBounds;
52
74
  private _calcActiveBullet;
75
+ private _buildParagraphBoundsBySegment;
76
+ private _buildParagraphBounds;
77
+ get paragraphBounds(): IParagraphBound[];
53
78
  }
54
79
  export {};
@@ -1,5 +1,5 @@
1
1
  import { IParagraph, ISectionBreak, SpacingRule } from '@univerjs/core';
2
- export declare const useCurrentParagraph: () => IParagraph[];
2
+ export declare const useCurrentParagraph: () => import('@univerjs/core').IParagraphRange[];
3
3
  export declare const useCurrentSections: (currentParagraphs: IParagraph[]) => ISectionBreak[];
4
4
  export declare const useFirstParagraphHorizontalAlign: (paragraph: IParagraph[], defaultValue: string) => readonly [string, (v: string) => Promise<boolean>];
5
5
  export declare const useFirstParagraphIndentStart: (paragraph: IParagraph[]) => readonly [number, (v: number) => Promise<boolean>];
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export declare function DocSideMenu(): import("react/jsx-runtime").JSX.Element | null;