microboard-temp 0.4.94 → 0.4.95

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.
@@ -21474,6 +21474,7 @@ class BaseItem extends Mbr {
21474
21474
  onRemoveCallbacks = [];
21475
21475
  shouldUseCustomRender = false;
21476
21476
  shouldRenderOutsideViewRect = true;
21477
+ shouldUseRelativeAlignment = true;
21477
21478
  itemType = "";
21478
21479
  constructor(board, id = "", defaultItemData, isGroupItem) {
21479
21480
  super();
@@ -45714,10 +45715,10 @@ class AlignmentHelper {
45714
45715
  }
45715
45716
  };
45716
45717
  nearbyItems.forEach((item) => {
45717
- if (item === movingItem || item.itemType === "Comment") {
45718
+ if (item === movingItem || item.itemType === "Comment" || item instanceof BaseItem && !item.shouldUseRelativeAlignment) {
45718
45719
  return;
45719
45720
  }
45720
- const itemMbr = item.itemType === "Shape" ? item.getPath().getMbr() : item.getMbr();
45721
+ const itemMbr = item.getPathMbr();
45721
45722
  const centerXMoving = (movingMBR.left + movingMBR.right) / 2;
45722
45723
  const centerXItem = (itemMbr.left + itemMbr.right) / 2;
45723
45724
  const centerYMoving = (movingMBR.top + movingMBR.bottom) / 2;
@@ -47956,6 +47957,7 @@ class Deck extends BaseItem {
47956
47957
  });
47957
47958
  this.board.items.index.remove(foundItem);
47958
47959
  foundItem.parent = this.getId();
47960
+ foundItem.shouldUseRelativeAlignment = false;
47959
47961
  this.index?.insert(foundItem);
47960
47962
  }
47961
47963
  }
@@ -47980,6 +47982,7 @@ class Deck extends BaseItem {
47980
47982
  });
47981
47983
  this.index?.remove(foundItem);
47982
47984
  foundItem.parent = "Board";
47985
+ foundItem.shouldUseRelativeAlignment = true;
47983
47986
  this.board.items.index.insert(foundItem);
47984
47987
  }
47985
47988
  }
@@ -48067,8 +48070,8 @@ class Deck extends BaseItem {
48067
48070
  return;
48068
48071
  }
48069
48072
  const tempCanvas = conf.documentFactory.createElement("canvas");
48070
- tempCanvas.width = width2;
48071
- tempCanvas.height = height3;
48073
+ tempCanvas.width = 1e4;
48074
+ tempCanvas.height = 1e4;
48072
48075
  const tempCtx = tempCanvas.getContext("2d");
48073
48076
  if (!tempCtx)
48074
48077
  return;
package/dist/cjs/index.js CHANGED
@@ -21474,6 +21474,7 @@ class BaseItem extends Mbr {
21474
21474
  onRemoveCallbacks = [];
21475
21475
  shouldUseCustomRender = false;
21476
21476
  shouldRenderOutsideViewRect = true;
21477
+ shouldUseRelativeAlignment = true;
21477
21478
  itemType = "";
21478
21479
  constructor(board, id = "", defaultItemData, isGroupItem) {
21479
21480
  super();
@@ -45714,10 +45715,10 @@ class AlignmentHelper {
45714
45715
  }
45715
45716
  };
45716
45717
  nearbyItems.forEach((item) => {
45717
- if (item === movingItem || item.itemType === "Comment") {
45718
+ if (item === movingItem || item.itemType === "Comment" || item instanceof BaseItem && !item.shouldUseRelativeAlignment) {
45718
45719
  return;
45719
45720
  }
45720
- const itemMbr = item.itemType === "Shape" ? item.getPath().getMbr() : item.getMbr();
45721
+ const itemMbr = item.getPathMbr();
45721
45722
  const centerXMoving = (movingMBR.left + movingMBR.right) / 2;
45722
45723
  const centerXItem = (itemMbr.left + itemMbr.right) / 2;
45723
45724
  const centerYMoving = (movingMBR.top + movingMBR.bottom) / 2;
@@ -47956,6 +47957,7 @@ class Deck extends BaseItem {
47956
47957
  });
47957
47958
  this.board.items.index.remove(foundItem);
47958
47959
  foundItem.parent = this.getId();
47960
+ foundItem.shouldUseRelativeAlignment = false;
47959
47961
  this.index?.insert(foundItem);
47960
47962
  }
47961
47963
  }
@@ -47980,6 +47982,7 @@ class Deck extends BaseItem {
47980
47982
  });
