@univerjs/docs-ui 0.6.9 → 0.6.10-alpha.0

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 (55) hide show
  1. package/lib/cjs/index.js +28 -22
  2. package/lib/cjs/locale/en-US.js +1 -1
  3. package/lib/cjs/locale/fa-IR.js +1 -1
  4. package/lib/cjs/locale/fr-FR.js +1 -1
  5. package/lib/cjs/locale/ru-RU.js +1 -1
  6. package/lib/cjs/locale/vi-VN.js +1 -1
  7. package/lib/cjs/locale/zh-CN.js +1 -1
  8. package/lib/cjs/locale/zh-TW.js +1 -1
  9. package/lib/es/index.js +8571 -7762
  10. package/lib/es/locale/en-US.js +6 -0
  11. package/lib/es/locale/fa-IR.js +6 -0
  12. package/lib/es/locale/fr-FR.js +6 -0
  13. package/lib/es/locale/ru-RU.js +6 -0
  14. package/lib/es/locale/vi-VN.js +6 -0
  15. package/lib/es/locale/zh-CN.js +6 -0
  16. package/lib/es/locale/zh-TW.js +6 -0
  17. package/lib/index.css +1 -1
  18. package/lib/index.js +8571 -7762
  19. package/lib/locale/en-US.js +6 -0
  20. package/lib/locale/fa-IR.js +6 -0
  21. package/lib/locale/fr-FR.js +6 -0
  22. package/lib/locale/ru-RU.js +6 -0
  23. package/lib/locale/vi-VN.js +6 -0
  24. package/lib/locale/zh-CN.js +6 -0
  25. package/lib/locale/zh-TW.js +6 -0
  26. package/lib/types/commands/commands/break-line.command.d.ts +2 -1
  27. package/lib/types/commands/commands/clipboard.command.d.ts +11 -1
  28. package/lib/types/commands/commands/clipboard.inner.command.d.ts +1 -0
  29. package/lib/types/commands/commands/doc-delete.command.d.ts +1 -0
  30. package/lib/types/commands/commands/doc-horizontal-line.command.d.ts +3 -1
  31. package/lib/types/commands/commands/insert-below/insert-bullet-below.command.d.ts +6 -0
  32. package/lib/types/commands/commands/list.command.d.ts +7 -1
  33. package/lib/types/commands/commands/set-heading.command.d.ts +10 -1
  34. package/lib/types/commands/commands/util.d.ts +2 -0
  35. package/lib/types/components/paragraph-menu/index.d.ts +4 -0
  36. package/lib/types/controllers/menu/menu.d.ts +3 -0
  37. package/lib/types/controllers/menu/paragraph-menu.d.ts +25 -0
  38. package/lib/types/controllers/render-controllers/doc-checklist.render-controller.d.ts +2 -2
  39. package/lib/types/index.d.ts +1 -0
  40. package/lib/types/locale/zh-CN.d.ts +6 -0
  41. package/lib/types/services/clipboard/clipboard.service.d.ts +5 -4
  42. package/lib/types/services/doc-event-manager.service.d.ts +55 -6
  43. package/lib/types/services/doc-paragraph-menu.service.d.ts +22 -0
  44. package/lib/types/services/doc-popup-manager.service.d.ts +5 -3
  45. package/lib/types/services/float-menu.service.d.ts +25 -0
  46. package/lib/umd/index.js +28 -22
  47. package/lib/umd/locale/en-US.js +1 -1
  48. package/lib/umd/locale/fa-IR.js +1 -1
  49. package/lib/umd/locale/fr-FR.js +1 -1
  50. package/lib/umd/locale/ru-RU.js +1 -1
  51. package/lib/umd/locale/vi-VN.js +1 -1
  52. package/lib/umd/locale/zh-CN.js +1 -1
  53. package/lib/umd/locale/zh-TW.js +1 -1
  54. package/package.json +10 -10
  55. package/lib/types/controllers/float-menu.controller.d.ts +0 -16
@@ -79,6 +79,12 @@ const e = {
79
79
  multiSpace: "Multi Space",
80
80
  fixedValue: "Fixed Value(px)"
81
81
  }
