bloom-player 2.10.3 → 2.11.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.10.3",
6
+ "version": "2.11.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,
@@ -362,11 +362,17 @@ const playAudioOfTarget = (e: PointerEvent) => {
362
362
  };
363
363
 
364
364
  const playAudioOf = (element: HTMLElement) => {
365
- const possibleElements = getVisibleEditables(element);
366
- const playables = getAudioSentences(possibleElements);
365
+ const playables = getAudioSentencesOfVisibleEditables(element);
367
366
  playAllAudio(playables, element.closest(".bloom-page") as HTMLElement);
368
367
  };
369
368
 
369
+ export function getAudioSentencesOfVisibleEditables(
370
+ element: HTMLElement,
371
+ ): HTMLElement[] {
372
+ const possibleElements = getVisibleEditables(element);
373
+ return getAudioSentences(possibleElements);
374
+ }
375
+
370
376
  function makeWordItems(
371
377
  page: HTMLElement,
372
378
  words: string[],
@@ -1160,6 +1166,12 @@ export function copyContentToTarget(draggable: HTMLElement) {
1160
1166
  Array.from(throwAway.querySelectorAll("[contenteditable]")).forEach((e) => {
1161
1167
  e.removeAttribute("contenteditable");
1162
1168
  });
1169
+ // Content is not recordable inside the target.
1170
+ Array.from(throwAway.getElementsByClassName("ui-audioCurrent")).forEach(
1171
+ (e) => {
1172
+ e.classList.remove("ui-audioCurrent");
1173
+ },
1174
+ );
1163
1175
  // Nor should we able to tab to it, or focus it.
1164
1176
  Array.from(throwAway.querySelectorAll("[tabindex]")).forEach((e) => {
1165
1177
  e.removeAttribute("tabindex");