bloom-player 2.20.1-alpha.2 → 2.20.1-alpha.4

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.
@@ -18,7 +18,7 @@
18
18
 
19
19
  <!-- At build time, we replace the target of this script tag to point at the
20
20
  the bloom player bundle with the cache-busting hash in its name. -->
21
- <script src="bloomPlayer.sNoPvBYs.js"></script>
21
+ <script src="bloomPlayer.BoTFQBcM.js"></script>
22
22
  </body>
23
23
 
24
24
 
package/lib/shared.es.js CHANGED
@@ -681,7 +681,9 @@ const zs = (s) => {
681
681
  function Is(s) {
682
682
  if (s.getAttribute("data-activity") !== "drag-letter-to-target")
683
683
  return;
684
- const c = Array.from(s.querySelectorAll("[data-draggable-id]"));
684
+ const c = Array.from(
685
+ s.querySelectorAll("[data-draggable-id]")
686
+ );
685
687
  c.shift(), c.forEach((d) => {
686
688
  const h = !!d.getElementsByClassName(
687
689
  "bloom-visibility-code-on"
@@ -699,7 +701,9 @@ function pa(s, c) {
699
701
  s.getAttribute("data-show-answers-in-targets") === "true" || s.getAttribute("data-show-target-as-shadow") === "true",
700
702
  s
701
703
  ), zs(s), Array.from(
702
- s.getElementsByClassName("bloom-change-page-button")
704
+ s.getElementsByClassName(
705
+ "bloom-change-page-button"
706
+ )
703
707
  ).forEach(
704
708
  (Q) => Q.addEventListener("click", eo)
705
709
  ), Array.from(document.getElementsByClassName("bloom-canvas")).forEach(
@@ -713,7 +717,9 @@ function pa(s, c) {
713
717
  ), Array.from(s.getElementsByTagName("img")).forEach((Q) => {
714
718
  Q.setAttribute("draggable", "false");
715
719
  }), Cr = [], ji = /* @__PURE__ */ new Map();
716
- const h = Array.from(s.querySelectorAll("[data-draggable-id]")), T = [];
720
+ const h = Array.from(
721
+ s.querySelectorAll("[data-draggable-id]")
722
+ ), T = [];
717
723
  h.forEach((Q) => {
718
724
  const _e = Q.getAttribute("data-draggable-id"), V = s.querySelector(
719
725
  `[data-target-of="${_e}"]`
@@ -733,7 +739,9 @@ function pa(s, c) {
733
739
  });
734
740
  const z = h.concat(T);
735
741
  Array.from(
736
- s.getElementsByClassName("bloom-visibility-code-on")
742
+ s.getElementsByClassName(
743
+ "bloom-visibility-code-on"
744
+ )
737
745
  ).filter((Q) => {
738
746
  var _e = Q.closest(Ri);
739
747
  return _e ? z.indexOf(_e) < 0 : !0;
@@ -741,11 +749,17 @@ function pa(s, c) {
741
749
  Q.addEventListener("pointerdown", Kn);
742
750
  });
743
751
  const L = Array.from(
744
- s.getElementsByClassName("check-button")
752
+ s.getElementsByClassName(
753
+ "check-button"
754
+ )
745
755
  ), q = Array.from(
746
- s.getElementsByClassName("try-again-button")
756
+ s.getElementsByClassName(
757
+ "try-again-button"
758
+ )
747
759
  ), _ = Array.from(
748
- s.getElementsByClassName("show-correct-button")
760
+ s.getElementsByClassName(
761
+ "show-correct-button"
762
+ )
749
763
  );
750
764
  L.forEach((Q) => {
751
765
  Q.addEventListener("click", so);
@@ -753,12 +767,18 @@ function pa(s, c) {
753
767
  Q.addEventListener("click", ao);
754
768
  }), _.forEach((Q) => {
755
769
  Q.addEventListener("click", io);
756
- }), Array.from(s.querySelectorAll("[data-sound]")).forEach((Q) => {
770
+ }), Array.from(
771
+ s.querySelectorAll("[data-sound]")
772
+ ).forEach((Q) => {
757
773
  Q.addEventListener("click", Zn);
758
774
  }), Hs(s), Rs(s);
759
775
  }
760
776
  const Hs = (s) => {
761
- Array.from(s.getElementsByClassName("drag-item-order-sentence")).forEach(
777
+ Array.from(
778
+ s.getElementsByClassName(
779
+ "drag-item-order-sentence"
780
+ )
781
+ ).forEach(
762
782
  (c) => {
763
783
  const d = c.getElementsByClassName(
764
784
  "bloom-content1 bloom-visibility-code-on"
@@ -773,14 +793,18 @@ const Hs = (s) => {
773
793
  };
774
794
  function ga(s) {
775
795
  Br(), Rr(), Wi = [], Array.from(
776
- s.getElementsByClassName("bloom-change-page-button")
796
+ s.getElementsByClassName(
797
+ "bloom-change-page-button"
798
+ )
777
799
  ).forEach(
778
800
  (L) => L.removeEventListener("click", eo)
779
- ), Array.from(s.getElementsByClassName("bloom-visibility-code-on")).forEach(
780
- (L) => {
781
- L.removeEventListener("pointerdown", Kn);
782
- }
783
- ), s.querySelectorAll("[data-draggable-id]").forEach((L) => {
801
+ ), Array.from(
802
+ s.getElementsByClassName(
803
+ "bloom-visibility-code-on"
804
+ )
805
+ ).forEach((L) => {
806
+ L.removeEventListener("pointerdown", Kn);
807
+ }), s.querySelectorAll("[data-draggable-id]").forEach((L) => {
784
808
  L.removeEventListener("pointerdown", ro, { capture: !0 });
785
809
  }), Array.from(s.getElementsByTagName("img")).forEach((L) => {
786
810
  L.removeAttribute("draggable");
@@ -788,11 +812,17 @@ function ga(s) {
788
812
  L.removeEventListener("pointerdown", Gn), L.classList.remove("bloom-ui-no-controls");
789
813
  });
790
814
  const h = Array.from(
791
- s.getElementsByClassName("check-button")
815
+ s.getElementsByClassName(
816
+ "check-button"
817
+ )
792
818
  ), T = Array.from(
793
- s.getElementsByClassName("try-again-button")
819
+ s.getElementsByClassName(
820
+ "try-again-button"
821
+ )
794
822
  ), A = Array.from(
795
- s.getElementsByClassName("show-correct-button")
823
+ s.getElementsByClassName(
824
+ "show-correct-button"
825
+ )
796
826
  );
797
827
  h.forEach((L) => {
798
828
  L.removeEventListener("click", so);
@@ -800,10 +830,14 @@ function ga(s) {
800
830
  L.removeEventListener("click", io);
801
831
  }), T.forEach((L) => {
802
832
  L.removeEventListener("click", ao);
803
- }), Array.from(s.querySelectorAll("[data-sound]")).forEach((L) => {
833
+ }), Array.from(
834
+ s.querySelectorAll("[data-sound]")
835
+ ).forEach((L) => {
804
836
  L.removeEventListener("click", Zn);
805
837
  }), Array.from(
806
- s.getElementsByClassName("drag-item-random-sentence")
838
+ s.getElementsByClassName(
839
+ "drag-item-random-sentence"
840
+ )
807
841
  ).forEach((L) => {
808
842
  L.parentElement?.removeChild(L);
809
843
  }), qs(s);
@@ -925,7 +959,9 @@ const io = (s) => {
925
959
  const D = T.offsetLeft + (T.offsetWidth - A) / 2, L = T.offsetTop + (T.offsetHeight - z) / 2;
926
960
  d.style.left = D + "px", d.style.top = L + "px";
927
961
  }), Array.from(
928
- pt.getElementsByClassName("drag-item-random-sentence")
962
+ pt.getElementsByClassName(
963
+ "drag-item-random-sentence"
964
+ )
929
965
  ).forEach((d) => {
930
966
  const h = d.getAttribute("data-answer")?.split(" ") ?? [], T = d.children[0];
931
967
  d.innerHTML = "", Qn(
@@ -975,7 +1011,9 @@ const Xi = (s) => s.getBoundingClientRect().width / s.offsetWidth, ro = (s) => {
975
1011
  }
976
1012
  Me.classList.remove("bloom-ui-dragging"), Me.removeEventListener("pointerup", oo), Me.removeEventListener("pointermove", no);
977
1013
  const c = Me.closest(".bloom-page");
978
- Array.from(c.querySelectorAll("[data-draggable-id]")).forEach((h) => {
1014
+ Array.from(
1015
+ c.querySelectorAll("[data-draggable-id]")
1016
+ ).forEach((h) => {
979
1017
  if (h !== Me && kr(h, Me)) {
980
1018
  const T = ji.get(h);
981
1019
  T && (h.style.left = T.x + "px", h.style.top = T.y + "px", h.classList.remove("bloom-draggedToTarget"));
@@ -1083,7 +1121,9 @@ function lo(s, c, d = !0, h) {
1083
1121
  }
1084
1122
  function Fs(s) {
1085
1123
  let c = !0;
1086
- const d = Array.from(s.querySelectorAll("[data-draggable-id]"));
1124
+ const d = Array.from(
1125
+ s.querySelectorAll("[data-draggable-id]")
1126
+ );
1087
1127
  return d.forEach((h) => {
1088
1128
  const T = h.getAttribute("data-draggable-id"), A = s.querySelector(
1089
1129
  `[data-target-of="${T}"]`
@@ -6509,7 +6549,13 @@ function vo(s, c) {
6509
6549
  return { topAdjust: d, leftAdjust: h, thumbWidth: T };
6510
6550
  }
6511
6551
  function Js(s, c) {
6512
- if (s.removeEventListener("pointerdown", An), s.addEventListener("pointerdown", An), !!c)
6552
+ if (s.removeEventListener(
6553
+ "pointerdown",
6554
+ An
6555
+ ), s.addEventListener(
6556
+ "pointerdown",
6557
+ An
6558
+ ), !!c)
6513
6559
  for (const d of ["pointermove", "pointerup"])
6514
6560
  s.ownerDocument.body.addEventListener(
6515
6561
  d,