82
+ },
83
+ rightClick: {
84
+ bulletList: "Bullet list",
85
+ orderList: "Ordered list",
86
+ checkList: "Task list",
87
+ insertBellow: "Insert below"
82
88
  }
83
89
  };
84
90
  export {
@@ -79,6 +79,12 @@ const e = {
79
79
  multiSpace: "فاصله چندگانه",
80
80
  fixedValue: "مقدار ثابت(px)"
81
81
  }
82
+ },
83
+ rightClick: {
84
+ bulletList: "لیست بدون شماره",
85
+ orderList: "لیست شماره‌دار",
86
+ checkList: "لیست وظیفه",
87
+ insertBellow: "درج در پایین"
82
88
  }
83
89
  };
84
90
  export {
@@ -79,6 +79,12 @@ const e = {
79
79
  multiSpace: "Espacement multiple",
80
80
  fixedValue: "Valeur fixe(px)"
81
81
  }
82
+ },
83
+ rightClick: {
84
+ bulletList: "Liste non ordonnée",
85
+ orderList: "Liste ordonnée",
86
+ checkList: "Liste de tâches",
87
+ insertBellow: "Insérer dans le bas"
82
88
  }
83
89
  };
84
90
  export {
@@ -79,6 +79,12 @@ const e = {
79
79
  multiSpace: "Multi Space",
80
80
  fixedValue: "Fixed Value(px)"
81
81
  }
82
+ },
83
+ rightClick: {
84
+ bulletList: "Неупорядоченный список",
85
+ orderList: "Упорядоченный список",
86
+ checkList: "Список задач",
87
+ insertBellow: "Вставить ниже"
82
88
  }
83
89
  };
84
90
  export {
@@ -79,6 +79,12 @@ const n = {
79
79
  multiSpace: "Multi Space",
80
80
  fixedValue: "Fixed Value(px)"
81
81
  }
82
+ },
83
+ rightClick: {
84
+ bulletList: "Danh sách không thứ tự",
85
+ orderList: "Danh sách có thứ tự",
86
+ checkList: "Danh sách công việc",
87
+ insertBellow: "Chèn dưới"
82
88
  }
83
89
  };
84
90
  export {
@@ -79,6 +79,12 @@ const e = {
79
79
  multiSpace: "多倍行距",
80
80
  fixedValue: "固定值(px)"
81
81
  }
82
+ },
83
+ rightClick: {
84
+ bulletList: "无序列表",
85
+ orderList: "有序列表",
86
+ checkList: "任务列表",
87
+ insertBellow: "在下方插入"
82
88
  }
83
89
  };
84
90
  export {
@@ -79,6 +79,12 @@ const e = {
79
79
  multiSpace: "Multi Space",
80
80
  fixedValue: "Fixed Value(px)"
81
81
  }
82
+ },
83
+ rightClick: {
84
+ bulletList: "無序列表",
85
+ orderList: "有序列表",
86
+ checkList: "任務列表",
87
+ insertBellow: "在下方插入"
82
88
  }
83
89
  };
