@8btc/whiteboard 0.0.20-alpha.14 → 0.0.20-alpha.15

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/dist/index.d.ts CHANGED
@@ -109,6 +109,12 @@ export declare class CanvasApi extends CanvasCore {
109
109
  moveNodesToBottom(nodeIds: string[]): void;
110
110
  moveNodesUp(nodeIds: string[]): void;
111
111
  moveNodesDown(nodeIds: string[]): void;
112
+ /**
113
+ * 按照给定的 ID 数组顺序重新排列节点
114
+ * 数组中的第一个节点将位于最底层,最后一个节点位于最顶层
115
+ * @param nodeIds - 节点 ID 数组,按从底层到顶层的顺序排列
116
+ */
117
+ reorderNodes(nodeIds: string[]): void;
112
118
  /**
113
119
  * 滚动到内容区域
114
120
  * - 如果提供了 nodeIds,将指定的节点居中显示
package/dist/index.js CHANGED
@@ -18935,6 +18935,21 @@ class NC extends MC {
18935
18935
  r && r.moveDown();
18936
18936
  }), this._syncNodesZIndexToStore());
18937
18937
  }
18938
+ /**
18939
+ * 按照给定的 ID 数组顺序重新排列节点
18940
+ * 数组中的第一个节点将位于最底层,最后一个节点位于最顶层
18941
+ * @param nodeIds - 节点 ID 数组,按从底层到顶层的顺序排列
18942
+ */
18943
+ reorderNodes(e) {
18944
+ if (e.length === 0) return;
18945
+ const t = [];
18946
+ e.forEach((r) => {
18947
+ const i = this.getStage().findOne(`#${r}`);
18948
+ i && t.push(i);
18949
+ }), t.length !== 0 && (t.forEach((r, i) => {
18950
+ r.zIndex(i);
18951
+ }), this._syncNodesZIndexToStore());
18952
+ }
18938
18953
  /**
18939
18954
  * 滚动到内容区域
18940
18955
  * - 如果提供了 nodeIds,将指定的节点居中显示
package/dist/maze.d.ts CHANGED
@@ -118,6 +118,12 @@ declare class CanvasApi extends CanvasCore {
118
118
  moveNodesToBottom(nodeIds: string[]): void;
119
119
  moveNodesUp(nodeIds: string[]): void;
120
120
  moveNodesDown(nodeIds: string[]): void;
121
+ /**
122
+ * 按照给定的 ID 数组顺序重新排列节点
123
+ * 数组中的第一个节点将位于最底层,最后一个节点位于最顶层
124
+ * @param nodeIds - 节点 ID 数组,按从底层到顶层的顺序排列
125
+ */
126
+ reorderNodes(nodeIds: string[]): void;
121
127
  /**
122
128
  * 滚动到内容区域
123
129
  * - 如果提供了 nodeIds,将指定的节点居中显示
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@8btc/whiteboard",
3
3
  "private": false,
4
- "version": "0.0.20-alpha.14",
4
+ "version": "0.0.20-alpha.15",
5
5
  "type": "module",
6
6
  "main": "./dist/index.umd.js",
7
7
  "module": "./dist/index.js",