microboard-temp 0.13.87 → 0.13.89

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.
@@ -13326,7 +13326,8 @@ var init_BaseItem = __esm(() => {
13326
13326
  const foundItem = this.board.items.getById(childId);
13327
13327
  if (this.parent !== childId && this.getId() !== childId && !this.hasAncestor(childId)) {
13328
13328
  if (!this.index?.getById(childId) && foundItem) {
13329
- const localMatrix = foundItem.transformation.toMatrix().toLocalOf(containerNestingMatrix);
13329
+ const worldMatrix = foundItem.getWorldMatrix();
13330
+ const localMatrix = worldMatrix.toLocalOf(containerNestingMatrix);
13330
13331
  const currentParentId = foundItem.parent;
13331
13332
  const currentParent = currentParentId !== "Board" ? this.board.items.getById(currentParentId) : undefined;
13332
13333
  const sourceIndex = currentParent?.index || this.board.items.index;
@@ -63896,7 +63897,21 @@ function createCanvasDrawer(board) {
63896
63897
  }).filter((item) => !!item);
63897
63898
  items.forEach((item) => {
63898
63899
  if (item.itemType !== "Frame") {
63899
- item.render(context);
63900
+ const baseItem = item;
63901
+ const isNested = baseItem.parent && baseItem.parent !== "Board";
63902
+ if (isNested) {
63903
+ const container2 = board2.items.getById(baseItem.parent);
63904
+ if (container2) {
63905
+ context.ctx.save();
63906
+ container2.getNestingMatrix().applyToContext(context.ctx);
63907
+ item.render(context);
63908
+ context.ctx.restore();
63909
+ } else {
63910
+ item.render(context);
63911
+ }
63912
+ } else {
63913
+ item.render(context);
63914
+ }
63900
63915
  board2.selection.renderItemMbr(context, item, board2.camera.getMatrix().scaleX);
63901
63916
  }
63902
63917
  });
@@ -64007,10 +64022,12 @@ function createCanvasDrawer(board) {
64007
64022
  return translation.map((i) => i.id).reduce((mbr, id) => {
64008
64023
  const item = board.items.getById(id);
64009
64024
  if (item) {
64025
+ const baseItem = item;
64026
+ const itemMbr = baseItem.parent && baseItem.parent !== "Board" ? baseItem.getWorldMbr() : item.getMbr();
64010
64027
  if (!mbr) {
64011
- mbr = item.getMbr();
64028
+ mbr = itemMbr;
64012
64029
  } else {
64013
- mbr.combine(item.getMbr());
64030
+ mbr.combine(itemMbr);
64014
64031
  if (item.itemType === "Frame") {
64015
64032
  mbr.combine(item.getRichText().getMbr());
64016
64033
  }
package/dist/cjs/index.js CHANGED
@@ -13326,7 +13326,8 @@ var init_BaseItem = __esm(() => {
13326
13326
  const foundItem = this.board.items.getById(childId);
13327
13327
  if (this.parent !== childId && this.getId() !== childId && !this.hasAncestor(childId)) {
13328
13328
  if (!this.index?.getById(childId) && foundItem) {
13329
- const localMatrix = foundItem.transformation.toMatrix().toLocalOf(containerNestingMatrix);
13329
+ const worldMatrix = foundItem.getWorldMatrix();
13330
+ const localMatrix = worldMatrix.toLocalOf(containerNestingMatrix);
13330
13331
  const currentParentId = foundItem.parent;
13331
13332
  const currentParent = currentParentId !== "Board" ? this.board.items.getById(currentParentId) : undefined;
13332
13333
  const sourceIndex = currentParent?.index || this.board.items.index;
@@ -63896,7 +63897,21 @@ function createCanvasDrawer(board) {
63896
63897
  }).filter((item) => !!item);
63897
63898
  items.forEach((item) => {
63898
63899
  if (item.itemType !== "Frame") {
63899
- item.render(context);
63900
+ const baseItem = item;
63901
+ const isNested = baseItem.parent && baseItem.parent !== "Board";
63902
+ if (isNested) {
63903
+ const container2 = board2.items.getById(baseItem.parent);
63904
+ if (container2) {
63905
+ context.ctx.save();
63906
+ container2.getNestingMatrix().applyToContext(context.ctx);
63907
+ item.render(context);
63908
+ context.ctx.restore();
63909
+ } else {
63910
+ item.render(context);
63911
+ }
63912
+ } else {
63913
+ item.render(context);
63914
+ }
63900
63915
  board2.selection.renderItemMbr(context, item, board2.camera.getMatrix().scaleX);
63901
63916
  }
63902
63917
  });
@@ -64007,10 +64022,12 @@ function createCanvasDrawer(board) {
64007
64022
  return translation.map((i) => i.id).reduce((mbr, id) => {
64008
64023
  const item = board.items.getById(id);
64009
64024
  if (item) {
64025
+ const baseItem = item;
64026
+ const itemMbr = baseItem.parent && baseItem.parent !== "Board" ? baseItem.getWorldMbr() : item.getMbr();
64010
64027
  if (!mbr) {
64011
- mbr = item.getMbr();
64028
+ mbr = itemMbr;
64012
64029
  } else {
64013
- mbr.combine(item.getMbr());
64030
+ mbr.combine(itemMbr);
64014
64031
  if (item.itemType === "Frame") {
64015
64032
  mbr.combine(item.getRichText().getMbr());
64016
64033
  }
package/dist/cjs/node.js CHANGED
@@ -13346,7 +13346,8 @@ var init_BaseItem = __esm(() => {
13346
13346
  const foundItem = this.board.items.getById(childId);
13347
13347
  if (this.parent !== childId && this.getId() !== childId && !this.hasAncestor(childId)) {
13348
13348
  if (!this.index?.getById(childId) && foundItem) {
13349
- const localMatrix = foundItem.transformation.toMatrix().toLocalOf(containerNestingMatrix);
13349
+ const worldMatrix = foundItem.getWorldMatrix();
13350
+ const localMatrix = worldMatrix.toLocalOf(containerNestingMatrix);
13350
13351
  const currentParentId = foundItem.parent;
13351
13352
  const currentParent = currentParentId !== "Board" ? this.board.items.getById(currentParentId) : undefined;
13352
13353
  const sourceIndex = currentParent?.index || this.board.items.index;
@@ -66316,7 +66317,21 @@ function createCanvasDrawer(board) {
66316
66317
  }).filter((item) => !!item);
66317
66318
  items.forEach((item) => {
66318
66319
  if (item.itemType !== "Frame") {
66319
- item.render(context);
66320
+ const baseItem = item;
66321
+ const isNested = baseItem.parent && baseItem.parent !== "Board";
66322
+ if (isNested) {
66323
+ const container2 = board2.items.getById(baseItem.parent);
66324
+ if (container2) {
66325
+ context.ctx.save();
66326
+ container2.getNestingMatrix().applyToContext(context.ctx);
66327
+ item.render(context);
66328
+ context.ctx.restore();
66329
+ } else {
66330
+ item.render(context);
66331
+ }
66332
+ } else {
66333
+ item.render(context);
66334
+ }
66320
66335
  board2.selection.renderItemMbr(context, item, board2.camera.getMatrix().scaleX);
66321
66336
  }
66322
66337
  });
@@ -66427,10 +66442,12 @@ function createCanvasDrawer(board) {
66427
66442
  return translation.map((i) => i.id).reduce((mbr, id) => {
66428
66443
  const item = board.items.getById(id);
66429
66444
  if (item) {
66445
+ const baseItem = item;
66446
+ const itemMbr = baseItem.parent && baseItem.parent !== "Board" ? baseItem.getWorldMbr() : item.getMbr();
66430
66447
  if (!mbr) {
66431
- mbr = item.getMbr();
66448
+ mbr = itemMbr;
66432
66449
  } else {
66433
- mbr.combine(item.getMbr());
66450
+ mbr.combine(itemMbr);
66434
66451
  if (item.itemType === "Frame") {
66435
66452
  mbr.combine(item.getRichText().getMbr());
66436
66453
  }
@@ -13298,7 +13298,8 @@ var init_BaseItem = __esm(() => {
13298
13298
  const foundItem = this.board.items.getById(childId);
13299
13299
  if (this.parent !== childId && this.getId() !== childId && !this.hasAncestor(childId)) {
13300
13300
  if (!this.index?.getById(childId) && foundItem) {
13301
- const localMatrix = foundItem.transformation.toMatrix().toLocalOf(containerNestingMatrix);
13301
+ const worldMatrix = foundItem.getWorldMatrix();
13302
+ const localMatrix = worldMatrix.toLocalOf(containerNestingMatrix);
13302
13303
  const currentParentId = foundItem.parent;
13303
13304
  const currentParent = currentParentId !== "Board" ? this.board.items.getById(currentParentId) : undefined;
13304
13305
  const sourceIndex = currentParent?.index || this.board.items.index;
@@ -63834,7 +63835,21 @@ function createCanvasDrawer(board) {
63834
63835
  }).filter((item) => !!item);
63835
63836
  items.forEach((item) => {
63836
63837
  if (item.itemType !== "Frame") {
63837
- item.render(context);
63838
+ const baseItem = item;
63839
+ const isNested = baseItem.parent && baseItem.parent !== "Board";
63840
+ if (isNested) {
63841
+ const container2 = board2.items.getById(baseItem.parent);
63842
+ if (container2) {
63843
+ context.ctx.save();
63844
+ container2.getNestingMatrix().applyToContext(context.ctx);
63845
+ item.render(context);
63846
+ context.ctx.restore();
63847
+ } else {
63848
+ item.render(context);
63849
+ }
63850
+ } else {
63851
+ item.render(context);
63852
+ }
63838
63853
  board2.selection.renderItemMbr(context, item, board2.camera.getMatrix().scaleX);
63839
63854
  }
63840
63855
  });
@@ -63945,10 +63960,12 @@ function createCanvasDrawer(board) {
63945
63960
  return translation.map((i) => i.id).reduce((mbr, id) => {
63946
63961
  const item = board.items.getById(id);
63947
63962
  if (item) {
63963
+ const baseItem = item;
63964
+ const itemMbr = baseItem.parent && baseItem.parent !== "Board" ? baseItem.getWorldMbr() : item.getMbr();
63948
63965
  if (!mbr) {
63949
- mbr = item.getMbr();
63966
+ mbr = itemMbr;
63950
63967
  } else {
63951
- mbr.combine(item.getMbr());
63968
+ mbr.combine(itemMbr);
63952
63969
  if (item.itemType === "Frame") {
63953
63970
  mbr.combine(item.getRichText().getMbr());
63954
63971
  }
package/dist/esm/index.js CHANGED
@@ -13291,7 +13291,8 @@ var init_BaseItem = __esm(() => {
13291
13291
  const foundItem = this.board.items.getById(childId);
13292
13292
  if (this.parent !== childId && this.getId() !== childId && !this.hasAncestor(childId)) {
13293
13293
  if (!this.index?.getById(childId) && foundItem) {
13294
- const localMatrix = foundItem.transformation.toMatrix().toLocalOf(containerNestingMatrix);
13294
+ const worldMatrix = foundItem.getWorldMatrix();
13295
+ const localMatrix = worldMatrix.toLocalOf(containerNestingMatrix);
13295
13296
  const currentParentId = foundItem.parent;
13296
13297
  const currentParent = currentParentId !== "Board" ? this.board.items.getById(currentParentId) : undefined;
13297
13298
  const sourceIndex = currentParent?.index || this.board.items.index;
@@ -63827,7 +63828,21 @@ function createCanvasDrawer(board) {
63827
63828
  }).filter((item) => !!item);
63828
63829
  items.forEach((item) => {
63829
63830
  if (item.itemType !== "Frame") {
63830
- item.render(context);
63831
+ const baseItem = item;
63832
+ const isNested = baseItem.parent && baseItem.parent !== "Board";
63833
+ if (isNested) {
63834
+ const container2 = board2.items.getById(baseItem.parent);
63835
+ if (container2) {
63836
+ context.ctx.save();
63837
+ container2.getNestingMatrix().applyToContext(context.ctx);
63838
+ item.render(context);
63839
+ context.ctx.restore();
63840
+ } else {
63841
+ item.render(context);
63842
+ }
63843
+ } else {
63844
+ item.render(context);
63845
+ }
63831
63846
  board2.selection.renderItemMbr(context, item, board2.camera.getMatrix().scaleX);
63832
63847
  }
63833
63848
  });
@@ -63938,10 +63953,12 @@ function createCanvasDrawer(board) {
63938
63953
  return translation.map((i) => i.id).reduce((mbr, id) => {
63939
63954
  const item = board.items.getById(id);
63940
63955
  if (item) {
63956
+ const baseItem = item;
63957
+ const itemMbr = baseItem.parent && baseItem.parent !== "Board" ? baseItem.getWorldMbr() : item.getMbr();
63941
63958
  if (!mbr) {
63942
- mbr = item.getMbr();
63959
+ mbr = itemMbr;
63943
63960
  } else {
63944
- mbr.combine(item.getMbr());
63961
+ mbr.combine(itemMbr);
63945
63962
  if (item.itemType === "Frame") {
63946
63963
  mbr.combine(item.getRichText().getMbr());
63947
63964
  }
package/dist/esm/node.js CHANGED
@@ -13313,7 +13313,8 @@ var init_BaseItem = __esm(() => {
13313
13313
  const foundItem = this.board.items.getById(childId);
13314
13314
  if (this.parent !== childId && this.getId() !== childId && !this.hasAncestor(childId)) {
13315
13315
  if (!this.index?.getById(childId) && foundItem) {
13316
- const localMatrix = foundItem.transformation.toMatrix().toLocalOf(containerNestingMatrix);
13316
+ const worldMatrix = foundItem.getWorldMatrix();
13317
+ const localMatrix = worldMatrix.toLocalOf(containerNestingMatrix);
13317
13318
  const currentParentId = foundItem.parent;
13318
13319
  const currentParent = currentParentId !== "Board" ? this.board.items.getById(currentParentId) : undefined;
13319
13320
  const sourceIndex = currentParent?.index || this.board.items.index;
@@ -66236,7 +66237,21 @@ function createCanvasDrawer(board) {
66236
66237
  }).filter((item) => !!item);
66237
66238
  items.forEach((item) => {
66238
66239
  if (item.itemType !== "Frame") {
66239
- item.render(context);
66240
+ const baseItem = item;
66241
+ const isNested = baseItem.parent && baseItem.parent !== "Board";
66242
+ if (isNested) {
66243
+ const container2 = board2.items.getById(baseItem.parent);
66244
+ if (container2) {
66245
+ context.ctx.save();
66246
+ container2.getNestingMatrix().applyToContext(context.ctx);
66247
+ item.render(context);
66248
+ context.ctx.restore();
66249
+ } else {
66250
+ item.render(context);
66251
+ }
66252
+ } else {
66253
+ item.render(context);
66254
+ }
66240
66255
  board2.selection.renderItemMbr(context, item, board2.camera.getMatrix().scaleX);
66241
66256
  }
66242
66257
  });
@@ -66347,10 +66362,12 @@ function createCanvasDrawer(board) {
66347
66362
  return translation.map((i) => i.id).reduce((mbr, id) => {
66348
66363
  const item = board.items.getById(id);
66349
66364
  if (item) {
66365
+ const baseItem = item;
66366
+ const itemMbr = baseItem.parent && baseItem.parent !== "Board" ? baseItem.getWorldMbr() : item.getMbr();
66350
66367
  if (!mbr) {
66351
- mbr = item.getMbr();
66368
+ mbr = itemMbr;
66352
66369
  } else {
66353
- mbr.combine(item.getMbr());
66370
+ mbr.combine(itemMbr);
66354
66371
  if (item.itemType === "Frame") {
66355
66372
  mbr.combine(item.getRichText().getMbr());
66356
66373
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "microboard-temp",
3
- "version": "0.13.87",
3
+ "version": "0.13.89",
4
4
  "description": "A flexible interactive whiteboard library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",