From 3df06c8fd24f3f614b2a24d57c28340dbd0ddfd8 Mon Sep 17 00:00:00 2001 From: Hatton Date: Tue, 10 Dec 2024 11:14:01 -0700 Subject: [PATCH] chore: final review session with JohnT --- public/testBooks/multibook-index/history.db | Bin 24576 -> 0 bytes .../multibook-index/publish-settings.json | 1 - src/bloom-player-controls.tsx | 4 +- src/bloom-player-core.tsx | 290 +----------------- src/externalContext.ts | 2 +- src/navigation.test.ts | 17 +- src/navigation.ts | 22 +- src/stories/BloomPlayerTester.ts | 8 +- 8 files changed, 36 insertions(+), 308 deletions(-) delete mode 100644 public/testBooks/multibook-index/history.db delete mode 100644 public/testBooks/multibook-index/publish-settings.json diff --git a/public/testBooks/multibook-index/history.db b/public/testBooks/multibook-index/history.db deleted file mode 100644 index ce655a89498d4045f1b798347b57ea02d7541dfa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 24576 zcmeI)%Wu;#90zcFeQd3?1rAeGaj|k?)z)fjyGF2oMbR= z6@L(a1}8Xk;m?@F5hra?TLhZ41Do`X>eR7p_xJnMmps~+&-X>l*-@whJ7!ICi%?3o z7$bxfbSdgG+H$&*A06m-I#&N%wLt10Pv?!Fq%i-P7!QrF3$GT^DmDl}00Izz00bZa z0SG_<0ucDOz(JvCRx30S(&Hca8JBU?al-JpBfP;;arZ@g`=HJCo<3;5X4YgEi-mI3 zW-VF6fmZcdzGyBl(>Jm0_&hrG^%-F&;-?9h?(|_{IRC-+&VHLs^<9#7z*qFhYTwVz znw1Lu)Xe4_gfZCXCuSH%XtAZTwdYw($e4GzVkb%jwmN6W{G8cI917_w9_W0T40TC- zpRJUwB;rcwQD?Std$t-irD04o#^)!xVKnz}U?<>FWOpZfdUmWE9MRRC)9KE*ibNlP08g)$Y@I}%wJe78Tz)QHYV*2K;|tL*Y!H9|1Rwwb2tWV=5P$## zAOHafTyKF*nm=474c@xf;LcjjaozP=%V{_@XLEg{w&8kqv&q*u=dB>|W0771sAX3P z$~rG^1(>MeGp!a(Isvd{nj0=l>`P5=M^ diff --git a/public/testBooks/multibook-index/publish-settings.json b/public/testBooks/multibook-index/publish-settings.json deleted file mode 100644 index 261f25e..0000000 --- a/public/testBooks/multibook-index/publish-settings.json +++ /dev/null @@ -1 +0,0 @@ -{"audioVideo":{"pageTurnDelay":3000,"format":"facebook","motion":false,"playerSettings":"","pageRange":[]},"epub":{"howToPublishImageDescriptions":0,"removeFontSizes":false,"mode":"fixed"},"bloomPUB":{"motion":true,"textLangs":{},"audioLangs":{},"signLangs":{},"imageSettings":{"maxWidth":1280,"maxHeight":720}},"bloomLibrary":{"textLangs":{},"audioLangs":{},"signLangs":{},"comic":true}} \ No newline at end of file diff --git a/src/bloom-player-controls.tsx b/src/bloom-player-controls.tsx index 2101755..7e07a6d 100644 --- a/src/bloom-player-controls.tsx +++ b/src/bloom-player-controls.tsx @@ -5,7 +5,7 @@ book inside of the Bloom:Publish:Android screen. import { BloomPlayerCore } from "./bloom-player-core"; import * as ReactDOM from "react-dom"; import { - sendBackToHost, + informHostOfBackAction, showNavBar, hideNavBar, reportBookProperties, @@ -933,7 +933,7 @@ export const BloomPlayerControls: React.FunctionComponent = ( if ( !coreRef.current?.HandleBackButtonClickedIfHavePlayerHistory() ) { - sendBackToHost(); + informHostOfBackAction(); } }} showPlayPause={hasAudio || hasMusic || hasVideo} diff --git a/src/bloom-player-core.tsx b/src/bloom-player-core.tsx index 1e1c122..7907238 100644 --- a/src/bloom-player-core.tsx +++ b/src/bloom-player-core.tsx @@ -3,8 +3,7 @@ bloom-player-core is responsible for all the behavior of working through a book, (other than page turning). */ import * as React from "react"; -import * as ReactDOM from "react-dom"; -import axios, { AxiosPromise } from "axios"; +import axios from "axios"; import Swiper, { SwiperInstance } from "react-id-swiper"; // This loads some JS right here that is a polyfill for the (otherwise discontinued) scoped-styles html feature import "style-scoped/scoped.min.js"; @@ -20,7 +19,6 @@ import { LocalizationManager } from "./l10n/localizationManager"; import { reportAnalytics, reportPlaybackComplete, - sendMessageToHost, setAmbientAnalyticsProperties, updateBookProgressReport, } from "./externalContext"; @@ -30,7 +28,6 @@ import { sendStringToBloomApi, } from "./videoRecordingSupport"; import LangData from "./langData"; -import Replay from "@material-ui/icons/Replay"; // See related comments in controlBar.tsx import IconButton from "@material-ui/core/IconButton"; @@ -83,7 +80,7 @@ import { assembleStyleSheets } from "./stylesheets"; import { canGoBack, checkClickForBookOrPageJump, - goBackInHistoryIfPossible, + tryPopPlayerHistory, } from "./navigation"; // BloomPlayer takes a URL param that directs it to Bloom book. @@ -428,9 +425,7 @@ export class BloomPlayerCore extends React.Component { } // called by bloom-player-controls public HandleBackButtonClickedIfHavePlayerHistory(): boolean { - const backLocation = goBackInHistoryIfPossible( - this.bookInfo.bookInstanceId, - ); + const backLocation = tryPopPlayerHistory(this.bookInfo.bookInstanceId); if (backLocation) { this.navigate(backLocation.bookUrl, backLocation.pageId); return true; @@ -1667,285 +1662,6 @@ export class BloomPlayerCore extends React.Component { } } - // Make a