kviewer 0.2.4 → 0.3.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 +13 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +9 -0
- package/dist/runtime/annotation/engine/config.d.ts +1 -0
- package/dist/runtime/annotation/engine/config.js +4 -0
- package/dist/runtime/annotation/engine/cursor-preview.d.ts +14 -1
- package/dist/runtime/annotation/engine/cursor-preview.js +32 -6
- package/dist/runtime/annotation/engine/editor/editor.d.ts +17 -0
- package/dist/runtime/annotation/engine/editor/editor.js +44 -15
- package/dist/runtime/annotation/engine/tools/signature.js +30 -5
- package/dist/runtime/annotation/engine/tools/stamp.d.ts +9 -0
- package/dist/runtime/annotation/engine/tools/stamp.js +67 -15
- package/dist/runtime/annotation/engine/types.d.ts +25 -0
- package/dist/runtime/annotation/engine/utils.d.ts +1 -4
- package/dist/runtime/annotation/engine/utils.js +1 -10
- package/dist/runtime/annotation/pdf-export/export.js +0 -3
- package/dist/runtime/annotation/utils/placement_size.d.ts +27 -0
- package/dist/runtime/annotation/utils/placement_size.js +26 -0
- package/dist/runtime/annotation/utils/signature_image.d.ts +26 -0
- package/dist/runtime/annotation/utils/signature_image.js +20 -0
- package/dist/runtime/assets/kviewer.css +1 -1
- package/dist/runtime/components/FormFieldLayer.vue +6 -1
- package/dist/runtime/components/Viewer.d.vue.ts +56 -2
- package/dist/runtime/components/Viewer.vue +68 -2
- package/dist/runtime/components/Viewer.vue.d.ts +56 -2
- package/dist/runtime/components/ViewerTabs.d.vue.ts +29 -9
- package/dist/runtime/components/ViewerTabs.vue +10 -2
- package/dist/runtime/components/ViewerTabs.vue.d.ts +29 -9
- package/dist/runtime/components/form-fields/FormFieldWrapper.vue +4 -2
- package/dist/runtime/components/form-fields/FormSignatureField.vue +15 -2
- package/dist/runtime/components/modals/FreeTextModal.vue +1 -1
- package/dist/runtime/components/modals/SignatureDrawModal.vue +170 -4
- package/dist/runtime/components/tools/ToolProperties.vue +98 -101
- package/dist/runtime/composables/useFormFields.d.ts +17 -1
- package/dist/runtime/composables/useFormFields.js +48 -9
- package/dist/runtime/composables/useViewerSearch.js +1 -1
- package/dist/runtime/composables/useViewerState.d.ts +1 -0
- package/dist/runtime/composables/useViewerState.js +12 -13
- package/dist/runtime/embed/bridge-client.d.ts +19 -3
- package/dist/runtime/embed/bridge-client.js +24 -0
- package/dist/runtime/embed/bridge-host.d.ts +10 -1
- package/dist/runtime/embed/bridge-host.js +20 -0
- package/dist/runtime/embed/protocol.d.ts +28 -1
- package/dist/runtime/i18n/messages.d.ts +16 -2
- package/dist/runtime/i18n/messages.js +16 -2
- package/dist/runtime/public-types.d.ts +1 -1
- package/dist/runtime/toolbar-tools.d.ts +1 -1
- package/dist/runtime/toolbar-tools.js +8 -0
- package/package.json +18 -18
|
@@ -73,6 +73,7 @@ export function provideViewerState() {
|
|
|
73
73
|
const visualZoom = ref(1);
|
|
74
74
|
const stylusMode = ref(false);
|
|
75
75
|
const formEditMode = ref(false);
|
|
76
|
+
const clickToSign = ref(false);
|
|
76
77
|
function isFormFieldTool(t) {
|
|
77
78
|
return typeof t === "number" && (t === AnnotationType.FORM_TEXT || t === AnnotationType.FORM_CHECKBOX || t === AnnotationType.FORM_RADIO || t === AnnotationType.FORM_SIGNATURE);
|
|
78
79
|
}
|
|
@@ -96,28 +97,25 @@ export function provideViewerState() {
|
|
|
96
97
|
const activeStamp = ref(null);
|
|
97
98
|
const signatures = ref([]);
|
|
98
99
|
const activeSignature = ref(null);
|
|
99
|
-
|
|
100
|
+
const _signatureHandlers = shallowRef(null);
|
|
100
101
|
async function loadSignatures() {
|
|
101
|
-
if (!_signatureHandlers) return;
|
|
102
|
-
signatures.value = await _signatureHandlers.onLoad();
|
|
102
|
+
if (!_signatureHandlers.value) return;
|
|
103
|
+
signatures.value = await _signatureHandlers.value.onLoad();
|
|
103
104
|
}
|
|
104
105
|
async function saveSignature(imageUrl) {
|
|
105
|
-
if (!_signatureHandlers) return null;
|
|
106
|
-
const sig = await _signatureHandlers.onSave(imageUrl);
|
|
106
|
+
if (!_signatureHandlers.value) return null;
|
|
107
|
+
const sig = await _signatureHandlers.value.onSave(imageUrl);
|
|
107
108
|
signatures.value = [...signatures.value, sig];
|
|
108
109
|
return sig;
|
|
109
110
|
}
|
|
110
111
|
async function deleteSignature(id) {
|
|
111
|
-
if (!_signatureHandlers) return;
|
|
112
|
-
await _signatureHandlers.onDelete(id);
|
|
112
|
+
if (!_signatureHandlers.value) return;
|
|
113
|
+
await _signatureHandlers.value.onDelete(id);
|
|
113
114
|
signatures.value = signatures.value.filter((s) => s.id !== id);
|
|
114
115
|
if (activeSignature.value?.id === id) activeSignature.value = null;
|
|
115
116
|
}
|
|
116
117
|
function selectTool(tool, dataTransfer) {
|
|
117
118
|
if (readonly.value && tool !== "hand") return;
|
|
118
|
-
if (isFormFieldTool(tool) && !formEditMode.value) {
|
|
119
|
-
formEditMode.value = true;
|
|
120
|
-
}
|
|
121
119
|
activeTool.value = tool;
|
|
122
120
|
selectedAnnotation.value = null;
|
|
123
121
|
selectedAnnotations.value = [];
|
|
@@ -187,10 +185,10 @@ export function provideViewerState() {
|
|
|
187
185
|
signatures,
|
|
188
186
|
activeSignature,
|
|
189
187
|
get signatureHandlers() {
|
|
190
|
-
return _signatureHandlers;
|
|
188
|
+
return _signatureHandlers.value;
|
|
191
189
|
},
|
|
192
190
|
set signatureHandlers(v) {
|
|
193
|
-
_signatureHandlers = v;
|
|
191
|
+
_signatureHandlers.value = v;
|
|
194
192
|
},
|
|
195
193
|
loadSignatures,
|
|
196
194
|
saveSignature,
|
|
@@ -207,7 +205,8 @@ export function provideViewerState() {
|
|
|
207
205
|
shapeDetection: shapeDetectionEnabled,
|
|
208
206
|
visualZoom,
|
|
209
207
|
formEditMode,
|
|
210
|
-
setFormEditMode
|
|
208
|
+
setFormEditMode,
|
|
209
|
+
clickToSign
|
|
211
210
|
};
|
|
212
211
|
provide(VIEWER_STATE_KEY, state);
|
|
213
212
|
return {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ExportPdfOptions } from '../annotation/pdf-export/export.js';
|
|
2
|
-
import type { AddFormFieldPayload, FormFieldDefinition, FormFieldValue, IAnnotationStore } from '../annotation/engine/types.js';
|
|
2
|
+
import type { AddFormFieldPayload, FormFieldDefinition, FormFieldValue, IAnnotationStore, PlacedFieldDefaults, SignatureFieldStatus } from '../annotation/engine/types.js';
|
|
3
3
|
import { type EventName, type EventPayloads, type ImportAnnotationsMode } from './protocol.js';
|
|
4
4
|
export interface KViewerEmbedClientOptions {
|
|
5
5
|
/**
|
|
@@ -20,8 +20,8 @@ type EventHandler<E extends EventName> = (payload: EventPayloads[E]) => void;
|
|
|
20
20
|
* Parent-page client that drives a `<KViewer>` instance running inside
|
|
21
21
|
* an iframe. Wraps `postMessage` into a Promise-based RPC mirroring the
|
|
22
22
|
* viewer's exposed methods, and surfaces iframe-emitted events
|
|
23
|
-
* (`ready`, `formEditMode-changed`, `viewedPages-changed`, `all-pages-read
|
|
24
|
-
* via `on()`.
|
|
23
|
+
* (`ready`, `formEditMode-changed`, `viewedPages-changed`, `all-pages-read`,
|
|
24
|
+
* `field-placed`, `signedStatus-changed`) via `on()`.
|
|
25
25
|
*/
|
|
26
26
|
export declare class KViewerEmbedClient {
|
|
27
27
|
private readonly iframe;
|
|
@@ -50,6 +50,22 @@ export declare class KViewerEmbedClient {
|
|
|
50
50
|
updateFormField(id: string, patch: Partial<FormFieldDefinition>): Promise<void>;
|
|
51
51
|
removeFormField(id: string): Promise<void>;
|
|
52
52
|
getFormFields(): Promise<FormFieldDefinition[]>;
|
|
53
|
+
/** Replace the per-field-type presets applied when the user places a
|
|
54
|
+
* field via the placement tools. Subscribe to `on('field-placed', …)`
|
|
55
|
+
* for per-field follow-ups (e.g. renaming). */
|
|
56
|
+
setFieldDefaults(defaults: PlacedFieldDefaults): Promise<void>;
|
|
57
|
+
/** Enable/disable kviewer's built-in click-to-sign flow on signature
|
|
58
|
+
* fields. Off by default — fields render as passive markers so the
|
|
59
|
+
* host's own signing process stays the only entry point. */
|
|
60
|
+
setClickToSign(enabled: boolean): Promise<void>;
|
|
61
|
+
/** True once every signature field is signed (in-session value or a
|
|
62
|
+
* digital signature already in the source PDF). Vacuously true with
|
|
63
|
+
* zero signature fields. Use to gate e.g. envelope finalization; for
|
|
64
|
+
* a push-style signal subscribe via `on('signedStatus-changed', …)`. */
|
|
65
|
+
getSignedStatus(): Promise<boolean>;
|
|
66
|
+
/** Per-widget signed-state snapshot (id, fieldName, pageNumber,
|
|
67
|
+
* signed, roleId). */
|
|
68
|
+
getSignatureFieldStatus(): Promise<SignatureFieldStatus[]>;
|
|
53
69
|
getFormEditMode(): Promise<boolean>;
|
|
54
70
|
setFormEditMode(enabled: boolean): Promise<void>;
|
|
55
71
|
toggleFormEditMode(): Promise<boolean>;
|
|
@@ -78,6 +78,30 @@ export class KViewerEmbedClient {
|
|
|
78
78
|
getFormFields() {
|
|
79
79
|
return this.call("getFormFields");
|
|
80
80
|
}
|
|
81
|
+
/** Replace the per-field-type presets applied when the user places a
|
|
82
|
+
* field via the placement tools. Subscribe to `on('field-placed', …)`
|
|
83
|
+
* for per-field follow-ups (e.g. renaming). */
|
|
84
|
+
setFieldDefaults(defaults) {
|
|
85
|
+
return this.call("setFieldDefaults", defaults);
|
|
86
|
+
}
|
|
87
|
+
/** Enable/disable kviewer's built-in click-to-sign flow on signature
|
|
88
|
+
* fields. Off by default — fields render as passive markers so the
|
|
89
|
+
* host's own signing process stays the only entry point. */
|
|
90
|
+
setClickToSign(enabled) {
|
|
91
|
+
return this.call("setClickToSign", enabled);
|
|
92
|
+
}
|
|
93
|
+
/** True once every signature field is signed (in-session value or a
|
|
94
|
+
* digital signature already in the source PDF). Vacuously true with
|
|
95
|
+
* zero signature fields. Use to gate e.g. envelope finalization; for
|
|
96
|
+
* a push-style signal subscribe via `on('signedStatus-changed', …)`. */
|
|
97
|
+
getSignedStatus() {
|
|
98
|
+
return this.call("getSignedStatus");
|
|
99
|
+
}
|
|
100
|
+
/** Per-widget signed-state snapshot (id, fieldName, pageNumber,
|
|
101
|
+
* signed, roleId). */
|
|
102
|
+
getSignatureFieldStatus() {
|
|
103
|
+
return this.call("getSignatureFieldStatus");
|
|
104
|
+
}
|
|
81
105
|
getFormEditMode() {
|
|
82
106
|
return this.call("getFormEditMode");
|
|
83
107
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Ref } from 'vue';
|
|
2
2
|
import type { ExportPdfOptions } from '../annotation/pdf-export/export.js';
|
|
3
|
-
import type { AddFormFieldPayload, FormFieldDefinition, FormFieldValue, IAnnotationStore } from '../annotation/engine/types.js';
|
|
3
|
+
import type { AddFormFieldPayload, FormFieldDefinition, FormFieldValue, IAnnotationStore, PlacedFieldDefaults, SignatureFieldStatus } from '../annotation/engine/types.js';
|
|
4
4
|
import { type MethodName } from './protocol.js';
|
|
5
5
|
/**
|
|
6
6
|
* Surface the bridge calls on the KViewer template ref. Mirrors the
|
|
@@ -23,6 +23,15 @@ export interface KViewerApi {
|
|
|
23
23
|
updateFormField: (id: string, patch: Partial<FormFieldDefinition>) => void;
|
|
24
24
|
removeFormField: (id: string) => void;
|
|
25
25
|
getFormFields: () => FormFieldDefinition[];
|
|
26
|
+
setFieldDefaults: (defaults: PlacedFieldDefaults) => void;
|
|
27
|
+
setClickToSign: (enabled: boolean) => void;
|
|
28
|
+
onFieldPlaced: (cb: (field: FormFieldDefinition) => void) => () => void;
|
|
29
|
+
getSignedStatus: () => boolean;
|
|
30
|
+
getSignatureFieldStatus: () => SignatureFieldStatus[];
|
|
31
|
+
onSignedStatusChanged: (cb: (payload: {
|
|
32
|
+
allSigned: boolean;
|
|
33
|
+
fields: SignatureFieldStatus[];
|
|
34
|
+
}) => void) => () => void;
|
|
26
35
|
formEditMode: Ref<boolean>;
|
|
27
36
|
setFormEditMode: (enabled: boolean) => void;
|
|
28
37
|
toggleFormEditMode: () => boolean;
|
|
@@ -66,6 +66,20 @@ export function useKViewerEmbedBridge(viewerRef, options) {
|
|
|
66
66
|
}
|
|
67
67
|
case "getFormFields":
|
|
68
68
|
return viewer.getFormFields();
|
|
69
|
+
case "setFieldDefaults": {
|
|
70
|
+
const [defaults] = req.args;
|
|
71
|
+
viewer.setFieldDefaults(defaults);
|
|
72
|
+
return void 0;
|
|
73
|
+
}
|
|
74
|
+
case "setClickToSign": {
|
|
75
|
+
const [enabled] = req.args;
|
|
76
|
+
viewer.setClickToSign(enabled);
|
|
77
|
+
return void 0;
|
|
78
|
+
}
|
|
79
|
+
case "getSignedStatus":
|
|
80
|
+
return viewer.getSignedStatus();
|
|
81
|
+
case "getSignatureFieldStatus":
|
|
82
|
+
return viewer.getSignatureFieldStatus();
|
|
69
83
|
case "getFormEditMode":
|
|
70
84
|
return viewer.formEditMode.value;
|
|
71
85
|
case "setFormEditMode": {
|
|
@@ -130,6 +144,12 @@ export function useKViewerEmbedBridge(viewerRef, options) {
|
|
|
130
144
|
viewer.formEditMode,
|
|
131
145
|
(enabled) => postEvent("formEditMode-changed", { enabled })
|
|
132
146
|
),
|
|
147
|
+
viewer.onFieldPlaced(
|
|
148
|
+
(field) => postEvent("field-placed", { field })
|
|
149
|
+
),
|
|
150
|
+
viewer.onSignedStatusChanged(
|
|
151
|
+
(payload) => postEvent("signedStatus-changed", payload)
|
|
152
|
+
),
|
|
133
153
|
// Read-tracking. The getters touch the viewer's reactive viewed-pages
|
|
134
154
|
// state, so watch re-runs them whenever a page is viewed or tracking
|
|
135
155
|
// is reset.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ExportPdfOptions } from '../annotation/pdf-export/export.js';
|
|
2
|
-
import type { AddFormFieldPayload, FormFieldDefinition, FormFieldValue, IAnnotationStore } from '../annotation/engine/types.js';
|
|
2
|
+
import type { AddFormFieldPayload, FormFieldDefinition, FormFieldValue, IAnnotationStore, PlacedFieldDefaults, SignatureFieldStatus } from '../annotation/engine/types.js';
|
|
3
3
|
export declare const KVIEWER_EMBED_PROTOCOL_VERSION = 1;
|
|
4
4
|
export declare const REQUEST_KIND: "kviewer:request";
|
|
5
5
|
export declare const RESPONSE_KIND: "kviewer:response";
|
|
@@ -47,6 +47,22 @@ export interface MethodSignatures {
|
|
|
47
47
|
args: [];
|
|
48
48
|
result: FormFieldDefinition[];
|
|
49
49
|
};
|
|
50
|
+
setFieldDefaults: {
|
|
51
|
+
args: [defaults: PlacedFieldDefaults];
|
|
52
|
+
result: undefined;
|
|
53
|
+
};
|
|
54
|
+
setClickToSign: {
|
|
55
|
+
args: [enabled: boolean];
|
|
56
|
+
result: undefined;
|
|
57
|
+
};
|
|
58
|
+
getSignedStatus: {
|
|
59
|
+
args: [];
|
|
60
|
+
result: boolean;
|
|
61
|
+
};
|
|
62
|
+
getSignatureFieldStatus: {
|
|
63
|
+
args: [];
|
|
64
|
+
result: SignatureFieldStatus[];
|
|
65
|
+
};
|
|
50
66
|
getFormEditMode: {
|
|
51
67
|
args: [];
|
|
52
68
|
result: boolean;
|
|
@@ -112,6 +128,17 @@ export interface EventPayloads {
|
|
|
112
128
|
/** Fires once when the final unseen page is viewed. Re-arms after
|
|
113
129
|
* `resetViewedPages()` or a new document. */
|
|
114
130
|
'all-pages-read': Record<string, never>;
|
|
131
|
+
/** The user placed a form field via a placement tool. Patch it with
|
|
132
|
+
* `updateFormField()` to set host-driven properties. */
|
|
133
|
+
'field-placed': {
|
|
134
|
+
field: FormFieldDefinition;
|
|
135
|
+
};
|
|
136
|
+
/** A signature field's signed state changed (signed, cleared, added,
|
|
137
|
+
* removed, or renamed). Push-style counterpart to `getSignedStatus()`. */
|
|
138
|
+
'signedStatus-changed': {
|
|
139
|
+
allSigned: boolean;
|
|
140
|
+
fields: SignatureFieldStatus[];
|
|
141
|
+
};
|
|
115
142
|
}
|
|
116
143
|
export type EventName = keyof EventPayloads;
|
|
117
144
|
export interface EventMessage<E extends EventName = EventName> {
|
|
@@ -23,7 +23,6 @@ export declare const messages: {
|
|
|
23
23
|
readonly strokeWidth: "Stroke width";
|
|
24
24
|
readonly decreaseStrokeWidth: "Decrease stroke width";
|
|
25
25
|
readonly increaseStrokeWidth: "Increase stroke width";
|
|
26
|
-
readonly noProperties: "No properties";
|
|
27
26
|
readonly detectFormFields: "Detect form fields";
|
|
28
27
|
readonly disableFormFieldDetection: "Disable form field detection";
|
|
29
28
|
readonly fitWidth: "Fit width";
|
|
@@ -42,6 +41,14 @@ export declare const messages: {
|
|
|
42
41
|
readonly freeText: "Free text";
|
|
43
42
|
readonly startTyping: "Start typing...";
|
|
44
43
|
readonly drawSignature: "Draw signature";
|
|
44
|
+
readonly uploadSignature: "Upload";
|
|
45
|
+
readonly dropSignatureImage: "Drop an image here or click to choose";
|
|
46
|
+
readonly chooseImage: "Choose image";
|
|
47
|
+
readonly removeWhiteBackground: "Remove white background";
|
|
48
|
+
readonly unsupportedImageType: "Unsupported file type. Allowed: {accept}";
|
|
49
|
+
readonly imageTooLarge: "Image is too large. Maximum {size} MB";
|
|
50
|
+
readonly imageReadFailed: "Could not read that image";
|
|
51
|
+
readonly backgroundRemovalFailed: "Background could not be removed for this image";
|
|
45
52
|
readonly noSavedSignatures: "No saved signatures";
|
|
46
53
|
readonly addSignature: "Add signature";
|
|
47
54
|
readonly selectedCount: "{count} selected";
|
|
@@ -142,7 +149,6 @@ export declare const messages: {
|
|
|
142
149
|
readonly strokeWidth: "Linienstärke";
|
|
143
150
|
readonly decreaseStrokeWidth: "Linienstärke verringern";
|
|
144
151
|
readonly increaseStrokeWidth: "Linienstärke erhöhen";
|
|
145
|
-
readonly noProperties: "Keine Eigenschaften";
|
|
146
152
|
readonly detectFormFields: "Formularfelder erkennen";
|
|
147
153
|
readonly disableFormFieldDetection: "Formularfeld-Erkennung deaktivieren";
|
|
148
154
|
readonly fitWidth: "Seitenbreite";
|
|
@@ -161,6 +167,14 @@ export declare const messages: {
|
|
|
161
167
|
readonly freeText: "Freitext";
|
|
162
168
|
readonly startTyping: "Text eingeben...";
|
|
163
169
|
readonly drawSignature: "Unterschrift zeichnen";
|
|
170
|
+
readonly uploadSignature: "Hochladen";
|
|
171
|
+
readonly dropSignatureImage: "Bild hierher ziehen oder klicken zum Auswählen";
|
|
172
|
+
readonly chooseImage: "Bild auswählen";
|
|
173
|
+
readonly removeWhiteBackground: "Weißen Hintergrund entfernen";
|
|
174
|
+
readonly unsupportedImageType: "Dateityp nicht unterstützt. Erlaubt: {accept}";
|
|
175
|
+
readonly imageTooLarge: "Bild ist zu groß. Maximal {size} MB";
|
|
176
|
+
readonly imageReadFailed: "Bild konnte nicht gelesen werden";
|
|
177
|
+
readonly backgroundRemovalFailed: "Hintergrund konnte für dieses Bild nicht entfernt werden";
|
|
164
178
|
readonly noSavedSignatures: "Keine gespeicherten Unterschriften";
|
|
165
179
|
readonly addSignature: "Unterschrift hinzufügen";
|
|
166
180
|
readonly selectedCount: "{count} ausgewählt";
|
|
@@ -16,7 +16,6 @@ export const messages = {
|
|
|
16
16
|
strokeWidth: "Stroke width",
|
|
17
17
|
decreaseStrokeWidth: "Decrease stroke width",
|
|
18
18
|
increaseStrokeWidth: "Increase stroke width",
|
|
19
|
-
noProperties: "No properties",
|
|
20
19
|
detectFormFields: "Detect form fields",
|
|
21
20
|
disableFormFieldDetection: "Disable form field detection",
|
|
22
21
|
fitWidth: "Fit width",
|
|
@@ -37,6 +36,14 @@ export const messages = {
|
|
|
37
36
|
freeText: "Free text",
|
|
38
37
|
startTyping: "Start typing...",
|
|
39
38
|
drawSignature: "Draw signature",
|
|
39
|
+
uploadSignature: "Upload",
|
|
40
|
+
dropSignatureImage: "Drop an image here or click to choose",
|
|
41
|
+
chooseImage: "Choose image",
|
|
42
|
+
removeWhiteBackground: "Remove white background",
|
|
43
|
+
unsupportedImageType: "Unsupported file type. Allowed: {accept}",
|
|
44
|
+
imageTooLarge: "Image is too large. Maximum {size} MB",
|
|
45
|
+
imageReadFailed: "Could not read that image",
|
|
46
|
+
backgroundRemovalFailed: "Background could not be removed for this image",
|
|
40
47
|
noSavedSignatures: "No saved signatures",
|
|
41
48
|
addSignature: "Add signature",
|
|
42
49
|
selectedCount: "{count} selected",
|
|
@@ -141,7 +148,6 @@ export const messages = {
|
|
|
141
148
|
strokeWidth: "Linienst\xE4rke",
|
|
142
149
|
decreaseStrokeWidth: "Linienst\xE4rke verringern",
|
|
143
150
|
increaseStrokeWidth: "Linienst\xE4rke erh\xF6hen",
|
|
144
|
-
noProperties: "Keine Eigenschaften",
|
|
145
151
|
detectFormFields: "Formularfelder erkennen",
|
|
146
152
|
disableFormFieldDetection: "Formularfeld-Erkennung deaktivieren",
|
|
147
153
|
fitWidth: "Seitenbreite",
|
|
@@ -160,6 +166,14 @@ export const messages = {
|
|
|
160
166
|
freeText: "Freitext",
|
|
161
167
|
startTyping: "Text eingeben...",
|
|
162
168
|
drawSignature: "Unterschrift zeichnen",
|
|
169
|
+
uploadSignature: "Hochladen",
|
|
170
|
+
dropSignatureImage: "Bild hierher ziehen oder klicken zum Ausw\xE4hlen",
|
|
171
|
+
chooseImage: "Bild ausw\xE4hlen",
|
|
172
|
+
removeWhiteBackground: "Wei\xDFen Hintergrund entfernen",
|
|
173
|
+
unsupportedImageType: "Dateityp nicht unterst\xFCtzt. Erlaubt: {accept}",
|
|
174
|
+
imageTooLarge: "Bild ist zu gro\xDF. Maximal {size} MB",
|
|
175
|
+
imageReadFailed: "Bild konnte nicht gelesen werden",
|
|
176
|
+
backgroundRemovalFailed: "Hintergrund konnte f\xFCr dieses Bild nicht entfernt werden",
|
|
163
177
|
noSavedSignatures: "Keine gespeicherten Unterschriften",
|
|
164
178
|
addSignature: "Unterschrift hinzuf\xFCgen",
|
|
165
179
|
selectedCount: "{count} ausgew\xE4hlt",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type { ExportPdfOptions } from './annotation/pdf-export/export.js';
|
|
2
2
|
export type { ViewerTabItem, AddTabOptions } from './components/ViewerTabs.vue.js';
|
|
3
|
-
export type { AddFormFieldPayload, CheckboxStyle, FormFieldDefinition, FormFieldOrigin, FormFieldType, FormFieldValue, SignatureData, SignatureHandlers, } from './annotation/engine/types.js';
|
|
3
|
+
export type { AddFormFieldPayload, CheckboxStyle, FormFieldDefinition, FormFieldOrigin, FormFieldType, FormFieldValue, PlacedFieldDefaultProps, PlacedFieldDefaults, SignatureData, SignatureFieldStatus, SignatureHandlers, } from './annotation/engine/types.js';
|
|
4
4
|
export type { ViewMode } from './composables/viewMode.js';
|
|
5
5
|
export type { ViewerState, ActiveTool } from './composables/useViewerState.js';
|
|
6
6
|
export type { KViewerApi, KViewerEmbedBridgeOptions, } from './embed/bridge-host.js';
|
|
@@ -9,7 +9,7 @@ export type ViewerTopToolId = 'menu' | 'pageSettings' | 'zoom' | 'hand' | 'marqu
|
|
|
9
9
|
* the text-selection `highlight`). The `select`/`highlight`/`strikeout`/
|
|
10
10
|
* `underline`/`circle`/`note`/`arrow`/`cloud` entries have no button in
|
|
11
11
|
* the default toolbar — they are opt-in extras a host may add. */
|
|
12
|
-
export type ViewerBottomToolId = 'properties' | 'freehand' | 'freeHighlight' | 'freeText' | 'stamp' | 'signature' | 'rectangle' | 'formText' | 'formCheckbox' | 'formRadio' | 'formSignature' | 'undo' | 'redo' | 'eraser' | 'select' | 'highlight' | 'strikeout' | 'underline' | 'circle' | 'note' | 'arrow' | 'cloud';
|
|
12
|
+
export type ViewerBottomToolId = 'properties' | 'freehand' | 'freeHighlight' | 'freeText' | 'stamp' | 'signature' | 'rectangle' | 'formText' | 'formCheckbox' | 'formRadio' | 'formSignature' | 'placeText' | 'placeCheckbox' | 'placeRadio' | 'placeSignature' | 'undo' | 'redo' | 'eraser' | 'select' | 'highlight' | 'strikeout' | 'underline' | 'circle' | 'note' | 'arrow' | 'cloud';
|
|
13
13
|
/** Layout primitives usable in either row. `separator` draws a vertical
|
|
14
14
|
* divider; `spacer` pushes everything after it to the right (flex
|
|
15
15
|
* `ml-auto`) — this is how you reproduce today's right-aligned group. */
|
|
@@ -46,6 +46,10 @@ export const BOTTOM_TOOL_IDS = /* @__PURE__ */ new Set([
|
|
|
46
46
|
"formCheckbox",
|
|
47
47
|
"formRadio",
|
|
48
48
|
"formSignature",
|
|
49
|
+
"placeText",
|
|
50
|
+
"placeCheckbox",
|
|
51
|
+
"placeRadio",
|
|
52
|
+
"placeSignature",
|
|
49
53
|
"undo",
|
|
50
54
|
"redo",
|
|
51
55
|
"eraser",
|
|
@@ -67,6 +71,10 @@ export const ANNOTATION_TOOL_TYPES = {
|
|
|
67
71
|
formCheckbox: AnnotationType.FORM_CHECKBOX,
|
|
68
72
|
formRadio: AnnotationType.FORM_RADIO,
|
|
69
73
|
formSignature: AnnotationType.FORM_SIGNATURE,
|
|
74
|
+
placeText: AnnotationType.FORM_TEXT,
|
|
75
|
+
placeCheckbox: AnnotationType.FORM_CHECKBOX,
|
|
76
|
+
placeRadio: AnnotationType.FORM_RADIO,
|
|
77
|
+
placeSignature: AnnotationType.FORM_SIGNATURE,
|
|
70
78
|
select: AnnotationType.SELECT,
|
|
71
79
|
highlight: AnnotationType.HIGHLIGHT,
|
|
72
80
|
strikeout: AnnotationType.STRIKEOUT,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kviewer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Kabema PDF Editor",
|
|
5
5
|
"repository": "kabema/kviewer",
|
|
6
6
|
"license": "MIT",
|
|
@@ -29,34 +29,34 @@
|
|
|
29
29
|
"docs"
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@iconify-json/lucide": "^1.2.
|
|
33
|
-
"@nuxt/kit": "^4.
|
|
34
|
-
"@nuxt/ui": "^4.
|
|
32
|
+
"@iconify-json/lucide": "^1.2.118",
|
|
33
|
+
"@nuxt/kit": "^4.5.0",
|
|
34
|
+
"@nuxt/ui": "^4.10.0",
|
|
35
35
|
"@pdf-lib/fontkit": "^1.1.1",
|
|
36
|
-
"konva": "^10.
|
|
36
|
+
"konva": "^10.3.0",
|
|
37
37
|
"pdf-lib": "^1.17.1",
|
|
38
|
-
"pdfjs-dist": "^6.
|
|
39
|
-
"tailwindcss": "^4.
|
|
38
|
+
"pdfjs-dist": "^6.1.200",
|
|
39
|
+
"tailwindcss": "^4.3.3"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@nuxt/devtools": "^3.2.4",
|
|
43
|
-
"@nuxt/eslint": "1.
|
|
44
|
-
"@nuxt/eslint-config": "^1.
|
|
43
|
+
"@nuxt/eslint": "1.16.0",
|
|
44
|
+
"@nuxt/eslint-config": "^1.16.0",
|
|
45
45
|
"@nuxt/module-builder": "^1.0.2",
|
|
46
|
-
"@nuxt/schema": "^4.
|
|
47
|
-
"@nuxt/test-utils": "^4.0.
|
|
48
|
-
"@playwright/test": "^1.
|
|
46
|
+
"@nuxt/schema": "^4.5.0",
|
|
47
|
+
"@nuxt/test-utils": "^4.0.3",
|
|
48
|
+
"@playwright/test": "^1.61.1",
|
|
49
49
|
"@types/node": "latest",
|
|
50
50
|
"canvas": "^3.2.3",
|
|
51
51
|
"changelogen": "^0.6.2",
|
|
52
|
-
"eslint": "^10.
|
|
53
|
-
"nuxt": "^4.
|
|
54
|
-
"path2d": "^0.3.
|
|
55
|
-
"pixelmatch": "^7.
|
|
52
|
+
"eslint": "^10.7.0",
|
|
53
|
+
"nuxt": "^4.5.0",
|
|
54
|
+
"path2d": "^0.3.3",
|
|
55
|
+
"pixelmatch": "^7.2.0",
|
|
56
56
|
"pngjs": "^7.0.0",
|
|
57
57
|
"typescript": "~6.0.2",
|
|
58
|
-
"vitest": "^4.1.
|
|
59
|
-
"vue-tsc": "^3.
|
|
58
|
+
"vitest": "^4.1.10",
|
|
59
|
+
"vue-tsc": "^3.3.7"
|
|
60
60
|
},
|
|
61
61
|
"scripts": {
|
|
62
62
|
"dev": "npm run dev:prepare && portless kviewer nuxt dev playground",
|