microboard-temp 0.5.52 → 0.5.54

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.
@@ -46528,10 +46528,10 @@ class Select extends Tool {
46528
46528
  return false;
46529
46529
  }
46530
46530
  const draggingMbr = draggingItem.getMbr();
46531
- const frames = this.board.items.getEnclosedOrCrossed(draggingMbr.left, draggingMbr.top, draggingMbr.right, draggingMbr.bottom).filter((item) => item instanceof Frame2);
46532
- frames.forEach((frame) => {
46533
- if (frame.handleNesting(draggingItem)) {
46534
- this.nestingHighlighter.add(frame, draggingItem);
46531
+ const groups = this.board.items.getEnclosedOrCrossed(draggingMbr.left, draggingMbr.top, draggingMbr.right, draggingMbr.bottom).filter((item) => !!(("index" in item) && item.index));
46532
+ groups.forEach((group) => {
46533
+ if (group.handleNesting(draggingItem)) {
46534
+ this.nestingHighlighter.add(group, draggingItem);
46535
46535
  } else {
46536
46536
  this.nestingHighlighter.remove(draggingItem);
46537
46537
  }
@@ -46582,13 +46582,13 @@ class Select extends Tool {
46582
46582
  }
46583
46583
  }
46584
46584
  updateFramesNesting(selectionMbr, selection) {
46585
- const frames = this.board.items.getEnclosedOrCrossed(selectionMbr.left, selectionMbr.top, selectionMbr.right, selectionMbr.bottom).filter((item) => item instanceof Frame2).filter((frame) => !selection.items.list().includes(frame));
46586
- const draggingFramesIds = selection.list().filter((item) => item instanceof Frame2).map((frame) => frame.getId());
46585
+ const groups = this.board.items.getEnclosedOrCrossed(selectionMbr.left, selectionMbr.top, selectionMbr.right, selectionMbr.bottom).filter((item) => !!(("index" in item) && item.index)).filter((group) => !selection.items.list().includes(group));
46586
+ const draggingGroupsIds = selection.list().filter((item) => !!(("index" in item) && item.index)).map((group) => group.getId());
46587
46587
  selection.list().forEach((item) => {
46588
- if (!(item instanceof Frame2) && !draggingFramesIds.includes(item.parent)) {
46589
- frames.forEach((frame) => {
46590
- if (frame.handleNesting(item)) {
46591
- this.nestingHighlighter.add(frame, item);
46588
+ if (!(("index" in item) && item.index) && !draggingGroupsIds.includes(item.parent)) {
46589
+ groups.forEach((group) => {
46590
+ if (group.handleNesting(item)) {
46591
+ this.nestingHighlighter.add(group, item);
46592
46592
  } else {
46593
46593
  this.nestingHighlighter.remove(item);
46594
46594
  }
@@ -48141,6 +48141,8 @@ class Deck extends BaseItem {
48141
48141
  resizeEnabled = false;
48142
48142
  path = null;
48143
48143
  isPerpendicular = undefined;
48144
+ animationFrameId;
48145
+ drawingContext = null;
48144
48146
  constructor(board, id = "") {
48145
48147
  super(board, id, defaultDeckData, true);
48146
48148
  this.index.getUnderPoint = () => [];
@@ -48251,6 +48253,7 @@ class Deck extends BaseItem {
48251
48253
  const j = Math.floor(Math.random() * (i + 1));
48252
48254
  [shuffled[i], shuffled[j]] = [shuffled[j], shuffled[i]];
48253
48255
  }
48256
+ this.emitAnimation();
48254
48257
  this.removeChildItems(this.index.list());
48255
48258
  this.addChildItems(shuffled);
48256
48259
  }
@@ -48267,6 +48270,12 @@ class Deck extends BaseItem {
48267
48270
  apply(op) {
48268
48271
  super.apply(op);
48269
48272
  if (op.class === "Deck") {
48273
+ if (op.method === "startAnimation" && op.newData.timeStamp && Date.now() - op.newData.timeStamp < 4000) {
48274
+ this.startAnimation();
48275
+ setTimeout(() => {
48276
+ this.stopAnimation();
48277
+ }, 2000);
48278
+ }
48270
48279
  this.isCacheDirty = true;
48271
48280
  }
48272
48281
  this.subject.publish(this);
@@ -48291,6 +48300,7 @@ class Deck extends BaseItem {
48291
48300
  return this;
48292
48301
  }
48293
48302
  render(context) {
48303
+ this.drawingContext = context;
48294
48304
  if (this.transformationRenderBlock) {
48295
48305
  return;
48296
48306
  }
@@ -48302,9 +48312,42 @@ class Deck extends BaseItem {
48302
48312
  if (this.cachedCanvas && this.cachedCanvas.width && this.cachedCanvas.height) {
48303
48313
  ctx.save();
48304
48314
  ctx.drawImage(this.cachedCanvas, this.left, this.top);
48315
+ if (this.animationFrameId) {
48316
+ const now = Date.now();
48317
+ const progress = now % 2000 / 2000;
48318
+ const yPos = this.top + this.getHeight() * Math.abs(Math.sin(progress * Math.PI));
48319
+ ctx.fillStyle = conf.SELECTION_COLOR;
48320
+ ctx.fillRect(this.left + 5, yPos - 2, this.getWidth() - 10, 4);
48321
+ }
48305
48322
  ctx.restore();
48306
48323
  }
48307
48324
  }
48325
+ emitAnimation() {
48326
+ this.emit({
48327
+ class: "Deck",
48328
+ method: "startAnimation",
48329
+ item: [this.getId()],
48330
+ newData: { timeStamp: Date.now() }
48331
+ });
48332
+ }
48333
+ startAnimation() {
48334
+ if (!this.animationFrameId) {
48335
+ const animate = () => {
48336
+ if (this.drawingContext) {
48337
+ this.subject.publish(this);
48338
+ this.animationFrameId = requestAnimationFrame(animate);
48339
+ }
48340
+ };
48341
+ this.animationFrameId = requestAnimationFrame(animate);
48342
+ }
48343
+ }
48344
+ stopAnimation() {
48345
+ if (this.animationFrameId) {
48346
+ cancelAnimationFrame(this.animationFrameId);
48347
+ this.animationFrameId = undefined;
48348
+ this.drawingContext = null;
48349
+ }
48350
+ }
48308
48351
  renderHTML(documentFactory) {
48309
48352
  const div = super.renderHTML(documentFactory);
48310
48353
  const cards = this.index?.list();
@@ -48851,7 +48894,19 @@ class AddScreen extends ShapeTool {
48851
48894
  localStorage.setItem("screenOwnerId", screenOwnerId);
48852
48895
  }
48853
48896
  this.item.applyOwnerId(screenOwnerId);
48854
- return super.pointerUp();
48897
+ const currMbr = this.item.getMbr();
48898
+ const screenChildren = this.board.items.getEnclosedOrCrossed(currMbr.left, currMbr.top, currMbr.right, currMbr.bottom).filter((item) => item.parent === "Board").filter((item) => this.item.handleNesting(item));
48899
+ const width2 = this.bounds.getWidth() < 2 ? 100 : this.bounds.getWidth();
48900
+ const height3 = this.bounds.getHeight() < 2 ? 100 : this.bounds.getHeight();
48901
+ this.initTransformation(width2 / 100, height3 / 100);
48902
+ const screen = this.board.add(this.item);
48903
+ screen.emitNesting(screenChildren);
48904
+ this.isDown = false;
48905
+ this.board.selection.removeAll();
48906
+ this.board.selection.add(screen);
48907
+ this.board.tools.select();
48908
+ this.board.tools.publish();
48909
+ return true;
48855
48910
  }
48856
48911
  }
48857
48912
 
@@ -51950,7 +52005,7 @@ function updateFrameChildren({
51950
52005
  }) {
51951
52006
  const groups = board.items.getGroupItemsEnclosedOrCrossed(mbr.left, mbr.top, mbr.right, mbr.bottom);
51952
52007
  board.selection.items.list().forEach((item) => {
51953
- if ("getChildrenIds" in item && item.getChildrenIds()) {
52008
+ if ("index" in item && item.index) {
51954
52009
  const currMbr = item.getMbr();
51955
52010
  const itemsToCheck = board.items.getEnclosedOrCrossed(currMbr.left, currMbr.top, currMbr.right, currMbr.bottom);
51956
52011
  itemsToCheck.forEach((currItem) => {
package/dist/cjs/index.js CHANGED
@@ -46528,10 +46528,10 @@ class Select extends Tool {
46528
46528
  return false;
46529
46529
  }
46530
46530
  const draggingMbr = draggingItem.getMbr();
46531
- const frames = this.board.items.getEnclosedOrCrossed(draggingMbr.left, draggingMbr.top, draggingMbr.right, draggingMbr.bottom).filter((item) => item instanceof Frame2);
46532
- frames.forEach((frame) => {
46533
- if (frame.handleNesting(draggingItem)) {
46534
- this.nestingHighlighter.add(frame, draggingItem);
46531
+ const groups = this.board.items.getEnclosedOrCrossed(draggingMbr.left, draggingMbr.top, draggingMbr.right, draggingMbr.bottom).filter((item) => !!(("index" in item) && item.index));
46532
+ groups.forEach((group) => {
46533
+ if (group.handleNesting(draggingItem)) {
46534
+ this.nestingHighlighter.add(group, draggingItem);
46535
46535
  } else {
46536
46536
  this.nestingHighlighter.remove(draggingItem);
46537
46537
  }
@@ -46582,13 +46582,13 @@ class Select extends Tool {
46582
46582
  }
46583
46583
  }
46584
46584
  updateFramesNesting(selectionMbr, selection) {
46585
- const frames = this.board.items.getEnclosedOrCrossed(selectionMbr.left, selectionMbr.top, selectionMbr.right, selectionMbr.bottom).filter((item) => item instanceof Frame2).filter((frame) => !selection.items.list().includes(frame));
46586
- const draggingFramesIds = selection.list().filter((item) => item instanceof Frame2).map((frame) => frame.getId());
46585
+ const groups = this.board.items.getEnclosedOrCrossed(selectionMbr.left, selectionMbr.top, selectionMbr.right, selectionMbr.bottom).filter((item) => !!(("index" in item) && item.index)).filter((group) => !selection.items.list().includes(group));
46586
+ const draggingGroupsIds = selection.list().filter((item) => !!(("index" in item) && item.index)).map((group) => group.getId());
46587
46587
  selection.list().forEach((item) => {
46588
- if (!(item instanceof Frame2) && !draggingFramesIds.includes(item.parent)) {
46589
- frames.forEach((frame) => {
46590
- if (frame.handleNesting(item)) {
46591
- this.nestingHighlighter.add(frame, item);
46588
+ if (!(("index" in item) && item.index) && !draggingGroupsIds.includes(item.parent)) {
46589
+ groups.forEach((group) => {
46590
+ if (group.handleNesting(item)) {
46591
+ this.nestingHighlighter.add(group, item);
46592
46592
  } else {
46593
46593
  this.nestingHighlighter.remove(item);
46594
46594
  }
@@ -48141,6 +48141,8 @@ class Deck extends BaseItem {
48141
48141
  resizeEnabled = false;
48142
48142
  path = null;
48143
48143
  isPerpendicular = undefined;
48144
+ animationFrameId;
48145
+ drawingContext = null;
48144
48146
  constructor(board, id = "") {
48145
48147
  super(board, id, defaultDeckData, true);
48146
48148
  this.index.getUnderPoint = () => [];
@@ -48251,6 +48253,7 @@ class Deck extends BaseItem {
48251
48253
  const j = Math.floor(Math.random() * (i + 1));
48252
48254
  [shuffled[i], shuffled[j]] = [shuffled[j], shuffled[i]];
48253
48255
  }
48256
+ this.emitAnimation();
48254
48257
  this.removeChildItems(this.index.list());
48255
48258
  this.addChildItems(shuffled);
48256
48259
  }
@@ -48267,6 +48270,12 @@ class Deck extends BaseItem {
48267
48270
  apply(op) {
48268
48271
  super.apply(op);
48269
48272
  if (op.class === "Deck") {
48273
+ if (op.method === "startAnimation" && op.newData.timeStamp && Date.now() - op.newData.timeStamp < 4000) {
48274
+ this.startAnimation();
48275
+ setTimeout(() => {
48276
+ this.stopAnimation();
48277
+ }, 2000);
48278
+ }
48270
48279
  this.isCacheDirty = true;
48271
48280
  }
48272
48281
  this.subject.publish(this);
@@ -48291,6 +48300,7 @@ class Deck extends BaseItem {
48291
48300
  return this;
48292
48301
  }
48293
48302
  render(context) {
48303
+ this.drawingContext = context;
48294
48304
  if (this.transformationRenderBlock) {
48295
48305
  return;
48296
48306
  }
@@ -48302,9 +48312,42 @@ class Deck extends BaseItem {
48302
48312
  if (this.cachedCanvas && this.cachedCanvas.width && this.cachedCanvas.height) {
48303
48313
  ctx.save();
48304
48314
  ctx.drawImage(this.cachedCanvas, this.left, this.top);
48315
+ if (this.animationFrameId) {
48316
+ const now = Date.now();
48317
+ const progress = now % 2000 / 2000;
48318
+ const yPos = this.top + this.getHeight() * Math.abs(Math.sin(progress * Math.PI));
48319
+ ctx.fillStyle = conf.SELECTION_COLOR;
48320
+ ctx.fillRect(this.left + 5, yPos - 2, this.getWidth() - 10, 4);
48321
+ }
48305
48322
  ctx.restore();
48306
48323
  }
48307
48324
  }
48325
+ emitAnimation() {
48326
+ this.emit({
48327
+ class: "Deck",
48328
+ method: "startAnimation",
48329
+ item: [this.getId()],
48330
+ newData: { timeStamp: Date.now() }
48331
+ });
48332
+ }
48333
+ startAnimation() {
48334
+ if (!this.animationFrameId) {
48335
+ const animate = () => {
48336
+ if (this.drawingContext) {
48337
+ this.subject.publish(this);
48338
+ this.animationFrameId = requestAnimationFrame(animate);
48339
+ }
48340
+ };
48341
+ this.animationFrameId = requestAnimationFrame(animate);
48342
+ }
48343
+ }
48344
+ stopAnimation() {
48345
+ if (this.animationFrameId) {
48346
+ cancelAnimationFrame(this.animationFrameId);
48347
+ this.animationFrameId = undefined;
48348
+ this.drawingContext = null;
48349
+ }
48350
+ }
48308
48351
  renderHTML(documentFactory) {
48309
48352
  const div = super.renderHTML(documentFactory);
48310
48353
  const cards = this.index?.list();
@@ -48851,7 +48894,19 @@ class AddScreen extends ShapeTool {
48851
48894
  localStorage.setItem("screenOwnerId", screenOwnerId);
48852
48895
  }
48853
48896
  this.item.applyOwnerId(screenOwnerId);
48854
- return super.pointerUp();
48897
+ const currMbr = this.item.getMbr();
48898
+ const screenChildren = this.board.items.getEnclosedOrCrossed(currMbr.left, currMbr.top, currMbr.right, currMbr.bottom).filter((item) => item.parent === "Board").filter((item) => this.item.handleNesting(item));
48899
+ const width2 = this.bounds.getWidth() < 2 ? 100 : this.bounds.getWidth();
48900
+ const height3 = this.bounds.getHeight() < 2 ? 100 : this.bounds.getHeight();
48901
+ this.initTransformation(width2 / 100, height3 / 100);
48902
+ const screen = this.board.add(this.item);
48903
+ screen.emitNesting(screenChildren);
48904
+ this.isDown = false;
48905
+ this.board.selection.removeAll();
48906
+ this.board.selection.add(screen);
48907
+ this.board.tools.select();
48908
+ this.board.tools.publish();
48909
+ return true;
48855
48910
  }
48856
48911
  }
48857
48912
 
@@ -51950,7 +52005,7 @@ function updateFrameChildren({
51950
52005
  }) {
51951
52006
  const groups = board.items.getGroupItemsEnclosedOrCrossed(mbr.left, mbr.top, mbr.right, mbr.bottom);
51952
52007
  board.selection.items.list().forEach((item) => {
51953
- if ("getChildrenIds" in item && item.getChildrenIds()) {
52008
+ if ("index" in item && item.index) {
51954
52009
  const currMbr = item.getMbr();
51955
52010
  const itemsToCheck = board.items.getEnclosedOrCrossed(currMbr.left, currMbr.top, currMbr.right, currMbr.bottom);
51956
52011
  itemsToCheck.forEach((currItem) => {
package/dist/cjs/node.js CHANGED
@@ -49001,10 +49001,10 @@ class Select extends Tool {
49001
49001
  return false;
49002
49002
  }
49003
49003
  const draggingMbr = draggingItem.getMbr();
49004
- const frames = this.board.items.getEnclosedOrCrossed(draggingMbr.left, draggingMbr.top, draggingMbr.right, draggingMbr.bottom).filter((item) => item instanceof Frame2);
49005
- frames.forEach((frame) => {
49006
- if (frame.handleNesting(draggingItem)) {
49007
- this.nestingHighlighter.add(frame, draggingItem);
49004
+ const groups = this.board.items.getEnclosedOrCrossed(draggingMbr.left, draggingMbr.top, draggingMbr.right, draggingMbr.bottom).filter((item) => !!(("index" in item) && item.index));
49005
+ groups.forEach((group) => {
49006
+ if (group.handleNesting(draggingItem)) {
49007
+ this.nestingHighlighter.add(group, draggingItem);
49008
49008
  } else {
49009
49009
  this.nestingHighlighter.remove(draggingItem);
49010
49010
  }
@@ -49055,13 +49055,13 @@ class Select extends Tool {
49055
49055
  }
49056
49056
  }
49057
49057
  updateFramesNesting(selectionMbr, selection) {
49058
- const frames = this.board.items.getEnclosedOrCrossed(selectionMbr.left, selectionMbr.top, selectionMbr.right, selectionMbr.bottom).filter((item) => item instanceof Frame2).filter((frame) => !selection.items.list().includes(frame));
49059
- const draggingFramesIds = selection.list().filter((item) => item instanceof Frame2).map((frame) => frame.getId());
49058
+ const groups = this.board.items.getEnclosedOrCrossed(selectionMbr.left, selectionMbr.top, selectionMbr.right, selectionMbr.bottom).filter((item) => !!(("index" in item) && item.index)).filter((group) => !selection.items.list().includes(group));
49059
+ const draggingGroupsIds = selection.list().filter((item) => !!(("index" in item) && item.index)).map((group) => group.getId());
49060
49060
  selection.list().forEach((item) => {
49061
- if (!(item instanceof Frame2) && !draggingFramesIds.includes(item.parent)) {
49062
- frames.forEach((frame) => {
49063
- if (frame.handleNesting(item)) {
49064
- this.nestingHighlighter.add(frame, item);
49061
+ if (!(("index" in item) && item.index) && !draggingGroupsIds.includes(item.parent)) {
49062
+ groups.forEach((group) => {
49063
+ if (group.handleNesting(item)) {
49064
+ this.nestingHighlighter.add(group, item);
49065
49065
  } else {
49066
49066
  this.nestingHighlighter.remove(item);
49067
49067
  }
@@ -50614,6 +50614,8 @@ class Deck extends BaseItem {
50614
50614
  resizeEnabled = false;
50615
50615
  path = null;
50616
50616
  isPerpendicular = undefined;
50617
+ animationFrameId;
50618
+ drawingContext = null;
50617
50619
  constructor(board, id = "") {
50618
50620
  super(board, id, defaultDeckData, true);
50619
50621
  this.index.getUnderPoint = () => [];
@@ -50724,6 +50726,7 @@ class Deck extends BaseItem {
50724
50726
  const j = Math.floor(Math.random() * (i + 1));
50725
50727
  [shuffled[i], shuffled[j]] = [shuffled[j], shuffled[i]];
50726
50728
  }
50729
+ this.emitAnimation();
50727
50730
  this.removeChildItems(this.index.list());
50728
50731
  this.addChildItems(shuffled);
50729
50732
  }
@@ -50740,6 +50743,12 @@ class Deck extends BaseItem {
50740
50743
  apply(op) {
50741
50744
  super.apply(op);
50742
50745
  if (op.class === "Deck") {
50746
+ if (op.method === "startAnimation" && op.newData.timeStamp && Date.now() - op.newData.timeStamp < 4000) {
50747
+ this.startAnimation();
50748
+ setTimeout(() => {
50749
+ this.stopAnimation();
50750
+ }, 2000);
50751
+ }
50743
50752
  this.isCacheDirty = true;
50744
50753
  }
50745
50754
  this.subject.publish(this);
@@ -50764,6 +50773,7 @@ class Deck extends BaseItem {
50764
50773
  return this;
50765
50774
  }
50766
50775
  render(context) {
50776
+ this.drawingContext = context;
50767
50777
  if (this.transformationRenderBlock) {
50768
50778
  return;
50769
50779
  }
@@ -50775,9 +50785,42 @@ class Deck extends BaseItem {
50775
50785
  if (this.cachedCanvas && this.cachedCanvas.width && this.cachedCanvas.height) {
50776
50786
  ctx.save();
50777
50787
  ctx.drawImage(this.cachedCanvas, this.left, this.top);
50788
+ if (this.animationFrameId) {
50789
+ const now = Date.now();
50790
+ const progress = now % 2000 / 2000;
50791
+ const yPos = this.top + this.getHeight() * Math.abs(Math.sin(progress * Math.PI));
50792
+ ctx.fillStyle = conf.SELECTION_COLOR;
50793
+ ctx.fillRect(this.left + 5, yPos - 2, this.getWidth() - 10, 4);
50794
+ }
50778
50795
  ctx.restore();
50779
50796
  }
50780
50797
  }
50798
+ emitAnimation() {
50799
+ this.emit({
50800
+ class: "Deck",
50801
+ method: "startAnimation",
50802
+ item: [this.getId()],
50803
+ newData: { timeStamp: Date.now() }
50804
+ });
50805
+ }
50806
+ startAnimation() {
50807
+ if (!this.animationFrameId) {
50808
+ const animate = () => {
50809
+ if (this.drawingContext) {
50810
+ this.subject.publish(this);
50811
+ this.animationFrameId = requestAnimationFrame(animate);
50812
+ }
50813
+ };
50814
+ this.animationFrameId = requestAnimationFrame(animate);
50815
+ }
50816
+ }
50817
+ stopAnimation() {
50818
+ if (this.animationFrameId) {
50819
+ cancelAnimationFrame(this.animationFrameId);
50820
+ this.animationFrameId = undefined;
50821
+ this.drawingContext = null;
50822
+ }
50823
+ }
50781
50824
  renderHTML(documentFactory) {
50782
50825
  const div = super.renderHTML(documentFactory);
50783
50826
  const cards = this.index?.list();
@@ -51324,7 +51367,19 @@ class AddScreen extends ShapeTool {
51324
51367
  localStorage.setItem("screenOwnerId", screenOwnerId);
51325
51368
  }
51326
51369
  this.item.applyOwnerId(screenOwnerId);
51327
- return super.pointerUp();
51370
+ const currMbr = this.item.getMbr();
51371
+ const screenChildren = this.board.items.getEnclosedOrCrossed(currMbr.left, currMbr.top, currMbr.right, currMbr.bottom).filter((item) => item.parent === "Board").filter((item) => this.item.handleNesting(item));
51372
+ const width2 = this.bounds.getWidth() < 2 ? 100 : this.bounds.getWidth();
51373
+ const height3 = this.bounds.getHeight() < 2 ? 100 : this.bounds.getHeight();
51374
+ this.initTransformation(width2 / 100, height3 / 100);
51375
+ const screen = this.board.add(this.item);
51376
+ screen.emitNesting(screenChildren);
51377
+ this.isDown = false;
51378
+ this.board.selection.removeAll();
51379
+ this.board.selection.add(screen);
51380
+ this.board.tools.select();
51381
+ this.board.tools.publish();
51382
+ return true;
51328
51383
  }
51329
51384
  }
51330
51385
 
@@ -54423,7 +54478,7 @@ function updateFrameChildren({
54423
54478
  }) {
54424
54479
  const groups = board.items.getGroupItemsEnclosedOrCrossed(mbr.left, mbr.top, mbr.right, mbr.bottom);
54425
54480
  board.selection.items.list().forEach((item) => {
54426
- if ("getChildrenIds" in item && item.getChildrenIds()) {
54481
+ if ("index" in item && item.index) {
54427
54482
  const currMbr = item.getMbr();
54428
54483
  const itemsToCheck = board.items.getEnclosedOrCrossed(currMbr.left, currMbr.top, currMbr.right, currMbr.bottom);
54429
54484
  itemsToCheck.forEach((currItem) => {
@@ -46374,10 +46374,10 @@ class Select extends Tool {
46374
46374
  return false;
46375
46375
  }
46376
46376
  const draggingMbr = draggingItem.getMbr();
46377
- const frames = this.board.items.getEnclosedOrCrossed(draggingMbr.left, draggingMbr.top, draggingMbr.right, draggingMbr.bottom).filter((item) => item instanceof Frame2);
46378
- frames.forEach((frame) => {
46379
- if (frame.handleNesting(draggingItem)) {
46380
- this.nestingHighlighter.add(frame, draggingItem);
46377
+ const groups = this.board.items.getEnclosedOrCrossed(draggingMbr.left, draggingMbr.top, draggingMbr.right, draggingMbr.bottom).filter((item) => !!(("index" in item) && item.index));
46378
+ groups.forEach((group) => {
46379
+ if (group.handleNesting(draggingItem)) {
46380
+ this.nestingHighlighter.add(group, draggingItem);
46381
46381
  } else {
46382
46382
  this.nestingHighlighter.remove(draggingItem);
46383
46383
  }
@@ -46428,13 +46428,13 @@ class Select extends Tool {
46428
46428
  }
46429
46429
  }
46430
46430
  updateFramesNesting(selectionMbr, selection) {
46431
- const frames = this.board.items.getEnclosedOrCrossed(selectionMbr.left, selectionMbr.top, selectionMbr.right, selectionMbr.bottom).filter((item) => item instanceof Frame2).filter((frame) => !selection.items.list().includes(frame));
46432
- const draggingFramesIds = selection.list().filter((item) => item instanceof Frame2).map((frame) => frame.getId());
46431
+ const groups = this.board.items.getEnclosedOrCrossed(selectionMbr.left, selectionMbr.top, selectionMbr.right, selectionMbr.bottom).filter((item) => !!(("index" in item) && item.index)).filter((group) => !selection.items.list().includes(group));
46432
+ const draggingGroupsIds = selection.list().filter((item) => !!(("index" in item) && item.index)).map((group) => group.getId());
46433
46433
  selection.list().forEach((item) => {
46434
- if (!(item instanceof Frame2) && !draggingFramesIds.includes(item.parent)) {
46435
- frames.forEach((frame) => {
46436
- if (frame.handleNesting(item)) {
46437
- this.nestingHighlighter.add(frame, item);
46434
+ if (!(("index" in item) && item.index) && !draggingGroupsIds.includes(item.parent)) {
46435
+ groups.forEach((group) => {
46436
+ if (group.handleNesting(item)) {
46437
+ this.nestingHighlighter.add(group, item);
46438
46438
  } else {
46439
46439
  this.nestingHighlighter.remove(item);
46440
46440
  }
@@ -47987,6 +47987,8 @@ class Deck extends BaseItem {
47987
47987
  resizeEnabled = false;
47988
47988
  path = null;
47989
47989
  isPerpendicular = undefined;
47990
+ animationFrameId;
47991
+ drawingContext = null;
47990
47992
  constructor(board, id = "") {
47991
47993
  super(board, id, defaultDeckData, true);
47992
47994
  this.index.getUnderPoint = () => [];
@@ -48097,6 +48099,7 @@ class Deck extends BaseItem {
48097
48099
  const j = Math.floor(Math.random() * (i + 1));
48098
48100
  [shuffled[i], shuffled[j]] = [shuffled[j], shuffled[i]];
48099
48101
  }
48102
+ this.emitAnimation();
48100
48103
  this.removeChildItems(this.index.list());
48101
48104
  this.addChildItems(shuffled);
48102
48105
  }
@@ -48113,6 +48116,12 @@ class Deck extends BaseItem {
48113
48116
  apply(op) {
48114
48117
  super.apply(op);
48115
48118
  if (op.class === "Deck") {
48119
+ if (op.method === "startAnimation" && op.newData.timeStamp && Date.now() - op.newData.timeStamp < 4000) {
48120
+ this.startAnimation();
48121
+ setTimeout(() => {
48122
+ this.stopAnimation();
48123
+ }, 2000);
48124
+ }
48116
48125
  this.isCacheDirty = true;
48117
48126
  }
48118
48127
  this.subject.publish(this);
@@ -48137,6 +48146,7 @@ class Deck extends BaseItem {
48137
48146
  return this;
48138
48147
  }
48139
48148
  render(context) {
48149
+ this.drawingContext = context;
48140
48150
  if (this.transformationRenderBlock) {
48141
48151
  return;
48142
48152
  }
@@ -48148,9 +48158,42 @@ class Deck extends BaseItem {
48148
48158
  if (this.cachedCanvas && this.cachedCanvas.width && this.cachedCanvas.height) {
48149
48159
  ctx.save();
48150
48160
  ctx.drawImage(this.cachedCanvas, this.left, this.top);
48161
+ if (this.animationFrameId) {
48162
+ const now = Date.now();
48163
+ const progress = now % 2000 / 2000;
48164
+ const yPos = this.top + this.getHeight() * Math.abs(Math.sin(progress * Math.PI));
48165
+ ctx.fillStyle = conf.SELECTION_COLOR;
48166
+ ctx.fillRect(this.left + 5, yPos - 2, this.getWidth() - 10, 4);
48167
+ }
48151
48168
  ctx.restore();
48152
48169
  }
48153
48170
  }
48171
+ emitAnimation() {
48172
+ this.emit({
48173
+ class: "Deck",
48174
+ method: "startAnimation",
48175
+ item: [this.getId()],
48176
+ newData: { timeStamp: Date.now() }
48177
+ });
48178
+ }
48179
+ startAnimation() {
48180
+ if (!this.animationFrameId) {
48181
+ const animate = () => {
48182
+ if (this.drawingContext) {
48183
+ this.subject.publish(this);
48184
+ this.animationFrameId = requestAnimationFrame(animate);
48185
+ }
48186
+ };
48187
+ this.animationFrameId = requestAnimationFrame(animate);
48188
+ }
48189
+ }
48190
+ stopAnimation() {
48191
+ if (this.animationFrameId) {
48192
+ cancelAnimationFrame(this.animationFrameId);
48193
+ this.animationFrameId = undefined;
48194
+ this.drawingContext = null;
48195
+ }
48196
+ }
48154
48197
  renderHTML(documentFactory) {
48155
48198
  const div = super.renderHTML(documentFactory);
48156
48199
  const cards = this.index?.list();
@@ -48697,7 +48740,19 @@ class AddScreen extends ShapeTool {
48697
48740
  localStorage.setItem("screenOwnerId", screenOwnerId);
48698
48741
  }
48699
48742
  this.item.applyOwnerId(screenOwnerId);
48700
- return super.pointerUp();
48743
+ const currMbr = this.item.getMbr();
48744
+ const screenChildren = this.board.items.getEnclosedOrCrossed(currMbr.left, currMbr.top, currMbr.right, currMbr.bottom).filter((item) => item.parent === "Board").filter((item) => this.item.handleNesting(item));
48745
+ const width2 = this.bounds.getWidth() < 2 ? 100 : this.bounds.getWidth();
48746
+ const height3 = this.bounds.getHeight() < 2 ? 100 : this.bounds.getHeight();
48747
+ this.initTransformation(width2 / 100, height3 / 100);
48748
+ const screen = this.board.add(this.item);
48749
+ screen.emitNesting(screenChildren);
48750
+ this.isDown = false;
48751
+ this.board.selection.removeAll();
48752
+ this.board.selection.add(screen);
48753
+ this.board.tools.select();
48754
+ this.board.tools.publish();
48755
+ return true;
48701
48756
  }
48702
48757
  }
48703
48758
 
@@ -51796,7 +51851,7 @@ function updateFrameChildren({
51796
51851
  }) {
51797
51852
  const groups = board.items.getGroupItemsEnclosedOrCrossed(mbr.left, mbr.top, mbr.right, mbr.bottom);
51798
51853
  board.selection.items.list().forEach((item) => {
51799
- if ("getChildrenIds" in item && item.getChildrenIds()) {
51854
+ if ("index" in item && item.index) {
51800
51855
  const currMbr = item.getMbr();
51801
51856
  const itemsToCheck = board.items.getEnclosedOrCrossed(currMbr.left, currMbr.top, currMbr.right, currMbr.bottom);
51802
51857
  itemsToCheck.forEach((currItem) => {
package/dist/esm/index.js CHANGED
@@ -46367,10 +46367,10 @@ class Select extends Tool {
46367
46367
  return false;
46368
46368
  }
46369
46369
  const draggingMbr = draggingItem.getMbr();
46370
- const frames = this.board.items.getEnclosedOrCrossed(draggingMbr.left, draggingMbr.top, draggingMbr.right, draggingMbr.bottom).filter((item) => item instanceof Frame2);
46371
- frames.forEach((frame) => {
46372
- if (frame.handleNesting(draggingItem)) {
46373
- this.nestingHighlighter.add(frame, draggingItem);
46370
+ const groups = this.board.items.getEnclosedOrCrossed(draggingMbr.left, draggingMbr.top, draggingMbr.right, draggingMbr.bottom).filter((item) => !!(("index" in item) && item.index));
46371
+ groups.forEach((group) => {
46372
+ if (group.handleNesting(draggingItem)) {
46373
+ this.nestingHighlighter.add(group, draggingItem);
46374
46374
  } else {
46375
46375
  this.nestingHighlighter.remove(draggingItem);
46376
46376
  }
@@ -46421,13 +46421,13 @@ class Select extends Tool {
46421
46421
  }
46422
46422
  }
46423
46423
  updateFramesNesting(selectionMbr, selection) {
46424
- const frames = this.board.items.getEnclosedOrCrossed(selectionMbr.left, selectionMbr.top, selectionMbr.right, selectionMbr.bottom).filter((item) => item instanceof Frame2).filter((frame) => !selection.items.list().includes(frame));
46425
- const draggingFramesIds = selection.list().filter((item) => item instanceof Frame2).map((frame) => frame.getId());
46424
+ const groups = this.board.items.getEnclosedOrCrossed(selectionMbr.left, selectionMbr.top, selectionMbr.right, selectionMbr.bottom).filter((item) => !!(("index" in item) && item.index)).filter((group) => !selection.items.list().includes(group));
46425
+ const draggingGroupsIds = selection.list().filter((item) => !!(("index" in item) && item.index)).map((group) => group.getId());
46426
46426
  selection.list().forEach((item) => {
46427
- if (!(item instanceof Frame2) && !draggingFramesIds.includes(item.parent)) {
46428
- frames.forEach((frame) => {
46429
- if (frame.handleNesting(item)) {
46430
- this.nestingHighlighter.add(frame, item);
46427
+ if (!(("index" in item) && item.index) && !draggingGroupsIds.includes(item.parent)) {
46428
+ groups.forEach((group) => {
46429
+ if (group.handleNesting(item)) {
46430
+ this.nestingHighlighter.add(group, item);
46431
46431
  } else {
46432
46432
  this.nestingHighlighter.remove(item);
46433
46433
  }
@@ -47980,6 +47980,8 @@ class Deck extends BaseItem {
47980
47980
  resizeEnabled = false;
47981
47981
  path = null;
47982
47982
  isPerpendicular = undefined;
47983
+ animationFrameId;
47984
+ drawingContext = null;
47983
47985
  constructor(board, id = "") {
47984
47986
  super(board, id, defaultDeckData, true);
47985
47987
  this.index.getUnderPoint = () => [];
@@ -48090,6 +48092,7 @@ class Deck extends BaseItem {
48090
48092
  const j = Math.floor(Math.random() * (i + 1));
48091
48093
  [shuffled[i], shuffled[j]] = [shuffled[j], shuffled[i]];
48092
48094
  }
48095
+ this.emitAnimation();
48093
48096
  this.removeChildItems(this.index.list());
48094
48097
  this.addChildItems(shuffled);
48095
48098
  }
@@ -48106,6 +48109,12 @@ class Deck extends BaseItem {
48106
48109
  apply(op) {
48107
48110
  super.apply(op);
48108
48111
  if (op.class === "Deck") {
48112
+ if (op.method === "startAnimation" && op.newData.timeStamp && Date.now() - op.newData.timeStamp < 4000) {
48113
+ this.startAnimation();
48114
+ setTimeout(() => {
48115
+ this.stopAnimation();
48116
+ }, 2000);
48117
+ }
48109
48118
  this.isCacheDirty = true;
48110
48119
  }
48111
48120
  this.subject.publish(this);
@@ -48130,6 +48139,7 @@ class Deck extends BaseItem {
48130
48139
  return this;
48131
48140
  }
48132
48141
  render(context) {
48142
+ this.drawingContext = context;
48133
48143
  if (this.transformationRenderBlock) {
48134
48144
  return;
48135
48145
  }
@@ -48141,9 +48151,42 @@ class Deck extends BaseItem {
48141
48151
  if (this.cachedCanvas && this.cachedCanvas.width && this.cachedCanvas.height) {
48142
48152
  ctx.save();
48143
48153
  ctx.drawImage(this.cachedCanvas, this.left, this.top);
48154
+ if (this.animationFrameId) {
48155
+ const now = Date.now();
48156
+ const progress = now % 2000 / 2000;
48157
+ const yPos = this.top + this.getHeight() * Math.abs(Math.sin(progress * Math.PI));
48158
+ ctx.fillStyle = conf.SELECTION_COLOR;
48159
+ ctx.fillRect(this.left + 5, yPos - 2, this.getWidth() - 10, 4);
48160
+ }
48144
48161
  ctx.restore();
48145
48162
  }
48146
48163
  }
48164
+ emitAnimation() {
48165
+ this.emit({
48166
+ class: "Deck",
48167
+ method: "startAnimation",
48168
+ item: [this.getId()],
48169
+ newData: { timeStamp: Date.now() }
48170
+ });
48171
+ }
48172
+ startAnimation() {
48173
+ if (!this.animationFrameId) {
48174
+ const animate = () => {
48175
+ if (this.drawingContext) {
48176
+ this.subject.publish(this);
48177
+ this.animationFrameId = requestAnimationFrame(animate);
48178
+ }
48179
+ };
48180
+ this.animationFrameId = requestAnimationFrame(animate);
48181
+ }
48182
+ }
48183
+ stopAnimation() {
48184
+ if (this.animationFrameId) {
48185
+ cancelAnimationFrame(this.animationFrameId);
48186
+ this.animationFrameId = undefined;
48187
+ this.drawingContext = null;
48188
+ }
48189
+ }
48147
48190
  renderHTML(documentFactory) {
48148
48191
  const div = super.renderHTML(documentFactory);
48149
48192
  const cards = this.index?.list();
@@ -48690,7 +48733,19 @@ class AddScreen extends ShapeTool {
48690
48733
  localStorage.setItem("screenOwnerId", screenOwnerId);
48691
48734
  }
48692
48735
  this.item.applyOwnerId(screenOwnerId);
48693
- return super.pointerUp();
48736
+ const currMbr = this.item.getMbr();
48737
+ const screenChildren = this.board.items.getEnclosedOrCrossed(currMbr.left, currMbr.top, currMbr.right, currMbr.bottom).filter((item) => item.parent === "Board").filter((item) => this.item.handleNesting(item));
48738
+ const width2 = this.bounds.getWidth() < 2 ? 100 : this.bounds.getWidth();
48739
+ const height3 = this.bounds.getHeight() < 2 ? 100 : this.bounds.getHeight();
48740
+ this.initTransformation(width2 / 100, height3 / 100);
48741
+ const screen = this.board.add(this.item);
48742
+ screen.emitNesting(screenChildren);
48743
+ this.isDown = false;
48744
+ this.board.selection.removeAll();
48745
+ this.board.selection.add(screen);
48746
+ this.board.tools.select();
48747
+ this.board.tools.publish();
48748
+ return true;
48694
48749
  }
48695
48750
  }
48696
48751
 
@@ -51789,7 +51844,7 @@ function updateFrameChildren({
51789
51844
  }) {
51790
51845
  const groups = board.items.getGroupItemsEnclosedOrCrossed(mbr.left, mbr.top, mbr.right, mbr.bottom);
51791
51846
  board.selection.items.list().forEach((item) => {
51792
- if ("getChildrenIds" in item && item.getChildrenIds()) {
51847
+ if ("index" in item && item.index) {
51793
51848
  const currMbr = item.getMbr();
51794
51849
  const itemsToCheck = board.items.getEnclosedOrCrossed(currMbr.left, currMbr.top, currMbr.right, currMbr.bottom);
51795
51850
  itemsToCheck.forEach((currItem) => {
package/dist/esm/node.js CHANGED
@@ -48835,10 +48835,10 @@ class Select extends Tool {
48835
48835
  return false;
48836
48836
  }
48837
48837
  const draggingMbr = draggingItem.getMbr();
48838
- const frames = this.board.items.getEnclosedOrCrossed(draggingMbr.left, draggingMbr.top, draggingMbr.right, draggingMbr.bottom).filter((item) => item instanceof Frame2);
48839
- frames.forEach((frame) => {
48840
- if (frame.handleNesting(draggingItem)) {
48841
- this.nestingHighlighter.add(frame, draggingItem);
48838
+ const groups = this.board.items.getEnclosedOrCrossed(draggingMbr.left, draggingMbr.top, draggingMbr.right, draggingMbr.bottom).filter((item) => !!(("index" in item) && item.index));
48839
+ groups.forEach((group) => {
48840
+ if (group.handleNesting(draggingItem)) {
48841
+ this.nestingHighlighter.add(group, draggingItem);
48842
48842
  } else {
48843
48843
  this.nestingHighlighter.remove(draggingItem);
48844
48844
  }
@@ -48889,13 +48889,13 @@ class Select extends Tool {
48889
48889
  }
48890
48890
  }
48891
48891
  updateFramesNesting(selectionMbr, selection) {
48892
- const frames = this.board.items.getEnclosedOrCrossed(selectionMbr.left, selectionMbr.top, selectionMbr.right, selectionMbr.bottom).filter((item) => item instanceof Frame2).filter((frame) => !selection.items.list().includes(frame));
48893
- const draggingFramesIds = selection.list().filter((item) => item instanceof Frame2).map((frame) => frame.getId());
48892
+ const groups = this.board.items.getEnclosedOrCrossed(selectionMbr.left, selectionMbr.top, selectionMbr.right, selectionMbr.bottom).filter((item) => !!(("index" in item) && item.index)).filter((group) => !selection.items.list().includes(group));
48893
+ const draggingGroupsIds = selection.list().filter((item) => !!(("index" in item) && item.index)).map((group) => group.getId());
48894
48894
  selection.list().forEach((item) => {
48895
- if (!(item instanceof Frame2) && !draggingFramesIds.includes(item.parent)) {
48896
- frames.forEach((frame) => {
48897
- if (frame.handleNesting(item)) {
48898
- this.nestingHighlighter.add(frame, item);
48895
+ if (!(("index" in item) && item.index) && !draggingGroupsIds.includes(item.parent)) {
48896
+ groups.forEach((group) => {
48897
+ if (group.handleNesting(item)) {
48898
+ this.nestingHighlighter.add(group, item);
48899
48899
  } else {
48900
48900
  this.nestingHighlighter.remove(item);
48901
48901
  }
@@ -50448,6 +50448,8 @@ class Deck extends BaseItem {
50448
50448
  resizeEnabled = false;
50449
50449
  path = null;
50450
50450
  isPerpendicular = undefined;
50451
+ animationFrameId;
50452
+ drawingContext = null;
50451
50453
  constructor(board, id = "") {
50452
50454
  super(board, id, defaultDeckData, true);
50453
50455
  this.index.getUnderPoint = () => [];
@@ -50558,6 +50560,7 @@ class Deck extends BaseItem {
50558
50560
  const j = Math.floor(Math.random() * (i + 1));
50559
50561
  [shuffled[i], shuffled[j]] = [shuffled[j], shuffled[i]];
50560
50562
  }
50563
+ this.emitAnimation();
50561
50564
  this.removeChildItems(this.index.list());
50562
50565
  this.addChildItems(shuffled);
50563
50566
  }
@@ -50574,6 +50577,12 @@ class Deck extends BaseItem {
50574
50577
  apply(op) {
50575
50578
  super.apply(op);
50576
50579
  if (op.class === "Deck") {
50580
+ if (op.method === "startAnimation" && op.newData.timeStamp && Date.now() - op.newData.timeStamp < 4000) {
50581
+ this.startAnimation();
50582
+ setTimeout(() => {
50583
+ this.stopAnimation();
50584
+ }, 2000);
50585
+ }
50577
50586
  this.isCacheDirty = true;
50578
50587
  }
50579
50588
  this.subject.publish(this);
@@ -50598,6 +50607,7 @@ class Deck extends BaseItem {
50598
50607
  return this;
50599
50608
  }
50600
50609
  render(context) {
50610
+ this.drawingContext = context;
50601
50611
  if (this.transformationRenderBlock) {
50602
50612
  return;
50603
50613
  }
@@ -50609,9 +50619,42 @@ class Deck extends BaseItem {
50609
50619
  if (this.cachedCanvas && this.cachedCanvas.width && this.cachedCanvas.height) {
50610
50620
  ctx.save();
50611
50621
  ctx.drawImage(this.cachedCanvas, this.left, this.top);
50622
+ if (this.animationFrameId) {
50623
+ const now = Date.now();
50624
+ const progress = now % 2000 / 2000;
50625
+ const yPos = this.top + this.getHeight() * Math.abs(Math.sin(progress * Math.PI));
50626
+ ctx.fillStyle = conf.SELECTION_COLOR;
50627
+ ctx.fillRect(this.left + 5, yPos - 2, this.getWidth() - 10, 4);
50628
+ }
50612
50629
  ctx.restore();
50613
50630
  }
50614
50631
  }
50632
+ emitAnimation() {
50633
+ this.emit({
50634
+ class: "Deck",
50635
+ method: "startAnimation",
50636
+ item: [this.getId()],
50637
+ newData: { timeStamp: Date.now() }
50638
+ });
50639
+ }
50640
+ startAnimation() {
50641
+ if (!this.animationFrameId) {
50642
+ const animate = () => {
50643
+ if (this.drawingContext) {
50644
+ this.subject.publish(this);
50645
+ this.animationFrameId = requestAnimationFrame(animate);
50646
+ }
50647
+ };
50648
+ this.animationFrameId = requestAnimationFrame(animate);
50649
+ }
50650
+ }
50651
+ stopAnimation() {
50652
+ if (this.animationFrameId) {
50653
+ cancelAnimationFrame(this.animationFrameId);
50654
+ this.animationFrameId = undefined;
50655
+ this.drawingContext = null;
50656
+ }
50657
+ }
50615
50658
  renderHTML(documentFactory) {
50616
50659
  const div = super.renderHTML(documentFactory);
50617
50660
  const cards = this.index?.list();
@@ -51158,7 +51201,19 @@ class AddScreen extends ShapeTool {
51158
51201
  localStorage.setItem("screenOwnerId", screenOwnerId);
51159
51202
  }
51160
51203
  this.item.applyOwnerId(screenOwnerId);
51161
- return super.pointerUp();
51204
+ const currMbr = this.item.getMbr();
51205
+ const screenChildren = this.board.items.getEnclosedOrCrossed(currMbr.left, currMbr.top, currMbr.right, currMbr.bottom).filter((item) => item.parent === "Board").filter((item) => this.item.handleNesting(item));
51206
+ const width2 = this.bounds.getWidth() < 2 ? 100 : this.bounds.getWidth();
51207
+ const height3 = this.bounds.getHeight() < 2 ? 100 : this.bounds.getHeight();
51208
+ this.initTransformation(width2 / 100, height3 / 100);
51209
+ const screen = this.board.add(this.item);
51210
+ screen.emitNesting(screenChildren);
51211
+ this.isDown = false;
51212
+ this.board.selection.removeAll();
51213
+ this.board.selection.add(screen);
51214
+ this.board.tools.select();
51215
+ this.board.tools.publish();
51216
+ return true;
51162
51217
  }
51163
51218
  }
51164
51219
 
@@ -54257,7 +54312,7 @@ function updateFrameChildren({
54257
54312
  }) {
54258
54313
  const groups = board.items.getGroupItemsEnclosedOrCrossed(mbr.left, mbr.top, mbr.right, mbr.bottom);
54259
54314
  board.selection.items.list().forEach((item) => {
54260
- if ("getChildrenIds" in item && item.getChildrenIds()) {
54315
+ if ("index" in item && item.index) {
54261
54316
  const currMbr = item.getMbr();
54262
54317
  const itemsToCheck = board.items.getEnclosedOrCrossed(currMbr.left, currMbr.top, currMbr.right, currMbr.bottom);
54263
54318
  itemsToCheck.forEach((currItem) => {
@@ -15,6 +15,8 @@ export declare class Deck extends BaseItem {
15
15
  resizeEnabled: boolean;
16
16
  path: Path | null;
17
17
  private isPerpendicular;
18
+ private animationFrameId?;
19
+ drawingContext: DrawingContext | null;
18
20
  constructor(board: Board, id?: string);
19
21
  getIsPerpendicular(): boolean | undefined;
20
22
  applyAddChildren(childIds: string[]): void;
@@ -29,6 +31,9 @@ export declare class Deck extends BaseItem {
29
31
  updateMbr(): void;
30
32
  deserialize(data: SerializedItemData): this;
31
33
  render(context: DrawingContext): void;
34
+ emitAnimation(): void;
35
+ startAnimation(): void;
36
+ stopAnimation(): void;
32
37
  renderHTML(documentFactory: DocumentFactory): HTMLElement;
33
38
  private updateCache;
34
39
  getFirstCard(): Card | undefined;
@@ -1,15 +1,8 @@
1
1
  import { BaseOperation } from "../../../../Events/EventsOperations";
2
- export type DeckOperation = AddCards | RemoveCards;
3
- export interface AddCards extends BaseOperation<{
4
- cardIds: string[];
5
- shouldReplaceExistingCards: boolean;
2
+ export type DeckOperation = StartAnimation;
3
+ export interface StartAnimation extends BaseOperation<{
4
+ timeStamp?: number;
6
5
  }> {
7
6
  class: "Deck";
8
- method: "addCards";
9
- }
10
- export interface RemoveCards extends BaseOperation<{
11
- cardIds: string[];
12
- }> {
13
- class: "Deck";
14
- method: "removeCards";
7
+ method: "startAnimation";
15
8
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "microboard-temp",
3
- "version": "0.5.52",
3
+ "version": "0.5.54",
4
4
  "description": "A flexible interactive whiteboard library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",