microboard-temp 0.5.37 → 0.5.39

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.
@@ -7070,7 +7070,8 @@ var conf = {
7070
7070
  cursorsMap,
7071
7071
  DECK_HORIZONTAL_OFFSET: 2,
7072
7072
  DECK_VERTICAL_OFFSET: 2,
7073
- CARD_DIMENSIONS: { width: 250, height: 400 }
7073
+ CARD_DIMENSIONS: { width: 250, height: 400 },
7074
+ DEFAULT_GAME_ITEM_DIMENSIONS: { width: 200, height: 200 }
7074
7075
  };
7075
7076
  initDefaultI18N();
7076
7077
 
@@ -21485,6 +21486,7 @@ class BaseItem extends Mbr {
21485
21486
  shouldRenderOutsideViewRect = true;
21486
21487
  shouldUseRelativeAlignment = true;
21487
21488
  enableResize = true;
21489
+ onlyProportionalResize = false;
21488
21490
  itemType = "";
21489
21491
  children = [];
21490
21492
  constructor(board, id = "", defaultItemData, isGroupItem) {
@@ -21724,7 +21726,7 @@ class BaseItem extends Mbr {
21724
21726
  return this.getMbr().combine(this.index.getMbr());
21725
21727
  }
21726
21728
  getPath() {
21727
- return new Path(this.getMbr().getLines());
21729
+ return new Path(this.getMbr().getLines(), true);
21728
21730
  }
21729
21731
  render(context) {
21730
21732
  if (this.index) {
@@ -47853,7 +47855,8 @@ var defaultCardData = {
47853
47855
  itemType: "Card",
47854
47856
  isOpen: false,
47855
47857
  faceUrl: "",
47856
- backsideUrl: ""
47858
+ backsideUrl: "",
47859
+ dimensions: { width: conf.CARD_DIMENSIONS.width, height: conf.CARD_DIMENSIONS.height }
47857
47860
  };
47858
47861
 
47859
47862
  class Card extends BaseItem {
@@ -47866,9 +47869,13 @@ class Card extends BaseItem {
47866
47869
  backside = null;
47867
47870
  imageToRender = null;
47868
47871
  shouldUseCustomRender = false;
47869
- enableResize = false;
47870
- constructor(board, id = "", urls) {
47872
+ onlyProportionalResize = true;
47873
+ dimensions = { width: conf.CARD_DIMENSIONS.width, height: conf.CARD_DIMENSIONS.height };
47874
+ constructor(board, id = "", urls, dimensions) {
47871
47875
  super(board, id, defaultCardData);
47876
+ if (dimensions) {
47877
+ this.dimensions = dimensions;
47878
+ }
47872
47879
  if (urls) {
47873
47880
  this.faceUrl = urls.faceUrl;
47874
47881
  this.backsideUrl = urls.backsideUrl;
@@ -47941,8 +47948,8 @@ class Card extends BaseItem {
47941
47948
  const transform = `translate(${translateX}px, ${translateY}px) scale(${scaleX}, ${scaleY})`;
47942
47949
  div.style.backgroundImage = `url(${this.imageToRender?.src || this.backsideUrl})`;
47943
47950
  div.id = this.getId();
47944
- div.style.width = `${conf.CARD_DIMENSIONS.width}px`;
47945
- div.style.height = `${conf.CARD_DIMENSIONS.height}px`;
47951
+ div.style.width = `${this.dimensions.width}px`;
47952
+ div.style.height = `${this.dimensions.height}px`;
47946
47953
  div.style.transformOrigin = "top left";
47947
47954
  div.style.transform = transform;
47948
47955
  div.style.position = "absolute";
@@ -47953,8 +47960,8 @@ class Card extends BaseItem {
47953
47960
  updateMbr() {
47954
47961
  const { translateX, translateY, scaleX, scaleY } = this.transformation.matrix;
47955
47962
  const rotation = this.transformation.getRotation();
47956
- const height3 = conf.CARD_DIMENSIONS.height * scaleY;
47957
- const width2 = conf.CARD_DIMENSIONS.width * scaleX;
47963
+ const height3 = this.dimensions.height * scaleY;
47964
+ const width2 = this.dimensions.width * scaleX;
47958
47965
  if (rotation % 180 === 0) {
47959
47966
  this.left = translateX;
47960
47967
  this.top = translateY;
@@ -51777,7 +51784,7 @@ function transformItems({
51777
51784
  setSnapCursorPos
51778
51785
  }) {
51779
51786
  const items = selection.items.list();
51780
- const includesProportionalItem = items.some((item) => item.itemType === "Sticker" || item.itemType === "RichText" || item.itemType === "AINode" || item.itemType === "Video" || item.itemType === "Audio");
51787
+ const includesProportionalItem = items.some((item) => item.itemType === "Sticker" || item.itemType === "RichText" || item.itemType === "AINode" || item.itemType === "Video" || item.itemType === "Audio" || item instanceof BaseItem && item.onlyProportionalResize);
51781
51788
  if (includesProportionalItem && (isWidth || isHeight)) {
51782
51789
  return null;
51783
51790
  }
package/dist/cjs/index.js CHANGED
@@ -7070,7 +7070,8 @@ var conf = {
7070
7070
  cursorsMap,
7071
7071
  DECK_HORIZONTAL_OFFSET: 2,
7072
7072
  DECK_VERTICAL_OFFSET: 2,
7073
- CARD_DIMENSIONS: { width: 250, height: 400 }
7073
+ CARD_DIMENSIONS: { width: 250, height: 400 },
7074
+ DEFAULT_GAME_ITEM_DIMENSIONS: { width: 200, height: 200 }
7074
7075
  };
7075
7076
  initDefaultI18N();
7076
7077
 
@@ -21485,6 +21486,7 @@ class BaseItem extends Mbr {
21485
21486
  shouldRenderOutsideViewRect = true;
21486
21487
  shouldUseRelativeAlignment = true;
21487
21488
  enableResize = true;
21489
+ onlyProportionalResize = false;
21488
21490
  itemType = "";
21489
21491
  children = [];
21490
21492
  constructor(board, id = "", defaultItemData, isGroupItem) {
@@ -21724,7 +21726,7 @@ class BaseItem extends Mbr {
21724
21726
  return this.getMbr().combine(this.index.getMbr());
21725
21727
  }
21726
21728
  getPath() {
21727
- return new Path(this.getMbr().getLines());
21729
+ return new Path(this.getMbr().getLines(), true);
21728
21730
  }
21729
21731
  render(context) {
21730
21732
  if (this.index) {
@@ -47853,7 +47855,8 @@ var defaultCardData = {
47853
47855
  itemType: "Card",
47854
47856
  isOpen: false,
47855
47857
  faceUrl: "",
47856
- backsideUrl: ""
47858
+ backsideUrl: "",
47859
+ dimensions: { width: conf.CARD_DIMENSIONS.width, height: conf.CARD_DIMENSIONS.height }
47857
47860
  };
47858
47861
 
47859
47862
  class Card extends BaseItem {
@@ -47866,9 +47869,13 @@ class Card extends BaseItem {
47866
47869
  backside = null;
47867
47870
  imageToRender = null;
47868
47871
  shouldUseCustomRender = false;
47869
- enableResize = false;
47870
- constructor(board, id = "", urls) {
47872
+ onlyProportionalResize = true;
47873
+ dimensions = { width: conf.CARD_DIMENSIONS.width, height: conf.CARD_DIMENSIONS.height };
47874
+ constructor(board, id = "", urls, dimensions) {
47871
47875
  super(board, id, defaultCardData);
47876
+ if (dimensions) {
47877
+ this.dimensions = dimensions;
47878
+ }
47872
47879
  if (urls) {
47873
47880
  this.faceUrl = urls.faceUrl;
47874
47881
  this.backsideUrl = urls.backsideUrl;
@@ -47941,8 +47948,8 @@ class Card extends BaseItem {
47941
47948
  const transform = `translate(${translateX}px, ${translateY}px) scale(${scaleX}, ${scaleY})`;
47942
47949
  div.style.backgroundImage = `url(${this.imageToRender?.src || this.backsideUrl})`;
47943
47950
  div.id = this.getId();
47944
- div.style.width = `${conf.CARD_DIMENSIONS.width}px`;
47945
- div.style.height = `${conf.CARD_DIMENSIONS.height}px`;
47951
+ div.style.width = `${this.dimensions.width}px`;
47952
+ div.style.height = `${this.dimensions.height}px`;
47946
47953
  div.style.transformOrigin = "top left";
47947
47954
  div.style.transform = transform;
47948
47955
  div.style.position = "absolute";
@@ -47953,8 +47960,8 @@ class Card extends BaseItem {
47953
47960
  updateMbr() {
47954
47961
  const { translateX, translateY, scaleX, scaleY } = this.transformation.matrix;
47955
47962
  const rotation = this.transformation.getRotation();
47956
- const height3 = conf.CARD_DIMENSIONS.height * scaleY;
47957
- const width2 = conf.CARD_DIMENSIONS.width * scaleX;
47963
+ const height3 = this.dimensions.height * scaleY;
47964
+ const width2 = this.dimensions.width * scaleX;
47958
47965
  if (rotation % 180 === 0) {
47959
47966
  this.left = translateX;
47960
47967
  this.top = translateY;
@@ -51777,7 +51784,7 @@ function transformItems({
51777
51784
  setSnapCursorPos
51778
51785
  }) {
51779
51786
  const items = selection.items.list();
51780
- const includesProportionalItem = items.some((item) => item.itemType === "Sticker" || item.itemType === "RichText" || item.itemType === "AINode" || item.itemType === "Video" || item.itemType === "Audio");
51787
+ const includesProportionalItem = items.some((item) => item.itemType === "Sticker" || item.itemType === "RichText" || item.itemType === "AINode" || item.itemType === "Video" || item.itemType === "Audio" || item instanceof BaseItem && item.onlyProportionalResize);
51781
51788
  if (includesProportionalItem && (isWidth || isHeight)) {
51782
51789
  return null;
51783
51790
  }
package/dist/cjs/node.js CHANGED
@@ -8107,7 +8107,8 @@ var conf = {
8107
8107
  cursorsMap,
8108
8108
  DECK_HORIZONTAL_OFFSET: 2,
8109
8109
  DECK_VERTICAL_OFFSET: 2,
8110
- CARD_DIMENSIONS: { width: 250, height: 400 }
8110
+ CARD_DIMENSIONS: { width: 250, height: 400 },
8111
+ DEFAULT_GAME_ITEM_DIMENSIONS: { width: 200, height: 200 }
8111
8112
  };
8112
8113
  initDefaultI18N();
8113
8114
 
@@ -23957,6 +23958,7 @@ class BaseItem extends Mbr {
23957
23958
  shouldRenderOutsideViewRect = true;
23958
23959
  shouldUseRelativeAlignment = true;
23959
23960
  enableResize = true;
23961
+ onlyProportionalResize = false;
23960
23962
  itemType = "";
23961
23963
  children = [];
23962
23964
  constructor(board, id = "", defaultItemData, isGroupItem) {
@@ -24196,7 +24198,7 @@ class BaseItem extends Mbr {
24196
24198
  return this.getMbr().combine(this.index.getMbr());
24197
24199
  }
24198
24200
  getPath() {
24199
- return new Path(this.getMbr().getLines());
24201
+ return new Path(this.getMbr().getLines(), true);
24200
24202
  }
24201
24203
  render(context) {
24202
24204
  if (this.index) {
@@ -50326,7 +50328,8 @@ var defaultCardData = {
50326
50328
  itemType: "Card",
50327
50329
  isOpen: false,
50328
50330
  faceUrl: "",
50329
- backsideUrl: ""
50331
+ backsideUrl: "",
50332
+ dimensions: { width: conf.CARD_DIMENSIONS.width, height: conf.CARD_DIMENSIONS.height }
50330
50333
  };
50331
50334
 
50332
50335
  class Card extends BaseItem {
@@ -50339,9 +50342,13 @@ class Card extends BaseItem {
50339
50342
  backside = null;
50340
50343
  imageToRender = null;
50341
50344
  shouldUseCustomRender = false;
50342
- enableResize = false;
50343
- constructor(board, id = "", urls) {
50345
+ onlyProportionalResize = true;
50346
+ dimensions = { width: conf.CARD_DIMENSIONS.width, height: conf.CARD_DIMENSIONS.height };
50347
+ constructor(board, id = "", urls, dimensions) {
50344
50348
  super(board, id, defaultCardData);
50349
+ if (dimensions) {
50350
+ this.dimensions = dimensions;
50351
+ }
50345
50352
  if (urls) {
50346
50353
  this.faceUrl = urls.faceUrl;
50347
50354
  this.backsideUrl = urls.backsideUrl;
@@ -50414,8 +50421,8 @@ class Card extends BaseItem {
50414
50421
  const transform = `translate(${translateX}px, ${translateY}px) scale(${scaleX}, ${scaleY})`;
50415
50422
  div.style.backgroundImage = `url(${this.imageToRender?.src || this.backsideUrl})`;
50416
50423
  div.id = this.getId();
50417
- div.style.width = `${conf.CARD_DIMENSIONS.width}px`;
50418
- div.style.height = `${conf.CARD_DIMENSIONS.height}px`;
50424
+ div.style.width = `${this.dimensions.width}px`;
50425
+ div.style.height = `${this.dimensions.height}px`;
50419
50426
  div.style.transformOrigin = "top left";
50420
50427
  div.style.transform = transform;
50421
50428
  div.style.position = "absolute";
@@ -50426,8 +50433,8 @@ class Card extends BaseItem {
50426
50433
  updateMbr() {
50427
50434
  const { translateX, translateY, scaleX, scaleY } = this.transformation.matrix;
50428
50435
  const rotation = this.transformation.getRotation();
50429
- const height3 = conf.CARD_DIMENSIONS.height * scaleY;
50430
- const width2 = conf.CARD_DIMENSIONS.width * scaleX;
50436
+ const height3 = this.dimensions.height * scaleY;
50437
+ const width2 = this.dimensions.width * scaleX;
50431
50438
  if (rotation % 180 === 0) {
50432
50439
  this.left = translateX;
50433
50440
  this.top = translateY;
@@ -54250,7 +54257,7 @@ function transformItems({
54250
54257
  setSnapCursorPos
54251
54258
  }) {
54252
54259
  const items = selection.items.list();
54253
- const includesProportionalItem = items.some((item) => item.itemType === "Sticker" || item.itemType === "RichText" || item.itemType === "AINode" || item.itemType === "Video" || item.itemType === "Audio");
54260
+ const includesProportionalItem = items.some((item) => item.itemType === "Sticker" || item.itemType === "RichText" || item.itemType === "AINode" || item.itemType === "Video" || item.itemType === "Audio" || item instanceof BaseItem && item.onlyProportionalResize);
54254
54261
  if (includesProportionalItem && (isWidth || isHeight)) {
54255
54262
  return null;
54256
54263
  }
@@ -6907,7 +6907,8 @@ var conf = {
6907
6907
  cursorsMap,
6908
6908
  DECK_HORIZONTAL_OFFSET: 2,
6909
6909
  DECK_VERTICAL_OFFSET: 2,
6910
- CARD_DIMENSIONS: { width: 250, height: 400 }
6910
+ CARD_DIMENSIONS: { width: 250, height: 400 },
6911
+ DEFAULT_GAME_ITEM_DIMENSIONS: { width: 200, height: 200 }
6911
6912
  };
6912
6913
  initDefaultI18N();
6913
6914
 
@@ -21331,6 +21332,7 @@ class BaseItem extends Mbr {
21331
21332
  shouldRenderOutsideViewRect = true;
21332
21333
  shouldUseRelativeAlignment = true;
21333
21334
  enableResize = true;
21335
+ onlyProportionalResize = false;
21334
21336
  itemType = "";
21335
21337
  children = [];
21336
21338
  constructor(board, id = "", defaultItemData, isGroupItem) {
@@ -21570,7 +21572,7 @@ class BaseItem extends Mbr {
21570
21572
  return this.getMbr().combine(this.index.getMbr());
21571
21573
  }
21572
21574
  getPath() {
21573
- return new Path(this.getMbr().getLines());
21575
+ return new Path(this.getMbr().getLines(), true);
21574
21576
  }
21575
21577
  render(context) {
21576
21578
  if (this.index) {
@@ -47699,7 +47701,8 @@ var defaultCardData = {
47699
47701
  itemType: "Card",
47700
47702
  isOpen: false,
47701
47703
  faceUrl: "",
47702
- backsideUrl: ""
47704
+ backsideUrl: "",
47705
+ dimensions: { width: conf.CARD_DIMENSIONS.width, height: conf.CARD_DIMENSIONS.height }
47703
47706
  };
47704
47707
 
47705
47708
  class Card extends BaseItem {
@@ -47712,9 +47715,13 @@ class Card extends BaseItem {
47712
47715
  backside = null;
47713
47716
  imageToRender = null;
47714
47717
  shouldUseCustomRender = false;
47715
- enableResize = false;
47716
- constructor(board, id = "", urls) {
47718
+ onlyProportionalResize = true;
47719
+ dimensions = { width: conf.CARD_DIMENSIONS.width, height: conf.CARD_DIMENSIONS.height };
47720
+ constructor(board, id = "", urls, dimensions) {
47717
47721
  super(board, id, defaultCardData);
47722
+ if (dimensions) {
47723
+ this.dimensions = dimensions;
47724
+ }
47718
47725
  if (urls) {
47719
47726
  this.faceUrl = urls.faceUrl;
47720
47727
  this.backsideUrl = urls.backsideUrl;
@@ -47787,8 +47794,8 @@ class Card extends BaseItem {
47787
47794
  const transform = `translate(${translateX}px, ${translateY}px) scale(${scaleX}, ${scaleY})`;
47788
47795
  div.style.backgroundImage = `url(${this.imageToRender?.src || this.backsideUrl})`;
47789
47796
  div.id = this.getId();
47790
- div.style.width = `${conf.CARD_DIMENSIONS.width}px`;
47791
- div.style.height = `${conf.CARD_DIMENSIONS.height}px`;
47797
+ div.style.width = `${this.dimensions.width}px`;
47798
+ div.style.height = `${this.dimensions.height}px`;
47792
47799
  div.style.transformOrigin = "top left";
47793
47800
  div.style.transform = transform;
47794
47801
  div.style.position = "absolute";
@@ -47799,8 +47806,8 @@ class Card extends BaseItem {
47799
47806
  updateMbr() {
47800
47807
  const { translateX, translateY, scaleX, scaleY } = this.transformation.matrix;
47801
47808
  const rotation = this.transformation.getRotation();
47802
- const height3 = conf.CARD_DIMENSIONS.height * scaleY;
47803
- const width2 = conf.CARD_DIMENSIONS.width * scaleX;
47809
+ const height3 = this.dimensions.height * scaleY;
47810
+ const width2 = this.dimensions.width * scaleX;
47804
47811
  if (rotation % 180 === 0) {
47805
47812
  this.left = translateX;
47806
47813
  this.top = translateY;
@@ -51623,7 +51630,7 @@ function transformItems({
51623
51630
  setSnapCursorPos
51624
51631
  }) {
51625
51632
  const items = selection.items.list();
51626
- const includesProportionalItem = items.some((item) => item.itemType === "Sticker" || item.itemType === "RichText" || item.itemType === "AINode" || item.itemType === "Video" || item.itemType === "Audio");
51633
+ const includesProportionalItem = items.some((item) => item.itemType === "Sticker" || item.itemType === "RichText" || item.itemType === "AINode" || item.itemType === "Video" || item.itemType === "Audio" || item instanceof BaseItem && item.onlyProportionalResize);
51627
51634
  if (includesProportionalItem && (isWidth || isHeight)) {
51628
51635
  return null;
51629
51636
  }
package/dist/esm/index.js CHANGED
@@ -6900,7 +6900,8 @@ var conf = {
6900
6900
  cursorsMap,
6901
6901
  DECK_HORIZONTAL_OFFSET: 2,
6902
6902
  DECK_VERTICAL_OFFSET: 2,
6903
- CARD_DIMENSIONS: { width: 250, height: 400 }
6903
+ CARD_DIMENSIONS: { width: 250, height: 400 },
6904
+ DEFAULT_GAME_ITEM_DIMENSIONS: { width: 200, height: 200 }
6904
6905
  };
6905
6906
  initDefaultI18N();
6906
6907
 
@@ -21324,6 +21325,7 @@ class BaseItem extends Mbr {
21324
21325
  shouldRenderOutsideViewRect = true;
21325
21326
  shouldUseRelativeAlignment = true;
21326
21327
  enableResize = true;
21328
+ onlyProportionalResize = false;
21327
21329
  itemType = "";
21328
21330
  children = [];
21329
21331
  constructor(board, id = "", defaultItemData, isGroupItem) {
@@ -21563,7 +21565,7 @@ class BaseItem extends Mbr {
21563
21565
  return this.getMbr().combine(this.index.getMbr());
21564
21566
  }
21565
21567
  getPath() {
21566
- return new Path(this.getMbr().getLines());
21568
+ return new Path(this.getMbr().getLines(), true);
21567
21569
  }
21568
21570
  render(context) {
21569
21571
  if (this.index) {
@@ -47692,7 +47694,8 @@ var defaultCardData = {
47692
47694
  itemType: "Card",
47693
47695
  isOpen: false,
47694
47696
  faceUrl: "",
47695
- backsideUrl: ""
47697
+ backsideUrl: "",
47698
+ dimensions: { width: conf.CARD_DIMENSIONS.width, height: conf.CARD_DIMENSIONS.height }
47696
47699
  };
47697
47700
 
47698
47701
  class Card extends BaseItem {
@@ -47705,9 +47708,13 @@ class Card extends BaseItem {
47705
47708
  backside = null;
47706
47709
  imageToRender = null;
47707
47710
  shouldUseCustomRender = false;
47708
- enableResize = false;
47709
- constructor(board, id = "", urls) {
47711
+ onlyProportionalResize = true;
47712
+ dimensions = { width: conf.CARD_DIMENSIONS.width, height: conf.CARD_DIMENSIONS.height };
47713
+ constructor(board, id = "", urls, dimensions) {
47710
47714
  super(board, id, defaultCardData);
47715
+ if (dimensions) {
47716
+ this.dimensions = dimensions;
47717
+ }
47711
47718
  if (urls) {
47712
47719
  this.faceUrl = urls.faceUrl;
47713
47720
  this.backsideUrl = urls.backsideUrl;
@@ -47780,8 +47787,8 @@ class Card extends BaseItem {
47780
47787
  const transform = `translate(${translateX}px, ${translateY}px) scale(${scaleX}, ${scaleY})`;
47781
47788
  div.style.backgroundImage = `url(${this.imageToRender?.src || this.backsideUrl})`;
47782
47789
  div.id = this.getId();
47783
- div.style.width = `${conf.CARD_DIMENSIONS.width}px`;
47784
- div.style.height = `${conf.CARD_DIMENSIONS.height}px`;
47790
+ div.style.width = `${this.dimensions.width}px`;
47791
+ div.style.height = `${this.dimensions.height}px`;
47785
47792
  div.style.transformOrigin = "top left";
47786
47793
  div.style.transform = transform;
47787
47794
  div.style.position = "absolute";
@@ -47792,8 +47799,8 @@ class Card extends BaseItem {
47792
47799
  updateMbr() {
47793
47800
  const { translateX, translateY, scaleX, scaleY } = this.transformation.matrix;
47794
47801
  const rotation = this.transformation.getRotation();
47795
- const height3 = conf.CARD_DIMENSIONS.height * scaleY;
47796
- const width2 = conf.CARD_DIMENSIONS.width * scaleX;
47802
+ const height3 = this.dimensions.height * scaleY;
47803
+ const width2 = this.dimensions.width * scaleX;
47797
47804
  if (rotation % 180 === 0) {
47798
47805
  this.left = translateX;
47799
47806
  this.top = translateY;
@@ -51616,7 +51623,7 @@ function transformItems({
51616
51623
  setSnapCursorPos
51617
51624
  }) {
51618
51625
  const items = selection.items.list();
51619
- const includesProportionalItem = items.some((item) => item.itemType === "Sticker" || item.itemType === "RichText" || item.itemType === "AINode" || item.itemType === "Video" || item.itemType === "Audio");
51626
+ const includesProportionalItem = items.some((item) => item.itemType === "Sticker" || item.itemType === "RichText" || item.itemType === "AINode" || item.itemType === "Video" || item.itemType === "Audio" || item instanceof BaseItem && item.onlyProportionalResize);
51620
51627
  if (includesProportionalItem && (isWidth || isHeight)) {
51621
51628
  return null;
51622
51629
  }
package/dist/esm/node.js CHANGED
@@ -7684,7 +7684,8 @@ var conf = {
7684
7684
  cursorsMap,
7685
7685
  DECK_HORIZONTAL_OFFSET: 2,
7686
7686
  DECK_VERTICAL_OFFSET: 2,
7687
- CARD_DIMENSIONS: { width: 250, height: 400 }
7687
+ CARD_DIMENSIONS: { width: 250, height: 400 },
7688
+ DEFAULT_GAME_ITEM_DIMENSIONS: { width: 200, height: 200 }
7688
7689
  };
7689
7690
  initDefaultI18N();
7690
7691
 
@@ -23791,6 +23792,7 @@ class BaseItem extends Mbr {
23791
23792
  shouldRenderOutsideViewRect = true;
23792
23793
  shouldUseRelativeAlignment = true;
23793
23794
  enableResize = true;
23795
+ onlyProportionalResize = false;
23794
23796
  itemType = "";
23795
23797
  children = [];
23796
23798
  constructor(board, id = "", defaultItemData, isGroupItem) {
@@ -24030,7 +24032,7 @@ class BaseItem extends Mbr {
24030
24032
  return this.getMbr().combine(this.index.getMbr());
24031
24033
  }
24032
24034
  getPath() {
24033
- return new Path(this.getMbr().getLines());
24035
+ return new Path(this.getMbr().getLines(), true);
24034
24036
  }
24035
24037
  render(context) {
24036
24038
  if (this.index) {
@@ -50160,7 +50162,8 @@ var defaultCardData = {
50160
50162
  itemType: "Card",
50161
50163
  isOpen: false,
50162
50164
  faceUrl: "",
50163
- backsideUrl: ""
50165
+ backsideUrl: "",
50166
+ dimensions: { width: conf.CARD_DIMENSIONS.width, height: conf.CARD_DIMENSIONS.height }
50164
50167
  };
50165
50168
 
50166
50169
  class Card extends BaseItem {
@@ -50173,9 +50176,13 @@ class Card extends BaseItem {
50173
50176
  backside = null;
50174
50177
  imageToRender = null;
50175
50178
  shouldUseCustomRender = false;
50176
- enableResize = false;
50177
- constructor(board, id = "", urls) {
50179
+ onlyProportionalResize = true;
50180
+ dimensions = { width: conf.CARD_DIMENSIONS.width, height: conf.CARD_DIMENSIONS.height };
50181
+ constructor(board, id = "", urls, dimensions) {
50178
50182
  super(board, id, defaultCardData);
50183
+ if (dimensions) {
50184
+ this.dimensions = dimensions;
50185
+ }
50179
50186
  if (urls) {
50180
50187
  this.faceUrl = urls.faceUrl;
50181
50188
  this.backsideUrl = urls.backsideUrl;
@@ -50248,8 +50255,8 @@ class Card extends BaseItem {
50248
50255
  const transform = `translate(${translateX}px, ${translateY}px) scale(${scaleX}, ${scaleY})`;
50249
50256
  div.style.backgroundImage = `url(${this.imageToRender?.src || this.backsideUrl})`;
50250
50257
  div.id = this.getId();
50251
- div.style.width = `${conf.CARD_DIMENSIONS.width}px`;
50252
- div.style.height = `${conf.CARD_DIMENSIONS.height}px`;
50258
+ div.style.width = `${this.dimensions.width}px`;
50259
+ div.style.height = `${this.dimensions.height}px`;
50253
50260
  div.style.transformOrigin = "top left";
50254
50261
  div.style.transform = transform;
50255
50262
  div.style.position = "absolute";
@@ -50260,8 +50267,8 @@ class Card extends BaseItem {
50260
50267
  updateMbr() {
50261
50268
  const { translateX, translateY, scaleX, scaleY } = this.transformation.matrix;
50262
50269
  const rotation = this.transformation.getRotation();
50263
- const height3 = conf.CARD_DIMENSIONS.height * scaleY;
50264
- const width2 = conf.CARD_DIMENSIONS.width * scaleX;
50270
+ const height3 = this.dimensions.height * scaleY;
50271
+ const width2 = this.dimensions.width * scaleX;
50265
50272
  if (rotation % 180 === 0) {
50266
50273
  this.left = translateX;
50267
50274
  this.top = translateY;
@@ -54084,7 +54091,7 @@ function transformItems({
54084
54091
  setSnapCursorPos
54085
54092
  }) {
54086
54093
  const items = selection.items.list();
54087
- const includesProportionalItem = items.some((item) => item.itemType === "Sticker" || item.itemType === "RichText" || item.itemType === "AINode" || item.itemType === "Video" || item.itemType === "Audio");
54094
+ const includesProportionalItem = items.some((item) => item.itemType === "Sticker" || item.itemType === "RichText" || item.itemType === "AINode" || item.itemType === "Video" || item.itemType === "Audio" || item instanceof BaseItem && item.onlyProportionalResize);
54088
54095
  if (includesProportionalItem && (isWidth || isHeight)) {
54089
54096
  return null;
54090
54097
  }
@@ -38,6 +38,7 @@ export declare class BaseItem extends Mbr implements Geometry {
38
38
  shouldRenderOutsideViewRect: boolean;
39
39
  shouldUseRelativeAlignment: boolean;
40
40
  enableResize: boolean;
41
+ onlyProportionalResize: boolean;
41
42
  itemType: string;
42
43
  children: string[];
43
44
  constructor(board: Board, id?: string, defaultItemData?: BaseItemData | undefined, isGroupItem?: boolean);
@@ -17,10 +17,17 @@ export declare class Card extends BaseItem {
17
17
  backside: HTMLImageElement | null;
18
18
  private imageToRender;
19
19
  shouldUseCustomRender: boolean;
20
- enableResize: boolean;
20
+ onlyProportionalResize: boolean;
21
+ dimensions: {
22
+ width: number;
23
+ height: number;
24
+ };
21
25
  constructor(board: Board, id?: string, urls?: {
22
26
  faceUrl: string;
23
27
  backsideUrl: string;
28
+ }, dimensions?: {
29
+ width: number;
30
+ height: number;
24
31
  });
25
32
  createImages(): void;
26
33
  updateImageToRender(): void;
@@ -236,6 +236,10 @@ export declare const conf: {
236
236
  width: number;
237
237
  height: number;
238
238
  };
239
+ DEFAULT_GAME_ITEM_DIMENSIONS: {
240
+ width: number;
241
+ height: number;
242
+ };
239
243
  };
240
244
  export type Settings = typeof conf;
241
245
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "microboard-temp",
3
- "version": "0.5.37",
3
+ "version": "0.5.39",
4
4
  "description": "A flexible interactive whiteboard library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",