drawui-core 0.5.0 → 0.5.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/README.md +26 -0
- package/dist/index.cjs +28 -28
- package/dist/index.d.cts +194 -46
- package/dist/index.d.ts +194 -46
- package/dist/index.js +28 -28
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -254,6 +254,11 @@ interface GenerationPreview {
|
|
|
254
254
|
to: Vec2;
|
|
255
255
|
/** 待放置图形的类型;不提供(指向已有图形)时只画线条 */
|
|
256
256
|
type?: ShapeType;
|
|
257
|
+
/** 待放置图形的尺寸(同型生成时沿用源图形尺寸,虚框必须按它画才与最终一致) */
|
|
258
|
+
size?: {
|
|
259
|
+
width: number;
|
|
260
|
+
height: number;
|
|
261
|
+
};
|
|
257
262
|
/** 源图形 id 与出线边:预览走与最终创建相同的「出线边同轴接入」路由 */
|
|
258
263
|
sourceShapeId?: string;
|
|
259
264
|
sourceEdge?: 'n' | 'e' | 's' | 'w';
|
|
@@ -340,6 +345,7 @@ interface DrawShape extends BaseShape {
|
|
|
340
345
|
points: Vec2[];
|
|
341
346
|
}
|
|
342
347
|
/** 思维导图节点:可带子节点;颜色/图标/属性说明均可手动覆盖,默认取层级色 */
|
|
348
|
+
type MindMapDirection = 'right' | 'left' | 'up' | 'down';
|
|
343
349
|
interface MindMapNode {
|
|
344
350
|
id: string;
|
|
345
351
|
text: string;
|
|
@@ -353,6 +359,13 @@ interface MindMapNode {
|
|
|
353
359
|
noteColor?: string;
|
|
354
360
|
collapsed?: boolean;
|
|
355
361
|
children?: MindMapNode[];
|
|
362
|
+
/** 该节点相对于父节点的生长方向;根节点无方向,子节点继承父方向(缺省为 right) */
|
|
363
|
+
direction?: MindMapDirection;
|
|
364
|
+
/** 手动拖拽产生的偏移(导图局部坐标,相对自动布局位置);拖拽节点时连子树一起平移 */
|
|
365
|
+
offset?: {
|
|
366
|
+
dx: number;
|
|
367
|
+
dy: number;
|
|
368
|
+
};
|
|
356
369
|
}
|
|
357
370
|
interface MindMapShape extends BaseShape {
|
|
358
371
|
type: 'mind-map';
|
|
@@ -846,6 +859,95 @@ declare function exportToBlob(shapes: Shape[], format: ExportFormat, opts?: Expo
|
|
|
846
859
|
/** 浏览器端触发下载 */
|
|
847
860
|
declare function downloadBlob(blob: Blob, fileName: string): void;
|
|
848
861
|
|
|
862
|
+
/** 不同层级节点的默认颜色,超过 6 层后循环复用 */
|
|
863
|
+
declare const MINDMAP_COLORS: string[];
|
|
864
|
+
declare const MINDMAP_FONT_SIZE = 14;
|
|
865
|
+
declare const MINDMAP_NODE_HEIGHT = 40;
|
|
866
|
+
declare const MINDMAP_MIN_WIDTH = 80;
|
|
867
|
+
declare const MINDMAP_MAX_WIDTH = 240;
|
|
868
|
+
/** 节点上「+」快捷按钮的圆钮半径(页面单位,随缩放一起放大,与折叠标记一致) */
|
|
869
|
+
declare const MINDMAP_HANDLE_RADIUS = 9;
|
|
870
|
+
/** 「+」圆钮的命中半径(比视觉半径大一点,好点中) */
|
|
871
|
+
declare const MINDMAP_HANDLE_HIT_RADIUS = 12;
|
|
872
|
+
declare const MINDMAP_DIRECTIONS: MindMapDirection[];
|
|
873
|
+
type MindMapHandleKind = 'child' | 'sibling';
|
|
874
|
+
interface MindMapHandlePos {
|
|
875
|
+
kind: MindMapHandleKind;
|
|
876
|
+
/** 该加号对应的子节点生长方向(根节点 child 加号有效;非根节点 child 与节点自身方向一致) */
|
|
877
|
+
direction: MindMapDirection;
|
|
878
|
+
/** 导图局部坐标(与 layoutMindMap 的 positions 同系,相对导图中心) */
|
|
879
|
+
x: number;
|
|
880
|
+
/** 导图局部坐标 */
|
|
881
|
+
y: number;
|
|
882
|
+
}
|
|
883
|
+
interface MindMapNodePos {
|
|
884
|
+
x: number;
|
|
885
|
+
y: number;
|
|
886
|
+
depth: number;
|
|
887
|
+
width: number;
|
|
888
|
+
height: number;
|
|
889
|
+
/** 该节点在布局中的有效生长方向 */
|
|
890
|
+
direction: MindMapDirection;
|
|
891
|
+
}
|
|
892
|
+
interface MindMapLayoutResult {
|
|
893
|
+
positions: Map<string, MindMapNodePos>;
|
|
894
|
+
width: number;
|
|
895
|
+
height: number;
|
|
896
|
+
}
|
|
897
|
+
declare function isHorizontalDirection(d: MindMapDirection): boolean;
|
|
898
|
+
/** 子节点的有效方向:自己显式设置优先,否则继承父方向 */
|
|
899
|
+
declare function effectiveDirection(node: MindMapNode, parentDir?: MindMapDirection): MindMapDirection;
|
|
900
|
+
/** 节点颜色:手动设置优先,否则按层级取默认色 */
|
|
901
|
+
declare function mindMapNodeColor(node: MindMapNode, depth: number): string;
|
|
902
|
+
/** 节点框尺寸:由文本长度决定(CJK 按全宽估算),图标占位额外加宽 */
|
|
903
|
+
declare function mindMapNodeSize(node: MindMapNode): {
|
|
904
|
+
width: number;
|
|
905
|
+
height: number;
|
|
906
|
+
};
|
|
907
|
+
/** 深拷贝节点树(撤销/重做快照用) */
|
|
908
|
+
declare function cloneMindMapNode(node: MindMapNode): MindMapNode;
|
|
909
|
+
declare function findMindMapNode(root: MindMapNode, nodeId: string): MindMapNode | null;
|
|
910
|
+
declare function getMindMapNodeDepth(root: MindMapNode, nodeId: string): number;
|
|
911
|
+
declare function getMindMapParent(root: MindMapNode, nodeId: string): MindMapNode | null;
|
|
912
|
+
declare function countMindMapNodes(root: MindMapNode): number;
|
|
913
|
+
/**
|
|
914
|
+
* 四方向树布局:根节点在中心,子节点可向 right/left/up/down 四个方向展开。
|
|
915
|
+
* 每个子节点继承所在分支的方向;同方向节点按顺序垂直/水平排列。
|
|
916
|
+
* 返回以内容包围盒中心为原点的局部坐标(shape.x/y 即该中心)。
|
|
917
|
+
*/
|
|
918
|
+
declare function layoutMindMap(root: MindMapNode): MindMapLayoutResult;
|
|
919
|
+
/**
|
|
920
|
+
* 活动节点上的「+」快捷按钮位置(导图局部坐标;绘制与命中检测共用这一份规则)。
|
|
921
|
+
*
|
|
922
|
+
* - 根节点:四个方向各一个 child 加号;
|
|
923
|
+
* - 非根节点:一个 child 加号(沿自身生长方向),一个 sibling 加号(水平节点在下方、垂直节点在右方)。
|
|
924
|
+
*/
|
|
925
|
+
declare function mindMapNodeHandles(root: MindMapNode, nodeId: string): MindMapHandlePos[];
|
|
926
|
+
/**
|
|
927
|
+
* 在一份**已算好的布局**上找「+」按钮(局部坐标):整棵树只走一遍,
|
|
928
|
+
* 避免「每个节点各算一次布局」的 O(N²)。命中检测走这个,绘制走 mindMapNodeHandles。
|
|
929
|
+
*/
|
|
930
|
+
declare function mindMapHandleAtLocalPoint(root: MindMapNode, positions: Map<string, MindMapNodePos>, lx: number, ly: number): {
|
|
931
|
+
nodeId: string;
|
|
932
|
+
kind: MindMapHandleKind;
|
|
933
|
+
direction: MindMapDirection;
|
|
934
|
+
} | null;
|
|
935
|
+
/**
|
|
936
|
+
* 获取节点在父节点同方向兄弟列表中的信息。
|
|
937
|
+
* 根节点的子节点按 direction 分组;普通节点的子节点全部继承父方向。
|
|
938
|
+
*/
|
|
939
|
+
declare function getMindMapNodeSiblings(root: MindMapNode, nodeId: string): {
|
|
940
|
+
parent: MindMapNode;
|
|
941
|
+
siblings: MindMapNode[];
|
|
942
|
+
index: number;
|
|
943
|
+
direction: MindMapDirection;
|
|
944
|
+
} | null;
|
|
945
|
+
/**
|
|
946
|
+
* 将指定节点在其同方向兄弟列表中移动到新的索引位置。
|
|
947
|
+
* newIndex 是相对于同 direction siblings 的索引。
|
|
948
|
+
*/
|
|
949
|
+
declare function reorderMindMapNodeInTree(root: MindMapNode, nodeId: string, newIndex: number): MindMapNode;
|
|
950
|
+
|
|
849
951
|
type Listener$1 = () => void;
|
|
850
952
|
type NotificationListener = (message: string) => void;
|
|
851
953
|
/** 核心 → React 的 UI 指令事件 */
|
|
@@ -915,6 +1017,20 @@ declare class Editor {
|
|
|
915
1017
|
private mindMapEditingShapeId;
|
|
916
1018
|
private mindMapSelectedNode;
|
|
917
1019
|
private mindMapHoverNode;
|
|
1020
|
+
/** 按下的节点「+」快捷按钮(抬手时若仍在同一按钮上才新建节点) */
|
|
1021
|
+
private pendingMindMapHandle;
|
|
1022
|
+
/**
|
|
1023
|
+
* 按在某个思维导图节点上的拖拽候选:移动超过阈值即开始「同方向重排序」。
|
|
1024
|
+
* 新交互下节点位置由布局决定,拖拽只改变同 direction 兄弟的排列顺序。
|
|
1025
|
+
*/
|
|
1026
|
+
private mindMapNodeDragCandidate;
|
|
1027
|
+
/** 是否已进入「拖动节点」状态(超过阈值后才算,避免单击误触发) */
|
|
1028
|
+
private isNodeDragging;
|
|
1029
|
+
/**
|
|
1030
|
+
* 重排序时的目标插入索引(相对于同 direction siblings);null 表示未确定。
|
|
1031
|
+
* siblingIds 已按 cross 坐标排好序,方便 Renderer 直接画插入指示线。
|
|
1032
|
+
*/
|
|
1033
|
+
private mindMapReorderTarget;
|
|
918
1034
|
private tableSelection;
|
|
919
1035
|
private tableEditing;
|
|
920
1036
|
private renderScheduled;
|
|
@@ -1072,7 +1188,7 @@ declare class Editor {
|
|
|
1072
1188
|
/**
|
|
1073
1189
|
* 创建"新图形 + 连线":在 to 处放置指定类型图形;若提供了 existingArrowId,
|
|
1074
1190
|
* 则把那条(已存在的浮动)线条末端接到新图形,否则新建一条连线。
|
|
1075
|
-
*
|
|
1191
|
+
* 新图形样式继承源图形(若有),**同型时尺寸也继承**(见 sourceSize)。
|
|
1076
1192
|
*/
|
|
1077
1193
|
createGeneratedConnection(context: GenerationContext, options: {
|
|
1078
1194
|
type: ShapeType;
|
|
@@ -1223,6 +1339,10 @@ declare class Editor {
|
|
|
1223
1339
|
getSelectedUml(): UmlClassShape | UmlInterfaceShape | null;
|
|
1224
1340
|
/** 按 id 查找 UML(类图或接口) */
|
|
1225
1341
|
private getUmlById;
|
|
1342
|
+
/** 页面坐标 → 思维导图局部坐标(逆旋转 + 平移) */
|
|
1343
|
+
private pageToMindMapLocal;
|
|
1344
|
+
/** 计算拖拽节点时,在其同方向兄弟列表中的目标插入索引 */
|
|
1345
|
+
private calcMindMapReorderTarget;
|
|
1226
1346
|
/** 获取选中的思维导图(恰好选中一个时) */
|
|
1227
1347
|
getSelectedMindMap(): MindMapShape | null;
|
|
1228
1348
|
/** 页面坐标下的思维导图节点命中:返回所在导图与节点 id */
|
|
@@ -1235,7 +1355,13 @@ declare class Editor {
|
|
|
1235
1355
|
shapeId: string;
|
|
1236
1356
|
nodeId: string;
|
|
1237
1357
|
} | null;
|
|
1238
|
-
/**
|
|
1358
|
+
/** 精确节点框命中:仅当页面坐标落在某个节点框内才返回该节点,导图空白/间隙返回 null
|
|
1359
|
+
* (区别于 getMindMapNodeAtPoint 的「落在包围盒内就回退根节点」,用于节点拖拽判定) */
|
|
1360
|
+
getMindMapNodeBoxAtPoint(point: Vec2): {
|
|
1361
|
+
shapeId: string;
|
|
1362
|
+
nodeId: string;
|
|
1363
|
+
} | null;
|
|
1364
|
+
/** 光标语义命中:仅节点框(含「+」快捷按钮、折叠/展开标记)内才命中,节点间空档不命中 */
|
|
1239
1365
|
getMindMapCursorHitAtPoint(point: Vec2): {
|
|
1240
1366
|
shapeId: string;
|
|
1241
1367
|
nodeId: string;
|
|
@@ -1263,17 +1389,44 @@ declare class Editor {
|
|
|
1263
1389
|
shapeId: string;
|
|
1264
1390
|
nodeId: string;
|
|
1265
1391
|
} | null;
|
|
1392
|
+
/** 页面坐标下「+」快捷新建按钮的命中检测(子节点 / 同级节点) */
|
|
1393
|
+
getMindMapHandleAtPoint(point: Vec2): {
|
|
1394
|
+
shapeId: string;
|
|
1395
|
+
nodeId: string;
|
|
1396
|
+
kind: MindMapHandleKind;
|
|
1397
|
+
direction: MindMapDirection;
|
|
1398
|
+
} | null;
|
|
1399
|
+
/**
|
|
1400
|
+
* 点「+」快捷按钮:新建子/同级节点并把新节点作为活动节点。
|
|
1401
|
+
* 新需求:点击加号**不进入就地文本编辑**,只添加节点。
|
|
1402
|
+
*/
|
|
1403
|
+
private addMindMapNodeFromHandle;
|
|
1266
1404
|
/** 进入思维导图编辑态(双击节点触发):选中导图并定位到节点 */
|
|
1267
1405
|
beginMindMapEdit(shapeId: string, nodeId: string | null): void;
|
|
1268
|
-
/**
|
|
1406
|
+
/**
|
|
1407
|
+
* 退出思维导图就地文本编辑(输入框收起)。
|
|
1408
|
+
* **活动节点保留**:导图仍被选中时,「+」快捷按钮继续挂在那个节点上,
|
|
1409
|
+
* 方便连续加节点;导图取消选中时由 render 里的钩子把活动节点一并清掉。
|
|
1410
|
+
*/
|
|
1269
1411
|
exitMindMapEdit(): void;
|
|
1270
1412
|
/** 更新思维导图某节点(文本/颜色/图标/说明等),自动重算布局尺寸。
|
|
1271
1413
|
* commit=false 时仅应用变更、不写历史(就地文本编辑逐键调用用);首个变更传入 commit=true 形成单个撤销点。 */
|
|
1272
1414
|
updateMindMapNode(shapeId: string, nodeId: string, patch: Partial<MindMapNode>, commit?: boolean): void;
|
|
1273
|
-
/**
|
|
1274
|
-
|
|
1275
|
-
|
|
1415
|
+
/** 设置思维导图某节点的手动偏移(拖拽用):连子树一起平移;不写历史(调用方在拖拽开始时 commitHistory 一次) */
|
|
1416
|
+
setMindMapNodeOffset(shapeId: string, nodeId: string, offset: {
|
|
1417
|
+
dx: number;
|
|
1418
|
+
dy: number;
|
|
1419
|
+
}): void;
|
|
1420
|
+
/**
|
|
1421
|
+
* 给指定节点添加一个子节点。
|
|
1422
|
+
* - 根节点:必须传入 direction,决定新子节点生长在哪个方向;
|
|
1423
|
+
* - 非根节点:direction 缺省则继承该节点自身方向。
|
|
1424
|
+
*/
|
|
1425
|
+
addMindMapChild(shapeId: string, nodeId: string, direction?: MindMapDirection): void;
|
|
1426
|
+
/** 给指定节点添加一个兄弟节点(根节点无兄弟);兄弟继承该节点方向 */
|
|
1276
1427
|
addMindMapSibling(shapeId: string, nodeId: string): void;
|
|
1428
|
+
/** 将节点在其同方向兄弟列表中移动到目标索引 */
|
|
1429
|
+
reorderMindMapNode(shapeId: string, nodeId: string, targetIndex: number): void;
|
|
1277
1430
|
/** 删除指定节点(含子树);删除根节点则移除整个思维导图 */
|
|
1278
1431
|
deleteMindMapNode(shapeId: string, nodeId: string): void;
|
|
1279
1432
|
/** 折叠/展开指定节点 */
|
|
@@ -1664,6 +1817,12 @@ declare class Renderer {
|
|
|
1664
1817
|
} | null, mindMapHover?: {
|
|
1665
1818
|
shapeId: string;
|
|
1666
1819
|
nodeId: string;
|
|
1820
|
+
} | null, mindMapReorderTarget?: {
|
|
1821
|
+
shapeId: string;
|
|
1822
|
+
nodeId: string;
|
|
1823
|
+
targetIndex: number;
|
|
1824
|
+
direction: MindMapDirection;
|
|
1825
|
+
siblingIds: string[];
|
|
1667
1826
|
} | null,
|
|
1668
1827
|
/** 导出用:非 null 时先以该颜色铺满整块画布(白底等),默认不铺(透明) */
|
|
1669
1828
|
background?: string | null,
|
|
@@ -1747,6 +1906,17 @@ declare class Renderer {
|
|
|
1747
1906
|
private drawMindMap;
|
|
1748
1907
|
private drawMindMapConnections;
|
|
1749
1908
|
private drawMindMapNodes;
|
|
1909
|
+
/**
|
|
1910
|
+
* 节点拖拽重排序时的「落点占位」预览。
|
|
1911
|
+
* 不再只画一条小线,而是在松手后会插入的位置画一个与节点等大的虚线圆角框:
|
|
1912
|
+
* 内边与同方向兄弟对齐、按 CROSS_GAP 让出缝隙,一眼能看出节点会落到哪里。
|
|
1913
|
+
*/
|
|
1914
|
+
private drawMindMapReorderIndicator;
|
|
1915
|
+
/**
|
|
1916
|
+
* 节点上的「+」快捷按钮:实心主色圆 + 白色加号,外圈再套一圈白环,
|
|
1917
|
+
* 让它压在连线上也能被看清楚。位置来自 mindMapNodeHandles(与命中检测同源)。
|
|
1918
|
+
*/
|
|
1919
|
+
private drawMindMapHandles;
|
|
1750
1920
|
/** 按像素宽度截断文本并加省略号 */
|
|
1751
1921
|
private ellipsizeText;
|
|
1752
1922
|
/**
|
|
@@ -2378,6 +2548,12 @@ declare class SelectTool extends Tool {
|
|
|
2378
2548
|
/** 生成点位命中阈值 / 单击 vs 拖动判定阈值 */
|
|
2379
2549
|
private static readonly GEN_HIT_THRESHOLD;
|
|
2380
2550
|
private static readonly CLICK_MOVE_THRESHOLD;
|
|
2551
|
+
/**
|
|
2552
|
+
* 「点击锚点生成图形」时源图形与新图形之间的默认间距(页面单位,**边到边**)。
|
|
2553
|
+
* 旧实现是「中心沿法线外移 96」:对默认矩形(120×60)实际边距只有 36,看着太挤;
|
|
2554
|
+
* 现在直接按边距算,取 36 + 40 = 76(用户要求 +40px),且不再随图形大小变化。
|
|
2555
|
+
*/
|
|
2556
|
+
private static readonly GEN_GAP;
|
|
2381
2557
|
/** 支持四边连接锚点的图形类型(矩形类、流程图形、UML 等) */
|
|
2382
2558
|
private static readonly GEN_SUPPORTED_TYPES;
|
|
2383
2559
|
/**
|
|
@@ -2389,8 +2565,18 @@ declare class SelectTool extends Tool {
|
|
|
2389
2565
|
private hitGenPoint;
|
|
2390
2566
|
/** 悬停(未按下)时指针所在的、支持连线锚点的图形 id(已选中的交给选择手柄,返回 null) */
|
|
2391
2567
|
private findHoverAnchorShape;
|
|
2392
|
-
/**
|
|
2568
|
+
/**
|
|
2569
|
+
* 生成点位预览的落点:拖动时跟随光标;静止/悬浮时沿出线方向外移
|
|
2570
|
+
* 「默认间距 GEN_GAP + 新图形在该方向上的半个尺寸」,即**两个图形边到边**留出 GEN_GAP。
|
|
2571
|
+
*/
|
|
2393
2572
|
private genPreviewTarget;
|
|
2573
|
+
/**
|
|
2574
|
+
* 「将要新建的图形」本体(预览虚框 / 避让 / 接入点计算共用):
|
|
2575
|
+
* 尺寸与最终 createGeneratedConnection 创建出来的完全一致(同型时沿用源图形尺寸)。
|
|
2576
|
+
*/
|
|
2577
|
+
private genGhostShape;
|
|
2578
|
+
/** 「将要新建的图形」的尺寸(页面单位) */
|
|
2579
|
+
private genGhostSize;
|
|
2394
2580
|
/** 生成拖动:更新预览(真实样式的连线 + 待放置图形虚框)与目标高亮 */
|
|
2395
2581
|
private handleGenerating;
|
|
2396
2582
|
private handleRotating;
|
|
@@ -2595,44 +2781,6 @@ declare class ArrowTool extends Tool {
|
|
|
2595
2781
|
private getCircleBindingPosition;
|
|
2596
2782
|
}
|
|
2597
2783
|
|
|
2598
|
-
/** 不同层级节点的默认颜色,超过 6 层后循环复用 */
|
|
2599
|
-
declare const MINDMAP_COLORS: string[];
|
|
2600
|
-
declare const MINDMAP_FONT_SIZE = 14;
|
|
2601
|
-
declare const MINDMAP_NODE_HEIGHT = 40;
|
|
2602
|
-
declare const MINDMAP_MIN_WIDTH = 80;
|
|
2603
|
-
declare const MINDMAP_MAX_WIDTH = 240;
|
|
2604
|
-
interface MindMapNodePos {
|
|
2605
|
-
x: number;
|
|
2606
|
-
y: number;
|
|
2607
|
-
depth: number;
|
|
2608
|
-
width: number;
|
|
2609
|
-
height: number;
|
|
2610
|
-
}
|
|
2611
|
-
interface MindMapLayoutResult {
|
|
2612
|
-
positions: Map<string, MindMapNodePos>;
|
|
2613
|
-
width: number;
|
|
2614
|
-
height: number;
|
|
2615
|
-
}
|
|
2616
|
-
/** 节点颜色:手动设置优先,否则按层级取默认色 */
|
|
2617
|
-
declare function mindMapNodeColor(node: MindMapNode, depth: number): string;
|
|
2618
|
-
/** 节点框尺寸:由文本长度决定(CJK 按全宽估算),图标占位额外加宽 */
|
|
2619
|
-
declare function mindMapNodeSize(node: MindMapNode): {
|
|
2620
|
-
width: number;
|
|
2621
|
-
height: number;
|
|
2622
|
-
};
|
|
2623
|
-
/** 深拷贝节点树(撤销/重做快照用) */
|
|
2624
|
-
declare function cloneMindMapNode(node: MindMapNode): MindMapNode;
|
|
2625
|
-
declare function findMindMapNode(root: MindMapNode, nodeId: string): MindMapNode | null;
|
|
2626
|
-
declare function getMindMapNodeDepth(root: MindMapNode, nodeId: string): number;
|
|
2627
|
-
declare function getMindMapParent(root: MindMapNode, nodeId: string): MindMapNode | null;
|
|
2628
|
-
declare function countMindMapNodes(root: MindMapNode): number;
|
|
2629
|
-
/**
|
|
2630
|
-
* 横向树布局:根在左,子节点向右展开,每个节点垂直居中于其子树。
|
|
2631
|
-
* 返回以内容包围盒中心为原点的局部坐标(shape.x/y 即该中心),
|
|
2632
|
-
* 便于复用现有选中框/旋转/命中检测逻辑。
|
|
2633
|
-
*/
|
|
2634
|
-
declare function layoutMindMap(root: MindMapNode): MindMapLayoutResult;
|
|
2635
|
-
|
|
2636
2784
|
/**
|
|
2637
2785
|
* 表格的纯数据操作(唯一实现):行列增删、合并/拆分、命中定位。
|
|
2638
2786
|
*
|
|
@@ -2839,4 +2987,4 @@ declare function imageDataUrl(src: string): string | null;
|
|
|
2839
2987
|
/** 清空缓存(测试/卸载时用;会释放自己创建的 blob 地址) */
|
|
2840
2988
|
declare function clearImageCache(): void;
|
|
2841
2989
|
|
|
2842
|
-
export { type ArrowBinding, type ArrowHeadType, type ArrowShape, type ArrowStyle, ArrowTool, BoardExtentKeeper, type BoardExtentResult, type BoardExtentUpdate, Camera, type CameraState, type CircleShape, type ConnectionType, DEFAULT_HIGHLIGHTER_COLOR, DEFAULT_IMAGE_MAX_SIZE_BYTES, type DiamondShape, type DrawShape, type DrawuiTheme, type DrawuiThemeSelection, Editor, type EditorData, type EditorOptions, type EditorState, type EllipseShape, type ExportFormat, type ExportOptions, type FreehandMode, FreehandTool, type GenerationContext, HandTool, type HexagonShape, ICONS, ICON_CATEGORIES, ICON_CATEGORY_INK, ICON_DEFAULT_INK, ICON_DEFAULT_SIZE, ICON_GRID, type IconCategoryId, type IconDef, type IconLayer, type IconShape, type ImageShape, type ImageUploadConfig, type ImageUploadOption, type ImageUploader, LANGUAGES, type Language, type LineShape, LineTool, MINDMAP_COLORS, MINDMAP_FONT_SIZE, MINDMAP_MAX_WIDTH, MINDMAP_MIN_WIDTH, MINDMAP_NODE_HEIGHT, MIN_HANDLE_SEGMENT, MIN_JOG, Mat2d, type MessageKey, type MindMapLayoutResult, type MindMapNode, type MindMapNodePos, type MindMapShape, type OctagonShape, type ParallelogramShape, type PentagonShape, type Rect, type RectangleShape, Renderer, type RoundedRectangleShape, STICKY_FOLD_RATIO, STICKY_NOTE_COLORS, STICKY_NOTE_DEFAULT_COLOR, STICKY_TEXT_SCALE, type SegmentHandle, SelectTool, type Shape, type ShapeStyle, ShapeTool, type ShapeType, type SnapGuide, type StarShape, type StickyNoteShape, TABLE_CELL_PADDING_X, TABLE_CELL_PADDING_Y, TABLE_DEFAULT_COL_WIDTH, TABLE_DEFAULT_ROW_HEIGHT, TABLE_FONT_SIZE, TABLE_HEADER_FILL, TABLE_LINE_HEIGHT_RATIO, TABLE_MAX_AUTO_LINES, TABLE_MIN_COL_WIDTH, TABLE_MIN_ROW_HEIGHT, TABLE_MOVE_HANDLE_GAP, TABLE_MOVE_HANDLE_HEIGHT, TABLE_MOVE_HANDLE_WIDTH, THEME, type TableCell, type TableShape, type TextShape, type ToolType, type TrapezoidShape, type TriangleShape, UML_FONT_SIZE, UML_HEADER_HEIGHT, UML_LINE_HEIGHT, UML_MIN_WIDTH, UML_PADDING_X, UML_PADDING_Y, type UiEvent, type UmlAttribute, type UmlClassShape, type UmlInterfaceShape, type UmlMethod, type UmlVisibility, Vec, type Vec2 as Vec2Type, addImageReadyListener, calcUmlClassSize, clearImageCache, cloneMindMapNode, cloneTable, cloneTableCells, collapseRoute, collectTemporaryImageSrcs, connectorSegmentHandles, countMindMapNodes, createTableCells, downloadBlob, ensureImagesLoaded, exportToBlob, findMindMapNode, getContentBounds, getIcon, getLanguage, getMindMapNodeDepth, getMindMapParent, getTheme, hasIcon, hexToRgba, hitTableBody, hitTableMoveHandle, iconInk, iconsByCategory, imageDataUrl, isEmptyRect, isFlippableShapeType, isImageFailed, isImageLoading, isStubCorner, isUploaderFunction, layoutMindMap, loadImage, mindMapNodeColor, mindMapNodeSize, offsetConnectorSegment, parseUploadResponse, peekImage, pickSegmentHandle, pointToSegmentDistance, pruneStubBends, rectsIntersect, renderSVGString, renderToCanvas, routeToUserPoints, sameRoute, searchIcons, setImageCrossOrigin, setLanguage, setTheme, shadeColor, subscribeLanguage, subscribeTheme, subtractUnion, t, tableAnchorAt, tableCellAtLocalClamped, tableCellLineCount, tableCellLocalRect, tableCellTextStartOffset, tableCoveredMap, tableDeleteColumn, tableDeleteRow, tableExpandRangeToMerges, tableGrowRowHeights, tableInsertColumn, tableInsertRow, tableLocalPoint, tableMerge, tableMoveHandleLocalRect, tablePagePoint, tableRangeHasMerge, tableRangeLocalRect, tableRowAtPoint, tableSplit, tableSplitRange, tableTotalHeight, tableTotalWidth, umlAttrRowText, umlMethodRowText, unionRect, uploadImageViaConfig };
|
|
2990
|
+
export { type ArrowBinding, type ArrowHeadType, type ArrowShape, type ArrowStyle, ArrowTool, BoardExtentKeeper, type BoardExtentResult, type BoardExtentUpdate, Camera, type CameraState, type CircleShape, type ConnectionType, DEFAULT_HIGHLIGHTER_COLOR, DEFAULT_IMAGE_MAX_SIZE_BYTES, type DiamondShape, type DrawShape, type DrawuiTheme, type DrawuiThemeSelection, Editor, type EditorData, type EditorOptions, type EditorState, type EllipseShape, type ExportFormat, type ExportOptions, type FreehandMode, FreehandTool, type GenerationContext, HandTool, type HexagonShape, ICONS, ICON_CATEGORIES, ICON_CATEGORY_INK, ICON_DEFAULT_INK, ICON_DEFAULT_SIZE, ICON_GRID, type IconCategoryId, type IconDef, type IconLayer, type IconShape, type ImageShape, type ImageUploadConfig, type ImageUploadOption, type ImageUploader, LANGUAGES, type Language, type LineShape, LineTool, MINDMAP_COLORS, MINDMAP_DIRECTIONS, MINDMAP_FONT_SIZE, MINDMAP_HANDLE_HIT_RADIUS, MINDMAP_HANDLE_RADIUS, MINDMAP_MAX_WIDTH, MINDMAP_MIN_WIDTH, MINDMAP_NODE_HEIGHT, MIN_HANDLE_SEGMENT, MIN_JOG, Mat2d, type MessageKey, type MindMapDirection, type MindMapHandleKind, type MindMapHandlePos, type MindMapLayoutResult, type MindMapNode, type MindMapNodePos, type MindMapShape, type OctagonShape, type ParallelogramShape, type PentagonShape, type Rect, type RectangleShape, Renderer, type RoundedRectangleShape, STICKY_FOLD_RATIO, STICKY_NOTE_COLORS, STICKY_NOTE_DEFAULT_COLOR, STICKY_TEXT_SCALE, type SegmentHandle, SelectTool, type Shape, type ShapeStyle, ShapeTool, type ShapeType, type SnapGuide, type StarShape, type StickyNoteShape, TABLE_CELL_PADDING_X, TABLE_CELL_PADDING_Y, TABLE_DEFAULT_COL_WIDTH, TABLE_DEFAULT_ROW_HEIGHT, TABLE_FONT_SIZE, TABLE_HEADER_FILL, TABLE_LINE_HEIGHT_RATIO, TABLE_MAX_AUTO_LINES, TABLE_MIN_COL_WIDTH, TABLE_MIN_ROW_HEIGHT, TABLE_MOVE_HANDLE_GAP, TABLE_MOVE_HANDLE_HEIGHT, TABLE_MOVE_HANDLE_WIDTH, THEME, type TableCell, type TableShape, type TextShape, type ToolType, type TrapezoidShape, type TriangleShape, UML_FONT_SIZE, UML_HEADER_HEIGHT, UML_LINE_HEIGHT, UML_MIN_WIDTH, UML_PADDING_X, UML_PADDING_Y, type UiEvent, type UmlAttribute, type UmlClassShape, type UmlInterfaceShape, type UmlMethod, type UmlVisibility, Vec, type Vec2 as Vec2Type, addImageReadyListener, calcUmlClassSize, clearImageCache, cloneMindMapNode, cloneTable, cloneTableCells, collapseRoute, collectTemporaryImageSrcs, connectorSegmentHandles, countMindMapNodes, createTableCells, downloadBlob, effectiveDirection, ensureImagesLoaded, exportToBlob, findMindMapNode, getContentBounds, getIcon, getLanguage, getMindMapNodeDepth, getMindMapNodeSiblings, getMindMapParent, getTheme, hasIcon, hexToRgba, hitTableBody, hitTableMoveHandle, iconInk, iconsByCategory, imageDataUrl, isEmptyRect, isFlippableShapeType, isHorizontalDirection, isImageFailed, isImageLoading, isStubCorner, isUploaderFunction, layoutMindMap, loadImage, mindMapHandleAtLocalPoint, mindMapNodeColor, mindMapNodeHandles, mindMapNodeSize, offsetConnectorSegment, parseUploadResponse, peekImage, pickSegmentHandle, pointToSegmentDistance, pruneStubBends, rectsIntersect, renderSVGString, renderToCanvas, reorderMindMapNodeInTree, routeToUserPoints, sameRoute, searchIcons, setImageCrossOrigin, setLanguage, setTheme, shadeColor, subscribeLanguage, subscribeTheme, subtractUnion, t, tableAnchorAt, tableCellAtLocalClamped, tableCellLineCount, tableCellLocalRect, tableCellTextStartOffset, tableCoveredMap, tableDeleteColumn, tableDeleteRow, tableExpandRangeToMerges, tableGrowRowHeights, tableInsertColumn, tableInsertRow, tableLocalPoint, tableMerge, tableMoveHandleLocalRect, tablePagePoint, tableRangeHasMerge, tableRangeLocalRect, tableRowAtPoint, tableSplit, tableSplitRange, tableTotalHeight, tableTotalWidth, umlAttrRowText, umlMethodRowText, unionRect, uploadImageViaConfig };
|