@cocoar/vue-document-viewer 2.3.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.
- package/LICENSE +201 -0
- package/README.md +212 -0
- package/dist/CoarDocumentViewer.vue.d.ts +243 -0
- package/dist/CoarDocumentViewer.vue.d.ts.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3283 -0
- package/dist/internal/AnnotationLayer.vue.d.ts +23 -0
- package/dist/internal/AnnotationLayer.vue.d.ts.map +1 -0
- package/dist/internal/AnnotationPopover.vue.d.ts +35 -0
- package/dist/internal/AnnotationPopover.vue.d.ts.map +1 -0
- package/dist/internal/DocumentAnnotationPanel.vue.d.ts +27 -0
- package/dist/internal/DocumentAnnotationPanel.vue.d.ts.map +1 -0
- package/dist/internal/DocumentInfoSection.vue.d.ts +18 -0
- package/dist/internal/DocumentInfoSection.vue.d.ts.map +1 -0
- package/dist/internal/DocumentSearchBar.vue.d.ts +23 -0
- package/dist/internal/DocumentSearchBar.vue.d.ts.map +1 -0
- package/dist/internal/DocumentSidebar.vue.d.ts +33 -0
- package/dist/internal/DocumentSidebar.vue.d.ts.map +1 -0
- package/dist/internal/DocumentToolbar.vue.d.ts +92 -0
- package/dist/internal/DocumentToolbar.vue.d.ts.map +1 -0
- package/dist/internal/PdfOutlineList.vue.d.ts +35 -0
- package/dist/internal/PdfOutlineList.vue.d.ts.map +1 -0
- package/dist/internal/effective-tools.d.ts +10 -0
- package/dist/internal/effective-tools.d.ts.map +1 -0
- package/dist/internal/page-provider.d.ts +51 -0
- package/dist/internal/page-provider.d.ts.map +1 -0
- package/dist/internal/useAnnotationEditor.d.ts +210 -0
- package/dist/internal/useAnnotationEditor.d.ts.map +1 -0
- package/dist/internal/useDocumentLoader.d.ts +20 -0
- package/dist/internal/useDocumentLoader.d.ts.map +1 -0
- package/dist/internal/usePageRenderer.d.ts +52 -0
- package/dist/internal/usePageRenderer.d.ts.map +1 -0
- package/dist/internal/usePdfSearch.d.ts +27 -0
- package/dist/internal/usePdfSearch.d.ts.map +1 -0
- package/dist/internal/usePositionMemory.d.ts +24 -0
- package/dist/internal/usePositionMemory.d.ts.map +1 -0
- package/dist/pdf.js +19 -0
- package/dist/source-types.d.ts +100 -0
- package/dist/source-types.d.ts.map +1 -0
- package/dist/sources/image-adapter.d.ts +38 -0
- package/dist/sources/image-adapter.d.ts.map +1 -0
- package/dist/sources/image-gallery-adapter.d.ts +14 -0
- package/dist/sources/image-gallery-adapter.d.ts.map +1 -0
- package/dist/sources/image.d.ts +32 -0
- package/dist/sources/image.d.ts.map +1 -0
- package/dist/sources/pdf-adapter.d.ts +27 -0
- package/dist/sources/pdf-adapter.d.ts.map +1 -0
- package/dist/sources/pdf.d.ts +20 -0
- package/dist/sources/pdf.d.ts.map +1 -0
- package/dist/types.d.ts +132 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/vue-document-viewer.css +2 -0
- package/package.json +64 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { CoarPdfAnnotation } from '../types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/** Annotations whose `pageIndex` matches this page. */
|
|
4
|
+
annotations: CoarPdfAnnotation[];
|
|
5
|
+
/**
|
|
6
|
+
* Display dimensions of the unrotated page in CSS pixels (= intrinsic × scale).
|
|
7
|
+
* Annotation 0..1 coords are interpreted against these — at rotation 0 they
|
|
8
|
+
* also match the wrapper dimensions; at rotation 90/180/270 the layer is
|
|
9
|
+
* CSS-transformed onto the rotated wrapper but the internal coordinate space
|
|
10
|
+
* stays unrotated.
|
|
11
|
+
*/
|
|
12
|
+
displayWidth: number;
|
|
13
|
+
displayHeight: number;
|
|
14
|
+
/** Rotation in 90° steps. Drives the transform that aligns this layer with the rotated page wrapper. */
|
|
15
|
+
rotation?: 0 | 90 | 180 | 270;
|
|
16
|
+
};
|
|
17
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
18
|
+
"annotation-click": (annotationId: string) => any;
|
|
19
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
20
|
+
"onAnnotation-click"?: ((annotationId: string) => any) | undefined;
|
|
21
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
22
|
+
export default _default;
|
|
23
|
+
//# sourceMappingURL=AnnotationLayer.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnnotationLayer.vue.d.ts","sourceRoot":"","sources":["../../src/internal/AnnotationLayer.vue"],"names":[],"mappings":"AA+TA,OAAO,KAAK,EACV,iBAAiB,EAKlB,MAAM,UAAU,CAAC;AAElB,KAAK,WAAW,GAAG;IACjB,uDAAuD;IACvD,WAAW,EAAE,iBAAiB,EAAE,CAAC;IACjC;;;;;;OAMG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,wGAAwG;IACxG,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,GAAG,CAAC;CAC/B,CAAC;;;;;;AAoPF,wBAQG"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { CoarDocumentViewerLabels } from '../CoarDocumentViewer.vue';
|
|
2
|
+
export interface AnnotationPopoverPayload {
|
|
3
|
+
/** Comment text (may be empty). */
|
|
4
|
+
comment: string;
|
|
5
|
+
/** Selected color (CSS hex). */
|
|
6
|
+
color: string;
|
|
7
|
+
}
|
|
8
|
+
type __VLS_Props = {
|
|
9
|
+
/** Anchor rect in viewport coordinates (from `getBoundingClientRect`). */
|
|
10
|
+
anchor: DOMRect;
|
|
11
|
+
/** Initial comment text. */
|
|
12
|
+
initialComment: string;
|
|
13
|
+
/** Initial color (CSS hex). */
|
|
14
|
+
initialColor: string;
|
|
15
|
+
/** Color palette to show as swatches. */
|
|
16
|
+
colors: readonly string[];
|
|
17
|
+
/** Whether this is a brand-new draft (shows Save/Cancel) or an edit (auto-save on change). */
|
|
18
|
+
draft: boolean;
|
|
19
|
+
/** All UI strings, already merged with defaults. */
|
|
20
|
+
labels: Required<CoarDocumentViewerLabels>;
|
|
21
|
+
};
|
|
22
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
23
|
+
close: () => any;
|
|
24
|
+
delete: () => any;
|
|
25
|
+
save: (payload: AnnotationPopoverPayload) => any;
|
|
26
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
27
|
+
onClose?: (() => any) | undefined;
|
|
28
|
+
onDelete?: (() => any) | undefined;
|
|
29
|
+
onSave?: ((payload: AnnotationPopoverPayload) => any) | undefined;
|
|
30
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
31
|
+
root: HTMLDivElement;
|
|
32
|
+
textareaRef: HTMLTextAreaElement;
|
|
33
|
+
}, any>;
|
|
34
|
+
export default _default;
|
|
35
|
+
//# sourceMappingURL=AnnotationPopover.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnnotationPopover.vue.d.ts","sourceRoot":"","sources":["../../src/internal/AnnotationPopover.vue"],"names":[],"mappings":"AAkTA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAE1E,MAAM,WAAW,wBAAwB;IACvC,mCAAmC;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,gCAAgC;IAChC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,KAAK,WAAW,GAAG;IACjB,0EAA0E;IAC1E,MAAM,EAAE,OAAO,CAAC;IAChB,4BAA4B;IAC5B,cAAc,EAAE,MAAM,CAAC;IACvB,+BAA+B;IAC/B,YAAY,EAAE,MAAM,CAAC;IACrB,yCAAyC;IACzC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1B,8FAA8F;IAC9F,KAAK,EAAE,OAAO,CAAC;IACf,oDAAoD;IACpD,MAAM,EAAE,QAAQ,CAAC,wBAAwB,CAAC,CAAC;CAC5C,CAAC;;;;;;;;;;;;;AAsPF,wBASG"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { CoarPdfAnnotation } from '../types';
|
|
2
|
+
import { DocumentInfo } from '../source-types';
|
|
3
|
+
import { CoarDocumentViewerLabels } from '../CoarDocumentViewer.vue';
|
|
4
|
+
type __VLS_Props = {
|
|
5
|
+
annotations: readonly CoarPdfAnnotation[];
|
|
6
|
+
selectedId: string | null;
|
|
7
|
+
/** Source-level metadata for the optional Info section. Null suppresses the section entirely. */
|
|
8
|
+
info?: DocumentInfo | null;
|
|
9
|
+
/** Current page's intrinsic dimensions, for the per-page row in the Info section. */
|
|
10
|
+
currentPageInfo?: {
|
|
11
|
+
index: number;
|
|
12
|
+
width: number;
|
|
13
|
+
height: number;
|
|
14
|
+
} | null;
|
|
15
|
+
labels: Required<CoarDocumentViewerLabels>;
|
|
16
|
+
};
|
|
17
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
18
|
+
select: (id: string) => any;
|
|
19
|
+
close: () => any;
|
|
20
|
+
delete: (id: string) => any;
|
|
21
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
22
|
+
onSelect?: ((id: string) => any) | undefined;
|
|
23
|
+
onClose?: (() => any) | undefined;
|
|
24
|
+
onDelete?: ((id: string) => any) | undefined;
|
|
25
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLElement>;
|
|
26
|
+
export default _default;
|
|
27
|
+
//# sourceMappingURL=DocumentAnnotationPanel.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DocumentAnnotationPanel.vue.d.ts","sourceRoot":"","sources":["../../src/internal/DocumentAnnotationPanel.vue"],"names":[],"mappings":"AA0gBA,OAAO,KAAK,EAAE,iBAAiB,EAAyB,MAAM,UAAU,CAAC;AACzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAG1E,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,SAAS,iBAAiB,EAAE,CAAC;IAC1C,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,iGAAiG;IACjG,IAAI,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;IAC3B,qFAAqF;IACrF,eAAe,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAC1E,MAAM,EAAE,QAAQ,CAAC,wBAAwB,CAAC,CAAC;CAC5C,CAAC;;;;;;;;;;AA+cF,wBAQG"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { DocumentInfo } from '../source-types';
|
|
2
|
+
import { CoarDocumentViewerLabels } from '../CoarDocumentViewer.vue';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
info: DocumentInfo | null;
|
|
5
|
+
/**
|
|
6
|
+
* Current page's intrinsic dimensions, used to render the per-page
|
|
7
|
+
* "Page N: W × H" row. Null while no page is bound yet.
|
|
8
|
+
*/
|
|
9
|
+
currentPage: {
|
|
10
|
+
index: number;
|
|
11
|
+
width: number;
|
|
12
|
+
height: number;
|
|
13
|
+
} | null;
|
|
14
|
+
labels: Required<CoarDocumentViewerLabels>;
|
|
15
|
+
};
|
|
16
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
17
|
+
export default _default;
|
|
18
|
+
//# sourceMappingURL=DocumentInfoSection.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DocumentInfoSection.vue.d.ts","sourceRoot":"","sources":["../../src/internal/DocumentInfoSection.vue"],"names":[],"mappings":"AA2OA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAE1E,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,YAAY,GAAG,IAAI,CAAC;IAC1B;;;OAGG;IACH,WAAW,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IACrE,MAAM,EAAE,QAAQ,CAAC,wBAAwB,CAAC,CAAC;CAC5C,CAAC;;AA4NF,wBAMG"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { CoarDocumentViewerLabels } from '../CoarDocumentViewer.vue';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
query: string;
|
|
4
|
+
matchCount: number;
|
|
5
|
+
currentIndex: number;
|
|
6
|
+
searching: boolean;
|
|
7
|
+
labels: Required<CoarDocumentViewerLabels>;
|
|
8
|
+
};
|
|
9
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
10
|
+
close: () => any;
|
|
11
|
+
prev: () => any;
|
|
12
|
+
next: () => any;
|
|
13
|
+
"update:query": (value: string) => any;
|
|
14
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
15
|
+
onClose?: (() => any) | undefined;
|
|
16
|
+
onPrev?: (() => any) | undefined;
|
|
17
|
+
onNext?: (() => any) | undefined;
|
|
18
|
+
"onUpdate:query"?: ((value: string) => any) | undefined;
|
|
19
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
20
|
+
inputEl: HTMLInputElement;
|
|
21
|
+
}, HTMLDivElement>;
|
|
22
|
+
export default _default;
|
|
23
|
+
//# sourceMappingURL=DocumentSearchBar.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DocumentSearchBar.vue.d.ts","sourceRoot":"","sources":["../../src/internal/DocumentSearchBar.vue"],"names":[],"mappings":"AAqMA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAE1E,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,QAAQ,CAAC,wBAAwB,CAAC,CAAC;CAC5C,CAAC;;;;;;;;;;;;;;AAqMF,wBASG"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { PDFDocumentProxy } from 'pdfjs-dist';
|
|
2
|
+
import { CoarDocumentViewerLabels } from '../CoarDocumentViewer.vue';
|
|
3
|
+
import { PageProvider } from './page-provider';
|
|
4
|
+
type __VLS_Props = {
|
|
5
|
+
/**
|
|
6
|
+
* PDF-only document proxy — used solely for outline resolution
|
|
7
|
+
* (`getOutline` / `getDestination` / `getPageIndex`). Null for image
|
|
8
|
+
* sources; the outline tab then auto-hides.
|
|
9
|
+
*/
|
|
10
|
+
doc: PDFDocumentProxy | null;
|
|
11
|
+
/**
|
|
12
|
+
* Source-agnostic page providers, fed straight into per-page render() for
|
|
13
|
+
* thumbnails. Lets the sidebar render image / gallery thumbnails through
|
|
14
|
+
* the same code path as PDFs.
|
|
15
|
+
*/
|
|
16
|
+
pageProviders: readonly PageProvider[] | null;
|
|
17
|
+
pageCount: number;
|
|
18
|
+
visiblePage: number;
|
|
19
|
+
showThumbnails: boolean;
|
|
20
|
+
showOutline: boolean;
|
|
21
|
+
labels: Required<CoarDocumentViewerLabels>;
|
|
22
|
+
};
|
|
23
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
24
|
+
close: () => any;
|
|
25
|
+
jump: (pageIndex: number) => any;
|
|
26
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
27
|
+
onClose?: (() => any) | undefined;
|
|
28
|
+
onJump?: ((pageIndex: number) => any) | undefined;
|
|
29
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
30
|
+
thumbsContainer: HTMLDivElement;
|
|
31
|
+
}, HTMLElement>;
|
|
32
|
+
export default _default;
|
|
33
|
+
//# sourceMappingURL=DocumentSidebar.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DocumentSidebar.vue.d.ts","sourceRoot":"","sources":["../../src/internal/DocumentSidebar.vue"],"names":[],"mappings":"AA4bA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAC1E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAGpD,KAAK,WAAW,GAAG;IACjB;;;;OAIG;IACH,GAAG,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAC7B;;;;OAIG;IACH,aAAa,EAAE,SAAS,YAAY,EAAE,GAAG,IAAI,CAAC;IAC9C,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,OAAO,CAAC;IACxB,WAAW,EAAE,OAAO,CAAC;IACrB,MAAM,EAAE,QAAQ,CAAC,wBAAwB,CAAC,CAAC;CAC5C,CAAC;;;;;;;;;;AA2VF,wBASG"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { VNode } from 'vue';
|
|
2
|
+
import { CoarPdfAnnotationMode, CoarDocumentViewerTool } from '../types';
|
|
3
|
+
import { CoarDocumentViewerLabels } from '../CoarDocumentViewer.vue';
|
|
4
|
+
import { DocumentSourceCapabilities } from '../source-types';
|
|
5
|
+
type __VLS_Props = {
|
|
6
|
+
/** 0-based index of the topmost visible page. */
|
|
7
|
+
currentPage: number;
|
|
8
|
+
pageCount: number;
|
|
9
|
+
zoom: number;
|
|
10
|
+
/** Zoom bounds — used to grey out + / - at the limits. */
|
|
11
|
+
minZoom: number;
|
|
12
|
+
maxZoom: number;
|
|
13
|
+
/** Pointer mode — 'pan' shows the pan button in pressed state. */
|
|
14
|
+
pointerMode: 'select' | 'pan';
|
|
15
|
+
/** Active annotation mode — highlights the matching button. */
|
|
16
|
+
annotationMode: CoarPdfAnnotationMode;
|
|
17
|
+
/** Stroke widths to show in the marker flyout (CSS px @ zoom=1). */
|
|
18
|
+
markerWidthPresets: readonly number[];
|
|
19
|
+
/** Stroke widths to show in the ink flyout (CSS px @ zoom=1). */
|
|
20
|
+
inkWidthPresets: readonly number[];
|
|
21
|
+
/** Current marker stroke width + color. */
|
|
22
|
+
markerWidth: number;
|
|
23
|
+
markerColor: string;
|
|
24
|
+
/** Current ink stroke width + color. */
|
|
25
|
+
inkWidth: number;
|
|
26
|
+
inkColor: string;
|
|
27
|
+
/** Color palette for the draw flyouts. */
|
|
28
|
+
colors: readonly string[];
|
|
29
|
+
/** All UI strings, already merged with the English defaults. */
|
|
30
|
+
labels: Required<CoarDocumentViewerLabels>;
|
|
31
|
+
/** Where the toolbar lives (drives `<CoarSidebar side>`). */
|
|
32
|
+
side: 'left' | 'right' | 'top' | 'bottom';
|
|
33
|
+
showSearch?: boolean;
|
|
34
|
+
showPrintDownload?: boolean;
|
|
35
|
+
showAnnotationModes?: boolean;
|
|
36
|
+
showSidebarToggle?: boolean;
|
|
37
|
+
sidebarOpen?: boolean;
|
|
38
|
+
showAnnotationsPanelToggle?: boolean;
|
|
39
|
+
annotationsPanelOpen?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Toolbar layout. The array drives both the visible set AND the order
|
|
42
|
+
* — pass `['prev-page', 'page-input', 'next-page', 'separator',
|
|
43
|
+
* 'zoom-out', 'zoom-reset', 'zoom-in']` for a minimal "nav + zoom"
|
|
44
|
+
* viewer. Use `'separator'` to place a divider. When omitted, falls
|
|
45
|
+
* back to `COAR_DOCUMENT_VIEWER_ALL_TOOLS`.
|
|
46
|
+
*
|
|
47
|
+
* Applies on top of the coarse-grained `show*` props, so e.g. passing
|
|
48
|
+
* `tools: ['search']` AND `showSearch: false` still hides the search
|
|
49
|
+
* button. The intent is: `show*` toggles entire sections off, `tools`
|
|
50
|
+
* cherry-picks individual buttons within sections.
|
|
51
|
+
*/
|
|
52
|
+
tools?: CoarDocumentViewerTool[];
|
|
53
|
+
/**
|
|
54
|
+
* Current source's capability flags. Tools that the source can't support
|
|
55
|
+
* (e.g. search on an image) stay visible but render disabled, with a
|
|
56
|
+
* contextual tooltip — so the user understands the tool is real but not
|
|
57
|
+
* applicable to this file type, rather than silently missing.
|
|
58
|
+
*/
|
|
59
|
+
capabilities: DocumentSourceCapabilities;
|
|
60
|
+
};
|
|
61
|
+
declare function __VLS_template(): {
|
|
62
|
+
attrs: Partial<{}>;
|
|
63
|
+
slots: Readonly<{
|
|
64
|
+
/** Trailing slot for consumer-supplied actions (e.g. share, custom modes). */
|
|
65
|
+
actions?: () => VNode[];
|
|
66
|
+
}> & {
|
|
67
|
+
/** Trailing slot for consumer-supplied actions (e.g. share, custom modes). */
|
|
68
|
+
actions?: () => VNode[];
|
|
69
|
+
};
|
|
70
|
+
refs: {
|
|
71
|
+
pageInputEl: HTMLInputElement;
|
|
72
|
+
zoomInputEl: HTMLInputElement;
|
|
73
|
+
};
|
|
74
|
+
rootEl: HTMLElement;
|
|
75
|
+
};
|
|
76
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
77
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
78
|
+
[x: string]: any;
|
|
79
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
80
|
+
[x: `on${Capitalize<any>}`]: ((...args: any) => any) | undefined;
|
|
81
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
82
|
+
pageInputEl: HTMLInputElement;
|
|
83
|
+
zoomInputEl: HTMLInputElement;
|
|
84
|
+
}, HTMLElement>;
|
|
85
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
86
|
+
export default _default;
|
|
87
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
88
|
+
new (): {
|
|
89
|
+
$slots: S;
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
//# sourceMappingURL=DocumentToolbar.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DocumentToolbar.vue.d.ts","sourceRoot":"","sources":["../../src/internal/DocumentToolbar.vue"],"names":[],"mappings":"AA0sBA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAwB,KAAK,KAAK,EAAE,MAAM,KAAK,CAAC;AAOvD,OAAO,EAEL,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC5B,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAC1E,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAGlE,KAAK,WAAW,GAAG;IACjB,iDAAiD;IACjD,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;I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,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;;eASnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAQpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
export interface OutlineNode {
|
|
3
|
+
title: string;
|
|
4
|
+
dest: string | unknown[] | null;
|
|
5
|
+
items: OutlineNode[];
|
|
6
|
+
/** Resolved 0-based page index, memoised by the parent on first click. */
|
|
7
|
+
resolvedPageIndex?: number;
|
|
8
|
+
}
|
|
9
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
10
|
+
nodes: {
|
|
11
|
+
type: PropType<OutlineNode[]>;
|
|
12
|
+
required: true;
|
|
13
|
+
};
|
|
14
|
+
depth: {
|
|
15
|
+
type: NumberConstructor;
|
|
16
|
+
default: number;
|
|
17
|
+
};
|
|
18
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
19
|
+
jump: (node: OutlineNode) => any;
|
|
20
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
21
|
+
nodes: {
|
|
22
|
+
type: PropType<OutlineNode[]>;
|
|
23
|
+
required: true;
|
|
24
|
+
};
|
|
25
|
+
depth: {
|
|
26
|
+
type: NumberConstructor;
|
|
27
|
+
default: number;
|
|
28
|
+
};
|
|
29
|
+
}>> & Readonly<{
|
|
30
|
+
onJump?: ((node: OutlineNode) => any) | undefined;
|
|
31
|
+
}>, {
|
|
32
|
+
depth: number;
|
|
33
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLUListElement>;
|
|
34
|
+
export default _default;
|
|
35
|
+
//# sourceMappingURL=PdfOutlineList.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PdfOutlineList.vue.d.ts","sourceRoot":"","sources":["../../src/internal/PdfOutlineList.vue"],"names":[],"mappings":"AA0DA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAEpC,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,GAAG,OAAO,EAAE,GAAG,IAAI,CAAC;IAChC,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,0EAA0E;IAC1E,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;;;cAgHkB,QAAQ,CAAC,WAAW,EAAE,CAAC;;;;;;;;;;;cAAvB,QAAQ,CAAC,WAAW,EAAE,CAAC;;;;;;;;;;;;AAR1C,wBAiBG"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CoarDocumentViewerTool } from '../types';
|
|
2
|
+
export interface EffectiveToolsOptions {
|
|
3
|
+
showSidebarToggle: boolean;
|
|
4
|
+
showAnnotationsPanelToggle: boolean;
|
|
5
|
+
showSearch: boolean;
|
|
6
|
+
showPrintDownload: boolean;
|
|
7
|
+
showAnnotationModes: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function computeEffectiveTools(requested: readonly CoarDocumentViewerTool[], options: EffectiveToolsOptions): readonly CoarDocumentViewerTool[];
|
|
10
|
+
//# sourceMappingURL=effective-tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"effective-tools.d.ts","sourceRoot":"","sources":["../../src/internal/effective-tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAYvD,MAAM,WAAW,qBAAqB;IACpC,iBAAiB,EAAE,OAAO,CAAC;IAC3B,0BAA0B,EAAE,OAAO,CAAC;IACpC,UAAU,EAAE,OAAO,CAAC;IACpB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,mBAAmB,EAAE,OAAO,CAAC;CAC9B;AAED,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,SAAS,sBAAsB,EAAE,EAC5C,OAAO,EAAE,qBAAqB,GAC7B,SAAS,sBAAsB,EAAE,CAoBnC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { PDFPageProxy } from 'pdfjs-dist';
|
|
2
|
+
export type PageRotation = 0 | 90 | 180 | 270;
|
|
3
|
+
export interface PageRenderOptions {
|
|
4
|
+
/** CSS-pixel scale (1 = 100%). */
|
|
5
|
+
scale: number;
|
|
6
|
+
rotation: PageRotation;
|
|
7
|
+
/** Device-pixel-ratio multiplier applied to the raster canvas only. */
|
|
8
|
+
dpr: number;
|
|
9
|
+
}
|
|
10
|
+
export interface TextLayerOptions {
|
|
11
|
+
scale: number;
|
|
12
|
+
rotation: PageRotation;
|
|
13
|
+
}
|
|
14
|
+
export interface TextLayerInstance {
|
|
15
|
+
cancel(): void;
|
|
16
|
+
}
|
|
17
|
+
export interface PageProvider {
|
|
18
|
+
readonly intrinsicWidth: number;
|
|
19
|
+
readonly intrinsicHeight: number;
|
|
20
|
+
/**
|
|
21
|
+
* Rasterize this page into the given canvas. The provider sets the canvas's
|
|
22
|
+
* `width`/`height` (raster pixels) — the caller owns CSS sizing via `style`.
|
|
23
|
+
* Resolves when the raster lands; rejects with a cancel-typed error if a
|
|
24
|
+
* later call (or `cancel()`) preempts this one.
|
|
25
|
+
*/
|
|
26
|
+
render(canvas: HTMLCanvasElement, opts: PageRenderOptions): Promise<void>;
|
|
27
|
+
/** Cancel any in-flight `render()` or `getTextLayer()` for this page. */
|
|
28
|
+
cancel(): void;
|
|
29
|
+
/**
|
|
30
|
+
* Optional: populate `container` with positioned text spans for native
|
|
31
|
+
* selection + Ctrl+C copy. Provider owns clearing the container's previous
|
|
32
|
+
* contents before adding new spans.
|
|
33
|
+
*/
|
|
34
|
+
getTextLayer?(container: HTMLDivElement, opts: TextLayerOptions): Promise<TextLayerInstance>;
|
|
35
|
+
}
|
|
36
|
+
/** Common pdfjs cancel error names + the browser `AbortError`. */
|
|
37
|
+
export declare function isCancelError(err: unknown): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Wrap a pdfjs `PDFPageProxy` in a `PageProvider`. The provider holds the
|
|
40
|
+
* active `RenderTask`s (keyed by target canvas) + `TextLayer`.
|
|
41
|
+
*
|
|
42
|
+
* **Per-canvas render tracking** matters here because a single provider can
|
|
43
|
+
* be asked to render to multiple canvases concurrently — typically the main
|
|
44
|
+
* viewport's big canvas and the sidebar's thumbnail canvas, both bound to
|
|
45
|
+
* the same logical page. Cancelling globally on each `render()` call would
|
|
46
|
+
* leave the loser's canvas at the default opaque-black state of a
|
|
47
|
+
* `{ alpha: false }` 2D context. So we cancel only the prior render that
|
|
48
|
+
* targeted *this* canvas; renders to other canvases keep running.
|
|
49
|
+
*/
|
|
50
|
+
export declare function createPdfPageProvider(proxy: PDFPageProxy): PageProvider;
|
|
51
|
+
//# sourceMappingURL=page-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-provider.d.ts","sourceRoot":"","sources":["../../src/internal/page-provider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,MAAM,MAAM,YAAY,GAAG,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,GAAG,CAAC;AAE9C,MAAM,WAAW,iBAAiB;IAChC,kCAAkC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,YAAY,CAAC;IACvB,uEAAuE;IACvE,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,YAAY,CAAC;CACxB;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,IAAI,IAAI,CAAC;CAChB;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC;;;;;OAKG;IACH,MAAM,CAAC,MAAM,EAAE,iBAAiB,EAAE,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1E,yEAAyE;IACzE,MAAM,IAAI,IAAI,CAAC;IACf;;;;OAIG;IACH,YAAY,CAAC,CAAC,SAAS,EAAE,cAAc,EAAE,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;CAC9F;AAED,kEAAkE;AAClE,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAGnD;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,YAAY,GAAG,YAAY,CAkGvE"}
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import { ComputedRef, Ref } from 'vue';
|
|
2
|
+
import { PageEntry } from './usePageRenderer';
|
|
3
|
+
import { CoarPdfAnnotation, CoarPdfAnnotationCreatePayload, CoarPdfAnnotationMode, CoarPdfAnnotationUpdatePayload, CoarPdfPoint, CoarPdfRect } from '../types';
|
|
4
|
+
export interface DraftPin {
|
|
5
|
+
/** Page index the click landed on. */
|
|
6
|
+
pageIndex: number;
|
|
7
|
+
/** Anchor in normalised page coords. */
|
|
8
|
+
anchor: CoarPdfPoint;
|
|
9
|
+
/** Click position in viewport coords — used as the popover anchor. */
|
|
10
|
+
viewportRect: DOMRect;
|
|
11
|
+
/** Initial color (palette[0]). */
|
|
12
|
+
color: string;
|
|
13
|
+
}
|
|
14
|
+
export interface DraftFreetext {
|
|
15
|
+
pageIndex: number;
|
|
16
|
+
/** Rect in normalised page coords. */
|
|
17
|
+
rect: CoarPdfRect;
|
|
18
|
+
/** Popover anchor (viewport coords). */
|
|
19
|
+
viewportRect: DOMRect;
|
|
20
|
+
/** Initial color (palette[0]). */
|
|
21
|
+
color: string;
|
|
22
|
+
}
|
|
23
|
+
export interface DraftInk {
|
|
24
|
+
/** Which final annotation type this draft will commit as. */
|
|
25
|
+
kind: 'ink' | 'marker';
|
|
26
|
+
pageIndex: number;
|
|
27
|
+
/** Live strokes — each entry is a polyline of normalised points. */
|
|
28
|
+
strokes: CoarPdfPoint[][];
|
|
29
|
+
/** Stroke width in CSS pixels at zoom=1. */
|
|
30
|
+
width: number;
|
|
31
|
+
color: string;
|
|
32
|
+
/**
|
|
33
|
+
* When set, the draft will commit as an `annotation:update` that APPENDS
|
|
34
|
+
* its (sole) stroke to the named annotation's existing `strokes` array,
|
|
35
|
+
* instead of emitting a fresh `annotation:create`. Activated by holding
|
|
36
|
+
* Shift on pointerdown while a previous marker/ink annotation of the same
|
|
37
|
+
* kind exists on the same page.
|
|
38
|
+
*/
|
|
39
|
+
appendToId?: string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Snapshot taken at pointerdown when starting a translate-drag on an existing
|
|
43
|
+
* annotation in `'select'` mode. The wrapper rect lets us convert raw pointer
|
|
44
|
+
* delta into normalised page-space delta.
|
|
45
|
+
*/
|
|
46
|
+
export interface DraftMove {
|
|
47
|
+
id: string;
|
|
48
|
+
pageIndex: number;
|
|
49
|
+
/** Page wrapper dimensions in CSS pixels (used to normalise the delta). */
|
|
50
|
+
wrapperWidth: number;
|
|
51
|
+
wrapperHeight: number;
|
|
52
|
+
/** Pointer position at drag-start, viewport coords. */
|
|
53
|
+
startX: number;
|
|
54
|
+
startY: number;
|
|
55
|
+
/** Live normalised offset since drag-start; written into the rendered position. */
|
|
56
|
+
dx: number;
|
|
57
|
+
dy: number;
|
|
58
|
+
}
|
|
59
|
+
export interface UseAnnotationEditorOptions {
|
|
60
|
+
mode: ComputedRef<CoarPdfAnnotationMode>;
|
|
61
|
+
annotations: ComputedRef<readonly CoarPdfAnnotation[]>;
|
|
62
|
+
pages: {
|
|
63
|
+
value: readonly PageEntry[];
|
|
64
|
+
} | {
|
|
65
|
+
length: number;
|
|
66
|
+
[i: number]: PageEntry;
|
|
67
|
+
};
|
|
68
|
+
scrollContainer: Ref<HTMLElement | null>;
|
|
69
|
+
/** Palette — first entry is the default color for new annotations. */
|
|
70
|
+
colors: ComputedRef<readonly string[]>;
|
|
71
|
+
emitCreate: (payload: CoarPdfAnnotationCreatePayload) => void;
|
|
72
|
+
emitUpdate: (payload: CoarPdfAnnotationUpdatePayload) => void;
|
|
73
|
+
emitDelete: (id: string) => void;
|
|
74
|
+
}
|
|
75
|
+
/** Preset stroke widths for the in-toolbar thickness picker. */
|
|
76
|
+
export declare const INK_WIDTH_PRESETS: readonly [1.5, 3, 6];
|
|
77
|
+
export declare const MARKER_WIDTH_PRESETS: readonly [10, 18, 30];
|
|
78
|
+
export declare function useAnnotationEditor(opts: UseAnnotationEditorOptions): {
|
|
79
|
+
selectedAnnotationId: Ref<string | null, string | null>;
|
|
80
|
+
selectedAnnotation: ComputedRef<CoarPdfAnnotation | null>;
|
|
81
|
+
selectAnnotation: (id: string | null) => void;
|
|
82
|
+
draftPin: Ref<{
|
|
83
|
+
pageIndex: number;
|
|
84
|
+
anchor: {
|
|
85
|
+
x: number;
|
|
86
|
+
y: number;
|
|
87
|
+
};
|
|
88
|
+
viewportRect: {
|
|
89
|
+
height: number;
|
|
90
|
+
width: number;
|
|
91
|
+
x: number;
|
|
92
|
+
y: number;
|
|
93
|
+
readonly bottom: number;
|
|
94
|
+
readonly left: number;
|
|
95
|
+
readonly right: number;
|
|
96
|
+
readonly top: number;
|
|
97
|
+
toJSON: () => any;
|
|
98
|
+
};
|
|
99
|
+
color: string;
|
|
100
|
+
} | null, DraftPin | {
|
|
101
|
+
pageIndex: number;
|
|
102
|
+
anchor: {
|
|
103
|
+
x: number;
|
|
104
|
+
y: number;
|
|
105
|
+
};
|
|
106
|
+
viewportRect: {
|
|
107
|
+
height: number;
|
|
108
|
+
width: number;
|
|
109
|
+
x: number;
|
|
110
|
+
y: number;
|
|
111
|
+
readonly bottom: number;
|
|
112
|
+
readonly left: number;
|
|
113
|
+
readonly right: number;
|
|
114
|
+
readonly top: number;
|
|
115
|
+
toJSON: () => any;
|
|
116
|
+
};
|
|
117
|
+
color: string;
|
|
118
|
+
} | null>;
|
|
119
|
+
commitDraftPin: (comment: string, color: string) => void;
|
|
120
|
+
cancelDraftPin: () => void;
|
|
121
|
+
draftFreetext: Ref<{
|
|
122
|
+
pageIndex: number;
|
|
123
|
+
rect: {
|
|
124
|
+
x: number;
|
|
125
|
+
y: number;
|
|
126
|
+
w: number;
|
|
127
|
+
h: number;
|
|
128
|
+
};
|
|
129
|
+
viewportRect: {
|
|
130
|
+
height: number;
|
|
131
|
+
width: number;
|
|
132
|
+
x: number;
|
|
133
|
+
y: number;
|
|
134
|
+
readonly bottom: number;
|
|
135
|
+
readonly left: number;
|
|
136
|
+
readonly right: number;
|
|
137
|
+
readonly top: number;
|
|
138
|
+
toJSON: () => any;
|
|
139
|
+
};
|
|
140
|
+
color: string;
|
|
141
|
+
} | null, DraftFreetext | {
|
|
142
|
+
pageIndex: number;
|
|
143
|
+
rect: {
|
|
144
|
+
x: number;
|
|
145
|
+
y: number;
|
|
146
|
+
w: number;
|
|
147
|
+
h: number;
|
|
148
|
+
};
|
|
149
|
+
viewportRect: {
|
|
150
|
+
height: number;
|
|
151
|
+
width: number;
|
|
152
|
+
x: number;
|
|
153
|
+
y: number;
|
|
154
|
+
readonly bottom: number;
|
|
155
|
+
readonly left: number;
|
|
156
|
+
readonly right: number;
|
|
157
|
+
readonly top: number;
|
|
158
|
+
toJSON: () => any;
|
|
159
|
+
};
|
|
160
|
+
color: string;
|
|
161
|
+
} | null>;
|
|
162
|
+
commitDraftFreetext: (text: string, color: string) => void;
|
|
163
|
+
cancelDraftFreetext: () => void;
|
|
164
|
+
draftInk: Ref<{
|
|
165
|
+
kind: "ink" | "marker";
|
|
166
|
+
pageIndex: number;
|
|
167
|
+
strokes: {
|
|
168
|
+
x: number;
|
|
169
|
+
y: number;
|
|
170
|
+
}[][];
|
|
171
|
+
width: number;
|
|
172
|
+
color: string;
|
|
173
|
+
appendToId?: string | undefined;
|
|
174
|
+
} | null, DraftInk | {
|
|
175
|
+
kind: "ink" | "marker";
|
|
176
|
+
pageIndex: number;
|
|
177
|
+
strokes: {
|
|
178
|
+
x: number;
|
|
179
|
+
y: number;
|
|
180
|
+
}[][];
|
|
181
|
+
width: number;
|
|
182
|
+
color: string;
|
|
183
|
+
appendToId?: string | undefined;
|
|
184
|
+
} | null>;
|
|
185
|
+
draftMove: Ref<{
|
|
186
|
+
id: string;
|
|
187
|
+
pageIndex: number;
|
|
188
|
+
wrapperWidth: number;
|
|
189
|
+
wrapperHeight: number;
|
|
190
|
+
startX: number;
|
|
191
|
+
startY: number;
|
|
192
|
+
dx: number;
|
|
193
|
+
dy: number;
|
|
194
|
+
} | null, DraftMove | {
|
|
195
|
+
id: string;
|
|
196
|
+
pageIndex: number;
|
|
197
|
+
wrapperWidth: number;
|
|
198
|
+
wrapperHeight: number;
|
|
199
|
+
startX: number;
|
|
200
|
+
startY: number;
|
|
201
|
+
dx: number;
|
|
202
|
+
dy: number;
|
|
203
|
+
} | null>;
|
|
204
|
+
inkWidth: Ref<number, number>;
|
|
205
|
+
inkColor: Ref<string, string>;
|
|
206
|
+
markerWidth: Ref<number, number>;
|
|
207
|
+
markerColor: Ref<string, string>;
|
|
208
|
+
detach: () => void;
|
|
209
|
+
};
|
|
210
|
+
//# sourceMappingURL=useAnnotationEditor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAnnotationEditor.d.ts","sourceRoot":"","sources":["../../src/internal/useAnnotationEditor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAwB,KAAK,WAAW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;;;YASf,MAAM;mBACC,MAAM;sBAEH,MAAM;uBACL,MAAM;gBAEb,MAAM;gBACN,MAAM;YAEV,MAAM;YACN,MAAM;;YAVN,MAAM;mBACC,MAAM;sBAEH,MAAM;uBACL,MAAM;gBAEb,MAAM;gBACN,MAAM;YAEV,MAAM;YACN,MAAM;;;;;;;EA8fX"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ComputedRef, Ref, ShallowRef } from 'vue';
|
|
2
|
+
import { PDFDocumentProxy } from 'pdfjs-dist';
|
|
3
|
+
import { DocumentInfo, DocumentSource } from '../source-types';
|
|
4
|
+
import { PageProvider } from './page-provider';
|
|
5
|
+
import { DocumentStatus } from '../sources/pdf-adapter';
|
|
6
|
+
export type { DocumentStatus };
|
|
7
|
+
export interface DocumentLoaderReturn {
|
|
8
|
+
status: Ref<DocumentStatus>;
|
|
9
|
+
/** PDF-only escape hatch for sidebar + search. Null for image sources. */
|
|
10
|
+
pdfDoc: ShallowRef<PDFDocumentProxy | null>;
|
|
11
|
+
/** Source-agnostic page providers — fed to `usePageRenderer`. */
|
|
12
|
+
pageProviders: ShallowRef<PageProvider[] | null>;
|
|
13
|
+
/** Source-level metadata for the optional Info panel — null until `status === 'ready'`. */
|
|
14
|
+
info: ShallowRef<DocumentInfo | null>;
|
|
15
|
+
error: Ref<unknown>;
|
|
16
|
+
retry: () => void;
|
|
17
|
+
destroy: () => Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
export declare function useDocumentLoader(sourceRef: ComputedRef<DocumentSource | null>): DocumentLoaderReturn;
|
|
20
|
+
//# sourceMappingURL=useDocumentLoader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDocumentLoader.d.ts","sourceRoot":"","sources":["../../src/internal/useDocumentLoader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAY,KAAK,WAAW,EAAE,KAAK,GAAG,EAAE,KAAK,UAAU,EAAE,MAAM,KAAK,CAAC;AAC5E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,KAAK,EACV,YAAY,EACZ,cAAc,EAIf,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAyB,KAAK,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAIpF,YAAY,EAAE,cAAc,EAAE,CAAC;AAE/B,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;IAC5B,0EAA0E;IAC1E,MAAM,EAAE,UAAU,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;IAC5C,iEAAiE;IACjE,aAAa,EAAE,UAAU,CAAC,YAAY,EAAE,GAAG,IAAI,CAAC,CAAC;IACjD,2FAA2F;IAC3F,IAAI,EAAE,UAAU,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC;IACtC,KAAK,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IACpB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9B;AAED,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,WAAW,CAAC,cAAc,GAAG,IAAI,CAAC,GAC5C,oBAAoB,CA+EtB"}
|