@univerjs-pro/boards-ui 1.0.0-alpha.8 → 1.0.0-beta.1

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 (184) hide show
  1. package/lib/cjs/facade.js +1 -0
  2. package/lib/cjs/index.js +1 -1
  3. package/lib/cjs/locale/ar-SA.js +1 -1
  4. package/lib/cjs/locale/ca-ES.js +1 -1
  5. package/lib/cjs/locale/de-DE.js +1 -1
  6. package/lib/cjs/locale/en-US.js +1 -1
  7. package/lib/cjs/locale/es-ES.js +1 -1
  8. package/lib/cjs/locale/fa-IR.js +1 -1
  9. package/lib/cjs/locale/fr-FR.js +1 -1
  10. package/lib/cjs/locale/id-ID.js +1 -1
  11. package/lib/cjs/locale/it-IT.js +1 -1
  12. package/lib/cjs/locale/ja-JP.js +1 -1
  13. package/lib/cjs/locale/ko-KR.js +1 -1
  14. package/lib/cjs/locale/pl-PL.js +1 -1
  15. package/lib/cjs/locale/pt-BR.js +1 -1
  16. package/lib/cjs/locale/ru-RU.js +1 -1
  17. package/lib/cjs/locale/sk-SK.js +1 -1
  18. package/lib/cjs/locale/vi-VN.js +1 -1
  19. package/lib/cjs/locale/zh-CN.js +1 -1
  20. package/lib/cjs/locale/zh-HK.js +1 -1
  21. package/lib/cjs/locale/zh-TW.js +1 -1
  22. package/lib/cjs/shape-preset-labels-C4G0G9GI.js +1 -1
  23. package/lib/es/facade.js +1 -0
  24. package/lib/es/index.js +1 -1
  25. package/lib/es/locale/ar-SA.js +1 -1
  26. package/lib/es/locale/ca-ES.js +1 -1
  27. package/lib/es/locale/de-DE.js +1 -1
  28. package/lib/es/locale/en-US.js +1 -1
  29. package/lib/es/locale/es-ES.js +1 -1
  30. package/lib/es/locale/fa-IR.js +1 -1
  31. package/lib/es/locale/fr-FR.js +1 -1
  32. package/lib/es/locale/id-ID.js +1 -1
  33. package/lib/es/locale/it-IT.js +1 -1
  34. package/lib/es/locale/ja-JP.js +1 -1
  35. package/lib/es/locale/ko-KR.js +1 -1
  36. package/lib/es/locale/pl-PL.js +1 -1
  37. package/lib/es/locale/pt-BR.js +1 -1
  38. package/lib/es/locale/ru-RU.js +1 -1
  39. package/lib/es/locale/sk-SK.js +1 -1
  40. package/lib/es/locale/vi-VN.js +1 -1
  41. package/lib/es/locale/zh-CN.js +1 -1
  42. package/lib/es/locale/zh-HK.js +1 -1
  43. package/lib/es/locale/zh-TW.js +1 -1
  44. package/lib/es/shape-preset-labels-092BdVw3.js +1 -1
  45. package/lib/facade.js +1 -0
  46. package/lib/index.css +31 -117
  47. package/lib/index.js +1 -1
  48. package/lib/locale/ar-SA.js +1 -1
  49. package/lib/locale/ca-ES.js +1 -1
  50. package/lib/locale/de-DE.js +1 -1
  51. package/lib/locale/en-US.js +1 -1
  52. package/lib/locale/es-ES.js +1 -1
  53. package/lib/locale/fa-IR.js +1 -1
  54. package/lib/locale/fr-FR.js +1 -1
  55. package/lib/locale/id-ID.js +1 -1
  56. package/lib/locale/it-IT.js +1 -1
  57. package/lib/locale/ja-JP.js +1 -1
  58. package/lib/locale/ko-KR.js +1 -1
  59. package/lib/locale/pl-PL.js +1 -1
  60. package/lib/locale/pt-BR.js +1 -1
  61. package/lib/locale/ru-RU.js +1 -1
  62. package/lib/locale/sk-SK.js +1 -1
  63. package/lib/locale/vi-VN.js +1 -1
  64. package/lib/locale/zh-CN.js +1 -1
  65. package/lib/locale/zh-HK.js +1 -1
  66. package/lib/locale/zh-TW.js +1 -1
  67. package/lib/shape-preset-labels-092BdVw3.js +1 -1
  68. package/lib/types/commands/commands/analyze-board-rendered-layout.command.d.ts +9 -0
  69. package/lib/types/commands/commands/capture-board-screenshot.command.d.ts +7 -0
  70. package/lib/types/commands/operations/board-chart-dialog.operation.d.ts +2 -2
  71. package/lib/types/commands/operations/board-pointer.operation.d.ts +8 -0
  72. package/lib/types/commands/operations/board-selection.operation.d.ts +4 -2
  73. package/lib/types/commands/operations/board-ui-control.operation.d.ts +30 -0
  74. package/lib/types/common/board-shortcuts.d.ts +1 -3
  75. package/lib/types/common/shape-presets.d.ts +4 -0
  76. package/lib/types/config/config.d.ts +29 -6
  77. package/lib/types/const.d.ts +2 -0
  78. package/lib/types/controllers/board-clipboard-shortcut.controller.d.ts +2 -21
  79. package/lib/types/controllers/board-connector-interaction.render-controller.d.ts +9 -3
  80. package/lib/types/controllers/board-element-selection.controller.d.ts +4 -1
  81. package/lib/types/controllers/board-element-transform.controller.d.ts +12 -1
  82. package/lib/types/controllers/board-element-transformer-config.util.d.ts +1 -0
  83. package/lib/types/controllers/board-grouping-shortcut.controller.d.ts +2 -14
  84. package/lib/types/controllers/board-history-shortcut.controller.d.ts +2 -8
  85. package/lib/types/controllers/board-layout-shortcut.controller.d.ts +2 -14
  86. package/lib/types/controllers/board-order-shortcut.controller.d.ts +2 -10
  87. package/lib/types/controllers/board-render.controller.d.ts +6 -3
  88. package/lib/types/controllers/board-selection-overlay.render-controller.d.ts +1 -0
  89. package/lib/types/controllers/board-selection-shortcut.controller.d.ts +2 -14
  90. package/lib/types/controllers/board-settings-shortcut.controller.d.ts +2 -14
  91. package/lib/types/controllers/board-swimlane-lane-shortcut.controller.d.ts +5 -17
  92. package/lib/types/controllers/board-text-editing.render-controller.d.ts +3 -1
  93. package/lib/types/controllers/board-tool-shortcut.controller.d.ts +5 -16
  94. package/lib/types/controllers/board-unit-presence.controller.d.ts +6 -0
  95. package/lib/types/controllers/board-unit-presence.render-controller.d.ts +37 -0
  96. package/lib/types/controllers/board-view-shortcut.controller.d.ts +2 -23
  97. package/lib/types/controllers/board-viewport-bar.render-controller.d.ts +41 -0
  98. package/lib/types/facade/f-board-layout.d.ts +51 -0
  99. package/lib/types/facade/f-board-ui.d.ts +19 -0
  100. package/lib/types/facade/index.d.ts +2 -0
  101. package/lib/types/index.d.ts +15 -4
  102. package/lib/types/locale/en-US.d.ts +1 -35
  103. package/lib/types/plugin.d.ts +6 -0
  104. package/lib/types/render-adapters/board-element-render-adapter.d.ts +13 -3
  105. package/lib/types/render-objects/board-connector-object.d.ts +42 -5
  106. package/lib/types/render-objects/board-element-render-layer.d.ts +65 -0
  107. package/lib/types/render-objects/board-viewport-bar-object.d.ts +33 -0
  108. package/lib/types/services/board-canvas-pop-manager.service.d.ts +3 -1
  109. package/lib/types/services/board-clipboard.service.d.ts +10 -3
  110. package/lib/types/services/board-element-edit.service.d.ts +2 -0
  111. package/lib/types/services/board-embed-integration.service.d.ts +9 -0
  112. package/lib/types/services/board-find.service.d.ts +1 -0
  113. package/lib/types/services/board-image-insert.service.d.ts +3 -1
  114. package/lib/types/services/board-pointer-state.service.d.ts +21 -0
  115. package/lib/types/services/board-screenshot.service.d.ts +38 -0
  116. package/lib/types/services/board-selection.service.d.ts +5 -1
  117. package/lib/types/services/board-settings.service.d.ts +3 -5
  118. package/lib/types/services/board-shortcut-runtime.service.d.ts +32 -0
  119. package/lib/types/services/board-text-editing.service.d.ts +9 -4
  120. package/lib/types/services/board-tool.service.d.ts +0 -1
  121. package/lib/types/services/board-ui-state.service.d.ts +2 -1
  122. package/lib/types/services/board-unit-presence-ui-adapter.service.d.ts +32 -0
  123. package/lib/types/services/board-viewport.service.d.ts +6 -2
  124. package/lib/types/utils/board-alignment-guides.util.d.ts +2 -0
  125. package/lib/types/utils/board-connector-hit-test.util.d.ts +2 -0
  126. package/lib/types/utils/board-connector-marker-anchor.util.d.ts +0 -1
  127. package/lib/types/utils/board-connector-marker.util.d.ts +21 -0
  128. package/lib/types/utils/board-connector-quick-connect.util.d.ts +1 -0
  129. package/lib/types/utils/board-connector-render-bounds.util.d.ts +0 -1
  130. package/lib/types/utils/board-connector-render-geometry.util.d.ts +33 -0
  131. package/lib/types/utils/board-connector-router.util.d.ts +1 -0
  132. package/lib/types/utils/board-connector-routing.util.d.ts +30 -2
  133. package/lib/types/utils/board-container-spatial-index.util.d.ts +2 -0
  134. package/lib/types/utils/board-floating-toolbar-selection.util.d.ts +22 -1
  135. package/lib/types/utils/board-guide-candidates.util.d.ts +13 -0
  136. package/lib/types/utils/board-page-background-image.util.d.ts +15 -0
  137. package/lib/types/utils/board-render-page.util.d.ts +10 -5
  138. package/lib/types/utils/board-selection-geometry.util.d.ts +4 -1
  139. package/lib/types/utils/board-selection-hit-test.util.d.ts +2 -0
  140. package/lib/types/utils/board-selection-interaction.util.d.ts +2 -1
  141. package/lib/types/utils/board-shortcut-preconditions.util.d.ts +4 -2
  142. package/lib/types/utils/board-snap-session.util.d.ts +2 -43
  143. package/lib/types/utils/board-spacing-guides.util.d.ts +2 -0
  144. package/lib/types/utils/board-viewport-bar.util.d.ts +55 -0
  145. package/lib/types/utils/board-viewport.util.d.ts +7 -0
  146. package/lib/types/views/BoardConnectorFloatingToolbar.d.ts +0 -4
  147. package/lib/types/views/BoardConnectorFloatingToolbarControls.d.ts +41 -0
  148. package/lib/types/views/BoardFloatingToolPanel.d.ts +1 -0
  149. package/lib/types/views/BoardPageBackgroundView.d.ts +8 -0
  150. package/lib/types/views/BoardRenamePopup.d.ts +7 -0
  151. package/lib/types/views/BoardSettingsMenu.d.ts +15 -0
  152. package/lib/types/views/BoardShapeFloatingToolbar.d.ts +2 -3
  153. package/lib/types/views/board-shape-floating-toolbar/BoardSwimlaneToolbarMenu.d.ts +12 -0
  154. package/lib/umd/facade.js +1 -0
  155. package/lib/umd/index.js +1 -1
  156. package/lib/umd/locale/ar-SA.js +1 -1
  157. package/lib/umd/locale/ca-ES.js +1 -1
  158. package/lib/umd/locale/de-DE.js +1 -1
  159. package/lib/umd/locale/en-US.js +1 -1
  160. package/lib/umd/locale/es-ES.js +1 -1
  161. package/lib/umd/locale/fa-IR.js +1 -1
  162. package/lib/umd/locale/fr-FR.js +1 -1
  163. package/lib/umd/locale/id-ID.js +1 -1
  164. package/lib/umd/locale/it-IT.js +1 -1
  165. package/lib/umd/locale/ja-JP.js +1 -1
  166. package/lib/umd/locale/ko-KR.js +1 -1
  167. package/lib/umd/locale/pl-PL.js +1 -1
  168. package/lib/umd/locale/pt-BR.js +1 -1
  169. package/lib/umd/locale/ru-RU.js +1 -1
  170. package/lib/umd/locale/sk-SK.js +1 -1
  171. package/lib/umd/locale/vi-VN.js +1 -1
  172. package/lib/umd/locale/zh-CN.js +1 -1
  173. package/lib/umd/locale/zh-HK.js +1 -1
  174. package/lib/umd/locale/zh-TW.js +1 -1
  175. package/package.json +29 -20
  176. package/lib/types/common/settings-actions.d.ts +0 -26
  177. package/lib/types/controllers/board-mermaid-import.controller.d.ts +0 -9
  178. package/lib/types/services/board-mermaid-import.service.d.ts +0 -81
  179. package/lib/types/services/board-settings-action.service.d.ts +0 -21
  180. package/lib/types/utils/board-draft-insert-position.util.d.ts +0 -13
  181. package/lib/types/utils/board-mermaid-preview.util.d.ts +0 -4
  182. package/lib/types/views/BoardContainerRenamePopup.d.ts +0 -6
  183. package/lib/types/views/BoardMermaidImportDialog.d.ts +0 -1
  184. package/lib/types/views/BoardSwimlaneLaneRenamePopup.d.ts +0 -6
