@cervio/plugin-sdk 1.0.0 → 1.1.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.
@@ -0,0 +1,38 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ReactNode } from 'react';
3
+
4
+ /**
5
+ * `PdfViewer`'s own chrome can't use next-intl - a plugin bundle has no
6
+ * `public/locales`. Small built-in catalog instead; pass `locale` to pick one
7
+ * (default `it`, matching the rest of this codebase's default).
8
+ */
9
+ type PdfViewerLocale = 'it' | 'en';
10
+
11
+ interface PdfPageOverlayInfo {
12
+ /** 1-based page number currently rendered. */
13
+ page: number;
14
+ /** Rendered page size in CSS pixels (matches the canvas exactly). */
15
+ width: number;
16
+ height: number;
17
+ }
18
+ interface PdfViewerProps {
19
+ /** Absolute (or origin-relative) URL to the PDF - fetched directly, cross-origin, no relay. */
20
+ url: string;
21
+ /** 1-based page to jump to; only acts on change (doesn't fight manual page nav). */
22
+ activePage?: number | null;
23
+ /** Fires whenever the rendered page changes (nav buttons or `activePage`). */
24
+ onPageChange?: (page: number) => void;
25
+ /**
26
+ * Renders extra content positioned over the current page, at its exact
27
+ * rendered size - e.g. citation/field bounding-box overlays. Sits above the
28
+ * text layer (`z-index`), so give interactive parts their own
29
+ * `pointer-events: auto` (the container itself has `pointer-events: none`
30
+ * so it doesn't block text selection where there's no overlay content).
31
+ */
32
+ renderPageOverlay?: (info: PdfPageOverlayInfo) => ReactNode;
33
+ /** `it` (default) or `en` - see `./i18n`. */
34
+ locale?: PdfViewerLocale;
35
+ }
36
+ declare function PdfViewer({ url, activePage, onPageChange, renderPageOverlay, locale }: PdfViewerProps): react_jsx_runtime.JSX.Element;
37
+
38
+ export { type PdfPageOverlayInfo, PdfViewer, type PdfViewerLocale, type PdfViewerProps };
@@ -0,0 +1,38 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ReactNode } from 'react';
3
+
4
+ /**
5
+ * `PdfViewer`'s own chrome can't use next-intl - a plugin bundle has no
6
+ * `public/locales`. Small built-in catalog instead; pass `locale` to pick one
7
+ * (default `it`, matching the rest of this codebase's default).
8
+ */
9
+ type PdfViewerLocale = 'it' | 'en';
10
+
11
+ interface PdfPageOverlayInfo {
12
+ /** 1-based page number currently rendered. */
13
+ page: number;
14
+ /** Rendered page size in CSS pixels (matches the canvas exactly). */
15
+ width: number;
16
+ height: number;
17
+ }
18
+ interface PdfViewerProps {
19
+ /** Absolute (or origin-relative) URL to the PDF - fetched directly, cross-origin, no relay. */
20
+ url: string;
21
+ /** 1-based page to jump to; only acts on change (doesn't fight manual page nav). */
22
+ activePage?: number | null;
23
+ /** Fires whenever the rendered page changes (nav buttons or `activePage`). */
24
+ onPageChange?: (page: number) => void;
25
+ /**
26
+ * Renders extra content positioned over the current page, at its exact
27
+ * rendered size - e.g. citation/field bounding-box overlays. Sits above the
28
+ * text layer (`z-index`), so give interactive parts their own
29
+ * `pointer-events: auto` (the container itself has `pointer-events: none`
30
+ * so it doesn't block text selection where there's no overlay content).
31
+ */
32
+ renderPageOverlay?: (info: PdfPageOverlayInfo) => ReactNode;
33
+ /** `it` (default) or `en` - see `./i18n`. */
34
+ locale?: PdfViewerLocale;
35
+ }
36
+ declare function PdfViewer({ url, activePage, onPageChange, renderPageOverlay, locale }: PdfViewerProps): react_jsx_runtime.JSX.Element;
37
+
38
+ export { type PdfPageOverlayInfo, PdfViewer, type PdfViewerLocale, type PdfViewerProps };