microboard-temp 0.13.46 → 0.13.47

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.
@@ -60511,6 +60511,8 @@ class GravityEngine {
60511
60511
  return false;
60512
60512
  if (item.parent !== "Board" && draggedIds.has(item.parent))
60513
60513
  return false;
60514
+ if (this.board.isNodeInForceGraph(item.getId()))
60515
+ return false;
60514
60516
  return true;
60515
60517
  });
60516
60518
  if (items.length < 1)
@@ -60613,25 +60615,30 @@ class GravityEngine {
60613
60615
  return false;
60614
60616
  if (item.parent !== "Board" && draggedIds.has(item.parent))
60615
60617
  return false;
60618
+ if (this.board.isNodeInForceGraph(item.getId()))
60619
+ return false;
60616
60620
  return true;
60617
60621
  });
60618
60622
  if (items.length === 0)
60619
60623
  return;
60620
- const movedItems = items.map((item) => {
60624
+ const toSend = [];
60625
+ for (const item of items) {
60621
60626
  const id = item.getId();
60622
60627
  const pos = item.transformation.getTranslation();
60623
60628
  const last = this.lastSyncedPositions.get(id);
60624
60629
  const dx = last ? pos.x - last.x : 0;
60625
60630
  const dy = last ? pos.y - last.y : 0;
60626
- this.lastSyncedPositions.set(id, { x: pos.x, y: pos.y });
60627
- return { id, dx, dy };
60628
- }).filter(({ dx, dy }) => Math.abs(dx) > 0.5 || Math.abs(dy) > 0.5);
60629
- if (movedItems.length === 0)
60631
+ if (Math.abs(dx) > 0.5 || Math.abs(dy) > 0.5) {
60632
+ toSend.push({ id, dx, dy });
60633
+ this.lastSyncedPositions.set(id, { x: pos.x, y: pos.y });
60634
+ }
60635
+ }
60636
+ if (toSend.length === 0)
60630
60637
  return;
