@embedpdf/plugin-stage 3.0.0-next.15 → 3.0.0-next.16
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/dist/contract/host.d.cts +2 -2
- package/dist/contract/host.d.ts +2 -2
- package/dist/{contract-DZR_jRer.d.cts → contract-B3QLVDlb.d.cts} +8 -1
- package/dist/{contract-CjHtrfJj.d.ts → contract-CqrsZNsY.d.ts} +8 -1
- package/dist/contract.d.cts +1 -1
- package/dist/contract.d.ts +1 -1
- package/dist/{host-contract-Du5tEZ4h.d.ts → host-contract-C7ofnyzA.d.ts} +2 -2
- package/dist/{host-contract-CPtbnJ4j.d.cts → host-contract-Dm5_acFs.d.cts} +2 -2
- package/dist/index.cjs +26 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +26 -1
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
package/dist/contract/host.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { A as StageCapability, B as StageViewportChangedEvent, C as ScrollBehaviorKind, D as SpreadMode, E as SizingMode, F as StageScrollToOptions, G as VisiblePage, H as Viewpoint, I as StageSettings, J as ZoomSpec, K as ZoomMode, L as StageSettingsChangedEvent, M as StageMotionEndedEvent, N as StagePageChangedEvent, O as StageBox, P as StagePluginOptions, R as StageSettingsPatch, S as RevealZoom, U as ViewportPoint, V as StageZoomChangedEvent, W as ViewportRect, Y as ZoomToOptions, a as ArrivalAlignValue, b as RevealAnchorValue, d as Gap, f as GoToDestinationOptions, g as PageFrame, h as LayoutKind, i as AlignmentValue, j as StageConfig, k as StageCameraChangedEvent, l as Direction, m as GridColumns, n as AlignValue, o as ArrivalAlignment, p as GoToOptions, q as ZoomModeValue, r as Alignment, s as BoxQuery, t as Align, u as FlowMode, v as ResponsiveRule, x as RevealOptions, y as RevealAnchor, z as StageViewState } from "../contract-
|
|
2
|
-
import { a as Size, c as StageState, i as ScrollMetrics, n as Point, o as StageHostCapability, r as Rect, s as StageToken, t as Camera } from "../host-contract-
|
|
1
|
+
import { A as StageCapability, B as StageViewportChangedEvent, C as ScrollBehaviorKind, D as SpreadMode, E as SizingMode, F as StageScrollToOptions, G as VisiblePage, H as Viewpoint, I as StageSettings, J as ZoomSpec, K as ZoomMode, L as StageSettingsChangedEvent, M as StageMotionEndedEvent, N as StagePageChangedEvent, O as StageBox, P as StagePluginOptions, R as StageSettingsPatch, S as RevealZoom, U as ViewportPoint, V as StageZoomChangedEvent, W as ViewportRect, Y as ZoomToOptions, a as ArrivalAlignValue, b as RevealAnchorValue, d as Gap, f as GoToDestinationOptions, g as PageFrame, h as LayoutKind, i as AlignmentValue, j as StageConfig, k as StageCameraChangedEvent, l as Direction, m as GridColumns, n as AlignValue, o as ArrivalAlignment, p as GoToOptions, q as ZoomModeValue, r as Alignment, s as BoxQuery, t as Align, u as FlowMode, v as ResponsiveRule, x as RevealOptions, y as RevealAnchor, z as StageViewState } from "../contract-B3QLVDlb.cjs";
|
|
2
|
+
import { a as Size, c as StageState, i as ScrollMetrics, n as Point, o as StageHostCapability, r as Rect, s as StageToken, t as Camera } from "../host-contract-Dm5_acFs.cjs";
|
|
3
3
|
export { type Align, type AlignValue, type Alignment, type AlignmentValue, ArrivalAlignValue, ArrivalAlignment, BoxQuery, type Camera, type Direction, FlowMode, Gap, GoToDestinationOptions, GoToOptions, GridColumns, LayoutKind, type PageFrame, type Point, type Rect, ResponsiveRule, RevealAnchor, RevealAnchorValue, RevealOptions, RevealZoom, ScrollBehaviorKind, type ScrollMetrics, type Size, type SizingMode, type SpreadMode, StageBox, StageCameraChangedEvent, StageCapability, StageConfig, StageHostCapability, StageMotionEndedEvent, StagePageChangedEvent, StagePluginOptions, StageScrollToOptions, StageSettings, StageSettingsChangedEvent, StageSettingsPatch, type StageState, StageToken, StageViewState, StageViewportChangedEvent, StageZoomChangedEvent, Viewpoint, ViewportPoint, ViewportRect, VisiblePage, ZoomMode, type ZoomModeValue, type ZoomSpec, ZoomToOptions };
|
package/dist/contract/host.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { A as StageCapability, B as StageViewportChangedEvent, C as ScrollBehaviorKind, D as SpreadMode, E as SizingMode, F as StageScrollToOptions, G as VisiblePage, H as Viewpoint, I as StageSettings, J as ZoomSpec, K as ZoomMode, L as StageSettingsChangedEvent, M as StageMotionEndedEvent, N as StagePageChangedEvent, O as StageBox, P as StagePluginOptions, R as StageSettingsPatch, S as RevealZoom, U as ViewportPoint, V as StageZoomChangedEvent, W as ViewportRect, Y as ZoomToOptions, a as ArrivalAlignValue, b as RevealAnchorValue, d as Gap, f as GoToDestinationOptions, g as PageFrame, h as LayoutKind, i as AlignmentValue, j as StageConfig, k as StageCameraChangedEvent, l as Direction, m as GridColumns, n as AlignValue, o as ArrivalAlignment, p as GoToOptions, q as ZoomModeValue, r as Alignment, s as BoxQuery, t as Align, u as FlowMode, v as ResponsiveRule, x as RevealOptions, y as RevealAnchor, z as StageViewState } from "../contract-
|
|
2
|
-
import { a as Size, c as StageState, i as ScrollMetrics, n as Point, o as StageHostCapability, r as Rect, s as StageToken, t as Camera } from "../host-contract-
|
|
1
|
+
import { A as StageCapability, B as StageViewportChangedEvent, C as ScrollBehaviorKind, D as SpreadMode, E as SizingMode, F as StageScrollToOptions, G as VisiblePage, H as Viewpoint, I as StageSettings, J as ZoomSpec, K as ZoomMode, L as StageSettingsChangedEvent, M as StageMotionEndedEvent, N as StagePageChangedEvent, O as StageBox, P as StagePluginOptions, R as StageSettingsPatch, S as RevealZoom, U as ViewportPoint, V as StageZoomChangedEvent, W as ViewportRect, Y as ZoomToOptions, a as ArrivalAlignValue, b as RevealAnchorValue, d as Gap, f as GoToDestinationOptions, g as PageFrame, h as LayoutKind, i as AlignmentValue, j as StageConfig, k as StageCameraChangedEvent, l as Direction, m as GridColumns, n as AlignValue, o as ArrivalAlignment, p as GoToOptions, q as ZoomModeValue, r as Alignment, s as BoxQuery, t as Align, u as FlowMode, v as ResponsiveRule, x as RevealOptions, y as RevealAnchor, z as StageViewState } from "../contract-CqrsZNsY.js";
|
|
2
|
+
import { a as Size, c as StageState, i as ScrollMetrics, n as Point, o as StageHostCapability, r as Rect, s as StageToken, t as Camera } from "../host-contract-C7ofnyzA.js";
|
|
3
3
|
export { type Align, type AlignValue, type Alignment, type AlignmentValue, ArrivalAlignValue, ArrivalAlignment, BoxQuery, type Camera, type Direction, FlowMode, Gap, GoToDestinationOptions, GoToOptions, GridColumns, LayoutKind, type PageFrame, type Point, type Rect, ResponsiveRule, RevealAnchor, RevealAnchorValue, RevealOptions, RevealZoom, ScrollBehaviorKind, type ScrollMetrics, type Size, type SizingMode, type SpreadMode, StageBox, StageCameraChangedEvent, StageCapability, StageConfig, StageHostCapability, StageMotionEndedEvent, StagePageChangedEvent, StagePluginOptions, StageScrollToOptions, StageSettings, StageSettingsChangedEvent, StageSettingsPatch, type StageState, StageToken, StageViewState, StageViewportChangedEvent, StageZoomChangedEvent, Viewpoint, ViewportPoint, ViewportRect, VisiblePage, ZoomMode, type ZoomModeValue, type ZoomSpec, ZoomToOptions };
|
|
@@ -420,6 +420,13 @@ interface StageCapability {
|
|
|
420
420
|
isPageVisible(page: PageRef | number): boolean;
|
|
421
421
|
/** What the viewer is looking at plus the zoom intent, for per-page view memory. */
|
|
422
422
|
getViewpoint(): Viewpoint;
|
|
423
|
+
/**
|
|
424
|
+
* Where the view is, as a destination: the first page on screen, the point
|
|
425
|
+
* of it at the viewport's top-left corner, and no zoom, so following it
|
|
426
|
+
* keeps the reader's zoom. What `goToDestination` takes, and what a new
|
|
427
|
+
* outline item goes to. `null` before a page is on screen.
|
|
428
|
+
*/
|
|
429
|
+
getCurrentDestination(): PageDestination | null;
|
|
423
430
|
/** Serialisable view state — the unit of session persistence. */
|
|
424
431
|
getViewState(): StageViewState;
|
|
425
432
|
/** Restore a saved view state; the responsive rules re-assert on top of its settings. */
|
|
@@ -565,4 +572,4 @@ interface StagePluginOptions extends StageConfig {
|
|
|
565
572
|
}
|
|
566
573
|
//#endregion
|
|
567
574
|
export { StageCapability as A, StageViewportChangedEvent as B, ScrollBehaviorKind as C, SpreadMode$1 as D, SizingMode$1 as E, StageScrollToOptions as F, VisiblePage as G, Viewpoint as H, StageSettings as I, ZoomSpec$1 as J, ZoomMode as K, StageSettingsChangedEvent as L, StageMotionEndedEvent as M, StagePageChangedEvent as N, StageBox as O, StagePluginOptions as P, StageSettingsPatch as R, RevealZoom as S, Size$1 as T, ViewportPoint as U, StageZoomChangedEvent as V, ViewportRect as W, StageToken as X, ZoomToOptions as Y, Point$1 as _, ArrivalAlignValue as a, RevealAnchorValue as b, Camera$1 as c, Gap as d, GoToDestinationOptions as f, PageFrame$1 as g, LayoutKind as h, AlignmentValue$1 as i, StageConfig as j, StageCameraChangedEvent as k, Direction$1 as l, GridColumns as m, AlignValue$1 as n, ArrivalAlignment as o, GoToOptions as p, ZoomModeValue$1 as q, Alignment$1 as r, BoxQuery as s, Align as t, FlowMode as u, ResponsiveRule as v, ScrollMetrics as w, RevealOptions as x, RevealAnchor as y, StageViewState as z };
|
|
568
|
-
//# sourceMappingURL=contract-
|
|
575
|
+
//# sourceMappingURL=contract-B3QLVDlb.d.cts.map
|
|
@@ -420,6 +420,13 @@ interface StageCapability {
|
|
|
420
420
|
isPageVisible(page: PageRef | number): boolean;
|
|
421
421
|
/** What the viewer is looking at plus the zoom intent, for per-page view memory. */
|
|
422
422
|
getViewpoint(): Viewpoint;
|
|
423
|
+
/**
|
|
424
|
+
* Where the view is, as a destination: the first page on screen, the point
|
|
425
|
+
* of it at the viewport's top-left corner, and no zoom, so following it
|
|
426
|
+
* keeps the reader's zoom. What `goToDestination` takes, and what a new
|
|
427
|
+
* outline item goes to. `null` before a page is on screen.
|
|
428
|
+
*/
|
|
429
|
+
getCurrentDestination(): PageDestination | null;
|
|
423
430
|
/** Serialisable view state — the unit of session persistence. */
|
|
424
431
|
getViewState(): StageViewState;
|
|
425
432
|
/** Restore a saved view state; the responsive rules re-assert on top of its settings. */
|
|
@@ -565,4 +572,4 @@ interface StagePluginOptions extends StageConfig {
|
|
|
565
572
|
}
|
|
566
573
|
//#endregion
|
|
567
574
|
export { StageCapability as A, StageViewportChangedEvent as B, ScrollBehaviorKind as C, SpreadMode$1 as D, SizingMode$1 as E, StageScrollToOptions as F, VisiblePage as G, Viewpoint as H, StageSettings as I, ZoomSpec$1 as J, ZoomMode$1 as K, StageSettingsChangedEvent as L, StageMotionEndedEvent as M, StagePageChangedEvent as N, StageBox as O, StagePluginOptions as P, StageSettingsPatch as R, RevealZoom as S, Size$1 as T, ViewportPoint as U, StageZoomChangedEvent as V, ViewportRect as W, StageToken as X, ZoomToOptions as Y, Point$1 as _, ArrivalAlignValue as a, RevealAnchorValue as b, Camera$1 as c, Gap as d, GoToDestinationOptions as f, PageFrame$1 as g, LayoutKind as h, AlignmentValue$1 as i, StageConfig as j, StageCameraChangedEvent as k, Direction$1 as l, GridColumns as m, AlignValue$1 as n, ArrivalAlignment as o, GoToOptions as p, ZoomModeValue$1 as q, Alignment$1 as r, BoxQuery as s, Align as t, FlowMode as u, ResponsiveRule as v, ScrollMetrics as w, RevealOptions as x, RevealAnchor as y, StageViewState as z };
|
|
568
|
-
//# sourceMappingURL=contract-
|
|
575
|
+
//# sourceMappingURL=contract-CqrsZNsY.d.ts.map
|
package/dist/contract.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as StageCapability, B as StageViewportChangedEvent, C as ScrollBehaviorKind, D as SpreadMode, E as SizingMode, F as StageScrollToOptions, G as VisiblePage, H as Viewpoint, I as StageSettings, J as ZoomSpec, K as ZoomMode, L as StageSettingsChangedEvent, M as StageMotionEndedEvent, N as StagePageChangedEvent, O as StageBox, P as StagePluginOptions, R as StageSettingsPatch, S as RevealZoom, T as Size, U as ViewportPoint, V as StageZoomChangedEvent, W as ViewportRect, X as StageToken, Y as ZoomToOptions, _ as Point, a as ArrivalAlignValue, b as RevealAnchorValue, c as Camera, d as Gap, f as GoToDestinationOptions, g as PageFrame, h as LayoutKind, i as AlignmentValue, j as StageConfig, k as StageCameraChangedEvent, l as Direction, m as GridColumns, n as AlignValue, o as ArrivalAlignment, p as GoToOptions, q as ZoomModeValue, r as Alignment, s as BoxQuery, t as Align, u as FlowMode, v as ResponsiveRule, w as ScrollMetrics, x as RevealOptions, y as RevealAnchor, z as StageViewState } from "./contract-
|
|
1
|
+
import { A as StageCapability, B as StageViewportChangedEvent, C as ScrollBehaviorKind, D as SpreadMode, E as SizingMode, F as StageScrollToOptions, G as VisiblePage, H as Viewpoint, I as StageSettings, J as ZoomSpec, K as ZoomMode, L as StageSettingsChangedEvent, M as StageMotionEndedEvent, N as StagePageChangedEvent, O as StageBox, P as StagePluginOptions, R as StageSettingsPatch, S as RevealZoom, T as Size, U as ViewportPoint, V as StageZoomChangedEvent, W as ViewportRect, X as StageToken, Y as ZoomToOptions, _ as Point, a as ArrivalAlignValue, b as RevealAnchorValue, c as Camera, d as Gap, f as GoToDestinationOptions, g as PageFrame, h as LayoutKind, i as AlignmentValue, j as StageConfig, k as StageCameraChangedEvent, l as Direction, m as GridColumns, n as AlignValue, o as ArrivalAlignment, p as GoToOptions, q as ZoomModeValue, r as Alignment, s as BoxQuery, t as Align, u as FlowMode, v as ResponsiveRule, w as ScrollMetrics, x as RevealOptions, y as RevealAnchor, z as StageViewState } from "./contract-B3QLVDlb.cjs";
|
|
2
2
|
export { type Align, type AlignValue, type Alignment, type AlignmentValue, ArrivalAlignValue, ArrivalAlignment, BoxQuery, type Camera, type Direction, FlowMode, Gap, GoToDestinationOptions, GoToOptions, GridColumns, LayoutKind, type PageFrame, type Point, ResponsiveRule, RevealAnchor, RevealAnchorValue, RevealOptions, RevealZoom, ScrollBehaviorKind, type ScrollMetrics, type Size, type SizingMode, type SpreadMode, StageBox, StageCameraChangedEvent, StageCapability, StageConfig, StageMotionEndedEvent, StagePageChangedEvent, StagePluginOptions, StageScrollToOptions, StageSettings, StageSettingsChangedEvent, StageSettingsPatch, StageToken, StageViewState, StageViewportChangedEvent, StageZoomChangedEvent, Viewpoint, ViewportPoint, ViewportRect, VisiblePage, ZoomMode, type ZoomModeValue, type ZoomSpec, ZoomToOptions };
|
package/dist/contract.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as StageCapability, B as StageViewportChangedEvent, C as ScrollBehaviorKind, D as SpreadMode, E as SizingMode, F as StageScrollToOptions, G as VisiblePage, H as Viewpoint, I as StageSettings, J as ZoomSpec, K as ZoomMode, L as StageSettingsChangedEvent, M as StageMotionEndedEvent, N as StagePageChangedEvent, O as StageBox, P as StagePluginOptions, R as StageSettingsPatch, S as RevealZoom, T as Size, U as ViewportPoint, V as StageZoomChangedEvent, W as ViewportRect, X as StageToken, Y as ZoomToOptions, _ as Point, a as ArrivalAlignValue, b as RevealAnchorValue, c as Camera, d as Gap, f as GoToDestinationOptions, g as PageFrame, h as LayoutKind, i as AlignmentValue, j as StageConfig, k as StageCameraChangedEvent, l as Direction, m as GridColumns, n as AlignValue, o as ArrivalAlignment, p as GoToOptions, q as ZoomModeValue, r as Alignment, s as BoxQuery, t as Align, u as FlowMode, v as ResponsiveRule, w as ScrollMetrics, x as RevealOptions, y as RevealAnchor, z as StageViewState } from "./contract-
|
|
1
|
+
import { A as StageCapability, B as StageViewportChangedEvent, C as ScrollBehaviorKind, D as SpreadMode, E as SizingMode, F as StageScrollToOptions, G as VisiblePage, H as Viewpoint, I as StageSettings, J as ZoomSpec, K as ZoomMode, L as StageSettingsChangedEvent, M as StageMotionEndedEvent, N as StagePageChangedEvent, O as StageBox, P as StagePluginOptions, R as StageSettingsPatch, S as RevealZoom, T as Size, U as ViewportPoint, V as StageZoomChangedEvent, W as ViewportRect, X as StageToken, Y as ZoomToOptions, _ as Point, a as ArrivalAlignValue, b as RevealAnchorValue, c as Camera, d as Gap, f as GoToDestinationOptions, g as PageFrame, h as LayoutKind, i as AlignmentValue, j as StageConfig, k as StageCameraChangedEvent, l as Direction, m as GridColumns, n as AlignValue, o as ArrivalAlignment, p as GoToOptions, q as ZoomModeValue, r as Alignment, s as BoxQuery, t as Align, u as FlowMode, v as ResponsiveRule, w as ScrollMetrics, x as RevealOptions, y as RevealAnchor, z as StageViewState } from "./contract-CqrsZNsY.js";
|
|
2
2
|
export { type Align, type AlignValue, type Alignment, type AlignmentValue, ArrivalAlignValue, ArrivalAlignment, BoxQuery, type Camera, type Direction, FlowMode, Gap, GoToDestinationOptions, GoToOptions, GridColumns, LayoutKind, type PageFrame, type Point, ResponsiveRule, RevealAnchor, RevealAnchorValue, RevealOptions, RevealZoom, ScrollBehaviorKind, type ScrollMetrics, type Size, type SizingMode, type SpreadMode, StageBox, StageCameraChangedEvent, StageCapability, StageConfig, StageMotionEndedEvent, StagePageChangedEvent, StagePluginOptions, StageScrollToOptions, StageSettings, StageSettingsChangedEvent, StageSettingsPatch, StageToken, StageViewState, StageViewportChangedEvent, StageZoomChangedEvent, Viewpoint, ViewportPoint, ViewportRect, VisiblePage, ZoomMode, type ZoomModeValue, type ZoomSpec, ZoomToOptions };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as StageCapability, I as StageSettings, U as ViewportPoint, z as StageViewState } from "./contract-
|
|
1
|
+
import { A as StageCapability, I as StageSettings, U as ViewportPoint, z as StageViewState } from "./contract-CqrsZNsY.js";
|
|
2
2
|
import { PageRef, Unsubscribe } from "@embedpdf/core";
|
|
3
3
|
import { Camera, Camera as Camera$1, ScrollMetrics, Size, Size as Size$1 } from "@embedpdf/core-stage";
|
|
4
4
|
import { Point as Point$1, Rect as Rect$1 } from "@embedpdf/core-geometry";
|
|
@@ -92,4 +92,4 @@ interface StageHostCapability extends StageCapability {
|
|
|
92
92
|
declare const StageToken: import("@embedpdf/core").CapabilityToken<StageHostCapability>;
|
|
93
93
|
//#endregion
|
|
94
94
|
export { Size$1 as a, StageState as c, ScrollMetrics as i, Point$1 as n, StageHostCapability as o, Rect$1 as r, StageToken as s, Camera$1 as t };
|
|
95
|
-
//# sourceMappingURL=host-contract-
|
|
95
|
+
//# sourceMappingURL=host-contract-C7ofnyzA.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as StageCapability, I as StageSettings, U as ViewportPoint, z as StageViewState } from "./contract-
|
|
1
|
+
import { A as StageCapability, I as StageSettings, U as ViewportPoint, z as StageViewState } from "./contract-B3QLVDlb.cjs";
|
|
2
2
|
import { PageRef, Unsubscribe } from "@embedpdf/core";
|
|
3
3
|
import { Point as Point$1, Rect as Rect$1 } from "@embedpdf/core-geometry";
|
|
4
4
|
import { Camera, Camera as Camera$1, ScrollMetrics, Size, Size as Size$1 } from "@embedpdf/core-stage";
|
|
@@ -92,4 +92,4 @@ interface StageHostCapability extends StageCapability {
|
|
|
92
92
|
declare const StageToken: import("@embedpdf/core").CapabilityToken<StageHostCapability>;
|
|
93
93
|
//#endregion
|
|
94
94
|
export { Size$1 as a, StageState as c, ScrollMetrics as i, Point$1 as n, StageHostCapability as o, Rect$1 as r, StageToken as s, Camera$1 as t };
|
|
95
|
-
//# sourceMappingURL=host-contract-
|
|
95
|
+
//# sourceMappingURL=host-contract-Dm5_acFs.d.cts.map
|
package/dist/index.cjs
CHANGED
|
@@ -1457,7 +1457,32 @@ function createPageReads(ctx, { scene }) {
|
|
|
1457
1457
|
getViewpoint: () => ({
|
|
1458
1458
|
anchor: currentAnchor(),
|
|
1459
1459
|
zoom: state().zoom
|
|
1460
|
-
})
|
|
1460
|
+
}),
|
|
1461
|
+
getCurrentDestination: () => {
|
|
1462
|
+
const inset = padding();
|
|
1463
|
+
const current = camera();
|
|
1464
|
+
const first = visiblePages().filter((page) => {
|
|
1465
|
+
const corner = (0, _embedpdf_core_stage.toScreen)(current, {
|
|
1466
|
+
x: page.x + page.width,
|
|
1467
|
+
y: page.y + page.height
|
|
1468
|
+
});
|
|
1469
|
+
return corner.x > inset && corner.y > inset;
|
|
1470
|
+
}).sort((left, right) => left.pageIndex - right.pageIndex)[0];
|
|
1471
|
+
const size = first && ctx.getPage(first.ref)?.size;
|
|
1472
|
+
if (!first || !size) return null;
|
|
1473
|
+
const corner = first.transform.viewToPage({
|
|
1474
|
+
x: inset - first.screenX,
|
|
1475
|
+
y: inset - first.screenY
|
|
1476
|
+
});
|
|
1477
|
+
const clamp = (value, max) => Math.round(Math.min(Math.max(value, 0), max) * 100) / 100;
|
|
1478
|
+
return {
|
|
1479
|
+
kind: "xyz",
|
|
1480
|
+
page: first.ref,
|
|
1481
|
+
x: clamp(corner.x, size.width),
|
|
1482
|
+
y: clamp(corner.y, size.height),
|
|
1483
|
+
zoom: null
|
|
1484
|
+
};
|
|
1485
|
+
}
|
|
1461
1486
|
}
|
|
1462
1487
|
};
|
|
1463
1488
|
}
|