@chialab/pdfjs-lib 1.0.0-alpha.24 → 1.0.0-alpha.26
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/browser/{chunk-W3YEFTNG.js → chunk-YWSFNHP3.js} +23 -5
- package/dist/browser/index.js +6775 -5170
- package/dist/browser/worker.js +460 -180
- package/dist/lib/Path2D.d.ts +8 -48
- package/dist/node/{NodeUtils-EDBNTTIR.js → NodeUtils-ZGLDDB6J.js} +2 -2
- package/dist/node/{chunk-ZKUTXCS2.js → chunk-AC5JE2E3.js} +1 -1
- package/dist/node/{chunk-K6VD27AD.js → chunk-GVC6TP3T.js} +4 -1
- package/dist/node/{chunk-XMKSLA4K.js → chunk-YDSKBMQ3.js} +23 -5
- package/dist/node/index.js +6776 -5174
- package/dist/node/worker.js +461 -181
- package/dist/pdf.js/src/display/annotation_layer.d.ts +9 -0
- package/dist/pdf.js/src/display/api.d.ts +43 -6
- package/dist/pdf.js/src/display/canvas.d.ts +82 -80
- package/dist/pdf.js/src/display/canvas_dependency_tracker.d.ts +144 -0
- package/dist/pdf.js/src/display/editor/annotation_editor_layer.d.ts +1 -1
- package/dist/pdf.js/src/display/editor/color_picker.d.ts +19 -0
- package/dist/pdf.js/src/display/editor/comment.d.ts +32 -0
- package/dist/pdf.js/src/display/editor/draw.d.ts +1 -1
- package/dist/pdf.js/src/display/editor/editor.d.ts +27 -2
- package/dist/pdf.js/src/display/editor/freetext.d.ts +7 -0
- package/dist/pdf.js/src/display/editor/highlight.d.ts +1 -0
- package/dist/pdf.js/src/display/editor/ink.d.ts +4 -0
- package/dist/pdf.js/src/display/editor/toolbar.d.ts +2 -1
- package/dist/pdf.js/src/display/editor/tools.d.ts +11 -3
- package/dist/pdf.js/src/pdf.d.ts +2 -1
- package/dist/pdf.js/src/shared/util.d.ts +6 -2
- package/dist/pdf.js/web/interfaces.d.ts +7 -0
- package/package.json +1 -1
|
@@ -22,6 +22,10 @@ export class InkEditor extends DrawingEditor {
|
|
|
22
22
|
static deserializeDraw(pageX: any, pageY: any, pageWidth: any, pageHeight: any, innerMargin: any, data: any): any;
|
|
23
23
|
defaultL10nId: string;
|
|
24
24
|
/** @inheritdoc */
|
|
25
|
+
get toolbarButtons(): (string | null)[][];
|
|
26
|
+
get colorType(): number;
|
|
27
|
+
get colorValue(): any;
|
|
28
|
+
/** @inheritdoc */
|
|
25
29
|
createDrawingOptions({ color, thickness, opacity }: {
|
|
26
30
|
color: any;
|
|
27
31
|
thickness: any;
|
|
@@ -8,6 +8,7 @@ export class EditorToolbar {
|
|
|
8
8
|
show(): void;
|
|
9
9
|
addDeleteButton(): void;
|
|
10
10
|
addAltText(altText: any): Promise<void>;
|
|
11
|
+
addComment(comment: any): void;
|
|
11
12
|
addColorPicker(colorPicker: any): void;
|
|
12
13
|
addEditSignatureButton(signatureManager: any): Promise<void>;
|
|
13
14
|
addButton(name: any, tool: any): Promise<void>;
|
|
@@ -15,7 +16,7 @@ export class EditorToolbar {
|
|
|
15
16
|
remove(): void;
|
|
16
17
|
#private;
|
|
17
18
|
}
|
|
18
|
-
export class
|
|
19
|
+
export class FloatingToolbar {
|
|
19
20
|
constructor(uiManager: any);
|
|
20
21
|
show(parent: any, boxes: any, isLTR: any): void;
|
|
21
22
|
hide(): void;
|
|
@@ -12,7 +12,7 @@ export class AnnotationEditorUIManager {
|
|
|
12
12
|
static TRANSLATE_SMALL: number;
|
|
13
13
|
static TRANSLATE_BIG: number;
|
|
14
14
|
static get _keyboardManager(): any;
|
|
15
|
-
constructor(container: any, viewer: any, viewerAlert: any, altTextManager: any, signatureManager: any, eventBus: any, pdfDocument: any, pageColors: any, highlightColors: any, enableHighlightFloatingButton: any, enableUpdatedAddImage: any, enableNewAltTextWhenAddingImage: any, mlManager: any, editorUndoBar: any, supportsPinchToZoom: any);
|
|
15
|
+
constructor(container: any, viewer: any, viewerAlert: any, altTextManager: any, commentManager: any, signatureManager: any, eventBus: any, pdfDocument: any, pageColors: any, highlightColors: any, enableHighlightFloatingButton: any, enableUpdatedAddImage: any, enableNewAltTextWhenAddingImage: any, mlManager: any, editorUndoBar: any, supportsPinchToZoom: any);
|
|
16
16
|
_editorUndoBar: null;
|
|
17
17
|
_signal: AbortSignal;
|
|
18
18
|
_eventBus: any;
|
|
@@ -29,8 +29,11 @@ export class AnnotationEditorUIManager {
|
|
|
29
29
|
get useNewAltTextWhenAddingImage(): boolean;
|
|
30
30
|
get hcmFilter(): any;
|
|
31
31
|
get direction(): any;
|
|
32
|
+
get _highlightColors(): any;
|
|
32
33
|
get highlightColors(): any;
|
|
33
34
|
get highlightColorNames(): any;
|
|
35
|
+
getNonHCMColor(color: any): any;
|
|
36
|
+
getNonHCMColorName(color: any): any;
|
|
34
37
|
/**
|
|
35
38
|
* Set the current drawing session.
|
|
36
39
|
* @param {AnnotationEditorLayer} layer
|
|
@@ -38,6 +41,8 @@ export class AnnotationEditorUIManager {
|
|
|
38
41
|
setCurrentDrawingSession(layer: AnnotationEditorLayer): void;
|
|
39
42
|
setMainHighlightColorPicker(colorPicker: any): void;
|
|
40
43
|
editAltText(editor: any, firstTime?: boolean): void;
|
|
44
|
+
hasCommentManager(): boolean;
|
|
45
|
+
editComment(editor: any, position: any): void;
|
|
41
46
|
getSignature(editor: any): void;
|
|
42
47
|
get signatureManager(): null;
|
|
43
48
|
switchToMode(mode: any, callback: any): void;
|
|
@@ -60,7 +65,8 @@ export class AnnotationEditorUIManager {
|
|
|
60
65
|
onRotationChanging({ pagesRotation }: {
|
|
61
66
|
pagesRotation: any;
|
|
62
67
|
}): void;
|
|
63
|
-
highlightSelection(methodOfCreation?: string): void;
|
|
68
|
+
highlightSelection(methodOfCreation?: string, comment?: boolean): void;
|
|
69
|
+
commentSelection(methodOfCreation?: string): void;
|
|
64
70
|
/**
|
|
65
71
|
* Add an editor in the annotation storage.
|
|
66
72
|
* @param {AnnotationEditor} editor
|
|
@@ -144,8 +150,10 @@ export class AnnotationEditorUIManager {
|
|
|
144
150
|
* keyboard action.
|
|
145
151
|
* @param {boolean} [mustEnterInEditMode] - true if the editor must enter in
|
|
146
152
|
* edit mode.
|
|
153
|
+
* @param {boolean} [editComment] - true if the mode change is due to a
|
|
154
|
+
* comment edit.
|
|
147
155
|
*/
|
|
148
|
-
updateMode(mode: number, editId?: string | null, isFromKeyboard?: boolean, mustEnterInEditMode?: boolean): Promise<void>;
|
|
156
|
+
updateMode(mode: number, editId?: string | null, isFromKeyboard?: boolean, mustEnterInEditMode?: boolean, editComment?: boolean): Promise<void>;
|
|
149
157
|
addNewEditorFromKeyboard(): void;
|
|
150
158
|
/**
|
|
151
159
|
* Update the toolbar if it's required to reflect the tool currently used.
|
package/dist/pdf.js/src/pdf.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ import { fetchData } from "./display/display_utils.js";
|
|
|
22
22
|
import { getDocument } from "./display/api.js";
|
|
23
23
|
import { getFilenameFromUrl } from "./display/display_utils.js";
|
|
24
24
|
import { getPdfFilenameFromUrl } from "./display/display_utils.js";
|
|
25
|
+
import { getRGB } from "./display/display_utils.js";
|
|
25
26
|
import { getUuid } from "./shared/util.js";
|
|
26
27
|
import { getXfaPageViewport } from "./display/display_utils.js";
|
|
27
28
|
import { GlobalWorkerOptions } from "./display/worker_options.js";
|
|
@@ -55,4 +56,4 @@ import { Util } from "./shared/util.js";
|
|
|
55
56
|
import { VerbosityLevel } from "./shared/util.js";
|
|
56
57
|
import { version } from "./display/api.js";
|
|
57
58
|
import { XfaLayer } from "./display/xfa_layer.js";
|
|
58
|
-
export { AbortException, AnnotationEditorLayer, AnnotationEditorParamsType, AnnotationEditorType, AnnotationEditorUIManager, AnnotationLayer, AnnotationMode, AnnotationType, build, ColorPicker, createValidAbsoluteUrl, DOMSVGFactory, DrawLayer, FeatureTest, fetchData, getDocument, getFilenameFromUrl, getPdfFilenameFromUrl, getUuid, getXfaPageViewport, GlobalWorkerOptions, ImageKind, InvalidPDFException, isDataScheme, isPdfFile, isValidExplicitDest, MathClamp, noContextMenu, normalizeUnicode, OPS, OutputScale, PasswordResponses, PDFDataRangeTransport, PDFDateString, PDFWorker, PermissionFlag, PixelsPerInch, RenderingCancelledException, ResponseException, setLayerDimensions, shadow, SignatureExtractor, stopEvent, SupportedImageMimeTypes, TextLayer, TouchManager, updateUrlHash, Util, VerbosityLevel, version, XfaLayer };
|
|
59
|
+
export { AbortException, AnnotationEditorLayer, AnnotationEditorParamsType, AnnotationEditorType, AnnotationEditorUIManager, AnnotationLayer, AnnotationMode, AnnotationType, build, ColorPicker, createValidAbsoluteUrl, DOMSVGFactory, DrawLayer, FeatureTest, fetchData, getDocument, getFilenameFromUrl, getPdfFilenameFromUrl, getRGB, getUuid, getXfaPageViewport, GlobalWorkerOptions, ImageKind, InvalidPDFException, isDataScheme, isPdfFile, isValidExplicitDest, MathClamp, noContextMenu, normalizeUnicode, OPS, OutputScale, PasswordResponses, PDFDataRangeTransport, PDFDateString, PDFWorker, PermissionFlag, PixelsPerInch, RenderingCancelledException, ResponseException, setLayerDimensions, shadow, SignatureExtractor, stopEvent, SupportedImageMimeTypes, TextLayer, TouchManager, updateUrlHash, Util, VerbosityLevel, version, XfaLayer };
|
|
@@ -40,7 +40,6 @@ export namespace AnnotationEditorParamsType {
|
|
|
40
40
|
let INK_THICKNESS: number;
|
|
41
41
|
let INK_OPACITY: number;
|
|
42
42
|
let HIGHLIGHT_COLOR: number;
|
|
43
|
-
let HIGHLIGHT_DEFAULT_COLOR: number;
|
|
44
43
|
let HIGHLIGHT_THICKNESS: number;
|
|
45
44
|
let HIGHLIGHT_FREE: number;
|
|
46
45
|
let HIGHLIGHT_SHOW_ALL: number;
|
|
@@ -54,7 +53,9 @@ export namespace AnnotationEditorType {
|
|
|
54
53
|
let HIGHLIGHT: number;
|
|
55
54
|
let STAMP: number;
|
|
56
55
|
let INK: number;
|
|
56
|
+
let POPUP: number;
|
|
57
57
|
let SIGNATURE: number;
|
|
58
|
+
let COMMENT: number;
|
|
58
59
|
}
|
|
59
60
|
export namespace AnnotationFieldFlag {
|
|
60
61
|
let READONLY: number;
|
|
@@ -123,7 +124,8 @@ export namespace AnnotationType {
|
|
|
123
124
|
export let CARET: number;
|
|
124
125
|
let INK_1: number;
|
|
125
126
|
export { INK_1 as INK };
|
|
126
|
-
|
|
127
|
+
let POPUP_1: number;
|
|
128
|
+
export { POPUP_1 as POPUP };
|
|
127
129
|
export let FILEATTACHMENT: number;
|
|
128
130
|
export let SOUND: number;
|
|
129
131
|
export let MOVIE: number;
|
|
@@ -386,8 +388,10 @@ export function updateUrlHash(url: URL | string, hash: string, allowRel?: boolea
|
|
|
386
388
|
export function utf8StringToString(str: any): string;
|
|
387
389
|
export class Util {
|
|
388
390
|
static makeHexColor(r: any, g: any, b: any): string;
|
|
391
|
+
static domMatrixToTransform(dm: any): any[];
|
|
389
392
|
static scaleMinMax(transform: any, minMax: any): void;
|
|
390
393
|
static transform(m1: any, m2: any): any[];
|
|
394
|
+
static multiplyByDOMMatrix(m: any, md: any): any[];
|
|
391
395
|
static applyTransform(p: any, m: any, pos?: number): void;
|
|
392
396
|
static applyTransformToBezier(p: any, transform: any, pos?: number): void;
|
|
393
397
|
static applyInverseTransform(p: any, m: any): void;
|
|
@@ -109,6 +109,13 @@ export class IPDFLinkService {
|
|
|
109
109
|
* @param {number|string} val - The page number, or page label.
|
|
110
110
|
*/
|
|
111
111
|
goToPage(val: number | string): void;
|
|
112
|
+
/**
|
|
113
|
+
* Scrolls to a specific location in the PDF document.
|
|
114
|
+
* @param {number} pageNumber - The page number to scroll to.
|
|
115
|
+
* @param {number} x - The x-coordinate to scroll to in page coordinates.
|
|
116
|
+
* @param {number} y - The y-coordinate to scroll to in page coordinates.
|
|
117
|
+
*/
|
|
118
|
+
goToXY(pageNumber: number, x: number, y: number): void;
|
|
112
119
|
/**
|
|
113
120
|
* @param {HTMLAnchorElement} link
|
|
114
121
|
* @param {string} url
|
package/package.json
CHANGED