@shznet/pdf-sign-react 0.1.0 → 0.2.1
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/README.md +17 -9
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18499 -0
- package/dist/lib/pdf-sign-react.d.ts +67 -0
- package/dist/lib/pdf-sign-react.d.ts.map +1 -0
- package/package.json +16 -3
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { PdfSignControl, PdfSignControlOptions, ViewMode, SignatureField } from '@shznet/pdf-sign-control';
|
|
2
|
+
export interface PdfSignReactRef {
|
|
3
|
+
/** Get the underlying PdfSignControl instance */
|
|
4
|
+
getControl(): PdfSignControl | null;
|
|
5
|
+
/** Load a PDF from URL or ArrayBuffer */
|
|
6
|
+
load(source: string | Uint8Array | ArrayBuffer): Promise<void>;
|
|
7
|
+
/** Navigate to specific page */
|
|
8
|
+
goToPage(page: number): void;
|
|
9
|
+
/** Go to next page */
|
|
10
|
+
nextPage(): void;
|
|
11
|
+
/** Go to previous page */
|
|
12
|
+
previousPage(): void;
|
|
13
|
+
/** Get current page number */
|
|
14
|
+
getCurrentPage(): number;
|
|
15
|
+
/** Get total pages */
|
|
16
|
+
getTotalPages(): number;
|
|
17
|
+
/** Set zoom scale */
|
|
18
|
+
setScale(scale: number): void;
|
|
19
|
+
/** Get current zoom scale */
|
|
20
|
+
getScale(): number;
|
|
21
|
+
/** Set view mode */
|
|
22
|
+
setViewMode(mode: ViewMode): Promise<void>;
|
|
23
|
+
/** Get current view mode */
|
|
24
|
+
getViewMode(): ViewMode;
|
|
25
|
+
}
|
|
26
|
+
export interface PdfSignReactProps {
|
|
27
|
+
/** PDF source URL or ArrayBuffer - auto-loads when provided */
|
|
28
|
+
src?: string | Uint8Array | ArrayBuffer;
|
|
29
|
+
/** Initial view mode: 'scroll' or 'single' */
|
|
30
|
+
viewMode?: ViewMode;
|
|
31
|
+
/** Enable gesture zoom (Ctrl+scroll, pinch) - default: true */
|
|
32
|
+
zoomable?: boolean;
|
|
33
|
+
/** PDF.js loader options */
|
|
34
|
+
pdfLoaderOptions?: PdfSignControlOptions['pdfLoaderOptions'];
|
|
35
|
+
/** CSS class name */
|
|
36
|
+
className?: string;
|
|
37
|
+
/** Inline styles */
|
|
38
|
+
style?: React.CSSProperties;
|
|
39
|
+
/** Callback when control is ready */
|
|
40
|
+
onReady?: (control: PdfSignControl) => void;
|
|
41
|
+
/** Callback when PDF is loaded */
|
|
42
|
+
onLoad?: () => void;
|
|
43
|
+
/** Callback when page changes */
|
|
44
|
+
onPageChange?: (page: number, total: number) => void;
|
|
45
|
+
/** Callback when scale changes */
|
|
46
|
+
onScaleChange?: (scale: number) => void;
|
|
47
|
+
/** Callback on error */
|
|
48
|
+
onError?: (error: Error) => void;
|
|
49
|
+
/** Initial fields */
|
|
50
|
+
fields?: SignatureField[];
|
|
51
|
+
/** Callback when a field is added */
|
|
52
|
+
onFieldAdd?: (field: SignatureField) => void;
|
|
53
|
+
/** Callback when a field is removed */
|
|
54
|
+
onFieldRemove?: (data: {
|
|
55
|
+
fieldId: string;
|
|
56
|
+
}) => void;
|
|
57
|
+
/** Callback when a field is updated */
|
|
58
|
+
onFieldUpdate?: (data: {
|
|
59
|
+
fieldId: string;
|
|
60
|
+
updates: Partial<SignatureField>;
|
|
61
|
+
}) => void;
|
|
62
|
+
/** Callback when any field changes (add/remove/update) */
|
|
63
|
+
onFieldsChange?: (fields: SignatureField[]) => void;
|
|
64
|
+
}
|
|
65
|
+
export declare const PdfSignReact: import('react').ForwardRefExoticComponent<PdfSignReactProps & import('react').RefAttributes<PdfSignReactRef>>;
|
|
66
|
+
export type { ViewMode } from '@shznet/pdf-sign-control';
|
|
67
|
+
//# sourceMappingURL=pdf-sign-react.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pdf-sign-react.d.ts","sourceRoot":"","sources":["../../src/lib/pdf-sign-react.tsx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,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;IAC5C,kCAAkC;IAClC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,iCAAiC;IACjC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACrD,kCAAkC;IAClC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,wBAAwB;IACxB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAEjC,qBAAqB;IACrB,MAAM,CAAC,EAAE,cAAc,EAAE,CAAC;IAE1B,qCAAqC;IACrC,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IAC7C,uCAAuC;IACvC,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IACpD,uCAAuC;IACvC,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAC,cAAc,CAAC,CAAA;KAAE,KAAK,IAAI,CAAC;IACtF,0DAA0D;IAC1D,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,cAAc,EAAE,KAAK,IAAI,CAAC;CACrD;AAED,eAAO,MAAM,YAAY,+GA+FvB,CAAC;AAGH,YAAY,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shznet/pdf-sign-react",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
|
+
"description": "React wrapper for @shznet/pdf-sign-control",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/ShzNet/pdf-signature-control.git"
|
|
9
|
+
},
|
|
10
|
+
"author": "Chien Tran <chientranit@gmail.com>",
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/ShzNet/pdf-signature-control/issues"
|
|
13
|
+
},
|
|
14
|
+
"homepage": "https://github.com/ShzNet/pdf-signature-control#readme",
|
|
4
15
|
"type": "module",
|
|
5
16
|
"main": "./dist/index.js",
|
|
6
17
|
"module": "./dist/index.js",
|
|
@@ -21,9 +32,11 @@
|
|
|
21
32
|
"publishConfig": {
|
|
22
33
|
"access": "public"
|
|
23
34
|
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"@shznet/pdf-sign-control": "*"
|
|
37
|
+
},
|
|
24
38
|
"peerDependencies": {
|
|
25
39
|
"react": ">=16.8.0",
|
|
26
|
-
"react-dom": ">=16.8.0"
|
|
27
|
-
"@shznet/pdf-sign-control": "*"
|
|
40
|
+
"react-dom": ">=16.8.0"
|
|
28
41
|
}
|
|
29
42
|
}
|