kviewer 0.2.4 → 0.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.
Files changed (40) hide show
  1. package/README.md +13 -1
  2. package/dist/module.json +1 -1
  3. package/dist/runtime/annotation/engine/editor/editor.d.ts +17 -0
  4. package/dist/runtime/annotation/engine/editor/editor.js +44 -15
  5. package/dist/runtime/annotation/engine/tools/signature.js +1 -1
  6. package/dist/runtime/annotation/engine/tools/stamp.d.ts +8 -0
  7. package/dist/runtime/annotation/engine/tools/stamp.js +27 -2
  8. package/dist/runtime/annotation/engine/types.d.ts +25 -0
  9. package/dist/runtime/annotation/pdf-export/export.js +0 -3
  10. package/dist/runtime/annotation/utils/signature_image.d.ts +26 -0
  11. package/dist/runtime/annotation/utils/signature_image.js +20 -0
  12. package/dist/runtime/assets/kviewer.css +1 -1
  13. package/dist/runtime/components/FormFieldLayer.vue +6 -1
  14. package/dist/runtime/components/Viewer.d.vue.ts +56 -2
  15. package/dist/runtime/components/Viewer.vue +68 -2
  16. package/dist/runtime/components/Viewer.vue.d.ts +56 -2
  17. package/dist/runtime/components/ViewerTabs.d.vue.ts +29 -9
  18. package/dist/runtime/components/ViewerTabs.vue +10 -2
  19. package/dist/runtime/components/ViewerTabs.vue.d.ts +29 -9
  20. package/dist/runtime/components/form-fields/FormFieldWrapper.vue +4 -2
  21. package/dist/runtime/components/form-fields/FormSignatureField.vue +15 -2
  22. package/dist/runtime/components/modals/FreeTextModal.vue +1 -1
  23. package/dist/runtime/components/modals/SignatureDrawModal.vue +170 -4
  24. package/dist/runtime/components/tools/ToolProperties.vue +98 -101
  25. package/dist/runtime/composables/useFormFields.d.ts +17 -1
  26. package/dist/runtime/composables/useFormFields.js +48 -9
  27. package/dist/runtime/composables/useViewerSearch.js +1 -1
  28. package/dist/runtime/composables/useViewerState.d.ts +1 -0
  29. package/dist/runtime/composables/useViewerState.js +12 -13
  30. package/dist/runtime/embed/bridge-client.d.ts +19 -3
  31. package/dist/runtime/embed/bridge-client.js +24 -0
  32. package/dist/runtime/embed/bridge-host.d.ts +10 -1
  33. package/dist/runtime/embed/bridge-host.js +20 -0
  34. package/dist/runtime/embed/protocol.d.ts +28 -1
  35. package/dist/runtime/i18n/messages.d.ts +16 -2
  36. package/dist/runtime/i18n/messages.js +16 -2
  37. package/dist/runtime/public-types.d.ts +1 -1
  38. package/dist/runtime/toolbar-tools.d.ts +1 -1
  39. package/dist/runtime/toolbar-tools.js +8 -0
  40. package/package.json +18 -18
@@ -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.2.4",
3
+ "version": "0.3.0",
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.101",
33
- "@nuxt/kit": "^4.4.2",
34
- "@nuxt/ui": "^4.6.0",
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.2.3",
36
+ "konva": "^10.3.0",
37
37
  "pdf-lib": "^1.17.1",
38
- "pdfjs-dist": "^6.0.227",
39
- "tailwindcss": "^4.2.2"
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.15.2",
44
- "@nuxt/eslint-config": "^1.15.2",
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.4.2",
47
- "@nuxt/test-utils": "^4.0.0",
48
- "@playwright/test": "^1.59.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.1.0",
53
- "nuxt": "^4.4.2",
54
- "path2d": "^0.3.1",
55
- "pixelmatch": "^7.1.0",
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.1",
59
- "vue-tsc": "^3.2.6"
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",