microboard-temp 0.5.144 → 0.5.145

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.
@@ -45112,7 +45112,7 @@ function createCanvasDrawer(board) {
45112
45112
  context.setCamera(camera);
45113
45113
  context.ctx.setTransform(board2.camera.getMatrix().scaleX, 0, 0, board2.camera.getMatrix().scaleY, 0, 0);
45114
45114
  context.matrix.applyToContext(context.ctx);
45115
- const items = Object.keys(translation).map((id) => {
45115
+ const items = translation.map((i) => i.id).map((id) => {
45116
45116
  const item = board2.items.getById(id);
45117
45117
  if (item) {
45118
45118
  if (item.itemType !== "Frame") {
@@ -45202,7 +45202,7 @@ function createCanvasDrawer(board) {
45202
45202
  matrix = new Matrix2;
45203
45203
  }
45204
45204
  function updateCanvasAndKeys(sumMbr, translation, resizingMatrix, actualMbr) {
45205
- const translationKeys = Object.keys(translation);
45205
+ const translationKeys = translation.map((i) => i.id);
45206
45206
  if (lastCreatedCanvas && lastTranslationKeys?.length === translationKeys.length && lastTranslationKeys?.every((key) => translationKeys.includes(key))) {
45207
45207
  recoordinateCanvas(sumMbr);
45208
45208
  if (resizingMatrix) {
@@ -45220,7 +45220,7 @@ function createCanvasDrawer(board) {
45220
45220
  cnvs.style.pointerEvents = "none";
45221
45221
  document.body.appendChild(cnvs);
45222
45222
  lastCreatedCanvas = cnvs;
45223
- lastTranslationKeys = Object.keys(translation);
45223
+ lastTranslationKeys = translation.map((i) => i.id);
45224
45224
  lastTranslationKeys.forEach((id) => {
45225
45225
  const item = board.items.getById(id);
45226
45226
  if (item) {
@@ -45233,7 +45233,7 @@ function createCanvasDrawer(board) {
45233
45233
  }
45234
45234
  }
45235
45235
  function countSumMbr(translation) {
45236
- return Object.keys(translation).reduce((mbr, id) => {
45236
+ return translation.map((i) => i.id).reduce((mbr, id) => {
45237
45237
  const item = board.items.getById(id);
45238
45238
  if (item) {
45239
45239
  if (!mbr) {
@@ -46581,7 +46581,7 @@ class Select extends Tool {
46581
46581
  return false;
46582
46582
  }
46583
46583
  const translation = selection.getManyItemsTranslation(x, y);
46584
- const translationKeys = Object.keys(translation);
46584
+ const translationKeys = translation.map((i) => i.id);
46585
46585
  const commentsSet = new Set(this.board.items.getComments().map((comment2) => comment2.getId()));
46586
46586
  if (translationKeys.filter((item) => !commentsSet.has(item)).length > 10) {
46587
46587
  const selectedMbr = this.board.selection.getMbr()?.copy();
@@ -52210,7 +52210,7 @@ function transformItems({
52210
52210
  isShiftPressed
52211
52211
  });
52212
52212
  selection.transformMany(translation, beginTimeStamp);
52213
- if (Object.keys(translation).length > 10) {
52213
+ if (translation.length > 10) {
52214
52214
  canvasDrawer.updateCanvasAndKeys(resize.mbr, translation, resize.matrix);
52215
52215
  debounceUpd.setFalse();
52216
52216
  debounceUpd.setTimeoutUpdate(1000);
package/dist/cjs/index.js CHANGED
@@ -45112,7 +45112,7 @@ function createCanvasDrawer(board) {
45112
45112
  context.setCamera(camera);
45113
45113
  context.ctx.setTransform(board2.camera.getMatrix().scaleX, 0, 0, board2.camera.getMatrix().scaleY, 0, 0);
45114
45114
  context.matrix.applyToContext(context.ctx);
45115
- const items = Object.keys(translation).map((id) => {
45115
+ const items = translation.map((i) => i.id).map((id) => {
45116
45116
  const item = board2.items.getById(id);
45117
45117
  if (item) {
45118
45118
  if (item.itemType !== "Frame") {
@@ -45202,7 +45202,7 @@ function createCanvasDrawer(board) {
45202
45202
  matrix = new Matrix2;
45203
45203
  }
45204
45204
  function updateCanvasAndKeys(sumMbr, translation, resizingMatrix, actualMbr) {
45205
- const translationKeys = Object.keys(translation);
45205
+ const translationKeys = translation.map((i) => i.id);
45206
45206
  if (lastCreatedCanvas && lastTranslationKeys?.length === translationKeys.length && lastTranslationKeys?.every((key) => translationKeys.includes(key))) {
45207
45207
  recoordinateCanvas(sumMbr);
45208
45208
  if (resizingMatrix) {
@@ -45220,7 +45220,7 @@ function createCanvasDrawer(board) {
45220
45220
  cnvs.style.pointerEvents = "none";
45221
45221
  document.body.appendChild(cnvs);
45222
45222
  lastCreatedCanvas = cnvs;
45223
- lastTranslationKeys = Object.keys(translation);
45223
+ lastTranslationKeys = translation.map((i) => i.id);
45224
45224
  lastTranslationKeys.forEach((id) => {
45225
45225
  const item = board.items.getById(id);
45226
45226
  if (item) {
@@ -45233,7 +45233,7 @@ function createCanvasDrawer(board) {
45233
45233
  }
45234
45234
  }
45235
45235
  function countSumMbr(translation) {
45236
- return Object.keys(translation).reduce((mbr, id) => {
45236
+ return translation.map((i) => i.id).reduce((mbr, id) => {
45237
45237
  const item = board.items.getById(id);
45238
45238
  if (item) {
45239
45239
  if (!mbr) {
@@ -46581,7 +46581,7 @@ class Select extends Tool {
46581
46581
  return false;
46582
46582
  }
46583
46583
  const translation = selection.getManyItemsTranslation(x, y);
46584
- const translationKeys = Object.keys(translation);
46584
+ const translationKeys = translation.map((i) => i.id);
46585
46585
  const commentsSet = new Set(this.board.items.getComments().map((comment2) => comment2.getId()));
46586
46586
  if (translationKeys.filter((item) => !commentsSet.has(item)).length > 10) {
46587
46587
  const selectedMbr = this.board.selection.getMbr()?.copy();
@@ -52210,7 +52210,7 @@ function transformItems({
52210
52210
  isShiftPressed
52211
52211
  });
52212
52212
  selection.transformMany(translation, beginTimeStamp);
52213
- if (Object.keys(translation).length > 10) {
52213
+ if (translation.length > 10) {
52214
52214
  canvasDrawer.updateCanvasAndKeys(resize.mbr, translation, resize.matrix);
52215
52215
  debounceUpd.setFalse();
52216
52216
  debounceUpd.setTimeoutUpdate(1000);
package/dist/cjs/node.js CHANGED
@@ -47585,7 +47585,7 @@ function createCanvasDrawer(board) {
47585
47585
  context.setCamera(camera);
47586
47586
  context.ctx.setTransform(board2.camera.getMatrix().scaleX, 0, 0, board2.camera.getMatrix().scaleY, 0, 0);
47587
47587
  context.matrix.applyToContext(context.ctx);
47588
- const items = Object.keys(translation).map((id) => {
47588
+ const items = translation.map((i) => i.id).map((id) => {
47589
47589
  const item = board2.items.getById(id);
47590
47590
  if (item) {
47591
47591
  if (item.itemType !== "Frame") {
@@ -47675,7 +47675,7 @@ function createCanvasDrawer(board) {
47675
47675
  matrix = new Matrix2;
47676
47676
  }
47677
47677
  function updateCanvasAndKeys(sumMbr, translation, resizingMatrix, actualMbr) {
47678
- const translationKeys = Object.keys(translation);
47678
+ const translationKeys = translation.map((i) => i.id);
47679
47679
  if (lastCreatedCanvas && lastTranslationKeys?.length === translationKeys.length && lastTranslationKeys?.every((key) => translationKeys.includes(key))) {
47680
47680
  recoordinateCanvas(sumMbr);
47681
47681
  if (resizingMatrix) {
@@ -47693,7 +47693,7 @@ function createCanvasDrawer(board) {
47693
47693
  cnvs.style.pointerEvents = "none";
47694
47694
  document.body.appendChild(cnvs);
47695
47695
  lastCreatedCanvas = cnvs;
47696
- lastTranslationKeys = Object.keys(translation);
47696
+ lastTranslationKeys = translation.map((i) => i.id);
47697
47697
  lastTranslationKeys.forEach((id) => {
47698
47698
  const item = board.items.getById(id);
47699
47699
  if (item) {
@@ -47706,7 +47706,7 @@ function createCanvasDrawer(board) {
47706
47706
  }
47707
47707
  }
47708
47708
  function countSumMbr(translation) {
47709
- return Object.keys(translation).reduce((mbr, id) => {
47709
+ return translation.map((i) => i.id).reduce((mbr, id) => {
47710
47710
  const item = board.items.getById(id);
47711
47711
  if (item) {
47712
47712
  if (!mbr) {
@@ -49054,7 +49054,7 @@ class Select extends Tool {
49054
49054
  return false;
49055
49055
  }
49056
49056
  const translation = selection.getManyItemsTranslation(x, y);
49057
- const translationKeys = Object.keys(translation);
49057
+ const translationKeys = translation.map((i) => i.id);
49058
49058
  const commentsSet = new Set(this.board.items.getComments().map((comment2) => comment2.getId()));
49059
49059
  if (translationKeys.filter((item) => !commentsSet.has(item)).length > 10) {
49060
49060
  const selectedMbr = this.board.selection.getMbr()?.copy();
@@ -54683,7 +54683,7 @@ function transformItems({
54683
54683
  isShiftPressed
54684
54684
  });
54685
54685
  selection.transformMany(translation, beginTimeStamp);
54686
- if (Object.keys(translation).length > 10) {
54686
+ if (translation.length > 10) {
54687
54687
  canvasDrawer.updateCanvasAndKeys(resize.mbr, translation, resize.matrix);
54688
54688
  debounceUpd.setFalse();
54689
54689
  debounceUpd.setTimeoutUpdate(1000);
@@ -44955,7 +44955,7 @@ function createCanvasDrawer(board) {
44955
44955
  context.setCamera(camera);
44956
44956
  context.ctx.setTransform(board2.camera.getMatrix().scaleX, 0, 0, board2.camera.getMatrix().scaleY, 0, 0);
44957
44957
  context.matrix.applyToContext(context.ctx);
44958
- const items = Object.keys(translation).map((id) => {
44958
+ const items = translation.map((i) => i.id).map((id) => {
44959
44959
  const item = board2.items.getById(id);
44960
44960
  if (item) {
44961
44961
  if (item.itemType !== "Frame") {
@@ -45045,7 +45045,7 @@ function createCanvasDrawer(board) {
45045
45045
  matrix = new Matrix2;
45046
45046
  }
45047
45047
  function updateCanvasAndKeys(sumMbr, translation, resizingMatrix, actualMbr) {
45048
- const translationKeys = Object.keys(translation);
45048
+ const translationKeys = translation.map((i) => i.id);
45049
45049
  if (lastCreatedCanvas && lastTranslationKeys?.length === translationKeys.length && lastTranslationKeys?.every((key) => translationKeys.includes(key))) {
45050
45050
  recoordinateCanvas(sumMbr);
45051
45051
  if (resizingMatrix) {
@@ -45063,7 +45063,7 @@ function createCanvasDrawer(board) {
45063
45063
  cnvs.style.pointerEvents = "none";
45064
45064
  document.body.appendChild(cnvs);
45065
45065
  lastCreatedCanvas = cnvs;
45066
- lastTranslationKeys = Object.keys(translation);
45066
+ lastTranslationKeys = translation.map((i) => i.id);
45067
45067
  lastTranslationKeys.forEach((id) => {
45068
45068
  const item = board.items.getById(id);
45069
45069
  if (item) {
@@ -45076,7 +45076,7 @@ function createCanvasDrawer(board) {
45076
45076
  }
45077
45077
  }
45078
45078
  function countSumMbr(translation) {
45079
- return Object.keys(translation).reduce((mbr, id) => {
45079
+ return translation.map((i) => i.id).reduce((mbr, id) => {
45080
45080
  const item = board.items.getById(id);
45081
45081
  if (item) {
45082
45082
  if (!mbr) {
@@ -46424,7 +46424,7 @@ class Select extends Tool {
46424
46424
  return false;
46425
46425
  }
46426
46426
  const translation = selection.getManyItemsTranslation(x, y);
46427
- const translationKeys = Object.keys(translation);
46427
+ const translationKeys = translation.map((i) => i.id);
46428
46428
  const commentsSet = new Set(this.board.items.getComments().map((comment2) => comment2.getId()));
46429
46429
  if (translationKeys.filter((item) => !commentsSet.has(item)).length > 10) {
46430
46430
  const selectedMbr = this.board.selection.getMbr()?.copy();
@@ -52053,7 +52053,7 @@ function transformItems({
52053
52053
  isShiftPressed
52054
52054
  });
52055
52055
  selection.transformMany(translation, beginTimeStamp);
52056
- if (Object.keys(translation).length > 10) {
52056
+ if (translation.length > 10) {
52057
52057
  canvasDrawer.updateCanvasAndKeys(resize.mbr, translation, resize.matrix);
52058
52058
  debounceUpd.setFalse();
52059
52059
  debounceUpd.setTimeoutUpdate(1000);
package/dist/esm/index.js CHANGED
@@ -44948,7 +44948,7 @@ function createCanvasDrawer(board) {
44948
44948
  context.setCamera(camera);
44949
44949
  context.ctx.setTransform(board2.camera.getMatrix().scaleX, 0, 0, board2.camera.getMatrix().scaleY, 0, 0);
44950
44950
  context.matrix.applyToContext(context.ctx);
44951
- const items = Object.keys(translation).map((id) => {
44951
+ const items = translation.map((i) => i.id).map((id) => {
44952
44952
  const item = board2.items.getById(id);
44953
44953
  if (item) {
44954
44954
  if (item.itemType !== "Frame") {
@@ -45038,7 +45038,7 @@ function createCanvasDrawer(board) {
45038
45038
  matrix = new Matrix2;
45039
45039
  }
45040
45040
  function updateCanvasAndKeys(sumMbr, translation, resizingMatrix, actualMbr) {
45041
- const translationKeys = Object.keys(translation);
45041
+ const translationKeys = translation.map((i) => i.id);
45042
45042
  if (lastCreatedCanvas && lastTranslationKeys?.length === translationKeys.length && lastTranslationKeys?.every((key) => translationKeys.includes(key))) {
45043
45043
  recoordinateCanvas(sumMbr);
45044
45044
  if (resizingMatrix) {
@@ -45056,7 +45056,7 @@ function createCanvasDrawer(board) {
45056
45056
  cnvs.style.pointerEvents = "none";
45057
45057
  document.body.appendChild(cnvs);
45058
45058
  lastCreatedCanvas = cnvs;
45059
- lastTranslationKeys = Object.keys(translation);
45059
+ lastTranslationKeys = translation.map((i) => i.id);
45060
45060
  lastTranslationKeys.forEach((id) => {
45061
45061
  const item = board.items.getById(id);
45062
45062
  if (item) {
@@ -45069,7 +45069,7 @@ function createCanvasDrawer(board) {
45069
45069
  }
45070
45070
  }
45071
45071
  function countSumMbr(translation) {
45072
- return Object.keys(translation).reduce((mbr, id) => {
45072
+ return translation.map((i) => i.id).reduce((mbr, id) => {
45073
45073
  const item = board.items.getById(id);
45074
45074
  if (item) {
45075
45075
  if (!mbr) {
@@ -46417,7 +46417,7 @@ class Select extends Tool {
46417
46417
  return false;
46418
46418
  }
46419
46419
  const translation = selection.getManyItemsTranslation(x, y);
46420
- const translationKeys = Object.keys(translation);
46420
+ const translationKeys = translation.map((i) => i.id);
46421
46421
  const commentsSet = new Set(this.board.items.getComments().map((comment2) => comment2.getId()));
46422
46422
  if (translationKeys.filter((item) => !commentsSet.has(item)).length > 10) {
46423
46423
  const selectedMbr = this.board.selection.getMbr()?.copy();
@@ -52046,7 +52046,7 @@ function transformItems({
52046
52046
  isShiftPressed
52047
52047
  });
52048
52048
  selection.transformMany(translation, beginTimeStamp);
52049
- if (Object.keys(translation).length > 10) {
52049
+ if (translation.length > 10) {
52050
52050
  canvasDrawer.updateCanvasAndKeys(resize.mbr, translation, resize.matrix);
52051
52051
  debounceUpd.setFalse();
52052
52052
  debounceUpd.setTimeoutUpdate(1000);
package/dist/esm/node.js CHANGED
@@ -47416,7 +47416,7 @@ function createCanvasDrawer(board) {
47416
47416
  context.setCamera(camera);
47417
47417
  context.ctx.setTransform(board2.camera.getMatrix().scaleX, 0, 0, board2.camera.getMatrix().scaleY, 0, 0);
47418
47418
  context.matrix.applyToContext(context.ctx);
47419
- const items = Object.keys(translation).map((id) => {
47419
+ const items = translation.map((i) => i.id).map((id) => {
47420
47420
  const item = board2.items.getById(id);
47421
47421
  if (item) {
47422
47422
  if (item.itemType !== "Frame") {
@@ -47506,7 +47506,7 @@ function createCanvasDrawer(board) {
47506
47506
  matrix = new Matrix2;
47507
47507
  }
47508
47508
  function updateCanvasAndKeys(sumMbr, translation, resizingMatrix, actualMbr) {
47509
- const translationKeys = Object.keys(translation);
47509
+ const translationKeys = translation.map((i) => i.id);
47510
47510
  if (lastCreatedCanvas && lastTranslationKeys?.length === translationKeys.length && lastTranslationKeys?.every((key) => translationKeys.includes(key))) {
47511
47511
  recoordinateCanvas(sumMbr);
47512
47512
  if (resizingMatrix) {
@@ -47524,7 +47524,7 @@ function createCanvasDrawer(board) {
47524
47524
  cnvs.style.pointerEvents = "none";
47525
47525
  document.body.appendChild(cnvs);
47526
47526
  lastCreatedCanvas = cnvs;
47527
- lastTranslationKeys = Object.keys(translation);
47527
+ lastTranslationKeys = translation.map((i) => i.id);
47528
47528
  lastTranslationKeys.forEach((id) => {
47529
47529
  const item = board.items.getById(id);
47530
47530
  if (item) {
@@ -47537,7 +47537,7 @@ function createCanvasDrawer(board) {
47537
47537
  }
47538
47538
  }
47539
47539
  function countSumMbr(translation) {
47540
- return Object.keys(translation).reduce((mbr, id) => {
47540
+ return translation.map((i) => i.id).reduce((mbr, id) => {
47541
47541
  const item = board.items.getById(id);
47542
47542
  if (item) {
47543
47543
  if (!mbr) {
@@ -48885,7 +48885,7 @@ class Select extends Tool {
48885
48885
  return false;
48886
48886
  }
48887
48887
  const translation = selection.getManyItemsTranslation(x, y);
48888
- const translationKeys = Object.keys(translation);
48888
+ const translationKeys = translation.map((i) => i.id);
48889
48889
  const commentsSet = new Set(this.board.items.getComments().map((comment2) => comment2.getId()));
48890
48890
  if (translationKeys.filter((item) => !commentsSet.has(item)).length > 10) {
48891
48891
  const selectedMbr = this.board.selection.getMbr()?.copy();
@@ -54514,7 +54514,7 @@ function transformItems({
54514
54514
  isShiftPressed
54515
54515
  });
54516
54516
  selection.transformMany(translation, beginTimeStamp);
54517
- if (Object.keys(translation).length > 10) {
54517
+ if (translation.length > 10) {
54518
54518
  canvasDrawer.updateCanvasAndKeys(resize.mbr, translation, resize.matrix);
54519
54519
  debounceUpd.setFalse();
54520
54520
  debounceUpd.setTimeoutUpdate(1000);
@@ -1,4 +1,4 @@
1
- import { TransformManyItems } from "../../../Items/Transformation/TransformationOperations";
1
+ import { ApplyMatrixItem } from "../../../Items/Transformation/TransformationOperations";
2
2
  import { Mbr } from "../../../Items/Mbr/Mbr";
3
3
  import { Sticker } from "../../../Items/Sticker/Sticker";
4
4
  import { Shape } from "../../../Items/Shape/Shape";
@@ -20,5 +20,5 @@ export declare function transformShape({ mbr, board, single, oppositePoint, resi
20
20
  startMbr?: Mbr;
21
21
  }): {
22
22
  resizedMbr: Mbr;
23
- translation: TransformManyItems | null;
23
+ translation: ApplyMatrixItem[] | null;
24
24
  };
@@ -1,6 +1,6 @@
1
1
  import { Board } from "./Board";
2
2
  import { Matrix, Mbr } from "./Items";
3
- import { TransformManyItems } from "./Items/Transformation/TransformationOperations";
3
+ import { ApplyMatrixItem } from "./Items/Transformation/TransformationOperations";
4
4
  export interface CanvasDrawer {
5
5
  getLastCreatedCanvas: () => HTMLDivElement | undefined;
6
6
  getLastTranslationKeys: () => string[] | undefined;
@@ -10,8 +10,8 @@ export interface CanvasDrawer {
10
10
  scaleCanvasBy: (scaleX: number, scaleY: number) => void;
11
11
  scaleCanvasTo: (scaleX: number, scaleY: number) => void;
12
12
  clearCanvasAndKeys: () => void;
13
- updateCanvasAndKeys: (sumMbr: Mbr, translation: TransformManyItems, resizingMatrix?: Matrix, actualMbr?: Mbr) => void;
14
- countSumMbr: (translation: TransformManyItems) => Mbr | undefined;
13
+ updateCanvasAndKeys: (sumMbr: Mbr, translation: ApplyMatrixItem[], resizingMatrix?: Matrix, actualMbr?: Mbr) => void;
14
+ countSumMbr: (translation: ApplyMatrixItem[]) => Mbr | undefined;
15
15
  highlightNesting: () => void;
16
16
  getMbr: () => Mbr;
17
17
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "microboard-temp",
3
- "version": "0.5.144",
3
+ "version": "0.5.145",
4
4
  "description": "A flexible interactive whiteboard library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",