bloom-player 2.9.9 → 2.10.0
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/README.md +12 -0
- package/dist/{bloomPlayer.B0wz4fEL.js → bloomPlayer.COkOWv26.js} +13 -13
- package/dist/bloomplayer.htm +1 -1
- package/lib/dragActivityRuntime.d.ts +17 -0
- package/lib/event.d.ts +11 -0
- package/lib/index.d.ts +4 -0
- package/lib/narration.d.ts +50 -0
- package/lib/scrolling.d.ts +5 -0
- package/lib/shared.es.js +6489 -0
- package/lib/shared.es.js.map +1 -0
- package/package.json +13 -1
- package/src/shared/dragActivityRuntime.ts +6 -0
- package/src/shared/index.ts +14 -0
package/dist/bloomplayer.htm
CHANGED
|
@@ -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.
|
|
21
|
+
<script src="bloomPlayer.COkOWv26.js"></script>
|
|
22
22
|
</body>
|
|
23
23
|
|
|
24
24
|
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const kLegacyCanvasElementSelector = ".bloom-textOverPicture, .bloom-canvas-element";
|
|
2
|
+
export declare function adjustDraggablesForLanguage(page: HTMLElement): void;
|
|
3
|
+
export declare function IsRunningOnBloomDesktop(bloomPage?: Element): boolean;
|
|
4
|
+
export declare function prepareActivity(page: HTMLElement, changePageAction: (next: boolean) => void): void;
|
|
5
|
+
export declare function undoPrepareActivity(page: HTMLElement): void;
|
|
6
|
+
export declare const playSoundOf: (e: MouseEvent) => void;
|
|
7
|
+
export declare function playInitialElements(page: HTMLElement, playVideos: boolean): void;
|
|
8
|
+
export declare function shuffle<T>(array: T[], areItemsTheSame?: (a: T, b: T) => boolean): T[];
|
|
9
|
+
export declare function isTheTextInDraggablesTheSame(a: HTMLElement, b: HTMLElement): boolean;
|
|
10
|
+
export declare const performCheck: (e: MouseEvent) => boolean;
|
|
11
|
+
export declare const performTryAgain: (e: MouseEvent) => void;
|
|
12
|
+
export declare const classSetter: (page: HTMLElement, className: string, wanted: boolean) => void;
|
|
13
|
+
export declare const doShowAnswersInTargets: (showNow: boolean, page: HTMLElement) => void;
|
|
14
|
+
export declare function copyContentToTarget(draggable: HTMLElement): void;
|
|
15
|
+
export declare const getTarget: (draggable: HTMLElement) => HTMLElement | undefined;
|
|
16
|
+
export declare let draggingSlider: boolean;
|
|
17
|
+
export declare function setupWordChooserSlider(page: HTMLElement): void;
|
package/lib/event.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
interface ILiteEvent<T> {
|
|
2
|
+
subscribe(handler: (data?: T) => void): void;
|
|
3
|
+
unsubscribe(handler: (data?: T) => void): void;
|
|
4
|
+
}
|
|
5
|
+
export default class LiteEvent<T> implements ILiteEvent<T> {
|
|
6
|
+
private handlers;
|
|
7
|
+
subscribe(handler: (data?: T) => void): void;
|
|
8
|
+
unsubscribe(handler: (data?: T) => void): void;
|
|
9
|
+
raise(data?: T): void;
|
|
10
|
+
}
|
|
11
|
+
export {};
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { default as LiteEvent } from './event';
|
|
2
|
+
export interface ISetHighlightParams {
|
|
3
|
+
newElement: Element;
|
|
4
|
+
shouldScrollToElement: boolean;
|
|
5
|
+
disableHighlightIfNoAudio?: boolean;
|
|
6
|
+
oldElement?: Element | null | undefined;
|
|
7
|
+
}
|
|
8
|
+
export declare enum PlaybackMode {
|
|
9
|
+
NewPage = 0,
|
|
10
|
+
NewPageMediaPaused = 1,
|
|
11
|
+
VideoPlaying = 2,
|
|
12
|
+
VideoPaused = 3,
|
|
13
|
+
AudioPlaying = 4,
|
|
14
|
+
AudioPaused = 5,
|
|
15
|
+
MediaFinished = 6
|
|
16
|
+
}
|
|
17
|
+
export declare let currentPlaybackMode: PlaybackMode;
|
|
18
|
+
export declare function setCurrentPlaybackMode(mode: PlaybackMode): void;
|
|
19
|
+
export declare let durationReporter: (duration: number) => void;
|
|
20
|
+
export declare function listenForPlayDuration(reporter: (duration: number) => void): void;
|
|
21
|
+
export declare let isSwipeInProgress: () => boolean;
|
|
22
|
+
export declare function setTestIsSwipeInProgress(tester: () => boolean): void;
|
|
23
|
+
export declare let logNarration: (src: string) => void;
|
|
24
|
+
export declare function setLogNarration(logger: (src: string) => void): void;
|
|
25
|
+
export declare function setPlayerUrlPrefix(prefix: string): void;
|
|
26
|
+
export declare function setPlayerUrlPrefixFromWindowLocationHref(bookSrc: string): void;
|
|
27
|
+
export declare function getUrlPrefixFromWindowHref(bookSrc: string): string;
|
|
28
|
+
export declare function urlPrefix(): string;
|
|
29
|
+
export declare function sortAudioElements(input: HTMLElement[]): HTMLElement[];
|
|
30
|
+
export declare const kHighlightSegmentClass = "bloom-highlightSegment";
|
|
31
|
+
export declare function setDurationOfPagesWithoutNarration(d: number): void;
|
|
32
|
+
export declare const kAudioSentence = "audio-sentence";
|
|
33
|
+
export declare function setCurrentPage(page: HTMLElement): void;
|
|
34
|
+
export declare function getCurrentNarrationPage(): HTMLElement;
|
|
35
|
+
export declare const PageNarrationComplete: LiteEvent<HTMLElement>;
|
|
36
|
+
export declare const PlayCompleted: LiteEvent<HTMLElement>;
|
|
37
|
+
export declare const PlayFailed: LiteEvent<HTMLElement>;
|
|
38
|
+
export declare const ToggleImageDescription: LiteEvent<boolean>;
|
|
39
|
+
export declare function setIncludeImageDescriptions(b: boolean): void;
|
|
40
|
+
export declare function playAllSentences(page: HTMLElement | null): void;
|
|
41
|
+
export declare function playAllAudio(elements: HTMLElement[], page: HTMLElement): void;
|
|
42
|
+
export declare function abortNarrationPlayback(): void;
|
|
43
|
+
export declare function pageHasAudio(page: HTMLElement): boolean;
|
|
44
|
+
export declare function playNarration(): void;
|
|
45
|
+
export declare function pauseNarration(): void;
|
|
46
|
+
export declare function computeDuration(page: HTMLElement): number;
|
|
47
|
+
export declare function hidingPage(): void;
|
|
48
|
+
export declare function playAllVideo(elements: HTMLVideoElement[], then: () => void): void;
|
|
49
|
+
export declare function showVideoError(video: HTMLVideoElement): void;
|
|
50
|
+
export declare function hideVideoError(video: HTMLVideoElement): void;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const kSelectorForPotentialNiceScrollElements: string;
|
|
2
|
+
export declare function addScrollbarsToPage(bloomPage: Element, pointerEventHandler?: (e: PointerEvent) => void): void;
|
|
3
|
+
export declare function setupSpecialMouseTrackingForNiceScroll(bloomPage: Element, pointerEventHandler?: (e: PointerEvent) => void): void;
|
|
4
|
+
export declare function fixNiceScrollOffsets(page: HTMLElement, scale: number): void;
|
|
5
|
+
export declare function cleanupNiceScroll(): void;
|