60631
60638
  const operation = {
60632
60639
  class: "Transformation",
60633
60640
  method: "applyMatrix",
60634
- items: movedItems.map(({ id, dx, dy }) => ({
60641
+ items: toSend.map(({ id, dx, dy }) => ({
60635
60642
  id,
60636
60643
  matrix: { translateX: dx, translateY: dy, scaleX: 1, scaleY: 1, shearX: 0, shearY: 0 }
60637
60644
  }))
package/dist/cjs/index.js CHANGED
@@ -60511,6 +60511,8 @@ class GravityEngine {
60511
60511
  return false;
60512
60512
  if (item.parent !== "Board" && draggedIds.has(item.parent))
60513
60513
  return false;
60514
+ if (this.board.isNodeInForceGraph(item.getId()))
60515
+ return false;
60514
60516
  return true;
60515
60517
  });
60516
60518
  if (items.length < 1)
@@ -60613,25 +60615,30 @@ class GravityEngine {
60613
60615
  return false;
60614
60616
  if (item.parent !== "Board" && draggedIds.has(item.parent))
60615
60617
  return false;
60618
+ if (this.board.isNodeInForceGraph(item.getId()))
60619
+ return false;
60616
60620
  return true;
60617
60621
  });
60618
60622
  if (items.length === 0)
60619
60623
  return;
60620
- const movedItems = items.map((item) => {
60624
+ const toSend = [];
60625
+ for (const item of items) {
60621
60626
  const id = item.getId();
60622
60627
  const pos = item.transformation.getTranslation();
60623
60628
  const last = this.lastSyncedPositions.get(id);
60624
60629
  const dx = last ? pos.x - last.x : 0;
60625
60630
  const dy = last ? pos.y - last.y : 0;
60626
- this.lastSyncedPositions.set(id, { x: pos.x, y: pos.y });
60627
- return { id, dx, dy };
60628
- }).filter(({ dx, dy }) => Math.abs(dx) > 0.5 || Math.abs(dy) > 0.5);
60629
- if (movedItems.length === 0)
60631
+ if (Math.abs(dx) > 0.5 || Math.abs(dy) > 0.5) {
60632
+ toSend.push({ id, dx, dy });
60633
+ this.lastSyncedPositions.set(id, { x: pos.x, y: pos.y });
60634
+ }
60635
+ }
60636
+ if (toSend.length === 0)
60630
60637
  return;
60631
60638
  const operation = {
60632
60639
  class: "Transformation",
60633
60640
  method: "applyMatrix",
60634
- items: movedItems.map(({ id, dx, dy }) => ({
60641
+ items: toSend.map(({ id, dx, dy }) => ({
60635
60642
  id,
60636
60643
  matrix: { translateX: dx, translateY: dy, scaleX: 1, scaleY: 1, shearX: 0, shearY: 0 }
60637
60644
  }))
package/dist/cjs/node.js CHANGED
@@ -62986,6 +62986,8 @@ class GravityEngine {
62986
62986
  return false;
62987
62987
  if (item.parent !== "Board" && draggedIds.has(item.parent))
62988
62988
  return false;
62989
+ if (this.board.isNodeInForceGraph(item.getId()))
62990
+ return false;
62989
62991
  return true;
62990
62992
  });
62991
62993
  if (items.length < 1)
@@ -63088,25 +63090,30 @@ class GravityEngine {
63088
63090
  return false;
63089
63091
  if (item.parent !== "Board" && draggedIds.has(item.parent))
63090
63092
  return false;
63093
+ if (this.board.isNodeInForceGraph(item.getId()))
63094
+ return false;
63091
63095
  return true;
63092
63096
  });
63093
63097
  if (items.length === 0)
63094
63098
  return;
63095
- const movedItems = items.map((item) => {
63099
+ const toSend = [];
63100
+ for (const item of items) {
63096
63101
  const id = item.getId();
63097
63102
  const pos = item.transformation.getTranslation();
63098
63103
  const last = this.lastSyncedPositions.get(id);
63099
63104
  const dx = last ? pos.x - last.x : 0;
63100
63105
  const dy = last ? pos.y - last.y : 0;
63101
- this.lastSyncedPositions.set(id, { x: pos.x, y: pos.y });
63102
- return { id, dx, dy };
63103
- }).filter(({ dx, dy }) => Math.abs(dx) > 0.5 || Math.abs(dy) > 0.5);
63104
- if (movedItems.length === 0)
63106
+ if (Math.abs(dx) > 0.5 || Math.abs(dy) > 0.5) {
63107
+ toSend.push({ id, dx, dy });
63108
+ this.lastSyncedPositions.set(id, { x: pos.x, y: pos.y });
63109
+ }
63110
+ }
63111
+ if (toSend.length === 0)
63105
63112
  return;
63106
63113
  const operation = {
63107
63114
  class: "Transformation",
63108
63115
  method: "applyMatrix",
63109
- items: movedItems.map(({ id, dx, dy }) => ({
63116
+ items: toSend.map(({ id, dx, dy }) => ({
63110
63117
  id,
63111
63118
  matrix: { translateX: dx, translateY: dy, scaleX: 1, scaleY: 1, shearX: 0, shearY: 0 }
63112
63119
  }))
@@ -60254,6 +60254,8 @@ class GravityEngine {
60254
60254
  return false;
60255
60255
  if (item.parent !== "Board" && draggedIds.has(item.parent))
60256
60256
  return false;
60257
+ if (this.board.isNodeInForceGraph(item.getId()))
60258
+ return false;
60257
60259
  return true;
60258
60260
  });
60259
60261
  if (items.length < 1)
@@ -60356,25 +60358,30 @@ class GravityEngine {
60356
60358
  return false;
60357
60359
  if (item.parent !== "Board" && draggedIds.has(item.parent))
60358
60360
  return false;
60361
+ if (this.board.isNodeInForceGraph(item.getId()))
60362
+ return false;
60359
60363
  return true;
60360
60364
  });
60361
60365
  if (items.length === 0)
60362
60366
  return;
60363
- const movedItems = items.map((item) => {
60367
+ const toSend = [];
60368
+ for (const item of items) {
60364
60369
  const id = item.getId();
60365
60370
  const pos = item.transformation.getTranslation();
60366
60371
  const last = this.lastSyncedPositions.get(id);
60367
60372
  const dx = last ? pos.x - last.x : 0;
60368
60373
  const dy = last ? pos.y - last.y : 0;
60369
- this.lastSyncedPositions.set(id, { x: pos.x, y: pos.y });
60370
- return { id, dx, dy };
60371
- }).filter(({ dx, dy }) => Math.abs(dx) > 0.5 || Math.abs(dy) > 0.5);
60372
- if (movedItems.length === 0)
60374
+ if (Math.abs(dx) > 0.5 || Math.abs(dy) > 0.5) {
60375
+ toSend.push({ id, dx, dy });
60376
+ this.lastSyncedPositions.set(id, { x: pos.x, y: pos.y });
60377
+ }
60378
+ }
60379
+ if (toSend.length === 0)
60373
60380
  return;
60374
60381
  const operation = {
60375
60382
  class: "Transformation",
60376
60383
  method: "applyMatrix",
60377
- items: movedItems.map(({ id, dx, dy }) => ({
60384
+ items: toSend.map(({ id, dx, dy }) => ({
60378
60385
  id,
60379
60386
  matrix: { translateX: dx, translateY: dy, scaleX: 1, scaleY: 1, shearX: 0, shearY: 0 }
60380
60387
  }))
package/dist/esm/index.js CHANGED
@@ -60247,6 +60247,8 @@ class GravityEngine {
60247
60247
  return false;
60248
60248
  if (item.parent !== "Board" && draggedIds.has(item.parent))
60249
60249
  return false;
60250
+ if (this.board.isNodeInForceGraph(item.getId()))
60251
+ return false;
60250
60252
  return true;
60251
60253
  });
60252
60254
  if (items.length < 1)
@@ -60349,25 +60351,30 @@ class GravityEngine {
60349
60351
  return false;
60350
60352
  if (item.parent !== "Board" && draggedIds.has(item.parent))
60351
60353
  return false;
60354
+ if (this.board.isNodeInForceGraph(item.getId()))
60355
+ return false;
60352
60356
  return true;
60353
60357
  });
60354
60358
  if (items.length === 0)
60355
60359
  return;
60356
- const movedItems = items.map((item) => {
60360
+ const toSend = [];
60361
+ for (const item of items) {
60357
60362
  const id = item.getId();
60358
60363
  const pos = item.transformation.getTranslation();
60359
60364
  const last = this.lastSyncedPositions.get(id);
60360
60365
  const dx = last ? pos.x - last.x : 0;
60361
60366
  const dy = last ? pos.y - last.y : 0;
60362
- this.lastSyncedPositions.set(id, { x: pos.x, y: pos.y });
60363
- return { id, dx, dy };
60364
- }).filter(({ dx, dy }) => Math.abs(dx) > 0.5 || Math.abs(dy) > 0.5);
60365
- if (movedItems.length === 0)
60367
+ if (Math.abs(dx) > 0.5 || Math.abs(dy) > 0.5) {
60368
+ toSend.push({ id, dx, dy });
60369
+ this.lastSyncedPositions.set(id, { x: pos.x, y: pos.y });
60370
+ }
60371
+ }
60372
+ if (toSend.length === 0)
60366
60373
  return;
60367
60374
  const operation = {
60368
60375
  class: "Transformation",
60369
60376
  method: "applyMatrix",
60370
- items: movedItems.map(({ id, dx, dy }) => ({
60377
+ items: toSend.map(({ id, dx, dy }) => ({
60371
60378
  id,
60372
60379
  matrix: { translateX: dx, translateY: dy, scaleX: 1, scaleY: 1, shearX: 0, shearY: 0 }
60373
60380
  }))
package/dist/esm/node.js CHANGED
@@ -62711,6 +62711,8 @@ class GravityEngine {
62711
62711
  return false;
62712
62712
  if (item.parent !== "Board" && draggedIds.has(item.parent))
62713
62713
  return false;
62714
+ if (this.board.isNodeInForceGraph(item.getId()))
62715
+ return false;
62714
62716
  return true;
62715
62717
  });
62716
62718
  if (items.length < 1)
@@ -62813,25 +62815,30 @@ class GravityEngine {
62813
62815
  return false;
62814
62816
  if (item.parent !== "Board" && draggedIds.has(item.parent))
62815
62817
  return false;
62818
+ if (this.board.isNodeInForceGraph(item.getId()))
62819
+ return false;
62816
62820
  return true;
62817
62821
  });
62818
62822
  if (items.length === 0)
62819
62823
  return;
62820
- const movedItems = items.map((item) => {
62824
+ const toSend = [];
62825
+ for (const item of items) {
62821
62826
  const id = item.getId();
62822
62827
  const pos = item.transformation.getTranslation();
62823
62828
  const last = this.lastSyncedPositions.get(id);
62824
62829
  const dx = last ? pos.x - last.x : 0;
62825
62830
  const dy = last ? pos.y - last.y : 0;
62826
- this.lastSyncedPositions.set(id, { x: pos.x, y: pos.y });
62827
- return { id, dx, dy };
62828
- }).filter(({ dx, dy }) => Math.abs(dx) > 0.5 || Math.abs(dy) > 0.5);
62829
- if (movedItems.length === 0)
62831
+ if (Math.abs(dx) > 0.5 || Math.abs(dy) > 0.5) {
62832
+ toSend.push({ id, dx, dy });
62833
+ this.lastSyncedPositions.set(id, { x: pos.x, y: pos.y });
62834
+ }
62835
+ }
62836
+ if (toSend.length === 0)
62830
62837
  return;
62831
62838
  const operation = {
62832
62839
  class: "Transformation",
62833
62840
  method: "applyMatrix",
62834
- items: movedItems.map(({ id, dx, dy }) => ({
62841
+ items: toSend.map(({ id, dx, dy }) => ({
62835
62842
  id,
62836
62843
  matrix: { translateX: dx, translateY: dy, scaleX: 1, scaleY: 1, shearX: 0, shearY: 0 }
62837
62844
  }))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "microboard-temp",
3
- "version": "0.13.46",
3
+ "version": "0.13.47",
4
4
  "description": "A flexible interactive whiteboard library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",