47981
47983
  this.index?.remove(foundItem);
47982
47984
  foundItem.parent = "Board";
47985
+ foundItem.shouldUseRelativeAlignment = true;
47983
47986
  this.board.items.index.insert(foundItem);
47984
47987
  }
47985
47988
  }
@@ -48067,8 +48070,8 @@ class Deck extends BaseItem {
48067
48070
  return;
48068
48071
  }
48069
48072
  const tempCanvas = conf.documentFactory.createElement("canvas");
48070
- tempCanvas.width = width2;
48071
- tempCanvas.height = height3;
48073
+ tempCanvas.width = 1e4;
48074
+ tempCanvas.height = 1e4;
48072
48075
  const tempCtx = tempCanvas.getContext("2d");
48073
48076
  if (!tempCtx)
48074
48077
  return;
package/dist/cjs/node.js CHANGED
@@ -23946,6 +23946,7 @@ class BaseItem extends Mbr {
23946
23946
  onRemoveCallbacks = [];
23947
23947
  shouldUseCustomRender = false;
23948
23948
  shouldRenderOutsideViewRect = true;
23949
+ shouldUseRelativeAlignment = true;
23949
23950
  itemType = "";
23950
23951
  constructor(board, id = "", defaultItemData, isGroupItem) {
23951
23952
  super();
@@ -48187,10 +48188,10 @@ class AlignmentHelper {
48187
48188
  }
48188
48189
  };
48189
48190
  nearbyItems.forEach((item) => {
48190
- if (item === movingItem || item.itemType === "Comment") {
48191
+ if (item === movingItem || item.itemType === "Comment" || item instanceof BaseItem && !item.shouldUseRelativeAlignment) {
48191
48192
  return;
48192
48193
  }
48193
- const itemMbr = item.itemType === "Shape" ? item.getPath().getMbr() : item.getMbr();
48194
+ const itemMbr = item.getPathMbr();
48194
48195
  const centerXMoving = (movingMBR.left + movingMBR.right) / 2;
48195
48196
  const centerXItem = (itemMbr.left + itemMbr.right) / 2;
48196
48197
  const centerYMoving = (movingMBR.top + movingMBR.bottom) / 2;
@@ -50429,6 +50430,7 @@ class Deck extends BaseItem {
50429
50430
  });
50430
50431
  this.board.items.index.remove(foundItem);
50431
50432
  foundItem.parent = this.getId();
50433
+ foundItem.shouldUseRelativeAlignment = false;
50432
50434
  this.index?.insert(foundItem);
50433
50435
  }
50434
50436
  }
@@ -50453,6 +50455,7 @@ class Deck extends BaseItem {
50453
50455
  });
50454
50456
  this.index?.remove(foundItem);
50455
50457
  foundItem.parent = "Board";
50458
+ foundItem.shouldUseRelativeAlignment = true;
50456
50459
  this.board.items.index.insert(foundItem);
50457
50460
  }
50458
50461
  }
@@ -50540,8 +50543,8 @@ class Deck extends BaseItem {
50540
50543
  return;
50541
50544
  }
50542
50545
  const tempCanvas = conf.documentFactory.createElement("canvas");
50543
- tempCanvas.width = width2;
50544
- tempCanvas.height = height3;
50546
+ tempCanvas.width = 1e4;
50547
+ tempCanvas.height = 1e4;
50545
50548
  const tempCtx = tempCanvas.getContext("2d");
50546
50549
  if (!tempCtx)
50547
50550
  return;
