microboard-temp 0.4.64 → 0.4.66

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.
@@ -21464,6 +21464,7 @@ class BaseItem extends Mbr {
21464
21464
  this.id = id;
21465
21465
  if (isGroupItem) {
21466
21466
  this.index = new SimpleSpatialIndex(board.camera, board.pointer);
21467
+ this.canBeNested = false;
21467
21468
  }
21468
21469
  if (defaultItemData) {
21469
21470
  Object.entries(defaultItemData).forEach(([key, value]) => {
@@ -21588,6 +21589,9 @@ class BaseItem extends Mbr {
21588
21589
  return null;
21589
21590
  }
21590
21591
  deserialize(data) {
21592
+ if (data.children) {
21593
+ this.applyAddChildren(data.children);
21594
+ }
21591
21595
  Object.entries(data).forEach(([key, value]) => {
21592
21596
  if (this[key]?.deserialize) {
21593
21597
  this[key].deserialize(value);
@@ -53742,14 +53746,14 @@ class Board {
53742
53746
  const items = Array.from(itemsDiv.children).map((el) => this.parseHTML(el));
53743
53747
  this.index.clear();
53744
53748
  const createdConnectors = {};
53745
- const createdFrames = {};
53749
+ const createdGroups = {};
53746
53750
  const addItem = (itemData) => {
53747
53751
  const item = this.createItem(itemData.id, itemData);
53748
53752
  if (item instanceof Connector2) {
53749
53753
  createdConnectors[itemData.id] = { item, itemData };
53750
53754
  }
53751
- if (item instanceof Frame2) {
53752
- createdFrames[item.getId()] = { item, itemData };
53755
+ if ("index" in item && item.index) {
53756
+ createdGroups[item.getId()] = { item, itemData };
53753
53757
  }
53754
53758
  this.index.insert(item);
53755
53759
  return item;
@@ -53767,8 +53771,8 @@ class Board {
53767
53771
  item.applyStartPoint(itemData.startPoint);
53768
53772
  item.applyEndPoint(itemData.endPoint);
53769
53773
  }
53770
- for (const key in createdFrames) {
53771
- const { item, itemData } = createdFrames[key];
53774
+ for (const key in createdGroups) {
53775
+ const { item, itemData } = createdGroups[key];
53772
53776
  item.applyAddChildren(itemData.children);
53773
53777
  }
53774
53778
  }
package/dist/cjs/index.js CHANGED
@@ -21464,6 +21464,7 @@ class BaseItem extends Mbr {
21464
21464
  this.id = id;
21465
21465
  if (isGroupItem) {
21466
21466
  this.index = new SimpleSpatialIndex(board.camera, board.pointer);
21467
+ this.canBeNested = false;
21467
21468
  }
21468
21469
  if (defaultItemData) {
21469
21470
  Object.entries(defaultItemData).forEach(([key, value]) => {
@@ -21588,6 +21589,9 @@ class BaseItem extends Mbr {
21588
21589
  return null;
21589
21590
  }
21590
21591
  deserialize(data) {
21592
+ if (data.children) {
21593
+ this.applyAddChildren(data.children);
21594
+ }
21591
21595
  Object.entries(data).forEach(([key, value]) => {
21592
21596
  if (this[key]?.deserialize) {
21593
21597
  this[key].deserialize(value);
@@ -53742,14 +53746,14 @@ class Board {
53742
53746
  const items = Array.from(itemsDiv.children).map((el) => this.parseHTML(el));
53743
53747
  this.index.clear();
53744
53748
  const createdConnectors = {};
53745
- const createdFrames = {};
53749
+ const createdGroups = {};
53746
53750
  const addItem = (itemData) => {
53747
53751
  const item = this.createItem(itemData.id, itemData);
53748
53752
  if (item instanceof Connector2) {
53749
53753
  createdConnectors[itemData.id] = { item, itemData };
53750
53754
  }
53751
- if (item instanceof Frame2) {
53752
- createdFrames[item.getId()] = { item, itemData };
53755
+ if ("index" in item && item.index) {
53756
+ createdGroups[item.getId()] = { item, itemData };
53753
53757
  }
53754
53758
  this.index.insert(item);
53755
53759
  return item;
@@ -53767,8 +53771,8 @@ class Board {
53767
53771
  item.applyStartPoint(itemData.startPoint);
53768
53772
  item.applyEndPoint(itemData.endPoint);
53769
53773
  }
53770
- for (const key in createdFrames) {
53771
- const { item, itemData } = createdFrames[key];
53774
+ for (const key in createdGroups) {
53775
+ const { item, itemData } = createdGroups[key];
53772
53776
  item.applyAddChildren(itemData.children);
53773
53777
  }
53774
53778
  }
package/dist/cjs/node.js CHANGED
@@ -23936,6 +23936,7 @@ class BaseItem extends Mbr {
23936
23936
  this.id = id;
23937
23937
  if (isGroupItem) {
23938
23938
  this.index = new SimpleSpatialIndex(board.camera, board.pointer);
23939
+ this.canBeNested = false;
23939
23940
  }
23940
23941
  if (defaultItemData) {
23941
23942
  Object.entries(defaultItemData).forEach(([key, value]) => {
@@ -24060,6 +24061,9 @@ class BaseItem extends Mbr {
24060
24061
  return null;
24061
24062
  }
24062
24063
  deserialize(data) {
24064
+ if (data.children) {
24065
+ this.applyAddChildren(data.children);
24066
+ }
24063
24067
  Object.entries(data).forEach(([key, value]) => {
24064
24068
  if (this[key]?.deserialize) {
24065
24069
  this[key].deserialize(value);
@@ -56215,14 +56219,14 @@ class Board {
56215
56219
  const items = Array.from(itemsDiv.children).map((el) => this.parseHTML(el));
56216
56220
  this.index.clear();
56217
56221
  const createdConnectors = {};
56218
- const createdFrames = {};
56222
+ const createdGroups = {};
56219
56223
  const addItem = (itemData) => {
56220
56224
  const item = this.createItem(itemData.id, itemData);
56221
56225
  if (item instanceof Connector2) {
56222
56226
  createdConnectors[itemData.id] = { item, itemData };
56223
56227
  }
56224
- if (item instanceof Frame2) {
56225
- createdFrames[item.getId()] = { item, itemData };
56228
+ if ("index" in item && item.index) {
56229
+ createdGroups[item.getId()] = { item, itemData };
56226
56230
  }
56227
56231
  this.index.insert(item);
56228
56232
  return item;
@@ -56240,8 +56244,8 @@ class Board {
56240
56244
  item.applyStartPoint(itemData.startPoint);
56241
56245
  item.applyEndPoint(itemData.endPoint);
56242
56246
  }
56243
- for (const key in createdFrames) {
56244
- const { item, itemData } = createdFrames[key];
56247
+ for (const key in createdGroups) {
56248
+ const { item, itemData } = createdGroups[key];
56245
56249
  item.applyAddChildren(itemData.children);
56246
56250
  }
56247
56251
  }
@@ -21314,6 +21314,7 @@ class BaseItem extends Mbr {
21314
21314
  this.id = id;
21315
21315
  if (isGroupItem) {
21316
21316
  this.index = new SimpleSpatialIndex(board.camera, board.pointer);
21317
+ this.canBeNested = false;
21317
21318
  }
21318
21319
  if (defaultItemData) {
21319
21320
  Object.entries(defaultItemData).forEach(([key, value]) => {
@@ -21438,6 +21439,9 @@ class BaseItem extends Mbr {
21438
21439
  return null;
21439
21440
  }
21440
21441
  deserialize(data) {
21442
+ if (data.children) {
21443
+ this.applyAddChildren(data.children);
21444
+ }
21441
21445
  Object.entries(data).forEach(([key, value]) => {
21442
21446
  if (this[key]?.deserialize) {
21443
21447
  this[key].deserialize(value);
@@ -53592,14 +53596,14 @@ class Board {
53592
53596
  const items = Array.from(itemsDiv.children).map((el) => this.parseHTML(el));
53593
53597
  this.index.clear();
53594
53598
  const createdConnectors = {};
53595
- const createdFrames = {};
53599
+ const createdGroups = {};
53596
53600
  const addItem = (itemData) => {
53597
53601
  const item = this.createItem(itemData.id, itemData);
53598
53602
  if (item instanceof Connector2) {
53599
53603
  createdConnectors[itemData.id] = { item, itemData };
53600
53604
  }
53601
- if (item instanceof Frame2) {
53602
- createdFrames[item.getId()] = { item, itemData };
53605
+ if ("index" in item && item.index) {
53606
+ createdGroups[item.getId()] = { item, itemData };
53603
53607
  }
53604
53608
  this.index.insert(item);
53605
53609
  return item;
@@ -53617,8 +53621,8 @@ class Board {
53617
53621
  item.applyStartPoint(itemData.startPoint);
53618
53622
  item.applyEndPoint(itemData.endPoint);
53619
53623
  }
53620
- for (const key in createdFrames) {
53621
- const { item, itemData } = createdFrames[key];
53624
+ for (const key in createdGroups) {
53625
+ const { item, itemData } = createdGroups[key];
53622
53626
  item.applyAddChildren(itemData.children);
53623
53627
  }
53624
53628
  }
package/dist/esm/index.js CHANGED
@@ -21307,6 +21307,7 @@ class BaseItem extends Mbr {
21307
21307
  this.id = id;
21308
21308
  if (isGroupItem) {
21309
21309
  this.index = new SimpleSpatialIndex(board.camera, board.pointer);
21310
+ this.canBeNested = false;
21310
21311
  }
21311
21312
  if (defaultItemData) {
21312
21313
  Object.entries(defaultItemData).forEach(([key, value]) => {
@@ -21431,6 +21432,9 @@ class BaseItem extends Mbr {
21431
21432
  return null;
21432
21433
  }
21433
21434
  deserialize(data) {
21435
+ if (data.children) {
21436
+ this.applyAddChildren(data.children);
21437
+ }
21434
21438
  Object.entries(data).forEach(([key, value]) => {
21435
21439
  if (this[key]?.deserialize) {
21436
21440
  this[key].deserialize(value);
@@ -53585,14 +53589,14 @@ class Board {
53585
53589
  const items = Array.from(itemsDiv.children).map((el) => this.parseHTML(el));
53586
53590
  this.index.clear();
53587
53591
  const createdConnectors = {};
53588
- const createdFrames = {};
53592
+ const createdGroups = {};
53589
53593
  const addItem = (itemData) => {
53590
53594
  const item = this.createItem(itemData.id, itemData);
53591
53595
  if (item instanceof Connector2) {
53592
53596
  createdConnectors[itemData.id] = { item, itemData };
53593
53597
  }
53594
- if (item instanceof Frame2) {
53595
- createdFrames[item.getId()] = { item, itemData };
53598
+ if ("index" in item && item.index) {
53599
+ createdGroups[item.getId()] = { item, itemData };
53596
53600
  }
53597
53601
  this.index.insert(item);
53598
53602
  return item;
@@ -53610,8 +53614,8 @@ class Board {
53610
53614
  item.applyStartPoint(itemData.startPoint);
53611
53615
  item.applyEndPoint(itemData.endPoint);
53612
53616
  }
53613
- for (const key in createdFrames) {
53614
- const { item, itemData } = createdFrames[key];
53617
+ for (const key in createdGroups) {
53618
+ const { item, itemData } = createdGroups[key];
53615
53619
  item.applyAddChildren(itemData.children);
53616
53620
  }
53617
53621
  }
package/dist/esm/node.js CHANGED
@@ -23774,6 +23774,7 @@ class BaseItem extends Mbr {
23774
23774
  this.id = id;
23775
23775
  if (isGroupItem) {
23776
23776
  this.index = new SimpleSpatialIndex(board.camera, board.pointer);
23777
+ this.canBeNested = false;
23777
23778
  }
23778
23779
  if (defaultItemData) {
23779
23780
  Object.entries(defaultItemData).forEach(([key, value]) => {
@@ -23898,6 +23899,9 @@ class BaseItem extends Mbr {
23898
23899
  return null;
23899
23900
  }
23900
23901
  deserialize(data) {
23902
+ if (data.children) {
23903
+ this.applyAddChildren(data.children);
23904
+ }
23901
23905
  Object.entries(data).forEach(([key, value]) => {
23902
23906
  if (this[key]?.deserialize) {
23903
23907
  this[key].deserialize(value);
@@ -56053,14 +56057,14 @@ class Board {
56053
56057
  const items = Array.from(itemsDiv.children).map((el) => this.parseHTML(el));
56054
56058
  this.index.clear();
56055
56059
  const createdConnectors = {};
56056
- const createdFrames = {};
56060
+ const createdGroups = {};
56057
56061
  const addItem = (itemData) => {
56058
56062
  const item = this.createItem(itemData.id, itemData);
56059
56063
  if (item instanceof Connector2) {
56060
56064
  createdConnectors[itemData.id] = { item, itemData };
56061
56065
  }
56062
- if (item instanceof Frame2) {
56063
- createdFrames[item.getId()] = { item, itemData };
56066
+ if ("index" in item && item.index) {
56067
+ createdGroups[item.getId()] = { item, itemData };
56064
56068
  }
56065
56069
  this.index.insert(item);
56066
56070
  return item;
@@ -56078,8 +56082,8 @@ class Board {
56078
56082
  item.applyStartPoint(itemData.startPoint);
56079
56083
  item.applyEndPoint(itemData.endPoint);
56080
56084
  }
56081
- for (const key in createdFrames) {
56082
- const { item, itemData } = createdFrames[key];
56085
+ for (const key in createdGroups) {
56086
+ const { item, itemData } = createdGroups[key];
56083
56087
  item.applyAddChildren(itemData.children);
56084
56088
  }
56085
56089
  }
@@ -0,0 +1,6 @@
1
+ import { Board } from "Board";
2
+ import { ShapeTool } from "Tools/CustomTool";
3
+ export declare class AddDice extends ShapeTool {
4
+ constructor(board: Board, name: string);
5
+ pointerUp(): boolean;
6
+ }
@@ -0,0 +1,18 @@
1
+ import { BaseItem, BaseItemData, SerializedItemData } from "Items/BaseItem/BaseItem";
2
+ import { Board } from "Board";
3
+ import { Subject } from "Subject";
4
+ import { DrawingContext } from "Items/DrawingContext";
5
+ import { DeckOperation } from "Items/Examples/CardGame/Deck/DeckOperation";
6
+ export declare const defaultHandData: BaseItemData;
7
+ export declare class Hand extends BaseItem {
8
+ private ownerId;
9
+ readonly subject: Subject<Hand>;
10
+ private path;
11
+ constructor(board: Board, id?: string, ownerId?: string);
12
+ apply(op: DeckOperation): void;
13
+ applyOwnerId(ownerId: string): void;
14
+ private transformPath;
15
+ updateMbr(): void;
16
+ deserialize(data: SerializedItemData): this;
17
+ render(context: DrawingContext): void;
18
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "microboard-temp",
3
- "version": "0.4.64",
3
+ "version": "0.4.66",
4
4
  "description": "A flexible interactive whiteboard library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",