microboard-temp 0.4.2 → 0.4.3

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.
@@ -33470,7 +33470,7 @@ function createCommand(board, operation) {
33470
33470
  }
33471
33471
  default: {
33472
33472
  const itemType = operation.class;
33473
- const itemIdList = "item" in operation ? Array.isArray(operation.item) ? operation.item : [operation.item] : ("items" in operation) ? Object.keys(operation.items) : Object.values(operation.itemsOps);
33473
+ const itemIdList = "item" in operation ? Array.isArray(operation.item) ? operation.item : [operation.item] : ("items" in operation) ? Object.keys(operation.items) : operation.itemsOps.map((itemOp) => itemOp.item);
33474
33474
  const items = itemIdList.map((itemId) => board.items.findById(itemId) ?? itemId).filter((item) => {
33475
33475
  if (typeof item === "string") {
33476
33476
  console.warn(`Item with ID ${item} not found for operation ${operation.class}.${operation.method}`);
@@ -33554,6 +33554,7 @@ class BaseItem extends Mbr {
33554
33554
  transformationRenderBlock = undefined;
33555
33555
  board;
33556
33556
  id;
33557
+ subject = new Subject;
33557
33558
  onRemoveCallbacks = [];
33558
33559
  shouldUseCustomRender = false;
33559
33560
  shouldRenderOutsideViewRect = true;
@@ -46013,6 +46014,9 @@ class Camera {
46013
46014
  }
46014
46015
  const startTime = performance.now();
46015
46016
  const animate = (currentTime) => {
46017
+ if (!currentTime) {
46018
+ currentTime = performance.now();
46019
+ }
46016
46020
  const progress = Math.min((currentTime - startTime) / duration, 1);
46017
46021
  const easedProgress = this.easeOutQuad(progress);
46018
46022
  this.matrix.translateX = this.lerp(startTranslateX, targetTranslateX, easedProgress);
@@ -54336,6 +54340,9 @@ function createEventsList(createCommand2) {
54336
54340
  removeUnconfirmedEventsByItems(itemIds) {
54337
54341
  function shouldRemoveEvent(operation, itemIds2) {
54338
54342
  if (operation.method === "add" && operation.class === "Board") {
54343
+ if (Array.isArray(operation.item)) {
54344
+ return operation.item.some((id) => itemIds2.includes(id));
54345
+ }
54339
54346
  return itemIds2.includes(operation.item);
54340
54347
  }
54341
54348
  if (operation.method === "remove" && operation.class === "Board") {
package/dist/cjs/index.js CHANGED
@@ -33470,7 +33470,7 @@ function createCommand(board, operation) {
33470
33470
  }
33471
33471
  default: {
33472
33472
  const itemType = operation.class;
33473
- const itemIdList = "item" in operation ? Array.isArray(operation.item) ? operation.item : [operation.item] : ("items" in operation) ? Object.keys(operation.items) : Object.values(operation.itemsOps);
33473
+ const itemIdList = "item" in operation ? Array.isArray(operation.item) ? operation.item : [operation.item] : ("items" in operation) ? Object.keys(operation.items) : operation.itemsOps.map((itemOp) => itemOp.item);
33474
33474
  const items = itemIdList.map((itemId) => board.items.findById(itemId) ?? itemId).filter((item) => {
33475
33475
  if (typeof item === "string") {
33476
33476
  console.warn(`Item with ID ${item} not found for operation ${operation.class}.${operation.method}`);
@@ -33554,6 +33554,7 @@ class BaseItem extends Mbr {
33554
33554
  transformationRenderBlock = undefined;
33555
33555
  board;
33556
33556
  id;
33557
+ subject = new Subject;
33557
33558
  onRemoveCallbacks = [];
33558
33559
  shouldUseCustomRender = false;
33559
33560
  shouldRenderOutsideViewRect = true;
@@ -46013,6 +46014,9 @@ class Camera {
46013
46014
  }
46014
46015
  const startTime = performance.now();
46015
46016
  const animate = (currentTime) => {
46017
+ if (!currentTime) {
46018
+ currentTime = performance.now();
46019
+ }
46016
46020
  const progress = Math.min((currentTime - startTime) / duration, 1);
46017
46021
  const easedProgress = this.easeOutQuad(progress);
46018
46022
  this.matrix.translateX = this.lerp(startTranslateX, targetTranslateX, easedProgress);
@@ -54336,6 +54340,9 @@ function createEventsList(createCommand2) {
54336
54340
  removeUnconfirmedEventsByItems(itemIds) {
54337
54341
  function shouldRemoveEvent(operation, itemIds2) {
54338
54342
  if (operation.method === "add" && operation.class === "Board") {
54343
+ if (Array.isArray(operation.item)) {
54344
+ return operation.item.some((id) => itemIds2.includes(id));
54345
+ }
54339
54346
  return itemIds2.includes(operation.item);
54340
54347
  }
54341
54348
  if (operation.method === "remove" && operation.class === "Board") {
package/dist/cjs/node.js CHANGED
@@ -36010,7 +36010,7 @@ function createCommand(board, operation) {
36010
36010
  }
36011
36011
  default: {
36012
36012
  const itemType = operation.class;
36013
- const itemIdList = "item" in operation ? Array.isArray(operation.item) ? operation.item : [operation.item] : ("items" in operation) ? Object.keys(operation.items) : Object.values(operation.itemsOps);
36013
+ const itemIdList = "item" in operation ? Array.isArray(operation.item) ? operation.item : [operation.item] : ("items" in operation) ? Object.keys(operation.items) : operation.itemsOps.map((itemOp) => itemOp.item);
36014
36014
  const items = itemIdList.map((itemId) => board.items.findById(itemId) ?? itemId).filter((item) => {
36015
36015
  if (typeof item === "string") {
36016
36016
  console.warn(`Item with ID ${item} not found for operation ${operation.class}.${operation.method}`);
@@ -36094,6 +36094,7 @@ class BaseItem extends Mbr {
36094
36094
  transformationRenderBlock = undefined;
36095
36095
  board;
36096
36096
  id;
36097
+ subject = new Subject;
36097
36098
  onRemoveCallbacks = [];
36098
36099
  shouldUseCustomRender = false;
36099
36100
  shouldRenderOutsideViewRect = true;
@@ -48553,6 +48554,9 @@ class Camera {
48553
48554
  }
48554
48555
  const startTime = performance.now();
48555
48556
  const animate = (currentTime) => {
48557
+ if (!currentTime) {
48558
+ currentTime = performance.now();
48559
+ }
48556
48560
  const progress = Math.min((currentTime - startTime) / duration, 1);
48557
48561
  const easedProgress = this.easeOutQuad(progress);
48558
48562
  this.matrix.translateX = this.lerp(startTranslateX, targetTranslateX, easedProgress);
@@ -56809,6 +56813,9 @@ function createEventsList(createCommand2) {
56809
56813
  removeUnconfirmedEventsByItems(itemIds) {
56810
56814
  function shouldRemoveEvent(operation, itemIds2) {
56811
56815
  if (operation.method === "add" && operation.class === "Board") {
56816
+ if (Array.isArray(operation.item)) {
56817
+ return operation.item.some((id) => itemIds2.includes(id));
56818
+ }
56812
56819
  return itemIds2.includes(operation.item);
56813
56820
  }
56814
56821
  if (operation.method === "remove" && operation.class === "Board") {
@@ -33323,7 +33323,7 @@ function createCommand(board, operation) {
33323
33323
  }
33324
33324
  default: {
33325
33325
  const itemType = operation.class;
33326
- const itemIdList = "item" in operation ? Array.isArray(operation.item) ? operation.item : [operation.item] : ("items" in operation) ? Object.keys(operation.items) : Object.values(operation.itemsOps);
33326
+ const itemIdList = "item" in operation ? Array.isArray(operation.item) ? operation.item : [operation.item] : ("items" in operation) ? Object.keys(operation.items) : operation.itemsOps.map((itemOp) => itemOp.item);
33327
33327
  const items = itemIdList.map((itemId) => board.items.findById(itemId) ?? itemId).filter((item) => {
33328
33328
  if (typeof item === "string") {
33329
33329
  console.warn(`Item with ID ${item} not found for operation ${operation.class}.${operation.method}`);
@@ -33407,6 +33407,7 @@ class BaseItem extends Mbr {
33407
33407
  transformationRenderBlock = undefined;
33408
33408
  board;
33409
33409
  id;
33410
+ subject = new Subject;
33410
33411
  onRemoveCallbacks = [];
33411
33412
  shouldUseCustomRender = false;
33412
33413
  shouldRenderOutsideViewRect = true;
@@ -45866,6 +45867,9 @@ class Camera {
45866
45867
  }
45867
45868
  const startTime = performance.now();
45868
45869
  const animate = (currentTime) => {
45870
+ if (!currentTime) {
45871
+ currentTime = performance.now();
45872
+ }
45869
45873
  const progress = Math.min((currentTime - startTime) / duration, 1);
45870
45874
  const easedProgress = this.easeOutQuad(progress);
45871
45875
  this.matrix.translateX = this.lerp(startTranslateX, targetTranslateX, easedProgress);
@@ -54189,6 +54193,9 @@ function createEventsList(createCommand2) {
54189
54193
  removeUnconfirmedEventsByItems(itemIds) {
54190
54194
  function shouldRemoveEvent(operation, itemIds2) {
54191
54195
  if (operation.method === "add" && operation.class === "Board") {
54196
+ if (Array.isArray(operation.item)) {
54197
+ return operation.item.some((id) => itemIds2.includes(id));
54198
+ }
54192
54199
  return itemIds2.includes(operation.item);
54193
54200
  }
54194
54201
  if (operation.method === "remove" && operation.class === "Board") {
package/dist/esm/index.js CHANGED
@@ -33316,7 +33316,7 @@ function createCommand(board, operation) {
33316
33316
  }
33317
33317
  default: {
33318
33318
  const itemType = operation.class;
33319
- const itemIdList = "item" in operation ? Array.isArray(operation.item) ? operation.item : [operation.item] : ("items" in operation) ? Object.keys(operation.items) : Object.values(operation.itemsOps);
33319
+ const itemIdList = "item" in operation ? Array.isArray(operation.item) ? operation.item : [operation.item] : ("items" in operation) ? Object.keys(operation.items) : operation.itemsOps.map((itemOp) => itemOp.item);
33320
33320
  const items = itemIdList.map((itemId) => board.items.findById(itemId) ?? itemId).filter((item) => {
33321
33321
  if (typeof item === "string") {
33322
33322
  console.warn(`Item with ID ${item} not found for operation ${operation.class}.${operation.method}`);
@@ -33400,6 +33400,7 @@ class BaseItem extends Mbr {
33400
33400
  transformationRenderBlock = undefined;
33401
33401
  board;
33402
33402
  id;
33403
+ subject = new Subject;
33403
33404
  onRemoveCallbacks = [];
33404
33405
  shouldUseCustomRender = false;
33405
33406
  shouldRenderOutsideViewRect = true;
@@ -45859,6 +45860,9 @@ class Camera {
45859
45860
  }
45860
45861
  const startTime = performance.now();
45861
45862
  const animate = (currentTime) => {
45863
+ if (!currentTime) {
45864
+ currentTime = performance.now();
45865
+ }
45862
45866
  const progress = Math.min((currentTime - startTime) / duration, 1);
45863
45867
  const easedProgress = this.easeOutQuad(progress);
45864
45868
  this.matrix.translateX = this.lerp(startTranslateX, targetTranslateX, easedProgress);
@@ -54182,6 +54186,9 @@ function createEventsList(createCommand2) {
54182
54186
  removeUnconfirmedEventsByItems(itemIds) {
54183
54187
  function shouldRemoveEvent(operation, itemIds2) {
54184
54188
  if (operation.method === "add" && operation.class === "Board") {
54189
+ if (Array.isArray(operation.item)) {
54190
+ return operation.item.some((id) => itemIds2.includes(id));
54191
+ }
54185
54192
  return itemIds2.includes(operation.item);
54186
54193
  }
54187
54194
  if (operation.method === "remove" && operation.class === "Board") {
package/dist/esm/node.js CHANGED
@@ -35851,7 +35851,7 @@ function createCommand(board, operation) {
35851
35851
  }
35852
35852
  default: {
35853
35853
  const itemType = operation.class;
35854
- const itemIdList = "item" in operation ? Array.isArray(operation.item) ? operation.item : [operation.item] : ("items" in operation) ? Object.keys(operation.items) : Object.values(operation.itemsOps);
35854
+ const itemIdList = "item" in operation ? Array.isArray(operation.item) ? operation.item : [operation.item] : ("items" in operation) ? Object.keys(operation.items) : operation.itemsOps.map((itemOp) => itemOp.item);
35855
35855
  const items = itemIdList.map((itemId) => board.items.findById(itemId) ?? itemId).filter((item) => {
35856
35856
  if (typeof item === "string") {
35857
35857
  console.warn(`Item with ID ${item} not found for operation ${operation.class}.${operation.method}`);
@@ -35935,6 +35935,7 @@ class BaseItem extends Mbr {
35935
35935
  transformationRenderBlock = undefined;
35936
35936
  board;
35937
35937
  id;
35938
+ subject = new Subject;
35938
35939
  onRemoveCallbacks = [];
35939
35940
  shouldUseCustomRender = false;
35940
35941
  shouldRenderOutsideViewRect = true;
@@ -48394,6 +48395,9 @@ class Camera {
48394
48395
  }
48395
48396
  const startTime = performance.now();
48396
48397
  const animate = (currentTime) => {
48398
+ if (!currentTime) {
48399
+ currentTime = performance.now();
48400
+ }
48397
48401
  const progress = Math.min((currentTime - startTime) / duration, 1);
48398
48402
  const easedProgress = this.easeOutQuad(progress);
48399
48403
  this.matrix.translateX = this.lerp(startTranslateX, targetTranslateX, easedProgress);
@@ -56650,6 +56654,9 @@ function createEventsList(createCommand2) {
56650
56654
  removeUnconfirmedEventsByItems(itemIds) {
56651
56655
  function shouldRemoveEvent(operation, itemIds2) {
56652
56656
  if (operation.method === "add" && operation.class === "Board") {
56657
+ if (Array.isArray(operation.item)) {
56658
+ return operation.item.some((id) => itemIds2.includes(id));
56659
+ }
56653
56660
  return itemIds2.includes(operation.item);
56654
56661
  }
56655
56662
  if (operation.method === "remove" && operation.class === "Board") {
@@ -9,6 +9,7 @@ import { DocumentFactory } from "api/DocumentFactory";
9
9
  import { Operation } from "Events";
10
10
  import { TransformationData } from "Items/Transformation/TransformationData";
11
11
  import { BaseOperation } from "Events/EventsOperations";
12
+ import { Subject } from "../../Subject";
12
13
  export type BaseItemData = {
13
14
  itemType: string;
14
15
  } & Record<string, any>;
@@ -24,6 +25,7 @@ export declare class BaseItem extends Mbr implements Geometry {
24
25
  transformationRenderBlock?: boolean;
25
26
  board: Board;
26
27
  id: string;
28
+ subject: Subject<any>;
27
29
  onRemoveCallbacks: (() => void)[];
28
30
  shouldUseCustomRender: boolean;
29
31
  shouldRenderOutsideViewRect: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "microboard-temp",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
4
4
  "description": "A flexible interactive whiteboard library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",