@univerjs-pro/boards-ui 1.0.0-alpha.8 → 1.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +1 -79
- 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 +8 -0
- package/lib/types/commands/commands/capture-board-screenshot.command.d.ts +7 -0
- package/lib/types/common/shape-presets.d.ts +4 -0
- package/lib/types/config/config.d.ts +0 -4
- package/lib/types/controllers/board-connector-interaction.render-controller.d.ts +8 -3
- package/lib/types/controllers/board-element-selection.controller.d.ts +3 -1
- package/lib/types/controllers/board-element-transform.controller.d.ts +9 -1
- package/lib/types/controllers/board-render.controller.d.ts +5 -3
- package/lib/types/controllers/board-selection-overlay.render-controller.d.ts +1 -0
- package/lib/types/controllers/board-text-editing.render-controller.d.ts +3 -1
- package/lib/types/facade/f-board-layout.d.ts +51 -0
- package/lib/types/facade/index.d.ts +1 -0
- package/lib/types/index.d.ts +9 -1
- package/lib/types/locale/en-US.d.ts +0 -35
- package/lib/types/render-adapters/board-element-render-adapter.d.ts +13 -3
- package/lib/types/render-objects/board-connector-object.d.ts +27 -2
- package/lib/types/render-objects/board-element-render-layer.d.ts +65 -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-tool.service.d.ts +0 -1
- package/lib/types/services/board-viewport.service.d.ts +4 -1
- package/lib/types/utils/board-alignment-guides.util.d.ts +2 -0
- package/lib/types/utils/board-connector-router.util.d.ts +1 -0
- package/lib/types/utils/board-connector-routing.util.d.ts +18 -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-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-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.util.d.ts +6 -0
- package/lib/types/views/BoardConnectorFloatingToolbar.d.ts +0 -4
- package/lib/types/views/BoardConnectorFloatingToolbarControls.d.ts +35 -0
- package/lib/types/views/BoardRenamePopup.d.ts +7 -0
- package/lib/types/views/BoardSettingsMenu.d.ts +1 -0
- 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
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function _0x283a(){const _0x321d1f=['Multiply','Plaque','Connector','Magnetic\x20tape','Up\x20arrow\x20callout','Inverse\x20line','Heptagon','Minus','Manual\x20input','Lightning\x20bolt','Callout\x203','Left\x20arrow\x20callout','Four-way\x20arrow\x20callout','Wave','Curved\x20down\x20arrow','Diagonal\x20round\x20corner\x20rectangle','Bracket\x20pair','Back\x20or\x20previous\x20button','24-point\x20star','12-point\x20star','7zNTFWf','2518587Zsscgz','4-point\x20star','Funnel','Sound\x20button','Chart\x20X','Help\x20button','Corner\x20tabs','2038royCOj','Ribbon\x202','143gEbhIv','Accent\x20border\x20callout\x203','Diagonal\x20snip\x20corner\x20rectangle','Rectangular\x20callout','Multiple\x20documents','Sort','Left-right\x20ribbon','Chart\x20plus','Vertical\x20scroll','Bevel','86850EAWoaC','Curved\x20left\x20arrow','1990gTxVDZ','Blank\x20button','Right\x20arrow\x20callout','Square\x20tabs','Equal','Manual\x20operation','648HsovnI','Explosion\x202','Pie\x20wedge','Divide','Return\x20button','Gear\x209','Dodecagon','Horizontal\x20scroll','Same-side\x20round\x20corner\x20rectangle','Sun','Left-up\x20arrow','Predefined\x20process','Punched\x20card','Internal\x20storage','Border\x20callout\x202','Single\x20snip\x20corner\x20rectangle','Forward\x20or\x20next\x20button','6-point\x20star','Gear\x206','1215efArAp','Off-page\x20connector','No\x20symbol','Movie\x20button','Four-way\x20arrow','Terminator','9171981lCwXop','Moon','6374076hSAsBf','Punched\x20tape','Accent\x20border\x20callout\x201','Merge','10-point\x20star','Corner','8035536NIUwNl','Swoosh\x20arrow','Notched\x20right\x20arrow','Half\x20frame','Plaque\x20tabs','Magnetic\x20drum','Alternate\x20process','Circular\x20arrow','Explosion\x201','Ellipse\x20ribbon','Display','Left\x20bracket','Border\x20callout\x203','Input/output','Block\x20arc','Not\x20equal','Summing\x20junction','Smiley\x20face','Delay','Up-down\x20arrow\x20callout','Folded\x20corner','Brace\x20pair','End\x20button','Bent\x20arrow','Ribbon','7-point\x20star','Chart\x20star'];_0x283a=function(){return _0x321d1f;};return _0x283a();}const _0x4a3800=_0x22f5;(function(_0xa88415,_0x47edef){const _0x4554d5=_0x22f5,_0x538ec7=_0xa88415();while(!![]){try{const _0x239687=parseInt(_0x4554d5(0x13b))/0x1*(-parseInt(_0x4554d5(0x114))/0x2)+parseInt(_0x4554d5(0x10d))/0x3+-parseInt(_0x4554d5(0x128))/0x4*(-parseInt(_0x4554d5(0x122))/0x5)+-parseInt(_0x4554d5(0x143))/0x6*(-parseInt(_0x4554d5(0x10c))/0x7)+-parseInt(_0x4554d5(0x149))/0x8+parseInt(_0x4554d5(0x141))/0x9+parseInt(_0x4554d5(0x120))/0xa*(-parseInt(_0x4554d5(0x116))/0xb);if(_0x239687===_0x47edef)break;else _0x538ec7['push'](_0x538ec7['shift']());}catch(_0x21cf95){_0x538ec7['push'](_0x538ec7['shift']());}}}(_0x283a,0x99d0c));function _0x22f5(_0xc24b07,_0xc7fe07){_0xc24b07=_0xc24b07-0xfb;const _0x283ab1=_0x283a();let _0x22f580=_0x283ab1[_0xc24b07];return _0x22f580;}const e={'snip1Rect':_0x4a3800(0x137),'snip2SameRect':'Same-side\x20snip\x20corner\x20rectangle','snip2DiagRect':_0x4a3800(0x118),'snipRoundRect':'Snip\x20and\x20round\x20corner\x20rectangle','round1Rect':'Single\x20round\x20corner\x20rectangle','round2SameRect':_0x4a3800(0x130),'round2DiagRect':_0x4a3800(0x107),'heptagon':_0x4a3800(0xfe),'decagon':'Decagon','dodecagon':_0x4a3800(0x12e),'pie':'Pie','chord':'Chord','teardrop':'Teardrop','frame':'Frame','halfFrame':_0x4a3800(0x14c),'corner':_0x4a3800(0x148),'diagStripe':'Diagonal\x20stripe','plaque':_0x4a3800(0x165),'cube':'Cube','bevel':_0x4a3800(0x11f),'donut':'Donut','noSmoking':_0x4a3800(0x13d),'blockArc':_0x4a3800(0x157),'foldedCorner':_0x4a3800(0x15d),'smileyFace':_0x4a3800(0x15a),'heart':'Heart','lightningBolt':_0x4a3800(0x101),'sun':_0x4a3800(0x131),'moon':_0x4a3800(0x142),'arc':'Arc','bracketPair':_0x4a3800(0x108),'bracePair':_0x4a3800(0x15e),'leftBracket':_0x4a3800(0x154),'rightBracket':'Right\x20bracket','upArrow':'Up\x20arrow','downArrow':'Down\x20arrow','upDownArrow':'Up-down\x20arrow','quadArrow':_0x4a3800(0x13f),'leftRightUpArrow':'Left-right-up\x20arrow','bentArrow':_0x4a3800(0x160),'uturnArrow':'U-turn\x20arrow','leftUpArrow':_0x4a3800(0x132),'bentUpArrow':'Bent-up\x20arrow','curvedRightArrow':'Curved\x20right\x20arrow','curvedLeftArrow':_0x4a3800(0x121),'curvedUpArrow':'Curved\x20up\x20arrow','curvedDownArrow':_0x4a3800(0x106),'stripedRightArrow':'Striped\x20right\x20arrow','notchedRightArrow':_0x4a3800(0x14b),'rightArrowCallout':_0x4a3800(0x124),'downArrowCallout':'Down\x20arrow\x20callout','leftArrowCallout':_0x4a3800(0x103),'upArrowCallout':_0x4a3800(0xfc),'leftRightArrowCallout':'Left-right\x20arrow\x20callout','quadArrowCallout':_0x4a3800(0x104),'circularArrow':_0x4a3800(0x150),'mathMinus':_0x4a3800(0xff),'mathMultiply':_0x4a3800(0x164),'mathDivide':_0x4a3800(0x12b),'mathEqual':_0x4a3800(0x126),'mathNotEqual':_0x4a3800(0x158),'flowChartProcess':'Process','flowChartAlternateProcess':_0x4a3800(0x14f),'flowChartDecision':'Decision','flowChartInputOutput':_0x4a3800(0x156),'flowChartPredefinedProcess':_0x4a3800(0x133),'flowChartInternalStorage':_0x4a3800(0x135),'flowChartDocument':'Document','flowChartMultidocument':_0x4a3800(0x11a),'flowChartTerminator':_0x4a3800(0x140),'flowChartPreparation':'Preparation','flowChartManualInput':_0x4a3800(0x100),'flowChartManualOperation':_0x4a3800(0x127),'flowChartConnector':_0x4a3800(0x166),'flowChartOffpageConnector':_0x4a3800(0x13c),'flowChartPunchedCard':_0x4a3800(0x134),'flowChartPunchedTape':_0x4a3800(0x144),'flowChartSummingJunction':_0x4a3800(0x159),'flowChartOr':'Or','flowChartCollate':'Collate','flowChartSort':_0x4a3800(0x11b),'flowChartExtract':'Extract','flowChartMerge':_0x4a3800(0x146),'flowChartOnlineStorage':'Online\x20storage','flowChartDelay':_0x4a3800(0x15b),'flowChartMagneticTape':_0x4a3800(0xfb),'flowChartMagneticDisk':'Magnetic\x20disk','flowChartMagneticDrum':_0x4a3800(0x14e),'flowChartDisplay':_0x4a3800(0x153),'irregularSeal1':_0x4a3800(0x151),'irregularSeal2':_0x4a3800(0x129),'star4':_0x4a3800(0x10e),'star6':_0x4a3800(0x139),'star7':_0x4a3800(0x162),'star8':'8-point\x20star','star10':_0x4a3800(0x147),'star12':_0x4a3800(0x10b),'star16':'16-point\x20star','star24':_0x4a3800(0x10a),'star32':'32-point\x20star','ribbon2':_0x4a3800(0x115),'ribbon':_0x4a3800(0x161),'ellipseRibbon2':'Ellipse\x20ribbon\x202','ellipseRibbon':_0x4a3800(0x152),'verticalScroll':_0x4a3800(0x11e),'horizontalScroll':_0x4a3800(0x12f),'wave':_0x4a3800(0x105),'doubleWave':'Double\x20wave','wedgeRectCallout':_0x4a3800(0x119),'cloudCallout':'Cloud\x20callout','borderCallout1':'Border\x20callout\x201','borderCallout2':_0x4a3800(0x136),'borderCallout3':_0x4a3800(0x155),'accentCallout1':'Accent\x20callout\x201','accentCallout2':'Accent\x20callout\x202','accentCallout3':'Accent\x20callout\x203','callout1':'Callout\x201','callout2':'Callout\x202','callout3':_0x4a3800(0x102),'accentBorderCallout1':_0x4a3800(0x145),'accentBorderCallout2':'Accent\x20border\x20callout\x202','accentBorderCallout3':_0x4a3800(0x117),'leftCircularArrow':'Left\x20circular\x20arrow','leftRightCircularArrow':'Left-right\x20circular\x20arrow','swooshArrow':_0x4a3800(0x14a),'leftRightRibbon':_0x4a3800(0x11c),'pieWedge':_0x4a3800(0x12a),'funnel':_0x4a3800(0x10f),'gear6':_0x4a3800(0x13a),'gear9':_0x4a3800(0x12d),'cornerTabs':_0x4a3800(0x113),'actionButtonBackPrevious':_0x4a3800(0x109),'actionButtonForwardNext':_0x4a3800(0x138),'actionButtonBeginning':'Beginning\x20button','actionButtonEnd':_0x4a3800(0x15f),'actionButtonHome':'Home\x20button','actionButtonInformation':'Information\x20button','actionButtonReturn':_0x4a3800(0x12c),'actionButtonMovie':_0x4a3800(0x13e),'actionButtonDocument':'Document\x20button','actionButtonSound':_0x4a3800(0x110),'actionButtonHelp':_0x4a3800(0x112),'actionButtonBlank':_0x4a3800(0x123),'chartPlus':_0x4a3800(0x11d),'chartStar':_0x4a3800(0x163),'chartX':_0x4a3800(0x111),'flowChartOfflineStorage':'Offline\x20storage','lineInv':_0x4a3800(0xfd),'plaqueTabs':_0x4a3800(0x14d),'squareTabs':_0x4a3800(0x125),'upDownArrowCallout':_0x4a3800(0x15c)};export{e as t};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IBoardLayoutAnalysisResult } from '@univerjs-pro/boards';
|
|
2
|
+
import type { ICommand } from '@univerjs/core';
|
|
3
|
+
export interface IAnalyzeBoardRenderedLayoutCommandParams {
|
|
4
|
+
unitId: string;
|
|
5
|
+
subUnitId: string;
|
|
6
|
+
focusPadding?: number;
|
|
7
|
+
}
|
|
8
|
+
export declare const AnalyzeBoardRenderedLayoutCommand: ICommand<IAnalyzeBoardRenderedLayoutCommandParams, IBoardLayoutAnalysisResult | false>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ICommand } from '@univerjs/core';
|
|
2
|
+
import type { IBoardScreenshotOptions, IBoardScreenshotResult } from '../../services/board-screenshot.service';
|
|
3
|
+
export interface ICaptureBoardScreenshotCommandParams extends IBoardScreenshotOptions {
|
|
4
|
+
subUnitId: string;
|
|
5
|
+
unitId: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const CaptureBoardScreenshotCommand: ICommand<ICaptureBoardScreenshotCommandParams, IBoardScreenshotResult | false>;
|
|
@@ -36,6 +36,10 @@ export interface IBoardShapePreset {
|
|
|
36
36
|
height?: number;
|
|
37
37
|
icon: BoardShapeIcon;
|
|
38
38
|
}
|
|
39
|
+
export declare function resolveBoardShapePresetInsertSize(preset: IBoardShapePreset): {
|
|
40
|
+
width?: number;
|
|
41
|
+
height?: number;
|
|
42
|
+
} | undefined;
|
|
39
43
|
export declare function resolveBoardShapePresetIcon(iconManager: IBoardShapeIconManager, icon: BoardShapeIcon): BoardShapeIconComponent | undefined;
|
|
40
44
|
export declare const BOARD_BASIC_SHAPE_CATEGORY_KEY: LocaleKey;
|
|
41
45
|
export declare const BOARD_SHAPE_PRESETS: IBoardShapePreset[];
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { BoardToolType, IBoardPageSize, IBoardSettings } from '@univerjs-pro/boards';
|
|
2
|
-
import type { BoardSettingsActionConfig, BoardSettingsActionType } from '../common/settings-actions';
|
|
3
2
|
import type { IBoardShapePreset } from '../common/shape-presets';
|
|
4
3
|
import type { IBoardElementRenderAdapter } from '../render-adapters/board-element-render-adapter';
|
|
5
4
|
export declare const BOARDS_UI_PLUGIN_CONFIG_KEY = "boards-ui.config";
|
|
@@ -71,9 +70,6 @@ export interface IUniverBoardsUIConfig extends IBoardSettings {
|
|
|
71
70
|
insert?: IBoardInsertConfig;
|
|
72
71
|
interaction?: IBoardInteractionConfig;
|
|
73
72
|
renderAdapters?: readonly IBoardElementRenderAdapter[];
|
|
74
|
-
settingsMenu?: {
|
|
75
|
-
actions?: Partial<Record<BoardSettingsActionType, BoardSettingsActionConfig>>;
|
|
76
|
-
};
|
|
77
73
|
shape?: IBoardShapeConfig;
|
|
78
74
|
sticky?: IBoardStickyConfig;
|
|
79
75
|
toolbar?: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { IBoardElementService } from '@univerjs-pro/boards';
|
|
2
|
-
import { ICommandService, IUniverInstanceService, LocaleService, RxDisposable } from '@univerjs/core';
|
|
3
1
|
import type { UnitModel } from '@univerjs/core';
|
|
4
2
|
import type { IRenderContext, IRenderModule } from '@univerjs/engine-render';
|
|
3
|
+
import { IBoardElementService } from '@univerjs-pro/boards';
|
|
4
|
+
import { ICommandService, IUniverInstanceService, LocaleService, RxDisposable } from '@univerjs/core';
|
|
5
5
|
import { BoardCanvasPopManagerService } from '../services/board-canvas-pop-manager.service';
|
|
6
6
|
import { BoardElementEditService } from '../services/board-element-edit.service';
|
|
7
7
|
import { BoardElementInsertService } from '../services/board-element-insert.service';
|
|
@@ -20,8 +20,11 @@ export declare class BoardConnectorInteractionRenderController extends RxDisposa
|
|
|
20
20
|
private readonly _boardCanvasPopManagerService;
|
|
21
21
|
private readonly _boardTextEditingService;
|
|
22
22
|
private readonly _localeService;
|
|
23
|
+
private readonly _runtimeSizedElementIdsByPage;
|
|
23
24
|
private _attachObjectPointerScheduled;
|
|
24
|
-
private
|
|
25
|
+
private _attachAllObjectPointerHandlers;
|
|
26
|
+
private _pendingObjectPointerElementIds;
|
|
27
|
+
private _objectPointerDisposablesByElementId;
|
|
25
28
|
private _affordanceObject;
|
|
26
29
|
private _endpointObject;
|
|
27
30
|
private _waypointObject;
|
|
@@ -62,6 +65,8 @@ export declare class BoardConnectorInteractionRenderController extends RxDisposa
|
|
|
62
65
|
private _cancelActiveConnectorDrag;
|
|
63
66
|
private _syncSceneInputMode;
|
|
64
67
|
private _getElementData;
|
|
68
|
+
private _getRuntimeSizedElementIds;
|
|
69
|
+
private _syncRuntimeSizedElementIds;
|
|
65
70
|
private _syncRuntimeElementGeometry;
|
|
66
71
|
private _isConnectorTextEditing;
|
|
67
72
|
private _isTextEditing;
|
|
@@ -24,9 +24,11 @@ export declare class BoardElementSelectionController extends RxDisposable implem
|
|
|
24
24
|
private readonly _inkEditService;
|
|
25
25
|
private readonly _boardTextEditingService;
|
|
26
26
|
private _attachScheduled;
|
|
27
|
+
private _attachAllObjectTransformers;
|
|
27
28
|
private _handledElementPointerDownEvent;
|
|
28
29
|
private _isSyncingTransformer;
|
|
29
|
-
private
|
|
30
|
+
private _objectPointerDisposablesByElementId;
|
|
31
|
+
private _pendingObjectTransformerElementIds;
|
|
30
32
|
private _restoreTransformerScheduled;
|
|
31
33
|
private _selectionDraft;
|
|
32
34
|
constructor(_renderContext: IRenderContext<UnitModel>, _instanceSrv: IUniverInstanceService, _boardElementService: IBoardElementService, _stateSrv: IBoardElementStateService, _selectionService: BoardSelectionService, _selectionOverlayService: BoardSelectionOverlayService, _uiStateService: IBoardUIStateService, _contextMenuService: IContextMenuService, _platformService: IPlatformService, _inkStateService: IInkUIStateService, _inkEditService: IBoardInkEditService, _boardTextEditingService: BoardTextEditingService);
|
|
@@ -5,6 +5,7 @@ import { IUniverInstanceService, RxDisposable } from '@univerjs/core';
|
|
|
5
5
|
import { BoardDomLayerService } from '../services/board-dom-layer.service';
|
|
6
6
|
import { BoardElementEditService } from '../services/board-element-edit.service';
|
|
7
7
|
import { IBoardElementStateService } from '../services/board-element-state.service';
|
|
8
|
+
import { IBoardUIStateService } from '../services/board-ui-state.service';
|
|
8
9
|
export declare class BoardElementTransformController extends RxDisposable implements IRenderModule {
|
|
9
10
|
private readonly _renderContext;
|
|
10
11
|
private readonly _instanceSrv;
|
|
@@ -12,15 +13,19 @@ export declare class BoardElementTransformController extends RxDisposable implem
|
|
|
12
13
|
private readonly _stateSrv;
|
|
13
14
|
private readonly _editService;
|
|
14
15
|
private readonly _domLayerService;
|
|
16
|
+
private readonly _uiStateService?;
|
|
15
17
|
private _domResizeGuideContext;
|
|
16
18
|
private _domResizeGuideDisposable;
|
|
17
19
|
private _domResizeGuideItemId;
|
|
20
|
+
private _alignmentSnapCandidates;
|
|
21
|
+
private _alignmentSnapCorrection;
|
|
22
|
+
private _areAlignmentSnapsDisabled;
|
|
18
23
|
private _isForceCaptureModifierActive;
|
|
19
24
|
private _shiftTransformStartRects;
|
|
20
25
|
private _areTransformerControlsHiddenForTransform;
|
|
21
26
|
private _xSnapSession;
|
|
22
27
|
private _ySnapSession;
|
|
23
|
-
constructor(_renderContext: IRenderContext<UnitModel>, _instanceSrv: IUniverInstanceService, _boardElementService: IBoardElementService, _stateSrv: IBoardElementStateService, _editService: BoardElementEditService, _domLayerService: BoardDomLayerService);
|
|
28
|
+
constructor(_renderContext: IRenderContext<UnitModel>, _instanceSrv: IUniverInstanceService, _boardElementService: IBoardElementService, _stateSrv: IBoardElementStateService, _editService: BoardElementEditService, _domLayerService: BoardDomLayerService, _uiStateService?: IBoardUIStateService | undefined);
|
|
24
29
|
dispose(): void;
|
|
25
30
|
private _init;
|
|
26
31
|
private _subscribeToTransformer;
|
|
@@ -32,10 +37,13 @@ export declare class BoardElementTransformController extends RxDisposable implem
|
|
|
32
37
|
private _restoreTransformerControlsAfterTransform;
|
|
33
38
|
private _captureShiftTransformStartRects;
|
|
34
39
|
private _resetAlignmentSnapSessions;
|
|
40
|
+
private _restoreUnsnappedTransform;
|
|
41
|
+
private _getAlignmentSnapZoomRatio;
|
|
35
42
|
private _applyShiftTransformModifier;
|
|
36
43
|
private _applyAlignmentSnapModifier;
|
|
37
44
|
private _resolveAlignmentSnapDelta;
|
|
38
45
|
private _applySequenceActivationSnapModifier;
|
|
46
|
+
private _applyRealtimeTransformModifiers;
|
|
39
47
|
private _applyProportionalResize;
|
|
40
48
|
private _syncRealtimeTransformPreview;
|
|
41
49
|
private _syncContainerDescendantPreviews;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import type { UnitModel } from '@univerjs/core';
|
|
2
|
+
import type { IRenderContext, IRenderModule } from '@univerjs/engine-render';
|
|
1
3
|
import { IBoardElementService } from '@univerjs-pro/boards';
|
|
2
4
|
import { ShapeFormulaService } from '@univerjs-pro/shape-editor';
|
|
3
5
|
import { IConfigService, IImageIoService, IUniverInstanceService, LocaleService, RxDisposable, ThemeService } from '@univerjs/core';
|
|
4
|
-
import type { UnitModel } from '@univerjs/core';
|
|
5
|
-
import type { IRenderContext, IRenderModule } from '@univerjs/engine-render';
|
|
6
6
|
import { IBoardElementStateService } from '../services/board-element-state.service';
|
|
7
7
|
import { IBoardUIStateService } from '../services/board-ui-state.service';
|
|
8
8
|
export declare const BOARD_MAIN_VIEWPORT_KEY = "viewMain";
|
|
@@ -19,6 +19,9 @@ export declare class BoardRenderController extends RxDisposable implements IRend
|
|
|
19
19
|
private readonly _shapeFormulaService;
|
|
20
20
|
private readonly _imageIoService?;
|
|
21
21
|
private readonly _renderedObjectKeys;
|
|
22
|
+
private _renderedObjectsByKey;
|
|
23
|
+
private readonly _connectorRoutingCache;
|
|
24
|
+
private readonly _connectorLineJumpCache;
|
|
22
25
|
private _renderedObjectLayerIndexes;
|
|
23
26
|
private _focusedSwimlaneFocus;
|
|
24
27
|
private _backgroundRect;
|
|
@@ -26,7 +29,6 @@ export declare class BoardRenderController extends RxDisposable implements IRend
|
|
|
26
29
|
private _init;
|
|
27
30
|
private _resolvePageBackgroundFill;
|
|
28
31
|
private _syncBackgroundRectToViewport;
|
|
29
|
-
private _enableStableLayerCaches;
|
|
30
32
|
private _syncSceneViewport;
|
|
31
33
|
private _syncFocusedSwimlaneLane;
|
|
32
34
|
private _clearRenderedBoardObjects;
|
|
@@ -16,6 +16,7 @@ export declare class BoardSelectionOverlayRenderController extends RxDisposable
|
|
|
16
16
|
private readonly _configService;
|
|
17
17
|
private readonly _boardTextEditingService;
|
|
18
18
|
private _areTransformGuidesDisabled;
|
|
19
|
+
private _transformGuideCandidates;
|
|
19
20
|
private _marqueeObject;
|
|
20
21
|
private _dimensionsObject;
|
|
21
22
|
private _guideObject;
|
|
@@ -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;
|
|
@@ -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 @@
|
|
|
1
|
+
import './f-board-layout';
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
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';
|
|
5
9
|
export { BOARD_SHORTCUT_BINDINGS } from './common/board-shortcuts';
|
|
6
10
|
export { BOARDS_UI_PLUGIN_CONFIG_KEY } from './config/config';
|
|
11
|
+
export { resolveBoardRenderAdapters } from './config/config';
|
|
7
12
|
export type { BoardToolbarToolConfig, 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';
|
|
@@ -26,6 +31,8 @@ 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';
|
|
@@ -41,7 +48,8 @@ export { resolveRotatedBoardObjectAnchorBound } from './utils/board-floating-too
|
|
|
41
48
|
export { resolveBoardFloatingToolbarSelection } from './utils/board-floating-toolbar-selection.util';
|
|
42
49
|
export type { BoardFloatingToolbarOwner, IBoardFloatingToolbarSelection, IResolveBoardFloatingToolbarSelectionOptions, } from './utils/board-floating-toolbar-selection.util';
|
|
43
50
|
export { resolveBoardInteractionConfig } from './utils/board-interaction-config.util';
|
|
51
|
+
export { resolveBoardElementBounds } from './utils/board-selection-geometry.util';
|
|
44
52
|
export { getBoardPointFromClient } from './utils/board-viewport.util';
|
|
45
|
-
export { BOARD_TOP_RIGHT_MENU_LEADING_PART } from './views/BoardSettingsMenu';
|
|
53
|
+
export { BOARD_SETTINGS_MENU_ACTIONS_PART, BOARD_TOP_RIGHT_MENU_LEADING_PART } from './views/BoardSettingsMenu';
|
|
46
54
|
export { BoardShapeTextEditorContainer } from './views/BoardShapeTextEditorContainer';
|
|
47
55
|
export { BoardWorkbench } from './views/BoardWorkbench';
|
|
@@ -109,8 +109,6 @@ declare const locale: {
|
|
|
109
109
|
showDimensions: string;
|
|
110
110
|
showToolbar: string;
|
|
111
111
|
translateInto: string;
|
|
112
|
-
import: string;
|
|
113
|
-
export: string;
|
|
114
112
|
};
|
|
115
113
|
objectListPanel: {
|
|
116
114
|
title: string;
|
|
@@ -195,7 +193,6 @@ declare const locale: {
|
|
|
195
193
|
mindMap: string;
|
|
196
194
|
resources: string;
|
|
197
195
|
image: string;
|
|
198
|
-
import: string;
|
|
199
196
|
wrapInContainer: string;
|
|
200
197
|
addSwimlaneLane: string;
|
|
201
198
|
swimlaneMenu: string;
|
|
@@ -208,38 +205,6 @@ declare const locale: {
|
|
|
208
205
|
sendToBack: string;
|
|
209
206
|
more: string;
|
|
210
207
|
};
|
|
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
208
|
shapePresets: {
|
|
244
209
|
roundedRectangle: string;
|
|
245
210
|
oval: string;
|
|
@@ -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,9 @@
|
|
|
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 { BoardConnectorRoutingCache } from '../utils/board-connector-routing.util';
|
|
6
|
+
import { BaseObject } from '@univerjs/engine-render';
|
|
6
7
|
import { resolveBoardConnectorPathBounds, resolveBoardConnectorPathCommands, resolveBoardConnectorRoutePoints } from '../utils/board-connector-routing.util';
|
|
7
8
|
export interface IBoardConnectorObjectProps {
|
|
8
9
|
left: number;
|
|
@@ -15,6 +16,8 @@ export interface IBoardConnectorObjectProps {
|
|
|
15
16
|
evented?: boolean;
|
|
16
17
|
element: IBoardConnectorElement;
|
|
17
18
|
elementData?: Record<string, IBoardElementData>;
|
|
19
|
+
lineJumpCache?: BoardConnectorLineJumpCache;
|
|
20
|
+
routingCache?: BoardConnectorRoutingCache;
|
|
18
21
|
localeService?: LocaleService;
|
|
19
22
|
}
|
|
20
23
|
export interface IBoardConnectorRouteCache {
|
|
@@ -22,10 +25,30 @@ export interface IBoardConnectorRouteCache {
|
|
|
22
25
|
pathCommands: ReturnType<typeof resolveBoardConnectorPathCommands>;
|
|
23
26
|
bounds: ReturnType<typeof resolveBoardConnectorPathBounds>;
|
|
24
27
|
}
|
|
28
|
+
interface IBoardConnectorLineJump {
|
|
29
|
+
x: number;
|
|
30
|
+
y: number;
|
|
31
|
+
distance: number;
|
|
32
|
+
}
|
|
33
|
+
type BoardConnectorRouteResolver = typeof resolveBoardConnectorRoutePoints;
|
|
34
|
+
export declare class BoardConnectorLineJumpCache {
|
|
35
|
+
private readonly _resolveRoutePoints;
|
|
36
|
+
private _elementData?;
|
|
37
|
+
private readonly _routePointsByConnectorId;
|
|
38
|
+
private readonly _lineJumpsByConnectorId;
|
|
39
|
+
constructor(_resolveRoutePoints?: BoardConnectorRouteResolver);
|
|
40
|
+
invalidate(elementData?: Record<string, IBoardElementData>): void;
|
|
41
|
+
resolveLineJumpsForRoute(connectorId: string, routePoints: readonly IBoardConnectorPoint[]): readonly IBoardConnectorLineJump[][];
|
|
42
|
+
private _clear;
|
|
43
|
+
private _getRoutePoints;
|
|
44
|
+
private _resolveLineJumpsForSegment;
|
|
45
|
+
}
|
|
25
46
|
export declare class BoardConnectorObject extends BaseObject {
|
|
26
47
|
private _element;
|
|
27
48
|
private _elementData?;
|
|
28
49
|
private readonly _localeService?;
|
|
50
|
+
private readonly _lineJumpCache;
|
|
51
|
+
private readonly _routingCache?;
|
|
29
52
|
private readonly _documentTextRenderCache;
|
|
30
53
|
private _routeCache;
|
|
31
54
|
private _routeStabilityHint;
|
|
@@ -38,6 +61,7 @@ export declare class BoardConnectorObject extends BaseObject {
|
|
|
38
61
|
getRoutePoints(): IBoardConnectorPoint[];
|
|
39
62
|
getCachedRoutePoints(): readonly IBoardConnectorPoint[] | null;
|
|
40
63
|
getPathCommands(): import("../utils/board-connector-routing.util").BoardConnectorPathCommand[];
|
|
64
|
+
getRenderBounds(): ReturnType<typeof resolveBoardConnectorPathBounds>;
|
|
41
65
|
getLabelPathPoints(): IBoardConnectorPoint[];
|
|
42
66
|
getLabelRect(): IBoardConnectorLabelRect | null;
|
|
43
67
|
measureLabelNaturalHeight(width: number, documentData?: IDocumentData): number | null;
|
|
@@ -48,15 +72,16 @@ export declare class BoardConnectorObject extends BaseObject {
|
|
|
48
72
|
private _shouldUseRouteStabilityHint;
|
|
49
73
|
transformByState(option: IObjectFullState): this;
|
|
50
74
|
isHit(coord: Vector2): boolean;
|
|
75
|
+
hitTest(point: IBoardConnectorPoint): boolean;
|
|
51
76
|
render(ctx: UniverRenderingContext, _bounds: IViewportInfo): this;
|
|
52
77
|
private _clipRouteAroundLabel;
|
|
53
78
|
private _drawRoute;
|
|
54
79
|
private _drawRoundedOrthogonalRoute;
|
|
55
80
|
private _drawRouteWithLineJumps;
|
|
56
|
-
private _resolveLineJumpsForSegment;
|
|
57
81
|
private _drawPathCommands;
|
|
58
82
|
private _drawMarkers;
|
|
59
83
|
private _resolveEndpointVisualGap;
|
|
60
84
|
private _drawLabel;
|
|
61
85
|
private _drawLabelFrame;
|
|
62
86
|
}
|
|
87
|
+
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,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
|
+
}
|