@@ -29,15 +29,22 @@ export interface IBoardCopySelectionAsImageOptions {
29
29
  };
30
30
  padding?: number;
31
31
  }
32
+ export declare class BoardClipboardStoreService {
33
+ private _payload;
34
+ private _stylePayload;
35
+ setPayload(payload: IBoardClipboardPayload | null | undefined): void;
36
+ getPayload(): IBoardClipboardPayload | null;
37
+ setStylePayload(payload: IBoardElementStylePayload | null | undefined): void;
38
+ getStylePayload(): IBoardElementStylePayload | null;
39
+ }
32
40
  export declare class BoardClipboardService {
33
41
  private readonly _boardElementService;
34
42
  private readonly _elementInsertService;
35
43
  private readonly _resourceAdapterService;
36
44
  private readonly _commandService;
37
45
  private readonly _undoRedoService;
38
- private _payload;
39
- private _stylePayload;
40
- constructor(_boardElementService: IBoardElementService, _elementInsertService: BoardElementInsertService, _resourceAdapterService: IBoardClipboardResourceAdapterService, _commandService: ICommandService, _undoRedoService: IUndoRedoService);
46
+ private readonly _storeService;
47
+ constructor(_boardElementService: IBoardElementService, _elementInsertService: BoardElementInsertService, _resourceAdapterService: IBoardClipboardResourceAdapterService, _commandService: ICommandService, _undoRedoService: IUndoRedoService, _storeService: BoardClipboardStoreService);
41
48
  setPayload(payload: IBoardClipboardPayload | null | undefined): void;
42
49
  getPayload(): IBoardClipboardPayload | null;
43
50
  setStylePayload(payload: IBoardElementStylePayload | null | undefined): void;
@@ -39,6 +39,7 @@ export interface IBoardElementUpdateSelectedConnectorLabelOptions {
39
39
  selectedIds: string[];
40
40
  focusedId?: string | null;
41
41
  label: IBoardConnectorLabel;
42
+ historyId?: string;
42
43
  }
43
44
  export interface IBoardElementWrapSelectedInContainerOptions {
44
45
  selectedIds: string[];
@@ -80,6 +81,7 @@ export interface IBoardElementUpdateElementsOptions {
80
81
  unitId: string;
81
82
  subUnitId: string;
82
83
  updates: IBoardElementUpdateElementsOperationItem[];
84
+ historyId?: string;
83
85
  forceCaptureElementIds?: readonly string[];
84
86
  membershipMode?: BoardContainerMembershipUpdateMode;
85
87
  }
@@ -1,3 +1,5 @@
1
+ import type { UniverInstanceType } from '@univerjs/core';
2
+ import type { Observable } from 'rxjs';
1
3
  /**
2
4
  * Optional host-side bridge supplied by Embed UI.
3
5
  *
@@ -5,6 +7,13 @@
5
7
  * prevent the host canvas from reclaiming focus for a child-owned pointer event.
6
8
  */
7
9
  export interface IBoardEmbedRuntimeFocusCoordinator {
10
+ readonly runtimeSessionChanged$?: Observable<void>;
11
+ resolveRuntimeScopeByChildUnitId?(childUnitId: string | undefined): {
12
+ embedId: string;
13
+ hostUnitId?: string;
14
+ childUnitId?: string;
15
+ childType?: UniverInstanceType;
16
+ } | undefined;
8
17
  shouldSuppressHostInteraction(unitId: string | undefined, target?: EventTarget | null, event?: Event): boolean;
9
18
  }
10
19
  export declare const IBoardEmbedRuntimeFocusCoordinator: import("@wendellhu/redi").IdentifierDecorator<IBoardEmbedRuntimeFocusCoordinator>;
@@ -18,5 +18,6 @@ export declare class BoardFindService {
18
18
  selectElementResult(boardModel: BoardModel | null | undefined, elementId: string): boolean;
19
19
  selectResult(boardModel: BoardModel | null | undefined, elementId: string): boolean;
20
20
  focusElementResult(boardModel: BoardModel | null | undefined, elementId: string, viewportPoint: IBoardViewportPoint): boolean;
21
+ getElementViewportPoint(boardModel: BoardModel | null | undefined, elementId: string): IBoardViewportPoint | null;
21
22
  focusResult(boardModel: BoardModel | null | undefined, elementId: string, viewportPoint: IBoardViewportPoint): boolean;
22
23
  }
@@ -1,5 +1,6 @@
1
1
  import { IConfigService, IImageIoService, ImageSourceType, IUniverInstanceService } from '@univerjs/core';
2
2
  import { BoardElementInsertService } from './board-element-insert.service';
3
+ import { BoardViewportService } from './board-viewport.service';
3
4
  export interface IBoardImageInsertOptions {
4
5
  point?: {
5
6
  x: number;
@@ -10,8 +11,9 @@ export declare class BoardImageInsertService {
10
11
  private readonly _instanceService;
11
12
  private readonly _elementInsertService;
12
13
  private readonly _configService;
14
+ private readonly _viewportService;
13
15
  private readonly _imageIoService?;
14
- constructor(_instanceService: IUniverInstanceService, _elementInsertService: BoardElementInsertService, _configService: IConfigService, _imageIoService?: IImageIoService | undefined);
16
+ constructor(_instanceService: IUniverInstanceService, _elementInsertService: BoardElementInsertService, _configService: IConfigService, _viewportService: BoardViewportService, _imageIoService?: IImageIoService | undefined);
15
17
  insertImage(file: File, options?: IBoardImageInsertOptions): Promise<boolean>;
16
18
  resolveImageSource(file: File): Promise<{
17
19
  source: string;
@@ -0,0 +1,21 @@
1
+ import type { Observable } from 'rxjs';
2
+ import type { IBoardViewportPoint } from '../utils/board-viewport.util';
3
+ import { Disposable } from '@univerjs/core';
4
+ export interface IBoardPointerStateSnapshot {
5
+ unitId: string;
6
+ subUnitId: string;
7
+ pointer: IBoardViewportPoint | null;
8
+ }
9
+ export interface IBoardPointerStateService {
10
+ readonly state$: Observable<IBoardPointerStateSnapshot | null>;
11
+ getSnapshot(): IBoardPointerStateSnapshot | null;
12
+ setPointer(state: IBoardPointerStateSnapshot): void;
13
+ }
14
+ export declare const IBoardPointerStateService: import("@wendellhu/redi").IdentifierDecorator<IBoardPointerStateService>;
15
+ export declare class BoardPointerStateService extends Disposable implements IBoardPointerStateService {
16
+ private readonly _state$;
17
+ readonly state$: Observable<IBoardPointerStateSnapshot | null>;
18
+ dispose(): void;
19
+ getSnapshot(): IBoardPointerStateSnapshot | null;
20
+ setPointer(state: IBoardPointerStateSnapshot): void;
21
+ }
@@ -0,0 +1,38 @@
1
+ import type { IBoardRect } from '@univerjs-pro/boards';
2
+ import { IBoardElementService } from '@univerjs-pro/boards';
3
+ import { IShapeHostAdapterRegistry } from '@univerjs-pro/engine-shape';
4
+ import { ShapeFormulaService } from '@univerjs-pro/shape-editor';
5
+ import { IRenderManagerService } from '@univerjs/engine-render';
6
+ import { IBoardElementStateService } from './board-element-state.service';
7
+ import { IBoardUIStateService } from './board-ui-state.service';
8
+ export declare const BOARD_SCREENSHOT_MIN_SCALE = 0.1;
9
+ export declare const BOARD_SCREENSHOT_MAX_SCALE = 4;
10
+ export interface IBoardScreenshotOptions {
11
+ bounds: IBoardRect;
12
+ scale?: number;
13
+ }
14
+ export interface IBoardScreenshotResult {
15
+ contentBounds: IBoardRect;
16
+ dataUrl: string;
17
+ height: number;
18
+ scale: number;
19
+ subUnitId: string;
20
+ unitId: string;
21
+ width: number;
22
+ }
23
+ export declare class BoardScreenshotService {
24
+ private readonly _boardElementService;
25
+ private readonly _boardElementStateService;
26
+ private readonly _boardUIStateService;
27
+ private readonly _renderManagerService;
28
+ private readonly _shapeHostAdapterRegistry;
29
+ private readonly _shapeFormulaService;
30
+ constructor(_boardElementService: IBoardElementService, _boardElementStateService: IBoardElementStateService, _boardUIStateService: IBoardUIStateService, _renderManagerService: IRenderManagerService, _shapeHostAdapterRegistry: IShapeHostAdapterRegistry, _shapeFormulaService: ShapeFormulaService);
31
+ capture(unitId: string, subUnitId: string, options: IBoardScreenshotOptions): Promise<IBoardScreenshotResult | false>;
32
+ private _prepareCaptureState;
33
+ private _restoreCaptureState;
34
+ private _waitForElements;
35
+ private _waitForFormulaShapes;
36
+ private _waitForViewport;
37
+ private _waitForStableImage;
38
+ }
@@ -1,6 +1,7 @@
1
1
  import type { BoardModel } from '@univerjs-pro/boards';
2
2
  import type { IBoardSelectionPoint } from '../utils/board-selection-interaction.util';
3
3
  import { IBoardElementService } from '@univerjs-pro/boards';
4
+ import { IRenderManagerService } from '@univerjs/engine-render';
4
5
  import { IBoardElementStateService } from './board-element-state.service';
5
6
  export interface IBoardPointerSelectionOptions {
6
7
  boardModel: BoardModel | null | undefined;
@@ -13,7 +14,10 @@ export interface IBoardPointerSelectionOptions {
13
14
  export declare class BoardSelectionService {
14
15
  private readonly _boardElementService;
15
16
  private readonly _elementStateService;
16
- constructor(_boardElementService: IBoardElementService, _elementStateService: IBoardElementStateService);
17
+ private readonly _renderManagerService;
18
+ constructor(_boardElementService: IBoardElementService, _elementStateService: IBoardElementStateService, _renderManagerService: Pick<IRenderManagerService, 'getRenderUnitById'>);
17
19
  selectByPointerGesture(options: IBoardPointerSelectionOptions): boolean;
20
+ private _createRenderBoundsResolver;
21
+ private _createRenderHitTester;
18
22
  private _resolveInvertedSelection;
19
23
  }
@@ -1,13 +1,11 @@
1
- import type { BoardModel, IBoardSettings } from '@univerjs-pro/boards';
1
+ import type { BoardModel } from '@univerjs-pro/boards';
2
+ import type { IBoardSettings } from '../config/config';
2
3
  import { ICommandService, ThemeService } from '@univerjs/core';
3
- import { IBoardUIStateService } from './board-ui-state.service';
4
4
  export declare class BoardSettingsService {
5
5
  private readonly _commandService;
6
- private readonly _stateService;
7
6
  private readonly _themeService;
8
- constructor(_commandService: ICommandService, _stateService: IBoardUIStateService, _themeService: ThemeService);
7
+ constructor(_commandService: ICommandService, _themeService: ThemeService);
9
8
  setSettings(boardModel: BoardModel | null | undefined, settings: Partial<IBoardSettings>): Promise<boolean>;
10
9
  setTheme(boardModel: BoardModel | null | undefined, themeId: string): Promise<boolean>;
11
10
  syncFollowUniverTheme(boardModel: BoardModel | null | undefined): Promise<boolean>;
12
- syncFromBoardModel(boardModel: BoardModel | null | undefined): void;
13
11
  }
@@ -0,0 +1,32 @@
1
+ import type { BoardModel } from '@univerjs-pro/boards';
2
+ import type { IAccessor, IExecutionOptions } from '@univerjs/core';
3
+ import type { IRenderContext, IRenderModule } from '@univerjs/engine-render';
4
+ import { IBoardElementService } from '@univerjs-pro/boards';
5
+ import { Disposable, ICommandService, IConfigService, IUniverInstanceService } from '@univerjs/core';
6
+ import { BoardClipboardService } from './board-clipboard.service';
7
+ import { BoardElementEditService } from './board-element-edit.service';
8
+ import { IBoardElementStateService } from './board-element-state.service';
9
+ import { BoardSettingsService } from './board-settings.service';
10
+ import { BoardSwimlaneLaneRenameService } from './board-swimlane-lane-rename.service';
11
+ import { BoardTextEditingService } from './board-text-editing.service';
12
+ import { BoardToolService } from './board-tool.service';
13
+ import { IBoardUIStateService } from './board-ui-state.service';
14
+ import { BoardViewportService } from './board-viewport.service';
15
+ export declare class BoardShortcutRuntimeService extends Disposable implements IRenderModule {
16
+ readonly renderContext: IRenderContext<BoardModel>;
17
+ readonly instanceService: IUniverInstanceService;
18
+ readonly commandService: ICommandService;
19
+ readonly configService: IConfigService;
20
+ readonly elementService: IBoardElementService;
21
+ readonly elementStateService: IBoardElementStateService;
22
+ readonly uiStateService: IBoardUIStateService;
23
+ readonly clipboardService: BoardClipboardService;
24
+ readonly elementEditService: BoardElementEditService;
25
+ readonly settingsService: BoardSettingsService;
26
+ readonly swimlaneLaneRenameService: BoardSwimlaneLaneRenameService;
27
+ readonly textEditingService: BoardTextEditingService;
28
+ readonly toolService: BoardToolService;
29
+ readonly viewportService: BoardViewportService;
30
+ constructor(renderContext: IRenderContext<BoardModel>, instanceService: IUniverInstanceService, commandService: ICommandService, configService: IConfigService, elementService: IBoardElementService, elementStateService: IBoardElementStateService, uiStateService: IBoardUIStateService, clipboardService: BoardClipboardService, elementEditService: BoardElementEditService, settingsService: BoardSettingsService, swimlaneLaneRenameService: BoardSwimlaneLaneRenameService, textEditingService: BoardTextEditingService, toolService: BoardToolService, viewportService: BoardViewportService);
31
+ }
32
+ export declare function resolveBoardShortcutRuntime(accessor: IAccessor, options?: IExecutionOptions): BoardShortcutRuntimeService | null;
@@ -1,17 +1,18 @@
1
- import type { IShapeTextEditingParams, IShapeTextHostSizeUpdateParams, IShapeTextUpdateParams } from '@univerjs-pro/shape-editor-ui';
2
1
  import type { Nullable } from '@univerjs/core';
3
2
  import type { Observable } from 'rxjs';
4
3
  import { IBoardElementService } from '@univerjs-pro/boards';
4
+ import * as ShapeEditorUI from '@univerjs-pro/shape-editor-ui';
5
5
  import { Disposable } from '@univerjs/core';
6
6
  import { BoardElementEditService } from './board-element-edit.service';
7
7
  import { BoardShapeIntrinsicSizeService } from './board-shape-intrinsic-size.service';
8
- export interface IBoardTextEditingParams extends IShapeTextEditingParams {
8
+ export interface IBoardTextEditingParams extends ShapeEditorUI.IShapeTextEditingParams {
9
9
  unitId: string;
10
10
  subUnitId: string;
11
11
  shapeId: string;
12
12
  shapeKey: string;
13
13
  visible: boolean;
14
14
  }
15
+ type IBoardTextEditingKeyParams = Pick<IBoardTextEditingParams, 'shapeId' | 'subUnitId' | 'unitId'>;
15
16
  export declare class BoardTextEditingService extends Disposable {
16
17
  private readonly _boardElementService;
17
18
  private readonly _editService;
@@ -23,18 +24,20 @@ export declare class BoardTextEditingService extends Disposable {
23
24
  private _ignoreExternalFocusChangesUntil;
24
25
  private _discardEditingKey;
25
26
  private _externalCompletionPointerDownEvent;
27
+ private _connectorLabelHistory;
26
28
  constructor(_boardElementService: IBoardElementService, _editService: BoardElementEditService, _intrinsicSizeService: BoardShapeIntrinsicSizeService);
27
29
  dispose(): void;
28
30
  setEditing(params: Nullable<IBoardTextEditingParams>): void;
29
31
  setOnSavingEditorData(params: Nullable<boolean>): void;
30
32
  getEditing(): Nullable<IBoardTextEditingParams>;
33
+ markConnectorLabelInsertion(params: IBoardTextEditingKeyParams, historyId: string): void;
31
34
  ignoreExternalFocusChanges(duration?: number): void;
32
35
  shouldIgnoreExternalFocusChanges(): boolean;
33
36
  completeEditing(event?: PointerEvent): void;
34
37
  shouldIgnoreSelectionPointerDown(evt: Event): boolean;
35
38
  cancelEditing(): void;
36
- updateShapeText(params: IShapeTextUpdateParams): boolean;
37
- updatePlainTextShapeHostSize(params: IShapeTextHostSizeUpdateParams): boolean;
39
+ updateShapeText(params: ShapeEditorUI.IShapeTextUpdateParams): boolean;
40
+ updatePlainTextShapeHostSize(params: ShapeEditorUI.IShapeTextHostSizeUpdateParams): boolean;
38
41
  private _updateConnectorLabelText;
39
42
  private _resolveHostSize;
40
43
  private _resolveConnectorLabelHostSize;
@@ -43,3 +46,5 @@ export declare class BoardTextEditingService extends Disposable {
43
46
  private _ensureConnectorLabel;
44
47
  private _shouldDiscardEditorUpdate;
45
48
  }
49
+ export declare function areBoardShapeTextValuesEquivalent(first: unknown, second: unknown): boolean;
50
+ export {};
@@ -71,7 +71,6 @@ export declare class BoardToolService {
71
71
  root: IBoardToolMindMapBlueprintNode;
72
72
  };
73
73
  }): void;
74
- private _beginImport;
75
74
  private _resolveShapePendingInsert;
76
75
  beginShapeInsert(shapeType: BoardShapeType | string, options?: IBoardShapeInsertOptions): void;
77
76
  beginShapeInsertDrag(shapeType: BoardShapeType | string, options?: IBoardShapeInsertOptions): void;
@@ -1,4 +1,5 @@
1
- import type { BoardConnectorRouting, BoardShapeType, IBoardConnectorStyle, IBoardSettings, IBoardSwimlaneData } from '@univerjs-pro/boards';
1
+ import type { BoardConnectorRouting, BoardShapeType, IBoardConnectorStyle, IBoardSwimlaneData } from '@univerjs-pro/boards';
2
+ import type { IBoardSettings } from '../config/config';
2
3
  import type { IBoardInsertRect } from '../utils/board-insert.util';
3
4
  import type { IBoardViewportPoint, IBoardViewportTransform } from '../utils/board-viewport.util';
4
5
  import { BoardToolType } from '@univerjs-pro/boards';
@@ -0,0 +1,32 @@
1
+ import type { ILocalUnitPresenceState, IRemoteUnitPresenceState, IUnitPresenceUIAdapter } from '@univerjs/ui';
2
+ import type { Observable } from 'rxjs';
3
+ import { IUniverInstanceService, RxDisposable, UniverInstanceType } from '@univerjs/core';
4
+ import { IBoardElementStateService } from './board-element-state.service';
5
+ import { IBoardPointerStateService } from './board-pointer-state.service';
6
+ import { IBoardUIStateService } from './board-ui-state.service';
7
+ export declare class BoardUnitPresenceUIAdapter extends RxDisposable implements IUnitPresenceUIAdapter {
8
+ private readonly _boardElementStateService;
9
+ private readonly _boardPointerStateService;
10
+ private readonly _boardUIStateService;
11
+ private readonly _univerInstanceService;
12
+ readonly unitType = UniverInstanceType.UNIVER_BOARD;
13
+ readonly presenceKind = "board-element-selection";
14
+ readonly statusUIPart = "board.top-right-menu.leading";
15
+ private readonly _active$;
16
+ private _activationCount;
17
+ readonly active$: Observable<boolean>;
18
+ readonly localPresence$: Observable<ILocalUnitPresenceState>;
19
+ private readonly _remotePresences;
20
+ constructor(_boardElementStateService: IBoardElementStateService, _boardPointerStateService: IBoardPointerStateService, _boardUIStateService: IBoardUIStateService, _univerInstanceService: IUniverInstanceService);
21
+ dispose(): void;
22
+ activate(): import("@wendellhu/redi").IDisposable;
23
+ isActive(): boolean;
24
+ getLocalPresence(unitId: string): ILocalUnitPresenceState | null;
25
+ getRemotePresences$(unitId: string): Observable<ReadonlyMap<string, IRemoteUnitPresenceState>>;
26
+ setRemotePresence(state: IRemoteUnitPresenceState): void;
27
+ removeRemotePresence(unitId: string, memberId: string): void;
28
+ clearRemotePresences(unitId: string): void;
29
+ private _getShareInterval;
30
+ private _getOrCreateRemotePresenceSubject;
31
+ private _disposeRemotePresenceSubject;
32
+ }
@@ -1,6 +1,7 @@
1
1
  import type { BoardModel } from '@univerjs-pro/boards';
2
- import type { IBoardViewportSize, IBoardViewportZoomConfig } from '../utils/board-viewport.util';
2
+ import type { IBoardViewportPoint, IBoardViewportSize, IBoardViewportZoomConfig } from '../utils/board-viewport.util';
3
3
  import { IBoardElementService } from '@univerjs-pro/boards';
4
+ import { IRenderManagerService } from '@univerjs/engine-render';
4
5
  import { IBoardUIStateService } from './board-ui-state.service';
5
6
  export interface IBoardViewportFitContentOptions {
6
7
  viewportSize: IBoardViewportSize;
@@ -10,6 +11,9 @@ export interface IBoardViewportFitContentOptions {
10
11
  export declare class BoardViewportService {
11
12
  private readonly _boardElementService;
12
13
  private readonly _uiStateService;
13
- constructor(_boardElementService: IBoardElementService, _uiStateService: IBoardUIStateService);
14
+ private readonly _renderManagerService;
15
+ constructor(_boardElementService: IBoardElementService, _uiStateService: IBoardUIStateService, _renderManagerService: Pick<IRenderManagerService, 'getRenderUnitById'>);
14
16
  fitContent(boardModel: BoardModel | null | undefined, options: IBoardViewportFitContentOptions): boolean;
17
+ getViewportCenterPoint(boardModel: BoardModel | null | undefined): IBoardViewportPoint | null;
18
+ private _createRenderBoundsResolver;
15
19
  }
@@ -1,4 +1,5 @@
1
1
  import type { IBoardElementData } from '@univerjs-pro/boards';
2
+ import type { IBoardGuideCandidate } from './board-guide-candidates.util';
2
3
  import type { IBoardSelectionRect } from './board-selection-geometry.util';
3
4
  export interface IBoardAlignmentGuide {
4
5
  position: number;
@@ -15,6 +16,7 @@ export interface IResolveBoardElementAlignmentGuidesOptions {
15
16
  elementData: Record<string, IBoardElementData>;
16
17
  elementOrder: string[];
17
18
  threshold: number;
19
+ candidates?: readonly IBoardGuideCandidate[];
18
20
  }
19
21
  export interface IBoardAlignmentSnap {
20
22
  delta: {
@@ -1,4 +1,5 @@
1
1
  import type { IBoardConnectorData, IBoardConnectorPoint, IBoardElementData } from '@univerjs-pro/boards';
2
+ import type { IBoardConnectorRenderGeometry } from './board-connector-render-geometry.util';
2
3
  import type { BoardConnectorPathCommand } from './board-connector-routing.util';
3
4
  export interface IHitTestBoardConnectorElementOptions {
4
5
  connectorData: IBoardConnectorData;
@@ -7,6 +8,7 @@ export interface IHitTestBoardConnectorElementOptions {
7
8
  connectorId?: string;
8
9
  pathCommands?: readonly BoardConnectorPathCommand[];
9
10
  routePoints?: readonly IBoardConnectorPoint[];
11
+ renderGeometry?: IBoardConnectorRenderGeometry | null;
10
12
  pathTolerance?: number;
11
13
  }
12
14
  export declare const BOARD_CONNECTOR_DEFAULT_HIT_TOLERANCE = 8;
@@ -13,5 +13,4 @@ export interface IResolveBoardConnectorMarkerAnchorsOptions {
13
13
  elementData?: Record<string, IBoardElementData>;
14
14
  endpointGap?: number;
15
15
  }
16
- export declare const BOARD_CONNECTOR_ENDPOINT_VISUAL_GAP = 5;
17
16
  export declare function resolveBoardConnectorMarkerAnchors(_routing: BoardConnectorRouting, points: readonly IBoardConnectorPoint[], pathCommands: readonly BoardConnectorPathCommand[], options?: IResolveBoardConnectorMarkerAnchorsOptions): IBoardConnectorMarkerAnchors | null;
@@ -2,7 +2,28 @@ import type { IBoardConnectorMarker, IBoardConnectorPoint } from '@univerjs-pro/
2
2
  import type { UniverRenderingContext } from '@univerjs/engine-render';
3
3
  export declare const BOARD_CONNECTOR_DEFAULT_MARKER_SIZE = 12;
4
4
  export declare const BOARD_CONNECTOR_DEFAULT_MARKER_COLOR = "#1f2937";
5
+ export declare const BOARD_CONNECTOR_ENDPOINT_VISUAL_GAP = 5;
6
+ export type BoardConnectorMarkerUnderlayPolicy = 'continue-to-tip' | 'stop-at-base';
7
+ export interface IBoardConnectorMarkerGeometry {
8
+ size: number;
9
+ tipOffset: number;
10
+ strokeCutback: number;
11
+ rearExtent: number;
12
+ forwardExtent: number;
13
+ lateralExtent: number;
14
+ strokeOutset: number;
15
+ underlayPolicy: BoardConnectorMarkerUnderlayPolicy;
16
+ }
17
+ export interface IBoardConnectorMarkerPaintBounds {
18
+ left: number;
19
+ top: number;
20
+ width: number;
21
+ height: number;
22
+ }
5
23
  export declare function resolveBoardConnectorMarkerSize(marker: IBoardConnectorMarker, strokeWidth: number): number;
24
+ export declare function resolveBoardConnectorMarkerGeometry(marker: IBoardConnectorMarker | undefined, strokeWidth: number): IBoardConnectorMarkerGeometry;
25
+ export declare function resolveBoardConnectorMarkerPaintBounds(marker: IBoardConnectorMarker | undefined, point: IBoardConnectorPoint, tangent: IBoardConnectorPoint, strokeWidth: number): IBoardConnectorMarkerPaintBounds | null;
26
+ export declare function resolveBoardConnectorMarkerTerminalLength(marker: IBoardConnectorMarker | undefined, strokeWidth: number, endpointGap: number, cornerExit: number): number;
6
27
  export declare function getBoardConnectorMarkerTrim(marker: IBoardConnectorMarker | undefined, strokeWidth: number): number;
7
28
  export declare function hitTestBoardConnectorMarker(marker: IBoardConnectorMarker | undefined, point: IBoardConnectorPoint, markerPoint: IBoardConnectorPoint, tangent: IBoardConnectorPoint, style: {
8
29
  strokeWidth: number;
@@ -10,6 +10,7 @@ export interface ICreateBoardConnectorQuickConnectElementsOptions {
10
10
  style: IBoardConnectorStyle;
11
11
  targetPoint?: IBoardConnectorPoint;
12
12
  shapeType?: ShapeTypeEnum | string;
13
+ sourceShape?: IBoardShapeElement;
13
14
  sourceSize?: {
14
15
  width?: number;
15
16
  height?: number;
@@ -7,5 +7,4 @@ export interface IResolveBoardConnectorRenderBoundsOptions {
7
7
  stabilityHint?: IResolveBoardConnectorRoutePointsOptions['stabilityHint'];
8
8
  }
9
9
  export declare function expandBoardConnectorBounds(bounds: IBoardConnectorRouteBounds, padding: number): IBoardConnectorRouteBounds;
10
- export declare function resolveBoardConnectorMarkerBoundsPadding(connectorData: IBoardConnectorData): number;
11
10
  export declare function resolveBoardConnectorRenderBounds(connectorData: IBoardConnectorData, options?: IResolveBoardConnectorRenderBoundsOptions): IBoardConnectorRouteBounds;
@@ -0,0 +1,33 @@
1
+ import type { IBoardConnectorData, IBoardConnectorPoint, IBoardElementData } from '@univerjs-pro/boards';
2
+ import type { IBoardConnectorMarkerAnchors } from './board-connector-marker-anchor.util';
3
+ import type { IBoardConnectorMarkerGeometry, IBoardConnectorMarkerPaintBounds } from './board-connector-marker.util';
4
+ import type { BoardConnectorPathCommand, IBoardConnectorRouteBounds } from './board-connector-routing.util';
5
+ export interface IBoardConnectorTerminalRenderGeometry {
6
+ anchor: IBoardConnectorMarkerAnchors['start'];
7
+ marker: IBoardConnectorMarkerGeometry;
8
+ markerBounds: IBoardConnectorMarkerPaintBounds | null;
9
+ endpointGap: number;
10
+ strokeTrim: number;
11
+ terminalSegmentLength: number;
12
+ requiredTerminalLength: number;
13
+ }
14
+ export interface IBoardConnectorRenderGeometry {
15
+ routePoints: readonly IBoardConnectorPoint[];
16
+ pathCommands: readonly BoardConnectorPathCommand[];
17
+ strokeRoutePoints: readonly IBoardConnectorPoint[];
18
+ strokePathCommands: readonly BoardConnectorPathCommand[];
19
+ start: IBoardConnectorTerminalRenderGeometry;
20
+ end: IBoardConnectorTerminalRenderGeometry;
21
+ strokePathLength: number;
22
+ dashOffset: number;
23
+ bounds: IBoardConnectorRouteBounds;
24
+ }
25
+ export interface IResolveBoardConnectorRenderGeometryOptions {
26
+ connectorData: IBoardConnectorData;
27
+ routePoints: readonly IBoardConnectorPoint[];
28
+ pathCommands: readonly BoardConnectorPathCommand[];
29
+ elementData?: Record<string, IBoardElementData>;
30
+ fallbackBounds?: IBoardConnectorRouteBounds;
31
+ }
32
+ export declare function resolveBoardConnectorDashOffset(dash: readonly number[] | undefined, pathLength: number, hasStartMarker: boolean, hasEndMarker: boolean): number;
33
+ export declare function resolveBoardConnectorRenderGeometry(options: IResolveBoardConnectorRenderGeometryOptions): IBoardConnectorRenderGeometry | null;
@@ -56,6 +56,7 @@ export interface IResolveBoardOrthogonalObstacleRouteOptions {
56
56
  };
57
57
  fallbackRoute?: () => IBoardConnectorPoint[];
58
58
  }
59
+ export declare function createBoardConnectorRoutingObstaclesForElementIds(elementData: Record<string, IBoardElementData>, elementIds: Iterable<string>, clearance?: number): IBoardRoutingObstacle[];
59
60
  export declare function createBoardConnectorRoutingObstacleIndex(elementData: Record<string, IBoardElementData> | undefined, options?: ICreateBoardConnectorRoutingObstaclesOptions): IBoardRoutingObstacleIndex;
60
61
  export declare function isBoardRoutingPointInsideObstacle(point: IBoardConnectorPoint, obstacle: IBoardRoutingObstacle): boolean;
61
62
  export declare function doesBoardRoutingSegmentIntersectObstacle(segment: IBoardRoutingSegment, obstacle: IBoardRoutingObstacle): boolean;
@@ -1,5 +1,5 @@
1
- import type { IBoardConnectorData, IBoardConnectorEndpoint, IBoardConnectorPoint, IBoardElementData, IBoardElementTransform } from '@univerjs-pro/boards';
2
- import type { IBoardRoutingSegment } from './board-connector-router.util';
1
+ import type { IBoardConnectorData, IBoardConnectorElement, IBoardConnectorEndpoint, IBoardConnectorMarker, IBoardConnectorPoint, IBoardElementData, IBoardElementTransform } from '@univerjs-pro/boards';
2
+ import type { IBoardRoutingObstacleIndex, IBoardRoutingSegment } from './board-connector-router.util';
3
3
  export interface IBoardConnectorRouteBounds {
4
4
  left: number;
5
5
  top: number;
@@ -44,13 +44,37 @@ export interface IResolveBoardConnectorRoutePointsOptions extends IResolveBoardC
44
44
  tolerance?: number;
45
45
  };
46
46
  resolvedRoutePoints?: readonly IBoardConnectorPoint[];
47
+ routingCache?: BoardConnectorRoutingCache;
48
+ connectorCrossingPenaltyEnabled?: boolean;
47
49
  }
48
50
  export declare const BOARD_CONNECTOR_MIN_BOUNDS_SIZE = 1;
51
+ export declare const BOARD_CONNECTOR_ROUNDED_CORNER_RADIUS = 16;
52
+ type IBoardConnectorElementData = IBoardElementData & {
53
+ element: IBoardConnectorElement;
54
+ };
49
55
  export declare function resolveBoardConnectorEndpointPoint(endpoint: IBoardConnectorEndpoint, options?: IResolveBoardConnectorEndpointPointOptions): IBoardConnectorPoint | null;
50
56
  export declare function resolveBoardConnectorEndpoint(endpoint: IBoardConnectorEndpoint, options?: IResolveBoardConnectorEndpointOptions): IBoardConnectorResolvedEndpoint | null;
51
57
  export declare function isBoardConnectorTerminalSegmentAlignedWithEndpointNormal(segment: IBoardRoutingSegment, endpoint: IBoardConnectorResolvedEndpoint, terminal: 'start' | 'end'): boolean;
52
58
  export declare function isBoardConnectorRouteAlignedWithEndpoints(connectorData: IBoardConnectorData, routePoints: readonly IBoardConnectorPoint[] | undefined, options?: IResolveBoardConnectorEndpointPointOptions): routePoints is readonly IBoardConnectorPoint[];
53
59
  export declare function normalizeBoardConnectorEndpointManualRoutePoints(connectorData: IBoardConnectorData, options?: IResolveBoardConnectorEndpointOptions): IBoardConnectorData;
60
+ export declare class BoardConnectorRoutingCache {
61
+ private _elementData?;
62
+ private readonly _connectorSceneKeyById;
63
+ private readonly _obstacleKeyByElementId;
64
+ private readonly _obstacleIndexesByExclusion;
65
+ private readonly _routePointsByConnectorId;
66
+ private readonly _crossingRoutePointsByConnectorId;
67
+ invalidate(elementData?: Record<string, IBoardElementData>, invalidatedElementIds?: Iterable<string>): string[];
68
+ private _reset;
69
+ private _syncConnectorSnapshot;
70
+ private _syncObstacleSnapshot;
71
+ private _invalidateDependentRoutes;
72
+ getObstacleIndex(elementData: Record<string, IBoardElementData> | undefined, excludeElementIds: readonly string[]): IBoardRoutingObstacleIndex;
73
+ resolveRoutePoints(connectorData: IBoardConnectorData, options?: IResolveBoardConnectorRoutePointsOptions): IBoardConnectorPoint[];
74
+ private _resolveRouteDependency;
75
+ resolveCrossingRoutePoints(item: IBoardConnectorElementData, elementData: Record<string, IBoardElementData>): IBoardConnectorPoint[];
76
+ }
77
+ export declare function resolveBoardConnectorTerminalPadding(marker: IBoardConnectorMarker | undefined, strokeWidth: number, rounded: boolean): number;
54
78
  export declare function resolveBoardConnectorRoutePoints(connectorData: IBoardConnectorData, options?: IResolveBoardConnectorRoutePointsOptions): IBoardConnectorPoint[];
55
79
  export declare function resolveBoardConnectorPathCommands(connectorData: IBoardConnectorData, options?: IResolveBoardConnectorRoutePointsOptions): BoardConnectorPathCommand[];
56
80
  export declare function resolveBoardConnectorPathBounds(commands: readonly BoardConnectorPathCommand[], fallbackTransform?: IBoardElementTransform): IBoardConnectorRouteBounds;
@@ -63,7 +87,11 @@ export declare function resolveBoardConnectorPathBounds(commands: readonly Board
63
87
  */
64
88
  export declare function resolveBoardConnectorPathGeometry(commands: readonly BoardConnectorPathCommand[]): IBoardConnectorPathGeometry | null;
65
89
  export declare function trimBoardConnectorPathCommands(commands: readonly BoardConnectorPathCommand[], startTrim: number, endTrim: number): BoardConnectorPathCommand[];
90
+ export declare function resolveBoardConnectorPathLength(commands: readonly BoardConnectorPathCommand[]): number;
91
+ export declare function resolveBoardConnectorRoundedRoutePathLength(points: readonly IBoardConnectorPoint[], cornerRadius?: number): number;
66
92
  export declare function hitTestBoardConnectorPath(point: IBoardConnectorPoint, commands: readonly BoardConnectorPathCommand[], tolerance: number): boolean;
67
93
  export declare function resolveBoardConnectorRouteBounds(points: readonly IBoardConnectorPoint[], fallbackTransform?: IBoardElementTransform): IBoardConnectorRouteBounds;
68
94
  export declare function distanceToBoardConnectorSegment(point: IBoardConnectorPoint, start: IBoardConnectorPoint, end: IBoardConnectorPoint): number;
95
+ export declare function resolveBoardConnectorPolylineLength(points: readonly IBoardConnectorPoint[]): number;
69
96
  export declare function trimBoardConnectorRoute(points: readonly IBoardConnectorPoint[], startTrim: number, endTrim: number): IBoardConnectorPoint[];
97
+ export {};
@@ -1,4 +1,5 @@
1
1
  import type { IBoardElementData, IBoardRect } from '@univerjs-pro/boards';
2
+ import { resolveBoardElementBounds } from './board-selection-geometry.util';
2
3
  export interface IBoardPoint {
3
4
  x: number;
4
5
  y: number;
@@ -7,6 +8,7 @@ export interface ICreateBoardElementSpatialIndexOptions {
7
8
  unitId: string;
8
9
  subUnitId: string;
9
10
  elementData: Record<string, IBoardElementData>;
11
+ resolveElementBounds?: Parameters<typeof resolveBoardElementBounds>[2];
10
12
  }
11
13
  export interface IBoardElementSpatialIndex {
12
14
  queryIntersecting(bounds: IBoardRect): string[];
@@ -1,5 +1,8 @@
1
- import type { BoardConnectorRouting, IBoardConnectorStyle, IBoardElementData } from '@univerjs-pro/boards';
1
+ import type { BoardConnectorRouting, IBoardConnectorStyle, IBoardContainerElement, IBoardElementData, IBoardSwimlaneLane, IBoardTextStyle } from '@univerjs-pro/boards';
2
2
  import type { IShapeData } from '@univerjs-pro/engine-shape';
3
+ import type { buildShapeTextDataUpdate } from '@univerjs-pro/shape-editor-ui';
4
+ import type { ITextStyle } from '@univerjs/core';
5
+ import { HorizontalAlign, VerticalAlign } from '@univerjs/core';
3
6
  export type BoardFloatingToolbarOwner = 'common' | 'connector' | 'mind-map' | 'none' | 'shape' | 'table';
4
7
  export interface IBoardFloatingToolbarSelection {
5
8
  elements: IBoardElementData[];
@@ -13,6 +16,24 @@ export interface IResolveBoardFloatingToolbarSelectionOptions {
13
16
  selectedIds: readonly string[];
14
17
  getElementById: (unitId: string, subUnitId: string, elementId: string) => IBoardElementData | null | undefined;
15
18
  }
19
+ export interface IBoardSwimlaneLaneTypographyTarget {
20
+ container: IBoardContainerElement;
21
+ lane: IBoardSwimlaneLane;
22
+ }
23
+ export declare function boardTextStyleToToolbarTextStyle(style: IBoardTextStyle | undefined, fallbackFontSize: number): ITextStyle;
24
+ export declare function getContainerTitleStyle(element: IBoardContainerElement | undefined): IBoardTextStyle | undefined;
25
+ export declare function getSwimlaneLaneTypographyTarget(element: IBoardContainerElement | undefined, laneId: string | undefined): IBoardSwimlaneLaneTypographyTarget | null;
26
+ export declare function getSwimlaneLaneTitleTextModel(target: IBoardSwimlaneLaneTypographyTarget | null): {
27
+ ha?: HorizontalAlign;
28
+ va?: VerticalAlign;
29
+ } | null;
30
+ export declare function getSwimlaneContainerTitleTextModel(element: IBoardContainerElement | undefined): {
31
+ ha?: HorizontalAlign;
32
+ va?: VerticalAlign;
33
+ } | null;
34
+ export declare function isUnfocusedSwimlaneTypographyTarget(element: IBoardContainerElement, laneTarget: IBoardSwimlaneLaneTypographyTarget | null): boolean;
35
+ export declare function buildTitleStyleUpdate(currentStyle: IBoardTextStyle | undefined, params: Parameters<typeof buildShapeTextDataUpdate>[1]): IBoardTextStyle;
36
+ export declare function buildContainerTitleStyleUpdate(element: IBoardContainerElement, params: Parameters<typeof buildShapeTextDataUpdate>[1]): IBoardTextStyle;
16
37
  /**
17
38
  * Resolves one owner for the selection-level floating toolbar.
18
39
  *
@@ -0,0 +1,13 @@
1
+ import type { IBoardElementData } from '@univerjs-pro/boards';
2
+ import type { IBoardSelectionRect } from './board-selection-geometry.util';
3
+ export interface IBoardGuideCandidate {
4
+ elementId: string;
5
+ rect: IBoardSelectionRect;
6
+ }
7
+ export interface ICreateBoardGuideCandidatesOptions {
8
+ activeIds: readonly string[];
9
+ bounds?: IBoardSelectionRect;
10
+ elementData: Record<string, IBoardElementData>;
11
+ elementOrder: readonly string[];
12
+ }
13
+ export declare function createBoardGuideCandidates(options: ICreateBoardGuideCandidatesOptions): IBoardGuideCandidate[];
@@ -0,0 +1,15 @@
1
+ import type { BoardBackgroundImageFit } from '@univerjs-pro/boards';
2
+ export interface IBoardPageBackgroundImageSource {
3
+ fit: BoardBackgroundImageFit;
4
+ image: HTMLImageElement;
5
+ }
6
+ export interface IDrawBoardPageBackgroundImageOptions {
7
+ cropLeft?: number;
8
+ cropTop?: number;
9
+ frameHeight: number;
10
+ frameWidth: number;
11
+ scaleX?: number;
12
+ scaleY?: number;
13
+ }
14
+ export declare function getBoardPageBackgroundImageSource(unitId: string, subUnitId: string, root?: ParentNode): IBoardPageBackgroundImageSource | null;
15
+ export declare function drawBoardPageBackgroundImage(context: CanvasRenderingContext2D, source: IBoardPageBackgroundImageSource, options: IDrawBoardPageBackgroundImageOptions): void;