@@ -21323,6 +21323,7 @@ class BaseItem extends Mbr {
21323
21323
  onRemoveCallbacks = [];
21324
21324
  shouldUseCustomRender = false;
21325
21325
  shouldRenderOutsideViewRect = true;
21326
+ shouldUseRelativeAlignment = true;
21326
21327
  itemType = "";
21327
21328
  constructor(board, id = "", defaultItemData, isGroupItem) {
21328
21329
  super();
@@ -45563,10 +45564,10 @@ class AlignmentHelper {
45563
45564
  }
45564
45565
  };
45565
45566
  nearbyItems.forEach((item) => {
45566
- if (item === movingItem || item.itemType === "Comment") {
45567
+ if (item === movingItem || item.itemType === "Comment" || item instanceof BaseItem && !item.shouldUseRelativeAlignment) {
45567
45568
  return;
45568
45569
  }
45569
- const itemMbr = item.itemType === "Shape" ? item.getPath().getMbr() : item.getMbr();
45570
+ const itemMbr = item.getPathMbr();
45570
45571
  const centerXMoving = (movingMBR.left + movingMBR.right) / 2;
45571
45572
  const centerXItem = (itemMbr.left + itemMbr.right) / 2;
45572
45573
  const centerYMoving = (movingMBR.top + movingMBR.bottom) / 2;
@@ -47805,6 +47806,7 @@ class Deck extends BaseItem {
47805
47806
  });
47806
47807
  this.board.items.index.remove(foundItem);
47807
47808
  foundItem.parent = this.getId();
47809
+ foundItem.shouldUseRelativeAlignment = false;
47808
47810
  this.index?.insert(foundItem);
47809
47811
  }
47810
47812
  }
@@ -47829,6 +47831,7 @@ class Deck extends BaseItem {
47829
47831
  });
47830
47832
  this.index?.remove(foundItem);
47831
47833
  foundItem.parent = "Board";
47834
+ foundItem.shouldUseRelativeAlignment = true;
47832
47835
  this.board.items.index.insert(foundItem);
47833
47836
  }
47834
47837
  }
@@ -47916,8 +47919,8 @@ class Deck extends BaseItem {
47916
47919
  return;
47917
47920
  }
47918
47921
  const tempCanvas = conf.documentFactory.createElement("canvas");
47919
- tempCanvas.width = width2;
47920
- tempCanvas.height = height3;
47922
+ tempCanvas.width = 1e4;
47923
+ tempCanvas.height = 1e4;
47921
47924
  const tempCtx = tempCanvas.getContext("2d");
47922
47925
  if (!tempCtx)
47923
47926
  return;
package/dist/esm/index.js CHANGED
@@ -21316,6 +21316,7 @@ class BaseItem extends Mbr {
21316
21316
  onRemoveCallbacks = [];
21317
21317
  shouldUseCustomRender = false;
21318
21318
  shouldRenderOutsideViewRect = true;
21319
+ shouldUseRelativeAlignment = true;
21319
21320
  itemType = "";
21320
21321
  constructor(board, id = "", defaultItemData, isGroupItem) {
21321
21322
  super();
@@ -45556,10 +45557,10 @@ class AlignmentHelper {
45556
45557
  }
45557
45558
  };
45558
45559
  nearbyItems.forEach((item) => {
45559
- if (item === movingItem || item.itemType === "Comment") {
45560
+ if (item === movingItem || item.itemType === "Comment" || item instanceof BaseItem && !item.shouldUseRelativeAlignment) {
45560
45561
  return;
45561
45562
  }
45562
- const itemMbr = item.itemType === "Shape" ? item.getPath().getMbr() : item.getMbr();
45563
+ const itemMbr = item.getPathMbr();
45563
45564
  const centerXMoving = (movingMBR.left + movingMBR.right) / 2;
45564
45565
  const centerXItem = (itemMbr.left + itemMbr.right) / 2;
45565
45566
  const centerYMoving = (movingMBR.top + movingMBR.bottom) / 2;
@@ -47798,6 +47799,7 @@ class Deck extends BaseItem {
47798
47799
  });
47799
47800
  this.board.items.index.remove(foundItem);
47800
47801
  foundItem.parent = this.getId();
47802
+ foundItem.shouldUseRelativeAlignment = false;
47801
47803
  this.index?.insert(foundItem);
47802
47804
  }
47803
47805
  }
@@ -47822,6 +47824,7 @@ class Deck extends BaseItem {
47822
47824
  });