84
90
  export {
@@ -1,7 +1,8 @@
1
- import { ICommand, IParagraph, IParagraphBorder } from '@univerjs/core';
1
+ import { ICommand, IParagraph, IParagraphBorder, ITextRangeParam } from '@univerjs/core';
2
2
  export declare function generateParagraphs(dataStream: string, prevParagraph?: IParagraph, borderBottom?: IParagraphBorder): IParagraph[];
3
3
  interface IBreakLineCommandParams {
4
4
  horizontalLine?: IParagraphBorder;
5
+ textRange?: ITextRangeParam;
5
6
  }
6
7
  export declare const BreakLineCommand: ICommand<IBreakLineCommandParams>;
7
8
  export {};
@@ -1,6 +1,16 @@
1
- import { IContextService, IMultiCommand } from '@univerjs/core';
1
+ import { IAccessor, IContextService, IMultiCommand, CommandType } from '@univerjs/core';
2
2
  export declare function whenDocOrEditor(contextService: IContextService): boolean;
3
3
  export declare function whenFocusEditor(contextService: IContextService): boolean;
4
4
  export declare const DocCopyCommand: IMultiCommand;
5
+ export declare const DocCopyCurrentParagraphCommand: {
6
+ id: string;
7
+ type: CommandType;
8
+ handler: (accessor: IAccessor) => Promise<boolean>;
9
+ };
5
10
  export declare const DocCutCommand: IMultiCommand;
11
+ export declare const DocCutCurrentParagraphCommand: {
12
+ id: string;
13
+ type: CommandType;
14
+ handler: (accessor: IAccessor) => Promise<boolean>;
15
+ };
6
16
  export declare const DocPasteCommand: IMultiCommand;
@@ -12,5 +12,6 @@ export interface IInnerCutCommandParams {
12
12
  segmentId: string;
13
13
  textRanges: ITextRangeWithStyle[];
14
14
  selections?: ITextRange[];
15
+ rectRanges?: IRectRangeWithStyle[];
15
16
  }
16
17
  export declare const CutContentCommand: ICommand<IInnerCutCommandParams>;
@@ -17,4 +17,5 @@ export declare const RemoveHorizontalLineCommand: ICommand;
17
17
  export declare function getCursorWhenDelete(textRanges: Readonly<Nullable<ITextRangeWithStyle[]>>, rectRanges: readonly IRectRangeWithStyle[]): number;
18
18
  export declare const DeleteLeftCommand: ICommand;
19
19
  export declare const DeleteRightCommand: ICommand;
20
+ export declare const DeleteCurrentParagraphCommand: ICommand;
20
21
  export {};
@@ -1,5 +1,7 @@
1
- import { ICommand } from '@univerjs/core';
1
+ import { ICommand, ITextRangeParam } from '@univerjs/core';
2
2
  interface IHorizontalCommandParams {
3
+ insertRange?: ITextRangeParam;
3
4
  }
4
5
  export declare const HorizontalLineCommand: ICommand<IHorizontalCommandParams>;
6
+ export declare const InsertHorizontalLineBellowCommand: ICommand<IHorizontalCommandParams>;
5
7
  export {};
@@ -0,0 +1,6 @@
1
+ import { ICommand, PresetListType } from '@univerjs/core';
2
+ interface IInsertBulletBelowCommandParams {
3
+ listType: PresetListType;
4
+ }
5
+ export declare const InsertBulletBelowCommand: ICommand<IInsertBulletBelowCommandParams>;
6
+ export {};
@@ -2,10 +2,12 @@ import { ICommand, IParagraph, IParagraphRange, ISectionBreak, PresetListType }
2
2
  import { ITextRangeWithStyle } from '@univerjs/engine-render';
3
3
  interface IListOperationCommandParams {
4
4
  listType: PresetListType;
5
+ docRange?: ITextRangeWithStyle[];
5
6
  }
6
7
  export declare const ListOperationCommand: ICommand<IListOperationCommandParams>;
7
8
  interface IChangeListTypeCommandParams {
8
9
  listType: PresetListType;
10
+ docRange?: ITextRangeWithStyle[];
9
11
  }
10
12
  export declare const ChangeListTypeCommand: ICommand<IChangeListTypeCommandParams>;
11
13
  export declare enum ChangeListNestingLevelType {
@@ -18,6 +20,7 @@ interface IChangeListNestingLevelCommandParams {
18
20
  export declare const ChangeListNestingLevelCommand: ICommand<IChangeListNestingLevelCommandParams>;
19
21
  interface IBulletListCommandParams {
20
22
  value?: PresetListType;
23
+ docRange?: ITextRangeWithStyle[];
21
24
  }
22
25
  export declare const BulletListCommand: ICommand<IBulletListCommandParams>;
23
26
  export declare const CheckListCommand: ICommand<IBulletListCommandParams>;
@@ -36,6 +39,9 @@ interface IQuickListCommandParams {
36
39
  paragraph: IParagraphRange;
37
40
  }
38
41
  export declare const QuickListCommand: ICommand<IQuickListCommandParams>;
39
- export declare function getParagraphsRelative(ranges: ITextRangeWithStyle[], paragraphs: IParagraph[]): IParagraph[];
42
+ export declare const InsertBulletListBellowCommand: ICommand<IQuickListCommandParams>;
43
+ export declare const InsertOrderListBellowCommand: ICommand<IQuickListCommandParams>;
44
+ export declare const InsertCheckListBellowCommand: ICommand<IQuickListCommandParams>;
45
+ export declare function getParagraphsRelative(ranges: ITextRangeWithStyle[], paragraphs: IParagraph[], dataStream: string): IParagraph[];
40
46
  export declare function findNearestSectionBreak(currentIndex: number, sectionBreaks: ISectionBreak[]): ISectionBreak | undefined;
41
47
  export {};
@@ -1,6 +1,7 @@
1
- import { ICommand, NamedStyleType } from '@univerjs/core';
1
+ import { ICommand, ITextRangeParam, NamedStyleType } from '@univerjs/core';
2
2
  export interface ISetParagraphNamedStyleCommandParams {
3
3
  value: NamedStyleType;
4
+ textRanges?: ITextRangeParam[];
4
5
  }
5
6
  export declare const SetParagraphNamedStyleCommand: ICommand<ISetParagraphNamedStyleCommandParams>;
6
7
  export declare const QuickHeadingCommand: ICommand<ISetParagraphNamedStyleCommandParams>;
@@ -11,3 +12,11 @@ export declare const QUICK_HEADING_MAP: {
11
12
  '####': NamedStyleType;
12
13
  '#####': NamedStyleType;
13
14
  };
15
+ export declare const H1HeadingCommand: ICommand<ISetParagraphNamedStyleCommandParams>;
16
+ export declare const H2HeadingCommand: ICommand<ISetParagraphNamedStyleCommandParams>;
17
+ export declare const H3HeadingCommand: ICommand<ISetParagraphNamedStyleCommandParams>;
18
+ export declare const H4HeadingCommand: ICommand<ISetParagraphNamedStyleCommandParams>;
19
+ export declare const H5HeadingCommand: ICommand<ISetParagraphNamedStyleCommandParams>;
20
+ export declare const NormalTextHeadingCommand: ICommand<ISetParagraphNamedStyleCommandParams>;
21
+ export declare const TitleHeadingCommand: ICommand<ISetParagraphNamedStyleCommandParams>;
22
+ export declare const SubtitleHeadingCommand: ICommand<ISetParagraphNamedStyleCommandParams>;
@@ -0,0 +1,2 @@
1
+ import { IAccessor } from '@univerjs/core';
2
+ export declare function getCurrentParagraph(accessor: IAccessor): false | import('@univerjs/core').IParagraphRange;
@@ -0,0 +1,4 @@
1
+ import { IPopup } from '@univerjs/ui';
2
+ export declare const ParagraphMenu: ({ popup }: {
3
+ popup: IPopup;
4
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,7 @@
1
1
  import { IAccessor, PresetListType } from '@univerjs/core';
2
2
  import { IMenuButtonItem, IMenuItem, IMenuSelectorItem } from '@univerjs/ui';
3
+ import { Observable } from 'rxjs';
4
+ export declare function disableMenuWhenNoDocRange(accessor: IAccessor): Observable<boolean>;
3
5
  export declare function BoldMenuItemFactory(accessor: IAccessor): IMenuButtonItem;
4
6
  export declare function ItalicMenuItemFactory(accessor: IAccessor): IMenuButtonItem;
5
7
  export declare function UnderlineMenuItemFactory(accessor: IAccessor): IMenuButtonItem;
@@ -26,3 +28,4 @@ export declare function CheckListMenuItemFactory(accessor: IAccessor): IMenuButt
26
28
  export declare function DocSwitchModeMenuItemFactory(accessor: IAccessor): IMenuButtonItem;
27
29
  export declare function ResetBackgroundColorMenuItemFactory(accessor: IAccessor): IMenuButtonItem;
28
30
  export declare function BackgroundColorSelectorMenuItemFactory(accessor: IAccessor): IMenuSelectorItem<string>;
31
+ export declare function getParagraphStyleAtCursor(accessor: IAccessor): import('@univerjs/core').IParagraph | null | undefined;
@@ -0,0 +1,25 @@
1
+ import { IAccessor, NamedStyleType } from '@univerjs/core';
2
+ import { IMenuItem, IMenuSelectorItem } from '@univerjs/ui';
3
+ export declare const HEADING_ICON_MAP: Record<NamedStyleType, {
4
+ key: string;
5
+ component: React.ComponentType<{
6
+ className: string;
7
+ }>;
8
+ }>;
9
+ export declare const H1HeadingMenuItemFactory: (accessor: IAccessor) => IMenuItem;
10
+ export declare const H2HeadingMenuItemFactory: (accessor: IAccessor) => IMenuItem;
11
+ export declare const H3HeadingMenuItemFactory: (accessor: IAccessor) => IMenuItem;
12
+ export declare const H4HeadingMenuItemFactory: (accessor: IAccessor) => IMenuItem;
13
+ export declare const H5HeadingMenuItemFactory: (accessor: IAccessor) => IMenuItem;
14
+ export declare const NormalTextHeadingMenuItemFactory: (accessor: IAccessor) => IMenuItem;
15
+ export declare const TitleHeadingMenuItemFactory: (accessor: IAccessor) => IMenuItem;
16
+ export declare const SubtitleHeadingMenuItemFactory: (accessor: IAccessor) => IMenuItem;
17
+ export declare const CopyCurrentParagraphMenuItemFactory: (accessor: IAccessor) => IMenuItem;
18
+ export declare const CutCurrentParagraphMenuItemFactory: (accessor: IAccessor) => IMenuItem;
19
+ export declare const DeleteCurrentParagraphMenuItemFactory: (accessor: IAccessor) => IMenuItem;
20
+ export declare const InsertBulletListBellowMenuItemFactory: (accessor: IAccessor) => IMenuItem;
21
+ export declare const InsertOrderListBellowMenuItemFactory: (accessor: IAccessor) => IMenuItem;
22
+ export declare const InsertCheckListBellowMenuItemFactory: (accessor: IAccessor) => IMenuItem;
23
+ export declare const InsertHorizontalLineBellowMenuItemFactory: (accessor: IAccessor) => IMenuItem;
24
+ export declare const INSERT_BELLOW_MENU_ID = "doc.menu.insert-bellow";
25
+ export declare function DocInsertBellowMenuItemFactory(accessor: IAccessor): IMenuSelectorItem<string>;
@@ -1,6 +1,6 @@
1
- import { Disposable, ICommandService, DocumentDataModel } from '@univerjs/core';
2
- import { DocSelectionManagerService, DocSkeletonManagerService } from '@univerjs/docs';
1
+ import { DocumentDataModel, Disposable, ICommandService } from '@univerjs/core';
3
2
  import { IRenderContext, IRenderModule } from '@univerjs/engine-render';
3
+ import { DocSelectionManagerService, DocSkeletonManagerService } from '@univerjs/docs';
4
4
  import { DocEventManagerService } from '../../services/doc-event-manager.service';
5
5
  export declare class DocChecklistRenderController extends Disposable implements IRenderModule {
6
6
  private _context;
@@ -29,6 +29,7 @@ export { DocUIController } from './controllers/doc-ui.controller';
29
29
  export { menuSchema as DocsUIMenuSchema } from './controllers/menu.schema';
30
30
  export { DocBackScrollRenderController } from './controllers/render-controllers/back-scroll.render-controller';
31
31
  export { DocRenderController } from './controllers/render-controllers/doc.render-controller';
32
+ export type { IUniverDocsUIConfig } from './controllers/config.schema';
32
33
  export * from './docs-ui-plugin';
33
34
  export * from './services';
34
35
  export { IDocClipboardService } from './services/clipboard/clipboard.service';
@@ -95,5 +95,11 @@ declare const locale: {
95
95
  fixedValue: string;
96
96
  };
97
97
  };
98
+ rightClick: {
99
+ bulletList: string;
100
+ orderList: string;
101
+ checkList: string;
102
+ insertBellow: string;
103
+ };
98
104
  };
99
105
  export default locale;
@@ -1,4 +1,5 @@
1
1
  import { IDisposable, IDocumentBody, Disposable, ICommandService, ILogService, IUniverInstanceService, SliceBodyType } from '@univerjs/core';
2
+ import { ITextRangeWithStyle } from '@univerjs/engine-render';
2
3
  import { DocSelectionManagerService } from '@univerjs/docs';
3
4
  import { ImageSourceType } from '@univerjs/drawing';
4
5
  import { IClipboardInterfaceService } from '@univerjs/ui';
@@ -14,8 +15,8 @@ export interface IDocClipboardHook {
14
15
  } | null>;
15
16
  }
16
17
  export interface IDocClipboardService {
17
- copy(sliceType?: SliceBodyType): Promise<boolean>;
18
- cut(): Promise<boolean>;
18
+ copy(sliceType?: SliceBodyType, ranges?: ITextRangeWithStyle[]): Promise<boolean>;
19
+ cut(ranges?: ITextRangeWithStyle[]): Promise<boolean>;
19
20
  paste(items: ClipboardItem[]): Promise<boolean>;
20
21
  legacyPaste(options: {
21
22
  html?: string;
@@ -35,8 +36,8 @@ export declare class DocClipboardService extends Disposable implements IDocClipb
35
36
  private _htmlToUDM;
36
37
  private _umdToHtml;
37
38
  constructor(_univerInstanceService: IUniverInstanceService, _logService: ILogService, _commandService: ICommandService, _clipboardInterfaceService: IClipboardInterfaceService, _docSelectionManagerService: DocSelectionManagerService);
38
- copy(sliceType?: SliceBodyType): Promise<boolean>;
39
- cut(): Promise<boolean>;
39
+ copy(sliceType?: SliceBodyType, ranges?: ITextRangeWithStyle[]): Promise<boolean>;
40
+ cut(ranges?: ITextRangeWithStyle[]): Promise<boolean>;
40
41
  paste(items: ClipboardItem[]): Promise<boolean>;
41
42
  legacyPaste(options: {
42
43
  html?: string;
@@ -1,4 +1,4 @@
1
- import { DocumentDataModel, ICustomRange, IParagraph, IParagraphRange, Nullable, Disposable } from '@univerjs/core';
1
+ import { DocumentDataModel, ICustomRange, IParagraph, 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
4
  export interface ICustomRangeBound {
@@ -13,10 +13,6 @@ export interface IBulletBound {
13
13
  segmentPageIndex: number;
14
14
  paragraph: IParagraph;
15
15
  }
16
- export interface IParagraphBound {
17
- rect: IBoundRectNoAngle;
18
- paragraph: IParagraphRange;
19
- }
20
16
  export declare const calcDocGlyphPosition: (glyph: IDocumentSkeletonGlyph, documents: Documents, skeleton: DocumentSkeleton, pageIndex?: number) => IBoundRectNoAngle | undefined;
21
17
  interface ICustomRangeActive {
22
18
  range: ICustomRange;
@@ -30,6 +26,40 @@ interface IBulletActive {
30
26
  segmentPageIndex: number;
31
27
  rect: IBoundRectNoAngle;
32
28
  }
29
+ export interface IMutiPageParagraphBound {
30
+ rect: IBoundRectNoAngle;
31
+ paragraphStart: number;
32
+ paragraphEnd: number;
33
+ startIndex: number;
34
+ rects: IBoundRectNoAngle[];
35
+ pageIndex: number;
36
+ segmentId?: string;
37
+ firstLine: IBoundRectNoAngle;
38
+ }
39
+ export interface ITableParagraphBound {
40
+ rect: IBoundRectNoAngle;
41
+ paragraphStart: number;
42
+ paragraphEnd: number;
43
+ startIndex: number;
44
+ pageIndex: number;
45
+ segmentId?: string;
46
+ rowIndex: number;
47
+ colIndex: number;
48
+ firstLine: IBoundRectNoAngle;
49
+ tableId: string;
50
+ }
51
+ export interface ITableBound {
52
+ rect: IBoundRectNoAngle;
53
+ pageIndex: number;
54
+ tableId: string;
55
+ }
56
+ export interface ITableCellBound {
57
+ rect: IBoundRectNoAngle;
58
+ pageIndex: number;
59
+ rowIndex: number;
60
+ colIndex: number;
61
+ tableId: string;
62
+ }
33
63
  export declare class DocEventManagerService extends Disposable implements IRenderModule {
34
64
  private _context;
35
65
  private readonly _docSkeletonManagerService;
@@ -41,6 +71,18 @@ export declare class DocEventManagerService extends Disposable implements IRende
41
71
  readonly hoverBullet$: import('rxjs').Observable<Nullable<IBulletActive>>;
42
72
  private readonly _clickBullet$;
43
73
  readonly clickBullets$: import('rxjs').Observable<IBulletActive>;
74
+ private readonly _hoverParagraph$;
75
+ readonly hoverParagraph$: import('rxjs').Observable<Nullable<IMutiPageParagraphBound>>;
76
+ readonly hoverParagraphRealTime$: import('rxjs').Observable<Nullable<IMutiPageParagraphBound>>;
77
+ private readonly _hoverParagraphLeft$;
78
+ readonly hoverParagraphLeft$: import('rxjs').Observable<Nullable<IMutiPageParagraphBound>>;
79
+ readonly hoverParagraphLeftRealTime$: import('rxjs').Observable<Nullable<IMutiPageParagraphBound>>;
80
+ private readonly _hoverTableCell$;
81
+ readonly hoverTableCell$: import('rxjs').Observable<Nullable<ITableCellBound>>;
82
+ readonly hoverTableCellRealTime$: import('rxjs').Observable<Nullable<ITableCellBound>>;
83
+ private readonly _hoverTable$;
84
+ readonly hoverTable$: import('rxjs').Observable<Nullable<ITableBound>>;
85
+ readonly hoverTableRealTime$: import('rxjs').Observable<Nullable<ITableBound>>;
44
86
  private _customRangeDirty;
45
87
  private _bulletDirty;
46
88
  private _paragraphDirty;
@@ -59,6 +101,11 @@ export declare class DocEventManagerService extends Disposable implements IRende
59
101
  * it will be updated when the doc-skeleton is recalculated
60
102
  */
61
103
  private _paragraphBounds;
104
+ private _paragraphLeftBounds;
105
+ private _tableParagraphBounds;
106
+ private _segmentParagraphBounds;
107
+ private _tableCellBounds;
108
+ private _tableBounds;
62
109
  private get _skeleton();
63
110
  private get _documents();
64
111
  constructor(_context: IRenderContext<DocumentDataModel>, _docSkeletonManagerService: DocSkeletonManagerService);
@@ -74,6 +121,8 @@ export declare class DocEventManagerService extends Disposable implements IRende
74
121
  private _calcActiveBullet;
75
122
  private _buildParagraphBoundsBySegment;
76
123
  private _buildParagraphBounds;
77
- get paragraphBounds(): IParagraphBound[];
124
+ private _calcActiveParagraph;
125
+ private _calcActiveParagraphLeft;
126
+ get paragraphBounds(): Map<number, IMutiPageParagraphBound>;
78
127
  }
79
128
  export {};
@@ -0,0 +1,22 @@
1
+ import { DocumentDataModel, IParagraphRange, Disposable } from '@univerjs/core';
2
+ import { IRenderContext, IRenderModule } from '@univerjs/engine-render';
3
+ import { IMutiPageParagraphBound, DocEventManagerService } from './doc-event-manager.service';
4
+ import { DocSelectionManagerService, DocSkeletonManagerService } from '@univerjs/docs';
5
+ import { DocCanvasPopManagerService } from './doc-popup-manager.service';
6
+ import { DocFloatMenuService } from './float-menu.service';
7
+ export declare class DocParagraphMenuService extends Disposable implements IRenderModule {
8
+ private _context;
9
+ private _docSelectionManagerService;
10
+ private _docEventManagerService;
11
+ private _docPopupManagerService;
12
+ private _docSkeletonManagerService;
13
+ private _floatMenuService;
14
+ private _paragrahMenu;
15
+ get activeParagraph(): IParagraphRange | undefined;
16
+ constructor(_context: IRenderContext<DocumentDataModel>, _docSelectionManagerService: DocSelectionManagerService, _docEventManagerService: DocEventManagerService, _docPopupManagerService: DocCanvasPopManagerService, _docSkeletonManagerService: DocSkeletonManagerService, _floatMenuService: DocFloatMenuService);
17
+ private _isCursorInActiveParagraph;
18
+ setParagraphMenuActive(active: boolean): void;
19
+ private _init;
20
+ showParagraphMenu(paragraph: IMutiPageParagraphBound): void;
21
+ hideParagraphMenu(force?: boolean): void;
22
+ }
@@ -1,4 +1,4 @@
1
- import { IDisposable, INeedCheckDisposable, ITextRangeParam, Disposable, ICommandService, IUniverInstanceService } from '@univerjs/core';
1
+ import { INeedCheckDisposable, ITextRangeParam, Disposable, ICommandService, IUniverInstanceService } from '@univerjs/core';
2
2
  import { BaseObject, IBoundRectNoAngle, IRender, Scene, IRenderManagerService } from '@univerjs/engine-render';
3
3
  import { IPopup, ICanvasPopupService } from '@univerjs/ui';
4
4
  export declare function transformBound2OffsetBound(originBound: IBoundRectNoAngle, scene: Scene): IBoundRectNoAngle;
@@ -10,7 +10,7 @@ export declare function transformOffset2Bound(offsetX: number, offsetY: number,
10
10
  x: number;
11
11
  y: number;
12
12
  };
13
- export interface IDocCanvasPopup extends Pick<IPopup, 'direction' | 'excludeOutside' | 'componentKey' | 'offset' | 'onClickOutside' | 'hideOnInvisible'> {
13
+ export interface IDocCanvasPopup extends Omit<IPopup, 'anchorRect$' | 'children' | 'unitId' | 'subUnitId' | 'canvasElement'> {
14
14
  mask?: boolean;
15
15
  extraProps?: Record<string, any>;
16
16
  multipleDirection?: IPopup['direction'];
@@ -22,15 +22,17 @@ export declare class DocCanvasPopManagerService extends Disposable {
22
22
  private readonly _univerInstanceService;
23
23
  private readonly _commandService;
24
24
  constructor(_globalPopupManagerService: ICanvasPopupService, _renderManagerService: IRenderManagerService, _univerInstanceService: IUniverInstanceService, _commandService: ICommandService);
25
+ private _createRectPositionObserver;
25
26
  private _createObjectPositionObserver;
26
27
  private _createRangePositionObserver;
28
+ attachPopupToRect(rect: IBoundRectNoAngle, popup: IDocCanvasPopup, unitId: string): INeedCheckDisposable;
27
29
  /**
28
30
  * attach a popup to canvas object
29
31
  * @param targetObject target canvas object
30
32
  * @param popup popup item
31
33
  * @returns disposable
32
34
  */
33
- attachPopupToObject(targetObject: BaseObject, popup: IDocCanvasPopup, unitId: string): IDisposable;
35
+ attachPopupToObject(targetObject: BaseObject, popup: IDocCanvasPopup, unitId: string): INeedCheckDisposable;
34
36
  /**
35
37
  * attach a popup to doc range
36
38
  * @param range doc range
@@ -0,0 +1,25 @@
1
+ import { DocumentDataModel, IDisposable, Nullable, Disposable, IUniverInstanceService } from '@univerjs/core';
2
+ import { IRenderContext, IRenderModule } from '@univerjs/engine-render';
3
+ import { DocSelectionManagerService } from '@univerjs/docs';
4
+ import { ComponentManager } from '@univerjs/ui';
5
+ import { DocCanvasPopManagerService } from './doc-popup-manager.service';
6
+ import { DocSelectionRenderService } from './selection/doc-selection-render.service';
7
+ export declare class DocFloatMenuService extends Disposable implements IRenderModule {
8
+ private _context;
9
+ private readonly _docSelectionManagerService;
10
+ private readonly _docCanvasPopManagerService;
11
+ private readonly _componentManager;
12
+ private readonly _univerInstanceService;
13
+ private readonly _docSelectionRenderService;
14
+ private _floatMenu;
15
+ constructor(_context: IRenderContext<DocumentDataModel>, _docSelectionManagerService: DocSelectionManagerService, _docCanvasPopManagerService: DocCanvasPopManagerService, _componentManager: ComponentManager, _univerInstanceService: IUniverInstanceService, _docSelectionRenderService: DocSelectionRenderService);
16
+ get floatMenu(): Nullable<{
17
+ disposable: IDisposable;
18
+ start: number;
19
+ end: number;
20
+ }>;
21
+ private _registerFloatMenu;
22
+ private _initSelectionChange;
23
+ private _hideFloatMenu;
24
+ private _showFloatMenu;
25
+ }