@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.
- package/lib/cjs/facade.js +1 -0
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/locale/ar-SA.js +1 -1
- package/lib/cjs/locale/ca-ES.js +1 -1
- package/lib/cjs/locale/de-DE.js +1 -1
- package/lib/cjs/locale/en-US.js +1 -1
- package/lib/cjs/locale/es-ES.js +1 -1
- package/lib/cjs/locale/fa-IR.js +1 -1
- package/lib/cjs/locale/fr-FR.js +1 -1
- package/lib/cjs/locale/id-ID.js +1 -1
- package/lib/cjs/locale/it-IT.js +1 -1
- package/lib/cjs/locale/ja-JP.js +1 -1
- package/lib/cjs/locale/ko-KR.js +1 -1
- package/lib/cjs/locale/pl-PL.js +1 -1
- package/lib/cjs/locale/pt-BR.js +1 -1
- package/lib/cjs/locale/ru-RU.js +1 -1
- package/lib/cjs/locale/sk-SK.js +1 -1
- package/lib/cjs/locale/vi-VN.js +1 -1
- package/lib/cjs/locale/zh-CN.js +1 -1
- package/lib/cjs/locale/zh-HK.js +1 -1
- package/lib/cjs/locale/zh-TW.js +1 -1
- package/lib/cjs/shape-preset-labels-C4G0G9GI.js +1 -1
- package/lib/es/facade.js +1 -0
- package/lib/es/index.js +1 -1
- package/lib/es/locale/ar-SA.js +1 -1
- package/lib/es/locale/ca-ES.js +1 -1
- package/lib/es/locale/de-DE.js +1 -1
- package/lib/es/locale/en-US.js +1 -1
- package/lib/es/locale/es-ES.js +1 -1
- package/lib/es/locale/fa-IR.js +1 -1
- package/lib/es/locale/fr-FR.js +1 -1
- package/lib/es/locale/id-ID.js +1 -1
- package/lib/es/locale/it-IT.js +1 -1
- package/lib/es/locale/ja-JP.js +1 -1
- package/lib/es/locale/ko-KR.js +1 -1
- package/lib/es/locale/pl-PL.js +1 -1
- package/lib/es/locale/pt-BR.js +1 -1
- package/lib/es/locale/ru-RU.js +1 -1
- package/lib/es/locale/sk-SK.js +1 -1
- package/lib/es/locale/vi-VN.js +1 -1
- package/lib/es/locale/zh-CN.js +1 -1
- package/lib/es/locale/zh-HK.js +1 -1
- package/lib/es/locale/zh-TW.js +1 -1
- package/lib/es/shape-preset-labels-092BdVw3.js +1 -1
- package/lib/facade.js +1 -0
- package/lib/index.css +31 -117
- package/lib/index.js +1 -1
- package/lib/locale/ar-SA.js +1 -1
- package/lib/locale/ca-ES.js +1 -1
- package/lib/locale/de-DE.js +1 -1
- package/lib/locale/en-US.js +1 -1
- package/lib/locale/es-ES.js +1 -1
- package/lib/locale/fa-IR.js +1 -1
- package/lib/locale/fr-FR.js +1 -1
- package/lib/locale/id-ID.js +1 -1
- package/lib/locale/it-IT.js +1 -1
- package/lib/locale/ja-JP.js +1 -1
- package/lib/locale/ko-KR.js +1 -1
- package/lib/locale/pl-PL.js +1 -1
- package/lib/locale/pt-BR.js +1 -1
- package/lib/locale/ru-RU.js +1 -1
- package/lib/locale/sk-SK.js +1 -1
- package/lib/locale/vi-VN.js +1 -1
- package/lib/locale/zh-CN.js +1 -1
- package/lib/locale/zh-HK.js +1 -1
- package/lib/locale/zh-TW.js +1 -1
- package/lib/shape-preset-labels-092BdVw3.js +1 -1
- package/lib/types/commands/commands/analyze-board-rendered-layout.command.d.ts +9 -0
- package/lib/types/commands/commands/capture-board-screenshot.command.d.ts +7 -0
- package/lib/types/commands/operations/board-chart-dialog.operation.d.ts +2 -2
- package/lib/types/commands/operations/board-pointer.operation.d.ts +8 -0
- package/lib/types/commands/operations/board-selection.operation.d.ts +4 -2
- package/lib/types/commands/operations/board-ui-control.operation.d.ts +30 -0
- package/lib/types/common/board-shortcuts.d.ts +1 -3
- package/lib/types/common/shape-presets.d.ts +4 -0
- package/lib/types/config/config.d.ts +29 -6
- package/lib/types/const.d.ts +2 -0
- package/lib/types/controllers/board-clipboard-shortcut.controller.d.ts +2 -21
- package/lib/types/controllers/board-connector-interaction.render-controller.d.ts +9 -3
- package/lib/types/controllers/board-element-selection.controller.d.ts +4 -1
- package/lib/types/controllers/board-element-transform.controller.d.ts +12 -1
- package/lib/types/controllers/board-element-transformer-config.util.d.ts +1 -0
- package/lib/types/controllers/board-grouping-shortcut.controller.d.ts +2 -14
- package/lib/types/controllers/board-history-shortcut.controller.d.ts +2 -8
- package/lib/types/controllers/board-layout-shortcut.controller.d.ts +2 -14
- package/lib/types/controllers/board-order-shortcut.controller.d.ts +2 -10
- package/lib/types/controllers/board-render.controller.d.ts +6 -3
- package/lib/types/controllers/board-selection-overlay.render-controller.d.ts +1 -0
- package/lib/types/controllers/board-selection-shortcut.controller.d.ts +2 -14
- package/lib/types/controllers/board-settings-shortcut.controller.d.ts +2 -14
- package/lib/types/controllers/board-swimlane-lane-shortcut.controller.d.ts +5 -17
- package/lib/types/controllers/board-text-editing.render-controller.d.ts +3 -1
- package/lib/types/controllers/board-tool-shortcut.controller.d.ts +5 -16
- package/lib/types/controllers/board-unit-presence.controller.d.ts +6 -0
- package/lib/types/controllers/board-unit-presence.render-controller.d.ts +37 -0
- package/lib/types/controllers/board-view-shortcut.controller.d.ts +2 -23
- package/lib/types/controllers/board-viewport-bar.render-controller.d.ts +41 -0
- package/lib/types/facade/f-board-layout.d.ts +51 -0
- package/lib/types/facade/f-board-ui.d.ts +19 -0
- package/lib/types/facade/index.d.ts +2 -0
- package/lib/types/index.d.ts +15 -4
- package/lib/types/locale/en-US.d.ts +1 -35
- package/lib/types/plugin.d.ts +6 -0
- package/lib/types/render-adapters/board-element-render-adapter.d.ts +13 -3
- package/lib/types/render-objects/board-connector-object.d.ts +42 -5
- package/lib/types/render-objects/board-element-render-layer.d.ts +65 -0
- package/lib/types/render-objects/board-viewport-bar-object.d.ts +33 -0
- package/lib/types/services/board-canvas-pop-manager.service.d.ts +3 -1
- package/lib/types/services/board-clipboard.service.d.ts +10 -3
- package/lib/types/services/board-element-edit.service.d.ts +2 -0
- package/lib/types/services/board-embed-integration.service.d.ts +9 -0
- package/lib/types/services/board-find.service.d.ts +1 -0
- package/lib/types/services/board-image-insert.service.d.ts +3 -1
- package/lib/types/services/board-pointer-state.service.d.ts +21 -0
- package/lib/types/services/board-screenshot.service.d.ts +38 -0
- package/lib/types/services/board-selection.service.d.ts +5 -1
- package/lib/types/services/board-settings.service.d.ts +3 -5
- package/lib/types/services/board-shortcut-runtime.service.d.ts +32 -0
- package/lib/types/services/board-text-editing.service.d.ts +9 -4
- package/lib/types/services/board-tool.service.d.ts +0 -1
- package/lib/types/services/board-ui-state.service.d.ts +2 -1
- package/lib/types/services/board-unit-presence-ui-adapter.service.d.ts +32 -0
- package/lib/types/services/board-viewport.service.d.ts +6 -2
- package/lib/types/utils/board-alignment-guides.util.d.ts +2 -0
- package/lib/types/utils/board-connector-hit-test.util.d.ts +2 -0
- package/lib/types/utils/board-connector-marker-anchor.util.d.ts +0 -1
- package/lib/types/utils/board-connector-marker.util.d.ts +21 -0
- package/lib/types/utils/board-connector-quick-connect.util.d.ts +1 -0
- package/lib/types/utils/board-connector-render-bounds.util.d.ts +0 -1
- package/lib/types/utils/board-connector-render-geometry.util.d.ts +33 -0
- package/lib/types/utils/board-connector-router.util.d.ts +1 -0
- package/lib/types/utils/board-connector-routing.util.d.ts +30 -2
- package/lib/types/utils/board-container-spatial-index.util.d.ts +2 -0
- package/lib/types/utils/board-floating-toolbar-selection.util.d.ts +22 -1
- package/lib/types/utils/board-guide-candidates.util.d.ts +13 -0
- package/lib/types/utils/board-page-background-image.util.d.ts +15 -0
- package/lib/types/utils/board-render-page.util.d.ts +10 -5
- package/lib/types/utils/board-selection-geometry.util.d.ts +4 -1
- package/lib/types/utils/board-selection-hit-test.util.d.ts +2 -0
- package/lib/types/utils/board-selection-interaction.util.d.ts +2 -1
- package/lib/types/utils/board-shortcut-preconditions.util.d.ts +4 -2
- package/lib/types/utils/board-snap-session.util.d.ts +2 -43
- package/lib/types/utils/board-spacing-guides.util.d.ts +2 -0
- package/lib/types/utils/board-viewport-bar.util.d.ts +55 -0
- package/lib/types/utils/board-viewport.util.d.ts +7 -0
- package/lib/types/views/BoardConnectorFloatingToolbar.d.ts +0 -4
- package/lib/types/views/BoardConnectorFloatingToolbarControls.d.ts +41 -0
- package/lib/types/views/BoardFloatingToolPanel.d.ts +1 -0
- package/lib/types/views/BoardPageBackgroundView.d.ts +8 -0
- package/lib/types/views/BoardRenamePopup.d.ts +7 -0
- package/lib/types/views/BoardSettingsMenu.d.ts +15 -0
- package/lib/types/views/BoardShapeFloatingToolbar.d.ts +2 -3
- package/lib/types/views/board-shape-floating-toolbar/BoardSwimlaneToolbarMenu.d.ts +12 -0
- package/lib/umd/facade.js +1 -0
- package/lib/umd/index.js +1 -1
- package/lib/umd/locale/ar-SA.js +1 -1
- package/lib/umd/locale/ca-ES.js +1 -1
- package/lib/umd/locale/de-DE.js +1 -1
- package/lib/umd/locale/en-US.js +1 -1
- package/lib/umd/locale/es-ES.js +1 -1
- package/lib/umd/locale/fa-IR.js +1 -1
- package/lib/umd/locale/fr-FR.js +1 -1
- package/lib/umd/locale/id-ID.js +1 -1
- package/lib/umd/locale/it-IT.js +1 -1
- package/lib/umd/locale/ja-JP.js +1 -1
- package/lib/umd/locale/ko-KR.js +1 -1
- package/lib/umd/locale/pl-PL.js +1 -1
- package/lib/umd/locale/pt-BR.js +1 -1
- package/lib/umd/locale/ru-RU.js +1 -1
- package/lib/umd/locale/sk-SK.js +1 -1
- package/lib/umd/locale/vi-VN.js +1 -1
- package/lib/umd/locale/zh-CN.js +1 -1
- package/lib/umd/locale/zh-HK.js +1 -1
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +29 -20
- package/lib/types/common/settings-actions.d.ts +0 -26
- package/lib/types/controllers/board-mermaid-import.controller.d.ts +0 -9
- package/lib/types/services/board-mermaid-import.service.d.ts +0 -81
- package/lib/types/services/board-settings-action.service.d.ts +0 -21
- package/lib/types/utils/board-draft-insert-position.util.d.ts +0 -13
- package/lib/types/utils/board-mermaid-preview.util.d.ts +0 -4
- package/lib/types/views/BoardContainerRenamePopup.d.ts +0 -6
- package/lib/types/views/BoardMermaidImportDialog.d.ts +0 -1
- package/lib/types/views/BoardSwimlaneLaneRenamePopup.d.ts +0 -6
|
@@ -20,9 +20,11 @@ export declare class BoardTextEditingRenderController extends RxDisposable imple
|
|
|
20
20
|
private readonly _contextService;
|
|
21
21
|
private readonly _inkStateService;
|
|
22
22
|
private _attachScheduled;
|
|
23
|
+
private _attachAllObjectDoubleClicks;
|
|
23
24
|
private _lastEditingShapeKey;
|
|
24
25
|
private _ignoreFocusChangesUntil;
|
|
25
|
-
private
|
|
26
|
+
private _objectDblclickDisposablesByElementId;
|
|
27
|
+
private _pendingObjectDoubleClickElementIds;
|
|
26
28
|
constructor(_renderContext: IRenderContext<UnitModel>, _instanceService: IUniverInstanceService, _boardElementService: IBoardElementService, _boardTextEditingService: BoardTextEditingService, _boardContainerRenameService: BoardContainerRenameService, _boardSwimlaneLaneRenameService: BoardSwimlaneLaneRenameService, _elementStateService: IBoardElementStateService, _uiStateService: IBoardUIStateService, _contextService: IContextService, _inkStateService: IInkUIStateService);
|
|
27
29
|
private _shouldIgnoreFocusChanges;
|
|
28
30
|
private _init;
|
|
@@ -1,22 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { BoardToolShortcutAction } from '../common/board-shortcuts';
|
|
2
|
+
import type { BoardShortcutRuntimeService } from '../services/board-shortcut-runtime.service';
|
|
3
|
+
import { ICommandService, RxDisposable } from '@univerjs/core';
|
|
2
4
|
import { IShortcutService } from '@univerjs/ui';
|
|
3
|
-
import { IBoardElementStateService } from '../services/board-element-state.service';
|
|
4
|
-
import { BoardToolService } from '../services/board-tool.service';
|
|
5
|
-
import { IBoardUIStateService } from '../services/board-ui-state.service';
|
|
6
5
|
export declare const BOARD_TOOL_SHORTCUT_OPERATION_ID = "board.operation.tool-shortcut";
|
|
6
|
+
export declare function handleToolShortcut(runtime: BoardShortcutRuntimeService, action: BoardToolShortcutAction | undefined): boolean;
|
|
7
7
|
export declare class BoardToolShortcutController extends RxDisposable {
|
|
8
|
-
private readonly _instanceService;
|
|
9
|
-
private readonly _configService;
|
|
10
|
-
private readonly _elementStateService;
|
|
11
|
-
private readonly _stateService;
|
|
12
|
-
private readonly _toolService;
|
|
13
8
|
private readonly _commandService;
|
|
14
9
|
private readonly _shortcutService;
|
|
15
|
-
constructor(
|
|
16
|
-
private _init;
|
|
17
|
-
private _createToolShortcutOperation;
|
|
18
|
-
private _createShortcutItem;
|
|
19
|
-
private _handleShortcut;
|
|
20
|
-
private _canCancelTool;
|
|
21
|
-
private _getCurrentBoardModel;
|
|
10
|
+
constructor(_commandService: ICommandService, _shortcutService: IShortcutService);
|
|
22
11
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Disposable } from '@univerjs/core';
|
|
2
|
+
import { IUnitPresenceUIAdapterRegistry } from '@univerjs/ui';
|
|
3
|
+
import { BoardUnitPresenceUIAdapter } from '../services/board-unit-presence-ui-adapter.service';
|
|
4
|
+
export declare class BoardUnitPresenceController extends Disposable {
|
|
5
|
+
constructor(adapterRegistry: IUnitPresenceUIAdapterRegistry, adapter: BoardUnitPresenceUIAdapter);
|
|
6
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { BoardModel } from '@univerjs-pro/boards';
|
|
2
|
+
import type { IRenderContext, IRenderModule } from '@univerjs/engine-render';
|
|
3
|
+
import { IBoardElementService } from '@univerjs-pro/boards';
|
|
4
|
+
import { ICommandService, RxDisposable, ThemeService } from '@univerjs/core';
|
|
5
|
+
import { IBoardUIStateService } from '../services/board-ui-state.service';
|
|
6
|
+
import { BoardUnitPresenceUIAdapter } from '../services/board-unit-presence-ui-adapter.service';
|
|
7
|
+
export declare class BoardUnitPresenceRenderController extends RxDisposable implements IRenderModule {
|
|
8
|
+
private readonly _context;
|
|
9
|
+
private readonly _presenceAdapter;
|
|
10
|
+
private readonly _commandService;
|
|
11
|
+
private readonly _boardElementService;
|
|
12
|
+
private readonly _boardUIStateService;
|
|
13
|
+
private readonly _themeService;
|
|
14
|
+
private readonly _selectionShapes;
|
|
15
|
+
private readonly _pointerAnimations;
|
|
16
|
+
private _animationFrameId;
|
|
17
|
+
private _renderScheduled;
|
|
18
|
+
private _isApplyingOverlays;
|
|
19
|
+
private _pointersVisible;
|
|
20
|
+
private _latestPresences;
|
|
21
|
+
constructor(_context: IRenderContext<BoardModel>, _presenceAdapter: BoardUnitPresenceUIAdapter, _commandService: ICommandService, _boardElementService: IBoardElementService, _boardUIStateService: IBoardUIStateService, _themeService: ThemeService);
|
|
22
|
+
dispose(): void;
|
|
23
|
+
private _init;
|
|
24
|
+
private _scheduleRender;
|
|
25
|
+
private _render;
|
|
26
|
+
private _publishLocalPointer;
|
|
27
|
+
private _clearLocalPointer;
|
|
28
|
+
private _clearLocalPointerIfActive;
|
|
29
|
+
private _syncPointers;
|
|
30
|
+
private _startAnimation;
|
|
31
|
+
private _animate;
|
|
32
|
+
private _cancelAnimation;
|
|
33
|
+
private _removePointer;
|
|
34
|
+
private _removeAllPointers;
|
|
35
|
+
private _removeSelectionShapes;
|
|
36
|
+
private _getSceneObjectByKey;
|
|
37
|
+
}
|
|
@@ -1,29 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ICommandService, IConfigService, IUniverInstanceService, RxDisposable } from '@univerjs/core';
|
|
3
|
-
import { IRenderManagerService } from '@univerjs/engine-render';
|
|
1
|
+
import { ICommandService, RxDisposable } from '@univerjs/core';
|
|
4
2
|
import { IShortcutService } from '@univerjs/ui';
|
|
5
|
-
import { IBoardElementStateService } from '../services/board-element-state.service';
|
|
6
|
-
import { IBoardUIStateService } from '../services/board-ui-state.service';
|
|
7
|
-
import { BoardViewportService } from '../services/board-viewport.service';
|
|
8
3
|
export declare const BOARD_VIEW_SHORTCUT_OPERATION_ID = "board.operation.view-shortcut";
|
|
9
4
|
export declare class BoardViewShortcutController extends RxDisposable {
|
|
10
|
-
private readonly _instanceService;
|
|
11
|
-
private readonly _configService;
|
|
12
|
-
private readonly _renderManagerService;
|
|
13
|
-
private readonly _boardElementService;
|
|
14
|
-
private readonly _elementStateService;
|
|
15
|
-
private readonly _stateService;
|
|
16
|
-
private readonly _viewportService;
|
|
17
5
|
private readonly _commandService;
|
|
18
6
|
private readonly _shortcutService;
|
|
19
|
-
constructor(
|
|
20
|
-
private _init;
|
|
21
|
-
private _createViewShortcutOperation;
|
|
22
|
-
private _createShortcutItem;
|
|
23
|
-
private _handleShortcut;
|
|
24
|
-
private _getCurrentBoardModel;
|
|
25
|
-
private _getCanvasElement;
|
|
26
|
-
private _resolveViewportSize;
|
|
27
|
-
private _resolveViewportCenterPoint;
|
|
28
|
-
private _resolveFullscreenTarget;
|
|
7
|
+
constructor(_commandService: ICommandService, _shortcutService: IShortcutService);
|
|
29
8
|
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { UnitModel } from '@univerjs/core';
|
|
2
|
+
import type { IRenderContext, IRenderModule } from '@univerjs/engine-render';
|
|
3
|
+
import { IBoardElementService } from '@univerjs-pro/boards';
|
|
4
|
+
import { IConfigService, IUniverInstanceService, RxDisposable, ThemeService } from '@univerjs/core';
|
|
5
|
+
import { IBoardUIStateService } from '../services/board-ui-state.service';
|
|
6
|
+
export declare class BoardViewportBarRenderController extends RxDisposable implements IRenderModule {
|
|
7
|
+
private readonly _renderContext;
|
|
8
|
+
private readonly _instanceSrv;
|
|
9
|
+
private readonly _boardElementService;
|
|
10
|
+
private readonly _configService;
|
|
11
|
+
private readonly _stateService;
|
|
12
|
+
private readonly _themeService;
|
|
13
|
+
private _barObject;
|
|
14
|
+
private _contentBounds;
|
|
15
|
+
private _drag;
|
|
16
|
+
private _layout;
|
|
17
|
+
private _navigationBounds;
|
|
18
|
+
private _ownsCursor;
|
|
19
|
+
private _pendingContentRefresh;
|
|
20
|
+
private _scheduledFrameId;
|
|
21
|
+
private _viewportPointerActive;
|
|
22
|
+
private _horizontalEnabled;
|
|
23
|
+
private _verticalEnabled;
|
|
24
|
+
constructor(_renderContext: IRenderContext<UnitModel>, _instanceSrv: IUniverInstanceService, _boardElementService: IBoardElementService, _configService: IConfigService, _stateService: IBoardUIStateService, _themeService: ThemeService);
|
|
25
|
+
dispose(): void;
|
|
26
|
+
private _init;
|
|
27
|
+
private _createInitialObjectState;
|
|
28
|
+
private _syncTheme;
|
|
29
|
+
private _handleElementChanges;
|
|
30
|
+
private _scheduleLayoutSync;
|
|
31
|
+
private _syncLayout;
|
|
32
|
+
private _resolveViewportPixelSize;
|
|
33
|
+
private _resolveContentBounds;
|
|
34
|
+
private _toWorldRect;
|
|
35
|
+
private _resolveSafeArea;
|
|
36
|
+
private _handleBarPointerDown;
|
|
37
|
+
private _handlePointerMove;
|
|
38
|
+
private _handlePointerEnd;
|
|
39
|
+
private _getBoardPoint;
|
|
40
|
+
private _setCursor;
|
|
41
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { IBoardLayoutAnalysisResult } from '@univerjs-pro/boards';
|
|
2
|
+
import type { IBoardScreenshotOptions, IBoardScreenshotResult } from '@univerjs-pro/boards-ui';
|
|
3
|
+
type AnalyzeBoardRenderedLayoutResult = IBoardLayoutAnalysisResult | false;
|
|
4
|
+
type CaptureBoardScreenshotOptions = IBoardScreenshotOptions;
|
|
5
|
+
type CaptureBoardScreenshotResult = IBoardScreenshotResult | false;
|
|
6
|
+
declare module '@univerjs-pro/boards/facade' {
|
|
7
|
+
interface FBoard {
|
|
8
|
+
/**
|
|
9
|
+
* Detects layout conflicts using connector paths resolved by the current Board renderer.
|
|
10
|
+
* This browser-only API requires the Boards UI plugin and Facade extension to be registered.
|
|
11
|
+
* Use `analyzeModelLayout()` when no renderer is available.
|
|
12
|
+
*
|
|
13
|
+
* @param focusPadding Padding added to each issue's suggested screenshot bounds.
|
|
14
|
+
* @returns Structured rendered layout issues, or `false` when no Board scene is available.
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* const board = univerAPI.getActiveBoard();
|
|
18
|
+
* if (!board) throw new Error('No active board');
|
|
19
|
+
* const analysis = board.analyzeRenderedLayout(48);
|
|
20
|
+
* if (!analysis) throw new Error('The active Board is not rendered');
|
|
21
|
+
* console.log(analysis.issues.map((issue) => ({
|
|
22
|
+
* rule: issue.rule,
|
|
23
|
+
* severity: issue.severity,
|
|
24
|
+
* focusBounds: issue.focusBounds,
|
|
25
|
+
* })));
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
analyzeRenderedLayout(focusPadding?: number): AnalyzeBoardRenderedLayoutResult;
|
|
29
|
+
/**
|
|
30
|
+
* Captures resolved Board world bounds using the current Board renderer.
|
|
31
|
+
* This browser-only API requires the Boards UI plugin and Facade extension to be registered.
|
|
32
|
+
* Resolve selectors with `resolveCaptureBounds()` before calling this method.
|
|
33
|
+
*
|
|
34
|
+
* @param options Resolved world bounds and an optional world-to-CSS-pixel scale.
|
|
35
|
+
* @returns PNG evidence from the current renderer, or `false` when capture cannot run.
|
|
36
|
+
* @example
|
|
37
|
+
* ```ts
|
|
38
|
+
* const board = univerAPI.getActiveBoard();
|
|
39
|
+
* if (!board) throw new Error('No active board');
|
|
40
|
+
* const target = board.resolveCaptureBounds({ padding: 48 });
|
|
41
|
+
* if (!target) throw new Error('Cannot resolve Board capture bounds');
|
|
42
|
+
* if (!target.ok) throw new Error(`Cannot capture Board: ${target.code}`);
|
|
43
|
+
* const screenshot = await board.getScreenshot({ bounds: target.bounds, scale: 2 });
|
|
44
|
+
* if (!screenshot) throw new Error('Cannot capture the active Board renderer');
|
|
45
|
+
* console.log(screenshot.dataUrl, screenshot.width, screenshot.height);
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
getScreenshot(options: CaptureBoardScreenshotOptions): Promise<CaptureBoardScreenshotResult>;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { IBoardElementFindResult, IBoardSettings, IBoardViewportPoint } from '@univerjs-pro/boards-ui';
|
|
2
|
+
declare module '@univerjs-pro/boards/facade' {
|
|
3
|
+
interface FBoard {
|
|
4
|
+
/** Returns the effective settings for the current Board UI runtime. */
|
|
5
|
+
getSettings(): Required<IBoardSettings>;
|
|
6
|
+
/** Updates local settings for the current Board UI runtime. */
|
|
7
|
+
setSettings(settings: Partial<IBoardSettings>): boolean;
|
|
8
|
+
/** Returns whether the object-list panel is open for the active Board UI. */
|
|
9
|
+
getObjectListPanelOpen(): boolean;
|
|
10
|
+
/** Opens or closes the object-list panel after focusing this Board. */
|
|
11
|
+
setObjectListPanelOpen(open: boolean): boolean;
|
|
12
|
+
/** Searches the active page using the same text index as the top-right Find panel. */
|
|
13
|
+
findElementsByText(query: string): IBoardElementFindResult[];
|
|
14
|
+
/** Selects an element and pans the viewport so its center reaches the requested viewport point. */
|
|
15
|
+
focusElement(elementId: string, viewportPoint: IBoardViewportPoint): boolean;
|
|
16
|
+
/** Returns the element center in the current Board viewport coordinate system. */
|
|
17
|
+
getElementViewportPoint(elementId: string): IBoardViewportPoint | null;
|
|
18
|
+
}
|
|
19
|
+
}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import './global.css';
|
|
2
|
+
export { AnalyzeBoardRenderedLayoutCommand } from './commands/commands/analyze-board-rendered-layout.command';
|
|
3
|
+
export type { IAnalyzeBoardRenderedLayoutCommandParams } from './commands/commands/analyze-board-rendered-layout.command';
|
|
4
|
+
export { CaptureBoardScreenshotCommand } from './commands/commands/capture-board-screenshot.command';
|
|
5
|
+
export type { ICaptureBoardScreenshotCommandParams } from './commands/commands/capture-board-screenshot.command';
|
|
2
6
|
export { BOARD_INSERT_CHART_DIALOG_ID, BOARD_INSERT_CHART_PANEL_COMPONENT, OpenBoardInsertChartDialogOperation, } from './commands/operations/board-chart-dialog.operation';
|
|
3
7
|
export type { IOpenBoardInsertChartDialogOperationParams } from './commands/operations/board-chart-dialog.operation';
|
|
4
8
|
export { BoardCopySelectionOperation, BoardCutSelectionOperation, BoardDeleteSelectionOperation, } from './commands/operations/board-selection.operation';
|
|
9
|
+
export { FindBoardElementsByTextOperation, FocusBoardElementOperation, GetBoardElementViewportPointOperation, GetBoardObjectListPanelOpenOperation, GetBoardSettingsOperation, SetBoardObjectListPanelOpenOperation, SetBoardSettingsOperation, } from './commands/operations/board-ui-control.operation';
|
|
5
10
|
export { BOARD_SHORTCUT_BINDINGS } from './common/board-shortcuts';
|
|
6
|
-
export { BOARDS_UI_PLUGIN_CONFIG_KEY } from './config/config';
|
|
7
|
-
export type { BoardToolbarToolConfig, IUniverBoardsUIConfig, } from './config/config';
|
|
11
|
+
export { BOARDS_UI_PLUGIN_CONFIG_KEY, DEFAULT_BOARD_COLLABORATOR_CURSOR_SHARE_INTERVAL, DEFAULT_BOARD_SETTINGS, resolveBoardCollaboratorCursorShareInterval, resolveBoardRenderAdapters, } from './config/config';
|
|
12
|
+
export type { BoardToolbarToolConfig, IBoardSettings, IBoardViewportBarConfig, IBoardViewportBarPadding, IUniverBoardsUIConfig, } from './config/config';
|
|
8
13
|
export { BOARD_RENDER_LAYER_INDEX, BOARD_RENDER_OBJECT_Z_INDEX, } from './const';
|
|
9
14
|
export { BOARD_MAIN_VIEWPORT_KEY } from './controllers/board-render.controller';
|
|
10
15
|
export { UniverBoardsUIPlugin } from './plugin';
|
|
@@ -26,22 +31,28 @@ export type { IBoardElementStateSnapshot } from './services/board-element-state.
|
|
|
26
31
|
export { IBoardEmbedRuntimeFocusCoordinator } from './services/board-embed-integration.service';
|
|
27
32
|
export { BoardImageInsertService } from './services/board-image-insert.service';
|
|
28
33
|
export { BoardInteractionSurfaceService } from './services/board-interaction-surface.service';
|
|
34
|
+
export { BOARD_SCREENSHOT_MAX_SCALE, BOARD_SCREENSHOT_MIN_SCALE, } from './services/board-screenshot.service';
|
|
35
|
+
export type { IBoardScreenshotOptions, IBoardScreenshotResult, } from './services/board-screenshot.service';
|
|
29
36
|
export { BoardSelectionService } from './services/board-selection.service';
|
|
30
37
|
export { BoardShapeIntrinsicSizeService } from './services/board-shape-intrinsic-size.service';
|
|
31
38
|
export type { IBoardShapeIntrinsicSizeHostUpdateContext, IBoardShapeIntrinsicSizeProvider, } from './services/board-shape-intrinsic-size.service';
|
|
32
39
|
export { BoardSidePanelService, IBoardSidePanelService } from './services/board-side-panel.service';
|
|
33
40
|
export type { BoardSidePanelCloseReason, IBoardSidePanelComponentDescriptor, IBoardSidePanelDescriptor, } from './services/board-side-panel.service';
|
|
34
|
-
export { BoardTextEditingService } from './services/board-text-editing.service';
|
|
41
|
+
export { areBoardShapeTextValuesEquivalent, BoardTextEditingService } from './services/board-text-editing.service';
|
|
35
42
|
export { BoardToolService } from './services/board-tool.service';
|
|
36
43
|
export { BoardToolbarContributionService, IBoardToolbarContributionService, } from './services/board-toolbar-contribution.service';
|
|
37
44
|
export type { BoardToolbarContributionGroup, IBoardToolbarContribution, } from './services/board-toolbar-contribution.service';
|
|
38
45
|
export { BoardUIStateService, IBoardUIStateService } from './services/board-ui-state.service';
|
|
39
46
|
export { BoardViewportService } from './services/board-viewport.service';
|
|
47
|
+
export type { IBoardElementFindResult } from './utils/board-find.util';
|
|
40
48
|
export { resolveRotatedBoardObjectAnchorBound } from './utils/board-floating-toolbar-anchor.util';
|
|
41
49
|
export { resolveBoardFloatingToolbarSelection } from './utils/board-floating-toolbar-selection.util';
|
|
42
50
|
export type { BoardFloatingToolbarOwner, IBoardFloatingToolbarSelection, IResolveBoardFloatingToolbarSelectionOptions, } from './utils/board-floating-toolbar-selection.util';
|
|
43
51
|
export { resolveBoardInteractionConfig } from './utils/board-interaction-config.util';
|
|
52
|
+
export { resolveBoardElementBounds } from './utils/board-selection-geometry.util';
|
|
53
|
+
export { resolveBoardWheelViewportAction } from './utils/board-viewport-input.util';
|
|
44
54
|
export { getBoardPointFromClient } from './utils/board-viewport.util';
|
|
45
|
-
export {
|
|
55
|
+
export type { IBoardViewportPoint } from './utils/board-viewport.util';
|
|
56
|
+
export { BOARD_SETTINGS_MENU_ACTIONS_PART, BOARD_TOP_RIGHT_MENU_LEADING_PART } from './views/BoardSettingsMenu';
|
|
46
57
|
export { BoardShapeTextEditorContainer } from './views/BoardShapeTextEditorContainer';
|
|
47
58
|
export { BoardWorkbench } from './views/BoardWorkbench';
|
|
@@ -94,6 +94,7 @@ declare const locale: {
|
|
|
94
94
|
collaboratorCursors: string;
|
|
95
95
|
find: string;
|
|
96
96
|
grid: string;
|
|
97
|
+
viewportBar: string;
|
|
97
98
|
preciseSelection: string;
|
|
98
99
|
quickAdd: string;
|
|
99
100
|
theme: string;
|
|
@@ -109,8 +110,6 @@ declare const locale: {
|
|
|
109
110
|
showDimensions: string;
|
|
110
111
|
showToolbar: string;
|
|
111
112
|
translateInto: string;
|
|
112
|
-
import: string;
|
|
113
|
-
export: string;
|
|
114
113
|
};
|
|
115
114
|
objectListPanel: {
|
|
116
115
|
title: string;
|
|
@@ -195,7 +194,6 @@ declare const locale: {
|
|
|
195
194
|
mindMap: string;
|
|
196
195
|
resources: string;
|
|
197
196
|
image: string;
|
|
198
|
-
import: string;
|
|
199
197
|
wrapInContainer: string;
|
|
200
198
|
addSwimlaneLane: string;
|
|
201
199
|
swimlaneMenu: string;
|
|
@@ -208,38 +206,6 @@ declare const locale: {
|
|
|
208
206
|
sendToBack: string;
|
|
209
207
|
more: string;
|
|
210
208
|
};
|
|
211
|
-
mermaidImport: {
|
|
212
|
-
cancel: string;
|
|
213
|
-
containerName: string;
|
|
214
|
-
defaultContainerName: string;
|
|
215
|
-
converting: string;
|
|
216
|
-
emptyPreview: string;
|
|
217
|
-
diagnostics: {
|
|
218
|
-
emptyDraft: string;
|
|
219
|
-
expandedBounds: string;
|
|
220
|
-
invalidElement: string;
|
|
221
|
-
renderElementFailed: string;
|
|
222
|
-
previewPaused: string;
|
|
223
|
-
};
|
|
224
|
-
errors: {
|
|
225
|
-
emptyCode: string;
|
|
226
|
-
exchangeUnavailable: string;
|
|
227
|
-
insertFailed: string;
|
|
228
|
-
invalidDraft: string;
|
|
229
|
-
};
|
|
230
|
-
help: string;
|
|
231
|
-
insert: string;
|
|
232
|
-
renderPreview: string;
|
|
233
|
-
inserting: string;
|
|
234
|
-
types: {
|
|
235
|
-
classDiagram: string;
|
|
236
|
-
erDiagram: string;
|
|
237
|
-
flowchart: string;
|
|
238
|
-
mindMap: string;
|
|
239
|
-
sequenceDiagram: string;
|
|
240
|
-
stateDiagram: string;
|
|
241
|
-
};
|
|
242
|
-
};
|
|
243
209
|
shapePresets: {
|
|
244
210
|
roundedRectangle: string;
|
|
245
211
|
oval: string;
|
package/lib/types/plugin.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Dependency } from '@univerjs/core';
|
|
1
2
|
import type { IUniverBoardsUIConfig } from './config/config';
|
|
2
3
|
import { ICommandService, IConfigService, Injector, Plugin, UniverInstanceType } from '@univerjs/core';
|
|
3
4
|
import { IRenderManagerService } from '@univerjs/engine-render';
|
|
@@ -15,7 +16,12 @@ export declare class UniverBoardsUIPlugin extends Plugin {
|
|
|
15
16
|
static packageName: string;
|
|
16
17
|
static version: string;
|
|
17
18
|
static type: UniverInstanceType;
|
|
19
|
+
private static readonly _runtimeScopedDependencies;
|
|
20
|
+
private static _getRuntimeScopedDependencies;
|
|
21
|
+
static getRuntimeScopedDependencies(injector: Injector): readonly Dependency[];
|
|
22
|
+
static registerRuntimeScopedDependencies(injector: Injector, dependencies: readonly Dependency[]): void;
|
|
18
23
|
constructor(_config: Partial<IUniverBoardsUIConfig> | undefined, _injector: Injector, _renderManagerService: IRenderManagerService, _uiPartsService: IUIPartsService, _commandService: ICommandService, _menuManagerService: IMenuManagerService, _configService: IConfigService);
|
|
19
24
|
onStarting(): void;
|
|
20
25
|
onReady(): void;
|
|
26
|
+
private _registerRenderModules;
|
|
21
27
|
}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import type { IShapeFormulaPresentation } from '@univerjs-pro/shape-editor';
|
|
2
|
-
import type { BaseObject } from '@univerjs/engine-render';
|
|
3
1
|
import type { IBoardElementData } from '@univerjs-pro/boards';
|
|
2
|
+
import type { IShapeFormulaPresentation } from '@univerjs-pro/shape-editor';
|
|
4
3
|
import type { IImageIoService, LocaleService } from '@univerjs/core';
|
|
4
|
+
import type { BaseObject } from '@univerjs/engine-render';
|
|
5
5
|
import type { IBoardFocusedSwimlaneLane } from '../services/board-element-state.service';
|
|
6
|
+
import { BoardConnectorObject } from '../render-objects/board-connector-object';
|
|
6
7
|
export declare const BOARD_ELEMENT_OBJECT_PREFIX = "board-element";
|
|
8
|
+
type BoardConnectorLineJumpCacheOption = ConstructorParameters<typeof BoardConnectorObject>[1]['lineJumpCache'];
|
|
9
|
+
type BoardConnectorRoutingCacheOption = ConstructorParameters<typeof BoardConnectorObject>[1]['routingCache'];
|
|
7
10
|
export interface IBoardElementRenderObjectKey {
|
|
8
11
|
unitId: string;
|
|
9
12
|
elementId: string;
|
|
@@ -24,6 +27,8 @@ export interface ICreateBoardElementRenderObjectOptions {
|
|
|
24
27
|
zIndex?: number;
|
|
25
28
|
imageIoService?: IImageIoService;
|
|
26
29
|
localeService?: LocaleService;
|
|
30
|
+
lineJumpCache?: BoardConnectorLineJumpCacheOption;
|
|
31
|
+
routingCache?: BoardConnectorRoutingCacheOption;
|
|
27
32
|
adapters?: readonly IBoardElementRenderAdapter[];
|
|
28
33
|
focusedSwimlaneLane?: IBoardFocusedSwimlaneLane | null;
|
|
29
34
|
formulaPresentation?: IShapeFormulaPresentation;
|
|
@@ -38,6 +43,8 @@ export interface ISyncBoardElementRenderObjectOptions {
|
|
|
38
43
|
focusedSwimlaneLane?: IBoardFocusedSwimlaneLane | null;
|
|
39
44
|
formulaPresentation?: IShapeFormulaPresentation;
|
|
40
45
|
animateFormulaPresentation?: boolean;
|
|
46
|
+
lineJumpCache?: BoardConnectorLineJumpCacheOption;
|
|
47
|
+
routingCache?: BoardConnectorRoutingCacheOption;
|
|
41
48
|
}
|
|
42
49
|
export interface IBoardElementRenderAdapterContext {
|
|
43
50
|
unitId: string;
|
|
@@ -48,6 +55,8 @@ export interface IBoardElementRenderAdapterContext {
|
|
|
48
55
|
zIndex?: number;
|
|
49
56
|
imageIoService?: IImageIoService;
|
|
50
57
|
localeService?: LocaleService;
|
|
58
|
+
lineJumpCache?: BoardConnectorLineJumpCacheOption;
|
|
59
|
+
routingCache?: BoardConnectorRoutingCacheOption;
|
|
51
60
|
focusedSwimlaneLane?: IBoardFocusedSwimlaneLane | null;
|
|
52
61
|
formulaPresentation?: IShapeFormulaPresentation;
|
|
53
62
|
animateFormulaPresentation?: boolean;
|
|
@@ -68,5 +77,6 @@ export declare const BOARD_CONNECTOR_ELEMENT_RENDER_ADAPTER: IBoardElementRender
|
|
|
68
77
|
export declare const BOARD_SHAPE_ELEMENT_RENDER_ADAPTER: IBoardElementRenderAdapter;
|
|
69
78
|
export declare const BOARD_IMAGE_ELEMENT_RENDER_ADAPTER: IBoardElementRenderAdapter;
|
|
70
79
|
export declare const BOARD_ELEMENT_RENDER_ADAPTERS: readonly IBoardElementRenderAdapter[];
|
|
71
|
-
export declare function createBoardElementRenderObject({ unitId, elementDataItem, elementData, zIndex, imageIoService, localeService, adapters, focusedSwimlaneLane, formulaPresentation, }: ICreateBoardElementRenderObjectOptions): BaseObject | null;
|
|
80
|
+
export declare function createBoardElementRenderObject({ unitId, elementDataItem, elementData, zIndex, imageIoService, localeService, lineJumpCache, routingCache, adapters, focusedSwimlaneLane, formulaPresentation, }: ICreateBoardElementRenderObjectOptions): BaseObject | null;
|
|
72
81
|
export declare function syncBoardElementRenderObject(object: BaseObject, elementDataItem: IBoardElementData, options?: ISyncBoardElementRenderObjectOptions): boolean;
|
|
82
|
+
export {};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { IBoardConnectorElement, IBoardConnectorPoint, IBoardElementData } from '@univerjs-pro/boards';
|
|
2
2
|
import type { IDocumentData, LocaleService } from '@univerjs/core';
|
|
3
|
-
import { BaseObject } from '@univerjs/engine-render';
|
|
4
3
|
import type { IObjectFullState, IViewportInfo, UniverRenderingContext, Vector2 } from '@univerjs/engine-render';
|
|
5
4
|
import type { IBoardConnectorLabelRect } from '../utils/board-connector-label.util';
|
|
5
|
+
import type { IBoardConnectorRenderGeometry } from '../utils/board-connector-render-geometry.util';
|
|
6
|
+
import type { BoardConnectorPathCommand, BoardConnectorRoutingCache } from '../utils/board-connector-routing.util';
|
|
7
|
+
import { BaseObject } from '@univerjs/engine-render';
|
|
6
8
|
import { resolveBoardConnectorPathBounds, resolveBoardConnectorPathCommands, resolveBoardConnectorRoutePoints } from '../utils/board-connector-routing.util';
|
|
7
9
|
export interface IBoardConnectorObjectProps {
|
|
8
10
|
left: number;
|
|
@@ -15,48 +17,83 @@ export interface IBoardConnectorObjectProps {
|
|
|
15
17
|
evented?: boolean;
|
|
16
18
|
element: IBoardConnectorElement;
|
|
17
19
|
elementData?: Record<string, IBoardElementData>;
|
|
20
|
+
lineJumpCache?: BoardConnectorLineJumpCache;
|
|
21
|
+
routingCache?: BoardConnectorRoutingCache;
|
|
18
22
|
localeService?: LocaleService;
|
|
19
23
|
}
|
|
20
24
|
export interface IBoardConnectorRouteCache {
|
|
21
25
|
routePoints: ReturnType<typeof resolveBoardConnectorRoutePoints>;
|
|
22
26
|
pathCommands: ReturnType<typeof resolveBoardConnectorPathCommands>;
|
|
23
27
|
bounds: ReturnType<typeof resolveBoardConnectorPathBounds>;
|
|
28
|
+
renderGeometry: IBoardConnectorRenderGeometry | null;
|
|
29
|
+
}
|
|
30
|
+
export interface IBoardConnectorObjectUpdateOptions {
|
|
31
|
+
preserveLineJumpCache?: boolean;
|
|
32
|
+
routeCache?: IBoardConnectorRouteCache;
|
|
33
|
+
skipLineJumps?: boolean;
|
|
34
|
+
}
|
|
35
|
+
interface IBoardConnectorLineJump {
|
|
36
|
+
x: number;
|
|
37
|
+
y: number;
|
|
38
|
+
distance: number;
|
|
39
|
+
}
|
|
40
|
+
type BoardConnectorRouteResolver = typeof resolveBoardConnectorRoutePoints;
|
|
41
|
+
export declare class BoardConnectorLineJumpCache {
|
|
42
|
+
private readonly _resolveRoutePoints;
|
|
43
|
+
private _elementData?;
|
|
44
|
+
private readonly _routePointsByConnectorId;
|
|
45
|
+
private readonly _lineJumpsByConnectorId;
|
|
46
|
+
constructor(_resolveRoutePoints?: BoardConnectorRouteResolver);
|
|
47
|
+
invalidate(elementData?: Record<string, IBoardElementData>, options?: {
|
|
48
|
+
force?: boolean;
|
|
49
|
+
}): void;
|
|
50
|
+
resolveLineJumpsForRoute(connectorId: string, routePoints: readonly IBoardConnectorPoint[]): readonly IBoardConnectorLineJump[][];
|
|
51
|
+
private _clear;
|
|
52
|
+
private _getRoutePoints;
|
|
53
|
+
private _resolveLineJumpsForSegment;
|
|
24
54
|
}
|
|
25
55
|
export declare class BoardConnectorObject extends BaseObject {
|
|
26
56
|
private _element;
|
|
27
57
|
private _elementData?;
|
|
28
58
|
private readonly _localeService?;
|
|
59
|
+
private readonly _lineJumpCache;
|
|
60
|
+
private readonly _routingCache?;
|
|
29
61
|
private readonly _documentTextRenderCache;
|
|
30
62
|
private _routeCache;
|
|
63
|
+
private _labelGeometryCache;
|
|
31
64
|
private _routeStabilityHint;
|
|
32
65
|
private _isEditingLabel;
|
|
66
|
+
private _skipLineJumps;
|
|
33
67
|
isDrawingObject: boolean;
|
|
34
68
|
constructor(key: string, props: IBoardConnectorObjectProps);
|
|
35
|
-
updateElement(element: IBoardConnectorElement, elementData?: Record<string, IBoardElementData
|
|
69
|
+
updateElement(element: IBoardConnectorElement, elementData?: Record<string, IBoardElementData>, options?: IBoardConnectorObjectUpdateOptions): void;
|
|
36
70
|
getElement(): IBoardConnectorElement;
|
|
37
71
|
setEditing(isEditing: boolean): void;
|
|
38
72
|
getRoutePoints(): IBoardConnectorPoint[];
|
|
39
73
|
getCachedRoutePoints(): readonly IBoardConnectorPoint[] | null;
|
|
40
|
-
getPathCommands():
|
|
74
|
+
getPathCommands(): BoardConnectorPathCommand[];
|
|
75
|
+
getRenderBounds(): ReturnType<typeof resolveBoardConnectorPathBounds>;
|
|
41
76
|
getLabelPathPoints(): IBoardConnectorPoint[];
|
|
42
77
|
getLabelRect(): IBoardConnectorLabelRect | null;
|
|
43
78
|
measureLabelNaturalHeight(width: number, documentData?: IDocumentData): number | null;
|
|
44
79
|
isLabelHit(point: IBoardConnectorPoint): boolean;
|
|
45
80
|
private _getRouteCache;
|
|
81
|
+
private _getLabelGeometry;
|
|
46
82
|
private _getRenderBounds;
|
|
47
83
|
private _getCurrentRouteStabilityHint;
|
|
48
84
|
private _shouldUseRouteStabilityHint;
|
|
49
85
|
transformByState(option: IObjectFullState): this;
|
|
50
86
|
isHit(coord: Vector2): boolean;
|
|
87
|
+
hitTest(point: IBoardConnectorPoint): boolean;
|
|
88
|
+
getRenderGeometry(): IBoardConnectorRenderGeometry | null;
|
|
51
89
|
render(ctx: UniverRenderingContext, _bounds: IViewportInfo): this;
|
|
52
90
|
private _clipRouteAroundLabel;
|
|
53
91
|
private _drawRoute;
|
|
54
92
|
private _drawRoundedOrthogonalRoute;
|
|
55
93
|
private _drawRouteWithLineJumps;
|
|
56
|
-
private _resolveLineJumpsForSegment;
|
|
57
94
|
private _drawPathCommands;
|
|
58
95
|
private _drawMarkers;
|
|
59
|
-
private _resolveEndpointVisualGap;
|
|
60
96
|
private _drawLabel;
|
|
61
97
|
private _drawLabelFrame;
|
|
62
98
|
}
|
|
99
|
+
export {};
|
|
@@ -0,0 +1,65 @@
|
|
|
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
|
+
import type { Scene, UniverRenderingContext } from '@univerjs/engine-render';
|
|
17
|
+
import { BaseObject, Layer } from '@univerjs/engine-render';
|
|
18
|
+
export interface IBoardElementRenderLayerMetrics {
|
|
19
|
+
cacheHits: number;
|
|
20
|
+
directRenders: number;
|
|
21
|
+
fullCacheRenders: number;
|
|
22
|
+
incrementalCacheRenders: number;
|
|
23
|
+
zoomPreviews: number;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Board-specific cache for the persistent element layer. Render objects stay as direct layer
|
|
27
|
+
* children, so object ordering and hit testing continue to use the engine's normal paths.
|
|
28
|
+
*/
|
|
29
|
+
export declare class BoardElementRenderLayer extends Layer {
|
|
30
|
+
private readonly _elementCacheCanvas;
|
|
31
|
+
private readonly _cacheProxy;
|
|
32
|
+
private readonly _metrics;
|
|
33
|
+
private _cacheState;
|
|
34
|
+
private _cacheContentValid;
|
|
35
|
+
private _rebuildRequested;
|
|
36
|
+
private _quietRevision;
|
|
37
|
+
private _quietFrame;
|
|
38
|
+
private _settleFrame;
|
|
39
|
+
constructor(scene: Scene, zIndex: number);
|
|
40
|
+
getMetrics(): Readonly<IBoardElementRenderLayerMetrics>;
|
|
41
|
+
addObject(object: BaseObject): this;
|
|
42
|
+
removeObject(object: BaseObject | string): void;
|
|
43
|
+
removeObjects(objects: BaseObject[] | string[]): void;
|
|
44
|
+
render(parentCtx?: UniverRenderingContext, isMaxLayer?: boolean): this;
|
|
45
|
+
private _paint;
|
|
46
|
+
private _canCache;
|
|
47
|
+
private _createCacheState;
|
|
48
|
+
private _refreshCache;
|
|
49
|
+
private _recenterCache;
|
|
50
|
+
private _getNewAreaBounds;
|
|
51
|
+
private _renderObjectsToCache;
|
|
52
|
+
private _renderDirect;
|
|
53
|
+
private _drawElementCache;
|
|
54
|
+
private _filterObjects;
|
|
55
|
+
private _shouldRecenter;
|
|
56
|
+
private _isSameScale;
|
|
57
|
+
private _markObjectsClean;
|
|
58
|
+
private _clearCanvas;
|
|
59
|
+
private _invalidateContent;
|
|
60
|
+
private _scheduleQuietRebuild;
|
|
61
|
+
private _cancelQuietFrames;
|
|
62
|
+
private _cancelQuietRebuild;
|
|
63
|
+
private _resetCache;
|
|
64
|
+
dispose(): void;
|
|
65
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { IViewportInfo, UniverRenderingContext, Vector2 } from '@univerjs/engine-render';
|
|
2
|
+
import type { IBoardViewportBarRect } from '../utils/board-viewport-bar.util';
|
|
3
|
+
import { BaseObject } from '@univerjs/engine-render';
|
|
4
|
+
export type BoardViewportBarAxis = 'horizontal' | 'vertical';
|
|
5
|
+
export interface IBoardViewportBarObjectState {
|
|
6
|
+
activeAxis: BoardViewportBarAxis | null;
|
|
7
|
+
activeColor: string;
|
|
8
|
+
activeOpacity: number;
|
|
9
|
+
barSize: number;
|
|
10
|
+
hitSize: number;
|
|
11
|
+
horizontalRect: IBoardViewportBarRect | null;
|
|
12
|
+
hoverAxis: BoardViewportBarAxis | null;
|
|
13
|
+
hoverColor: string;
|
|
14
|
+
hoverOpacity: number;
|
|
15
|
+
idleColor: string;
|
|
16
|
+
idleOpacity: number;
|
|
17
|
+
verticalRect: IBoardViewportBarRect | null;
|
|
18
|
+
zoomRatio: number;
|
|
19
|
+
}
|
|
20
|
+
export declare const BOARD_VIEWPORT_BAR_OBJECT_KEY = "board-viewport-bar-object";
|
|
21
|
+
export declare const BOARD_VIEWPORT_BAR_OBJECT_LAYER_INDEX: 8;
|
|
22
|
+
type BoardViewportBarPoint = Pick<Vector2, 'x' | 'y'>;
|
|
23
|
+
export declare class BoardViewportBarObject extends BaseObject {
|
|
24
|
+
private _state;
|
|
25
|
+
constructor(key: string | undefined, state: IBoardViewportBarObjectState);
|
|
26
|
+
getBarState(): IBoardViewportBarObjectState;
|
|
27
|
+
updateState(state: Partial<IBoardViewportBarObjectState>): void;
|
|
28
|
+
resolveHitAxis(coord: BoardViewportBarPoint): BoardViewportBarAxis | null;
|
|
29
|
+
isHit(coord: Vector2): boolean;
|
|
30
|
+
render(ctx: UniverRenderingContext, _bounds: IViewportInfo): this;
|
|
31
|
+
private _syncVisibility;
|
|
32
|
+
}
|
|
33
|
+
export {};
|
|
@@ -4,6 +4,7 @@ import type { IPopup } from '@univerjs/ui';
|
|
|
4
4
|
import { Disposable } from '@univerjs/core';
|
|
5
5
|
import { IRenderManagerService } from '@univerjs/engine-render';
|
|
6
6
|
import { ICanvasPopupService } from '@univerjs/ui';
|
|
7
|
+
import { IBoardUIStateService } from './board-ui-state.service';
|
|
7
8
|
export interface IBoardCanvasPopup extends Pick<IPopup, 'componentKey' | 'direction' | 'excludeOutside' | 'hideOnInvisible' | 'offset' | 'onClickOutside'> {
|
|
8
9
|
anchorBoundResolver?: (targetObject: BaseObject) => IBoundRectNoAngle;
|
|
9
10
|
extraProps?: Record<string, unknown>;
|
|
@@ -12,7 +13,8 @@ export interface IBoardCanvasPopup extends Pick<IPopup, 'componentKey' | 'direct
|
|
|
12
13
|
export declare class BoardCanvasPopManagerService extends Disposable {
|
|
13
14
|
private readonly _globalPopupManagerService;
|
|
14
15
|
private readonly _renderManagerService;
|
|
15
|
-
|
|
16
|
+
private readonly _boardUIStateService;
|
|
17
|
+
constructor(_globalPopupManagerService: ICanvasPopupService, _renderManagerService: IRenderManagerService, _boardUIStateService: IBoardUIStateService);
|
|
16
18
|
private _createObjectPositionObserver;
|
|
17
19
|
attachPopupToObject(unitId: string, subUnitId: string, targetObject: BaseObject, popup: IBoardCanvasPopup): IDisposable;
|
|
18
20
|
attachPopupToPoint(unitId: string, subUnitId: string, point: {
|