microboard-temp 0.13.24 → 0.13.26

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.
@@ -54760,14 +54760,14 @@ class ForceGraphEngine {
54760
54760
  tick() {
54761
54761
  const dt = this.TICK_MS / 1000;
54762
54762
  const activeIds = this.getActiveNodeIds();
54763
- const selectedIds = new Set(this.board.selection.list().map((i) => i.getId()));
54763
+ const draggedIds = this.board.getDraggedItemIds();
54764
54764
  const allNodes = this.getNodes();
54765
54765
  const nodes = allNodes.filter((item) => {
54766
54766
  if (!activeIds.has(item.getId()))
54767
54767
  return false;
54768
- if (selectedIds.has(item.getId()))
54768
+ if (draggedIds.has(item.getId()))
54769
54769
  return false;
54770
- if (item.parent !== "Board" && selectedIds.has(item.parent))
54770
+ if (item.parent !== "Board" && draggedIds.has(item.parent))
54771
54771
  return false;
54772
54772
  return true;
54773
54773
  });
@@ -54875,8 +54875,8 @@ class ForceGraphEngine {
54875
54875
  }
54876
54876
  syncPositions() {
54877
54877
  const activeIds = this.getActiveNodeIds();
54878
- const selectedIds = new Set(this.board.selection.list().map((i) => i.getId()));
54879
- const nodes = this.getNodes().filter((item) => activeIds.has(item.getId()) && !selectedIds.has(item.getId()) && !(item.parent !== "Board" && selectedIds.has(item.parent)));
54878
+ const draggedIds = this.board.getDraggedItemIds();
54879
+ const nodes = this.getNodes().filter((item) => activeIds.has(item.getId()) && !draggedIds.has(item.getId()) && !(item.parent !== "Board" && draggedIds.has(item.parent)));
54880
54880
  if (nodes.length === 0)
54881
54881
  return;
54882
54882
  const movedItems = nodes.map((item) => {
@@ -55998,6 +55998,18 @@ class Board {
55998
55998
  setForceGraphGap(nodeId, gap) {
55999
55999
  this.forceGraph?.setComponentTargetGap(nodeId, gap);
56000
56000
  }
56001
+ getDraggedItemIds() {
56002
+ const ids = new Set;
56003
+ const selectTool = this.tools.getSelect();
56004
+ if (this.selection.transformationRenderBlock) {
56005
+ for (const item of this.selection.list())
56006
+ ids.add(item.getId());
56007
+ }
56008
+ if (selectTool?.isDraggingUnselectedItem && selectTool.downOnItem) {
56009
+ ids.add(selectTool.downOnItem.getId());
56010
+ }
56011
+ return ids;
56012
+ }
56001
56013
  syncForceGraph() {
56002
56014
  this.forceGraph?.flushSync();
56003
56015
  }
package/dist/cjs/index.js CHANGED
@@ -54760,14 +54760,14 @@ class ForceGraphEngine {
54760
54760
  tick() {
54761
54761
  const dt = this.TICK_MS / 1000;
54762
54762
  const activeIds = this.getActiveNodeIds();
54763
- const selectedIds = new Set(this.board.selection.list().map((i) => i.getId()));
54763
+ const draggedIds = this.board.getDraggedItemIds();
54764
54764
  const allNodes = this.getNodes();
54765
54765
  const nodes = allNodes.filter((item) => {
54766
54766
  if (!activeIds.has(item.getId()))
54767
54767
  return false;
54768
- if (selectedIds.has(item.getId()))
54768
+ if (draggedIds.has(item.getId()))
54769
54769
  return false;
54770
- if (item.parent !== "Board" && selectedIds.has(item.parent))
54770
+ if (item.parent !== "Board" && draggedIds.has(item.parent))
54771
54771
  return false;
54772
54772
  return true;
54773
54773
  });
@@ -54875,8 +54875,8 @@ class ForceGraphEngine {
54875
54875
  }
54876
54876
  syncPositions() {
54877
54877
  const activeIds = this.getActiveNodeIds();
54878
- const selectedIds = new Set(this.board.selection.list().map((i) => i.getId()));
54879
- const nodes = this.getNodes().filter((item) => activeIds.has(item.getId()) && !selectedIds.has(item.getId()) && !(item.parent !== "Board" && selectedIds.has(item.parent)));
54878
+ const draggedIds = this.board.getDraggedItemIds();
54879
+ const nodes = this.getNodes().filter((item) => activeIds.has(item.getId()) && !draggedIds.has(item.getId()) && !(item.parent !== "Board" && draggedIds.has(item.parent)));
54880
54880
  if (nodes.length === 0)
54881
54881
  return;
54882
54882
  const movedItems = nodes.map((item) => {
@@ -55998,6 +55998,18 @@ class Board {
55998
55998
  setForceGraphGap(nodeId, gap) {
55999
55999
  this.forceGraph?.setComponentTargetGap(nodeId, gap);
56000
56000
  }
56001
+ getDraggedItemIds() {
56002
+ const ids = new Set;
56003
+ const selectTool = this.tools.getSelect();
56004
+ if (this.selection.transformationRenderBlock) {
56005
+ for (const item of this.selection.list())
56006
+ ids.add(item.getId());
56007
+ }
56008
+ if (selectTool?.isDraggingUnselectedItem && selectTool.downOnItem) {
56009
+ ids.add(selectTool.downOnItem.getId());
56010
+ }
56011
+ return ids;
56012
+ }
56001
56013
  syncForceGraph() {
56002
56014
  this.forceGraph?.flushSync();
56003
56015
  }
package/dist/cjs/node.js CHANGED
@@ -57233,14 +57233,14 @@ class ForceGraphEngine {
57233
57233
  tick() {
57234
57234
  const dt = this.TICK_MS / 1000;
57235
57235
  const activeIds = this.getActiveNodeIds();
57236
- const selectedIds = new Set(this.board.selection.list().map((i) => i.getId()));
57236
+ const draggedIds = this.board.getDraggedItemIds();
57237
57237
  const allNodes = this.getNodes();
57238
57238
  const nodes = allNodes.filter((item) => {
57239
57239
  if (!activeIds.has(item.getId()))
57240
57240
  return false;
57241
- if (selectedIds.has(item.getId()))
57241
+ if (draggedIds.has(item.getId()))
57242
57242
  return false;
57243
- if (item.parent !== "Board" && selectedIds.has(item.parent))
57243
+ if (item.parent !== "Board" && draggedIds.has(item.parent))
57244
57244
  return false;
57245
57245
  return true;
57246
57246
  });
@@ -57348,8 +57348,8 @@ class ForceGraphEngine {
57348
57348
  }
57349
57349
  syncPositions() {
57350
57350
  const activeIds = this.getActiveNodeIds();
57351
- const selectedIds = new Set(this.board.selection.list().map((i) => i.getId()));
57352
- const nodes = this.getNodes().filter((item) => activeIds.has(item.getId()) && !selectedIds.has(item.getId()) && !(item.parent !== "Board" && selectedIds.has(item.parent)));
57351
+ const draggedIds = this.board.getDraggedItemIds();
57352
+ const nodes = this.getNodes().filter((item) => activeIds.has(item.getId()) && !draggedIds.has(item.getId()) && !(item.parent !== "Board" && draggedIds.has(item.parent)));
57353
57353
  if (nodes.length === 0)
57354
57354
  return;
57355
57355
  const movedItems = nodes.map((item) => {
@@ -58471,6 +58471,18 @@ class Board {
58471
58471
  setForceGraphGap(nodeId, gap) {
58472
58472
  this.forceGraph?.setComponentTargetGap(nodeId, gap);
58473
58473
  }
58474
+ getDraggedItemIds() {
58475
+ const ids = new Set;
58476
+ const selectTool = this.tools.getSelect();
58477
+ if (this.selection.transformationRenderBlock) {
58478
+ for (const item of this.selection.list())
58479
+ ids.add(item.getId());
58480
+ }
58481
+ if (selectTool?.isDraggingUnselectedItem && selectTool.downOnItem) {
58482
+ ids.add(selectTool.downOnItem.getId());
58483
+ }
58484
+ return ids;
58485
+ }
58474
58486
  syncForceGraph() {
58475
58487
  this.forceGraph?.flushSync();
58476
58488
  }
@@ -54589,14 +54589,14 @@ class ForceGraphEngine {
54589
54589
  tick() {
54590
54590
  const dt = this.TICK_MS / 1000;
54591
54591
  const activeIds = this.getActiveNodeIds();
54592
- const selectedIds = new Set(this.board.selection.list().map((i) => i.getId()));
54592
+ const draggedIds = this.board.getDraggedItemIds();
54593
54593
  const allNodes = this.getNodes();
54594
54594
  const nodes = allNodes.filter((item) => {
54595
54595
  if (!activeIds.has(item.getId()))
54596
54596
  return false;
54597
- if (selectedIds.has(item.getId()))
54597
+ if (draggedIds.has(item.getId()))
54598
54598
  return false;
54599
- if (item.parent !== "Board" && selectedIds.has(item.parent))
54599
+ if (item.parent !== "Board" && draggedIds.has(item.parent))
54600
54600
  return false;
54601
54601
  return true;
54602
54602
  });
@@ -54704,8 +54704,8 @@ class ForceGraphEngine {
54704
54704
  }
54705
54705
  syncPositions() {
54706
54706
  const activeIds = this.getActiveNodeIds();
54707
- const selectedIds = new Set(this.board.selection.list().map((i) => i.getId()));
54708
- const nodes = this.getNodes().filter((item) => activeIds.has(item.getId()) && !selectedIds.has(item.getId()) && !(item.parent !== "Board" && selectedIds.has(item.parent)));
54707
+ const draggedIds = this.board.getDraggedItemIds();
54708
+ const nodes = this.getNodes().filter((item) => activeIds.has(item.getId()) && !draggedIds.has(item.getId()) && !(item.parent !== "Board" && draggedIds.has(item.parent)));
54709
54709
  if (nodes.length === 0)
54710
54710
  return;
54711
54711
  const movedItems = nodes.map((item) => {
@@ -55827,6 +55827,18 @@ class Board {
55827
55827
  setForceGraphGap(nodeId, gap) {
55828
55828
  this.forceGraph?.setComponentTargetGap(nodeId, gap);
55829
55829
  }
55830
+ getDraggedItemIds() {
55831
+ const ids = new Set;
55832
+ const selectTool = this.tools.getSelect();
55833
+ if (this.selection.transformationRenderBlock) {
55834
+ for (const item of this.selection.list())
55835
+ ids.add(item.getId());
55836
+ }
55837
+ if (selectTool?.isDraggingUnselectedItem && selectTool.downOnItem) {
55838
+ ids.add(selectTool.downOnItem.getId());
55839
+ }
55840
+ return ids;
55841
+ }
55830
55842
  syncForceGraph() {
55831
55843
  this.forceGraph?.flushSync();
55832
55844
  }
package/dist/esm/index.js CHANGED
@@ -54582,14 +54582,14 @@ class ForceGraphEngine {
54582
54582
  tick() {
54583
54583
  const dt = this.TICK_MS / 1000;
54584
54584
  const activeIds = this.getActiveNodeIds();
54585
- const selectedIds = new Set(this.board.selection.list().map((i) => i.getId()));
54585
+ const draggedIds = this.board.getDraggedItemIds();
54586
54586
  const allNodes = this.getNodes();
54587
54587
  const nodes = allNodes.filter((item) => {
54588
54588
  if (!activeIds.has(item.getId()))
54589
54589
  return false;
54590
- if (selectedIds.has(item.getId()))
54590
+ if (draggedIds.has(item.getId()))
54591
54591
  return false;
54592
- if (item.parent !== "Board" && selectedIds.has(item.parent))
54592
+ if (item.parent !== "Board" && draggedIds.has(item.parent))
54593
54593
  return false;
54594
54594
  return true;
54595
54595
  });
@@ -54697,8 +54697,8 @@ class ForceGraphEngine {
54697
54697
  }
54698
54698
  syncPositions() {
54699
54699
  const activeIds = this.getActiveNodeIds();
54700
- const selectedIds = new Set(this.board.selection.list().map((i) => i.getId()));
54701
- const nodes = this.getNodes().filter((item) => activeIds.has(item.getId()) && !selectedIds.has(item.getId()) && !(item.parent !== "Board" && selectedIds.has(item.parent)));
54700
+ const draggedIds = this.board.getDraggedItemIds();
54701
+ const nodes = this.getNodes().filter((item) => activeIds.has(item.getId()) && !draggedIds.has(item.getId()) && !(item.parent !== "Board" && draggedIds.has(item.parent)));
54702
54702
  if (nodes.length === 0)
54703
54703
  return;
54704
54704
  const movedItems = nodes.map((item) => {
@@ -55820,6 +55820,18 @@ class Board {
55820
55820
  setForceGraphGap(nodeId, gap) {
55821
55821
  this.forceGraph?.setComponentTargetGap(nodeId, gap);
55822
55822
  }
55823
+ getDraggedItemIds() {
55824
+ const ids = new Set;
55825
+ const selectTool = this.tools.getSelect();
55826
+ if (this.selection.transformationRenderBlock) {
55827
+ for (const item of this.selection.list())
55828
+ ids.add(item.getId());
55829
+ }
55830
+ if (selectTool?.isDraggingUnselectedItem && selectTool.downOnItem) {
55831
+ ids.add(selectTool.downOnItem.getId());
55832
+ }
55833
+ return ids;
55834
+ }
55823
55835
  syncForceGraph() {
55824
55836
  this.forceGraph?.flushSync();
55825
55837
  }
package/dist/esm/node.js CHANGED
@@ -57050,14 +57050,14 @@ class ForceGraphEngine {
57050
57050
  tick() {
57051
57051
  const dt = this.TICK_MS / 1000;
57052
57052
  const activeIds = this.getActiveNodeIds();
57053
- const selectedIds = new Set(this.board.selection.list().map((i) => i.getId()));
57053
+ const draggedIds = this.board.getDraggedItemIds();
57054
57054
  const allNodes = this.getNodes();
57055
57055
  const nodes = allNodes.filter((item) => {
57056
57056
  if (!activeIds.has(item.getId()))
57057
57057
  return false;
57058
- if (selectedIds.has(item.getId()))
57058
+ if (draggedIds.has(item.getId()))
57059
57059
  return false;
57060
- if (item.parent !== "Board" && selectedIds.has(item.parent))
57060
+ if (item.parent !== "Board" && draggedIds.has(item.parent))
57061
57061
  return false;
57062
57062
  return true;
57063
57063
  });
@@ -57165,8 +57165,8 @@ class ForceGraphEngine {
57165
57165
  }
57166
57166
  syncPositions() {
57167
57167
  const activeIds = this.getActiveNodeIds();
57168
- const selectedIds = new Set(this.board.selection.list().map((i) => i.getId()));
57169
- const nodes = this.getNodes().filter((item) => activeIds.has(item.getId()) && !selectedIds.has(item.getId()) && !(item.parent !== "Board" && selectedIds.has(item.parent)));
57168
+ const draggedIds = this.board.getDraggedItemIds();
57169
+ const nodes = this.getNodes().filter((item) => activeIds.has(item.getId()) && !draggedIds.has(item.getId()) && !(item.parent !== "Board" && draggedIds.has(item.parent)));
57170
57170
  if (nodes.length === 0)
57171
57171
  return;
57172
57172
  const movedItems = nodes.map((item) => {
@@ -58288,6 +58288,18 @@ class Board {
58288
58288
  setForceGraphGap(nodeId, gap) {
58289
58289
  this.forceGraph?.setComponentTargetGap(nodeId, gap);
58290
58290
  }
58291
+ getDraggedItemIds() {
58292
+ const ids = new Set;
58293
+ const selectTool = this.tools.getSelect();
58294
+ if (this.selection.transformationRenderBlock) {
58295
+ for (const item of this.selection.list())
58296
+ ids.add(item.getId());
58297
+ }
58298
+ if (selectTool?.isDraggingUnselectedItem && selectTool.downOnItem) {
58299
+ ids.add(selectTool.downOnItem.getId());
58300
+ }
58301
+ return ids;
58302
+ }
58291
58303
  syncForceGraph() {
58292
58304
  this.forceGraph?.flushSync();
58293
58305
  }
@@ -150,6 +150,11 @@ export declare class Board {
150
150
  getForceGraphGap(nodeId: string): number | undefined;
151
151
  /** Set the connector target gap (px) for the component containing `nodeId`. */
152
152
  setForceGraphGap(nodeId: string, gap: number): void;
153
+ /**
154
+ * Returns IDs of all items currently being dragged (both selected and unselected drag).
155
+ * Used by physics engines to skip items that are under user control.
156
+ */
157
+ getDraggedItemIds(): Set<string>;
153
158
  /** Flush pending physics positions to the server immediately (call before drag starts). */
154
159
  syncForceGraph(): void;
155
160
  /** Call after dragging a node to re-wake the physics engine if it was sleeping. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "microboard-temp",
3
- "version": "0.13.24",
3
+ "version": "0.13.26",
4
4
  "description": "A flexible interactive whiteboard library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",