bloom-player 2.9.10 → 2.10.1

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.
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "A library for displaying Bloom books in iframes or WebViews",
4
4
  "author": "SIL Global",
5
5
  "license": "MIT",
6
- "version": "2.9.10",
6
+ "version": "2.10.1",
7
7
  "private": false,
8
8
  "// sideeffects might need to be ['*.css'] to avoid 'shaking' our CSS, if we ever get tree shaking working": "",
9
9
  "sideEffects": false,
@@ -54,6 +54,7 @@ const restorePositions = () => {
54
54
  positionsToRestore.forEach((p) => {
55
55
  p.elt.style.left = p.x;
56
56
  p.elt.style.top = p.y;
57
+ p.elt.classList.remove("bloom-draggedToTarget");
57
58
  });
58
59
  };
59
60
 
@@ -621,6 +622,7 @@ const startDrag = (e: PointerEvent) => {
621
622
  target.addEventListener("pointermove", elementDrag);
622
623
  playAudioOf(target);
623
624
  target.classList.add("bloom-ui-dragging");
625
+ dragTarget.classList.remove("bloom-draggedToTarget");
624
626
  };
625
627
 
626
628
  const elementDrag = (e: PointerEvent) => {
@@ -662,6 +664,9 @@ const stopDrag = (e: PointerEvent) => {
662
664
  const oldPosition = originalPositions.get(dragTarget);
663
665
  dragTarget.style.top = oldPosition?.y + "px";
664
666
  dragTarget.style.left = oldPosition?.x + "px";
667
+ dragTarget.classList.remove("bloom-draggedToTarget");
668
+ } else {
669
+ dragTarget.classList.add("bloom-draggedToTarget");
665
670
  }
666
671
  dragTarget.classList.remove("bloom-ui-dragging");
667
672
  dragTarget.removeEventListener("pointerup", stopDrag);
@@ -681,6 +686,7 @@ const stopDrag = (e: PointerEvent) => {
681
686
  if (originalPosition) {
682
687
  elt.style.left = originalPosition.x + "px";
683
688
  elt.style.top = originalPosition.y + "px";
689
+ elt.classList.remove("bloom-draggedToTarget");
684
690
  }
685
691
  }
686
692
  });