@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/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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-
|
|
2
|
-
import { c as StageState, o as StageHostCapability } 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, 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
|
+
import { c as StageState, o as StageHostCapability } from "./host-contract-Dm5_acFs.cjs";
|
|
3
3
|
import { Size as Size$1 } from "@embedpdf/core-stage";
|
|
4
4
|
import { InteractionHandler, InteractionHostCapability } from "@embedpdf/plugin-interaction/contract/host";
|
|
5
5
|
//#region src/stage.plugin.d.ts
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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-
|
|
2
|
-
import { c as StageState, o as StageHostCapability } 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, 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
|
+
import { c as StageState, o as StageHostCapability } from "./host-contract-C7ofnyzA.js";
|
|
3
3
|
import { Size as Size$1 } from "@embedpdf/core-stage";
|
|
4
4
|
import { InteractionHandler, InteractionHostCapability } from "@embedpdf/plugin-interaction/contract/host";
|
|
5
5
|
//#region src/stage.plugin.d.ts
|
package/dist/index.js
CHANGED
|
@@ -1456,7 +1456,32 @@ function createPageReads(ctx, { scene }) {
|
|
|
1456
1456
|
getViewpoint: () => ({
|
|
1457
1457
|
anchor: currentAnchor(),
|
|
1458
1458
|
zoom: state().zoom
|
|
1459
|
-
})
|
|
1459
|
+
}),
|
|
1460
|
+
getCurrentDestination: () => {
|
|
1461
|
+
const inset = padding();
|
|
1462
|
+
const current = camera();
|
|
1463
|
+
const first = visiblePages().filter((page) => {
|
|
1464
|
+
const corner = toScreen(current, {
|
|
1465
|
+
x: page.x + page.width,
|
|
1466
|
+
y: page.y + page.height
|
|
1467
|
+
});
|
|
1468
|
+
return corner.x > inset && corner.y > inset;
|
|
1469
|
+
}).sort((left, right) => left.pageIndex - right.pageIndex)[0];
|
|
1470
|
+
const size = first && ctx.getPage(first.ref)?.size;
|
|
1471
|
+
if (!first || !size) return null;
|
|
1472
|
+
const corner = first.transform.viewToPage({
|
|
1473
|
+
x: inset - first.screenX,
|
|
1474
|
+
y: inset - first.screenY
|
|
1475
|
+
});
|
|
1476
|
+
const clamp = (value, max) => Math.round(Math.min(Math.max(value, 0), max) * 100) / 100;
|
|
1477
|
+
return {
|
|
1478
|
+
kind: "xyz",
|
|
1479
|
+
page: first.ref,
|
|
1480
|
+
x: clamp(corner.x, size.width),
|
|
1481
|
+
y: clamp(corner.y, size.height),
|
|
1482
|
+
zoom: null
|
|
1483
|
+
};
|
|
1484
|
+
}
|
|
1460
1485
|
}
|
|
1461
1486
|
};
|
|
1462
1487
|
}
|