47823
47825
  this.index?.remove(foundItem);
47824
47826
  foundItem.parent = "Board";
47827
+ foundItem.shouldUseRelativeAlignment = true;
47825
47828
  this.board.items.index.insert(foundItem);
47826
47829
  }
47827
47830
  }
@@ -47909,8 +47912,8 @@ class Deck extends BaseItem {
47909
47912
  return;
47910
47913
  }
47911
47914
  const tempCanvas = conf.documentFactory.createElement("canvas");
47912
- tempCanvas.width = width2;
47913
- tempCanvas.height = height3;
47915
+ tempCanvas.width = 1e4;
47916
+ tempCanvas.height = 1e4;
47914
47917
  const tempCtx = tempCanvas.getContext("2d");
47915
47918
  if (!tempCtx)
47916
47919
  return;
package/dist/esm/node.js CHANGED
@@ -23783,6 +23783,7 @@ class BaseItem extends Mbr {
23783
23783
  onRemoveCallbacks = [];
23784
23784
  shouldUseCustomRender = false;
23785
23785
  shouldRenderOutsideViewRect = true;
23786
+ shouldUseRelativeAlignment = true;
23786
23787
  itemType = "";
23787
23788
  constructor(board, id = "", defaultItemData, isGroupItem) {
23788
23789
  super();
@@ -48024,10 +48025,10 @@ class AlignmentHelper {
48024
48025
  }
48025
48026
  };
48026
48027
  nearbyItems.forEach((item) => {
48027
- if (item === movingItem || item.itemType === "Comment") {
48028
+ if (item === movingItem || item.itemType === "Comment" || item instanceof BaseItem && !item.shouldUseRelativeAlignment) {
48028
48029
  return;
48029
48030
  }
48030
- const itemMbr = item.itemType === "Shape" ? item.getPath().getMbr() : item.getMbr();
48031
+ const itemMbr = item.getPathMbr();
48031
48032
  const centerXMoving = (movingMBR.left + movingMBR.right) / 2;
48032
48033
  const centerXItem = (itemMbr.left + itemMbr.right) / 2;
48033
48034
  const centerYMoving = (movingMBR.top + movingMBR.bottom) / 2;
@@ -50266,6 +50267,7 @@ class Deck extends BaseItem {
50266
50267
  });
50267
50268
  this.board.items.index.remove(foundItem);
50268
50269
  foundItem.parent = this.getId();
50270
+ foundItem.shouldUseRelativeAlignment = false;
50269
50271
  this.index?.insert(foundItem);
50270
50272
  }
50271
50273
  }
@@ -50290,6 +50292,7 @@ class Deck extends BaseItem {
50290
50292
  });
50291
50293
  this.index?.remove(foundItem);
50292
50294
  foundItem.parent = "Board";
50295
+ foundItem.shouldUseRelativeAlignment = true;
50293
50296
  this.board.items.index.insert(foundItem);
50294
50297
  }
50295
50298
  }
@@ -50377,8 +50380,8 @@ class Deck extends BaseItem {
50377
50380
  return;
50378
50381
  }
50379
50382
  const tempCanvas = conf.documentFactory.createElement("canvas");
50380
- tempCanvas.width = width2;
50381
- tempCanvas.height = height3;
50383
+ tempCanvas.width = 1e4;
50384
+ tempCanvas.height = 1e4;
50382
50385
  const tempCtx = tempCanvas.getContext("2d");
50383
50386
  if (!tempCtx)
50384
50387
  return;
@@ -36,6 +36,7 @@ export declare class BaseItem extends Mbr implements Geometry {
36
36
  onRemoveCallbacks: (() => void)[];
37
37
  shouldUseCustomRender: boolean;
38
38
  shouldRenderOutsideViewRect: boolean;
39
+ shouldUseRelativeAlignment: boolean;
39
40
  itemType: string;
40
41
  constructor(board: Board, id?: string, defaultItemData?: BaseItemData | undefined, isGroupItem?: boolean);
41
42
  getId(): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "microboard-temp",
3
- "version": "0.4.94",
3
+ "version": "0.4.95",
4
4
  "description": "A flexible interactive whiteboard library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",