@d-i-t-a/reader 3.0.0-alpha.19 → 3.0.0-alpha.20

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.
@@ -180,6 +180,18 @@ export interface IFrameAttributes {
180
180
  top?: () => Element | null;
181
181
  bottom?: () => Element | null;
182
182
  };
183
+ /**
184
+ * Scroll-mode viewport model. Opt-in.
185
+ *
186
+ * - `"host"` (default): iframe grows to its content height and
187
+ * `#iframe-wrapper` provides the scrollbar. Existing behaviour.
188
+ * - `"iframe"`: iframe stays at viewport height and scrolls internally.
189
+ * Prevents the feedback loop when injected styles create a 100%
190
+ * height chain (e.g. `body { height: 100% }` on cover pages).
191
+ *
192
+ * Only affects scroll mode. Paginated and fixed-layout are unchanged.
193
+ */
194
+ scrollContainer?: "host" | "iframe";
183
195
  /** Margin (in px) around fixed-layout content. Defaults to 100. */
184
196
  fixedLayoutMargin?: number;
185
197
  /** Whether to show a drop shadow on fixed-layout spreads. Defaults to true. */
@@ -34,6 +34,23 @@ export default class ReflowableBookView implements BookView {
34
34
  isScrollMode(): boolean;
35
35
  getProperty(name: string): Promise<UserProperty | null>;
36
36
  getScreenHeight(): number;
37
+ /**
38
+ * Which element provides the scrollbar in scroll mode.
39
+ *
40
+ * - `"host"` (default): `#iframe-wrapper` scrolls; iframe grows to content.
41
+ * - `"iframe"`: iframe's own document scrolls; iframe stays at viewport.
42
+ */
43
+ private get scrollContainerMode();
44
+ /** Current scroll offset (px from top) of the active scroll container. */
45
+ private getScrollOffset;
46
+ /** Set scroll offset on the active scroll container. */
47
+ private setScrollOffset;
48
+ /**
49
+ * Total scrollable height. Same value in both modes — iframe's internal
50
+ * document `scrollHeight`, because the iframe's document is always the
51
+ * source of truth for "how much content is there."
52
+ */
53
+ private getScrollExtent;
37
54
  setIframeHeight(iframe: any): void;
38
55
  protected hasFixedScrollWidth: boolean;
39
56
  protected checkForFixedScrollWidth(): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@d-i-t-a/reader",
3
- "version": "3.0.0-alpha.19",
3
+ "version": "3.0.0-alpha.20",
4
4
  "description": "A viewer application for EPUB files.",
5
5
  "repository": "https://github.com/d-i-t-a/R2D2BC",
6
6
  "license": "Apache-2.0",