kviewer 0.0.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.
Files changed (197) hide show
  1. package/README.md +134 -0
  2. package/dist/module.d.mts +15 -0
  3. package/dist/module.json +9 -0
  4. package/dist/module.mjs +26 -0
  5. package/dist/runtime/annotation/engine/config.d.ts +52 -0
  6. package/dist/runtime/annotation/engine/config.js +283 -0
  7. package/dist/runtime/annotation/engine/const.d.ts +6 -0
  8. package/dist/runtime/annotation/engine/const.js +7 -0
  9. package/dist/runtime/annotation/engine/cursor-preview.d.ts +2 -0
  10. package/dist/runtime/annotation/engine/cursor-preview.js +88 -0
  11. package/dist/runtime/annotation/engine/editor/editor.d.ts +69 -0
  12. package/dist/runtime/annotation/engine/editor/editor.js +233 -0
  13. package/dist/runtime/annotation/engine/editor/selector.d.ts +74 -0
  14. package/dist/runtime/annotation/engine/editor/selector.js +594 -0
  15. package/dist/runtime/annotation/engine/import-normalize.d.ts +5 -0
  16. package/dist/runtime/annotation/engine/import-normalize.js +99 -0
  17. package/dist/runtime/annotation/engine/input-device.d.ts +53 -0
  18. package/dist/runtime/annotation/engine/input-device.js +64 -0
  19. package/dist/runtime/annotation/engine/painter.d.ts +97 -0
  20. package/dist/runtime/annotation/engine/painter.js +591 -0
  21. package/dist/runtime/annotation/engine/store.d.ts +11 -0
  22. package/dist/runtime/annotation/engine/store.js +47 -0
  23. package/dist/runtime/annotation/engine/tools/arrow.d.ts +22 -0
  24. package/dist/runtime/annotation/engine/tools/arrow.js +126 -0
  25. package/dist/runtime/annotation/engine/tools/circle.d.ts +45 -0
  26. package/dist/runtime/annotation/engine/tools/circle.js +148 -0
  27. package/dist/runtime/annotation/engine/tools/cloud.d.ts +50 -0
  28. package/dist/runtime/annotation/engine/tools/cloud.js +244 -0
  29. package/dist/runtime/annotation/engine/tools/free-highlight.d.ts +43 -0
  30. package/dist/runtime/annotation/engine/tools/free-highlight.js +165 -0
  31. package/dist/runtime/annotation/engine/tools/free-text.d.ts +27 -0
  32. package/dist/runtime/annotation/engine/tools/free-text.js +114 -0
  33. package/dist/runtime/annotation/engine/tools/freehand.d.ts +44 -0
  34. package/dist/runtime/annotation/engine/tools/freehand.js +151 -0
  35. package/dist/runtime/annotation/engine/tools/highlight.d.ts +87 -0
  36. package/dist/runtime/annotation/engine/tools/highlight.js +215 -0
  37. package/dist/runtime/annotation/engine/tools/note.d.ts +9 -0
  38. package/dist/runtime/annotation/engine/tools/note.js +34 -0
  39. package/dist/runtime/annotation/engine/tools/rectangle.d.ts +45 -0
  40. package/dist/runtime/annotation/engine/tools/rectangle.js +142 -0
  41. package/dist/runtime/annotation/engine/tools/signature.d.ts +16 -0
  42. package/dist/runtime/annotation/engine/tools/signature.js +74 -0
  43. package/dist/runtime/annotation/engine/tools/stamp.d.ts +18 -0
  44. package/dist/runtime/annotation/engine/tools/stamp.js +94 -0
  45. package/dist/runtime/annotation/engine/types.d.ts +170 -0
  46. package/dist/runtime/annotation/engine/types.js +67 -0
  47. package/dist/runtime/annotation/engine/utils.d.ts +40 -0
  48. package/dist/runtime/annotation/engine/utils.js +257 -0
  49. package/dist/runtime/annotation/parsers/parseFormFields.d.ts +9 -0
  50. package/dist/runtime/annotation/parsers/parseFormFields.js +101 -0
  51. package/dist/runtime/annotation/pdf-export/download.d.ts +1 -0
  52. package/dist/runtime/annotation/pdf-export/download.js +10 -0
  53. package/dist/runtime/annotation/pdf-export/export-form-fields.d.ts +9 -0
  54. package/dist/runtime/annotation/pdf-export/export-form-fields.js +90 -0
  55. package/dist/runtime/annotation/pdf-export/export.d.ts +15 -0
  56. package/dist/runtime/annotation/pdf-export/export.js +145 -0
  57. package/dist/runtime/annotation/pdf-export/parse.d.ts +10 -0
  58. package/dist/runtime/annotation/pdf-export/parse.js +19 -0
  59. package/dist/runtime/annotation/pdf-export/parse_circle.d.ts +4 -0
  60. package/dist/runtime/annotation/pdf-export/parse_circle.js +41 -0
  61. package/dist/runtime/annotation/pdf-export/parse_freetext.d.ts +4 -0
  62. package/dist/runtime/annotation/pdf-export/parse_freetext.js +54 -0
  63. package/dist/runtime/annotation/pdf-export/parse_highlight.d.ts +4 -0
  64. package/dist/runtime/annotation/pdf-export/parse_highlight.js +134 -0
  65. package/dist/runtime/annotation/pdf-export/parse_ink.d.ts +4 -0
  66. package/dist/runtime/annotation/pdf-export/parse_ink.js +124 -0
  67. package/dist/runtime/annotation/pdf-export/parse_line.d.ts +4 -0
  68. package/dist/runtime/annotation/pdf-export/parse_line.js +71 -0
  69. package/dist/runtime/annotation/pdf-export/parse_polyline.d.ts +4 -0
  70. package/dist/runtime/annotation/pdf-export/parse_polyline.js +93 -0
  71. package/dist/runtime/annotation/pdf-export/parse_square.d.ts +4 -0
  72. package/dist/runtime/annotation/pdf-export/parse_square.js +41 -0
  73. package/dist/runtime/annotation/pdf-export/parse_stamp.d.ts +4 -0
  74. package/dist/runtime/annotation/pdf-export/parse_stamp.js +195 -0
  75. package/dist/runtime/annotation/pdf-export/parse_strikeout.d.ts +4 -0
  76. package/dist/runtime/annotation/pdf-export/parse_strikeout.js +59 -0
  77. package/dist/runtime/annotation/pdf-export/parse_text.d.ts +4 -0
  78. package/dist/runtime/annotation/pdf-export/parse_text.js +42 -0
  79. package/dist/runtime/annotation/pdf-export/parse_underline.d.ts +4 -0
  80. package/dist/runtime/annotation/pdf-export/parse_underline.js +59 -0
  81. package/dist/runtime/assets/kviewer.css +1 -0
  82. package/dist/runtime/components/AnnotationToolbar.d.vue.ts +3 -0
  83. package/dist/runtime/components/AnnotationToolbar.vue +125 -0
  84. package/dist/runtime/components/AnnotationToolbar.vue.d.ts +3 -0
  85. package/dist/runtime/components/FloatingPageIndicator.d.vue.ts +6 -0
  86. package/dist/runtime/components/FloatingPageIndicator.vue +93 -0
  87. package/dist/runtime/components/FloatingPageIndicator.vue.d.ts +6 -0
  88. package/dist/runtime/components/FormFieldLayer.d.vue.ts +11 -0
  89. package/dist/runtime/components/FormFieldLayer.vue +40 -0
  90. package/dist/runtime/components/FormFieldLayer.vue.d.ts +11 -0
  91. package/dist/runtime/components/PdfPage.d.vue.ts +9 -0
  92. package/dist/runtime/components/PdfPage.vue +199 -0
  93. package/dist/runtime/components/PdfPage.vue.d.ts +9 -0
  94. package/dist/runtime/components/ToolButton.d.vue.ts +13 -0
  95. package/dist/runtime/components/ToolButton.vue +26 -0
  96. package/dist/runtime/components/ToolButton.vue.d.ts +13 -0
  97. package/dist/runtime/components/Toolbar.d.vue.ts +3 -0
  98. package/dist/runtime/components/Toolbar.vue +11 -0
  99. package/dist/runtime/components/Toolbar.vue.d.ts +3 -0
  100. package/dist/runtime/components/Viewer.d.vue.ts +45 -0
  101. package/dist/runtime/components/Viewer.vue +617 -0
  102. package/dist/runtime/components/Viewer.vue.d.ts +45 -0
  103. package/dist/runtime/components/ViewerBar.d.vue.ts +3 -0
  104. package/dist/runtime/components/ViewerBar.vue +91 -0
  105. package/dist/runtime/components/ViewerBar.vue.d.ts +3 -0
  106. package/dist/runtime/components/ViewerTabs.d.vue.ts +381 -0
  107. package/dist/runtime/components/ViewerTabs.vue +171 -0
  108. package/dist/runtime/components/ViewerTabs.vue.d.ts +381 -0
  109. package/dist/runtime/components/form-fields/FormButton.d.vue.ts +7 -0
  110. package/dist/runtime/components/form-fields/FormButton.vue +39 -0
  111. package/dist/runtime/components/form-fields/FormButton.vue.d.ts +7 -0
  112. package/dist/runtime/components/form-fields/FormCheckbox.d.vue.ts +7 -0
  113. package/dist/runtime/components/form-fields/FormCheckbox.vue +28 -0
  114. package/dist/runtime/components/form-fields/FormCheckbox.vue.d.ts +7 -0
  115. package/dist/runtime/components/form-fields/FormDropdown.d.vue.ts +7 -0
  116. package/dist/runtime/components/form-fields/FormDropdown.vue +112 -0
  117. package/dist/runtime/components/form-fields/FormDropdown.vue.d.ts +7 -0
  118. package/dist/runtime/components/form-fields/FormFieldWrapper.d.vue.ts +8 -0
  119. package/dist/runtime/components/form-fields/FormFieldWrapper.vue +41 -0
  120. package/dist/runtime/components/form-fields/FormFieldWrapper.vue.d.ts +8 -0
  121. package/dist/runtime/components/form-fields/FormRadioButton.d.vue.ts +7 -0
  122. package/dist/runtime/components/form-fields/FormRadioButton.vue +30 -0
  123. package/dist/runtime/components/form-fields/FormRadioButton.vue.d.ts +7 -0
  124. package/dist/runtime/components/form-fields/FormSignatureField.d.vue.ts +7 -0
  125. package/dist/runtime/components/form-fields/FormSignatureField.vue +54 -0
  126. package/dist/runtime/components/form-fields/FormSignatureField.vue.d.ts +7 -0
  127. package/dist/runtime/components/form-fields/FormTextField.d.vue.ts +7 -0
  128. package/dist/runtime/components/form-fields/FormTextField.vue +66 -0
  129. package/dist/runtime/components/form-fields/FormTextField.vue.d.ts +7 -0
  130. package/dist/runtime/components/modals/FreeTextModal.d.vue.ts +25 -0
  131. package/dist/runtime/components/modals/FreeTextModal.vue +89 -0
  132. package/dist/runtime/components/modals/FreeTextModal.vue.d.ts +25 -0
  133. package/dist/runtime/components/modals/SignatureDrawModal.d.vue.ts +14 -0
  134. package/dist/runtime/components/modals/SignatureDrawModal.vue +120 -0
  135. package/dist/runtime/components/modals/SignatureDrawModal.vue.d.ts +14 -0
  136. package/dist/runtime/components/panels/SignaturePicker.d.vue.ts +3 -0
  137. package/dist/runtime/components/panels/SignaturePicker.vue +85 -0
  138. package/dist/runtime/components/panels/SignaturePicker.vue.d.ts +3 -0
  139. package/dist/runtime/components/panels/StampPicker.d.vue.ts +3 -0
  140. package/dist/runtime/components/panels/StampPicker.vue +46 -0
  141. package/dist/runtime/components/panels/StampPicker.vue.d.ts +3 -0
  142. package/dist/runtime/components/tools/ActionTools.d.vue.ts +3 -0
  143. package/dist/runtime/components/tools/ActionTools.vue +32 -0
  144. package/dist/runtime/components/tools/ActionTools.vue.d.ts +3 -0
  145. package/dist/runtime/components/tools/DrawingTools.d.vue.ts +6 -0
  146. package/dist/runtime/components/tools/DrawingTools.vue +57 -0
  147. package/dist/runtime/components/tools/DrawingTools.vue.d.ts +6 -0
  148. package/dist/runtime/components/tools/HandTool.d.vue.ts +3 -0
  149. package/dist/runtime/components/tools/HandTool.vue +14 -0
  150. package/dist/runtime/components/tools/HandTool.vue.d.ts +3 -0
  151. package/dist/runtime/components/tools/MarqueeTool.d.vue.ts +3 -0
  152. package/dist/runtime/components/tools/MarqueeTool.vue +15 -0
  153. package/dist/runtime/components/tools/MarqueeTool.vue.d.ts +3 -0
  154. package/dist/runtime/components/tools/PageInfo.d.vue.ts +3 -0
  155. package/dist/runtime/components/tools/PageInfo.vue +10 -0
  156. package/dist/runtime/components/tools/PageInfo.vue.d.ts +3 -0
  157. package/dist/runtime/components/tools/PageSettings.d.vue.ts +3 -0
  158. package/dist/runtime/components/tools/PageSettings.vue +92 -0
  159. package/dist/runtime/components/tools/PageSettings.vue.d.ts +3 -0
  160. package/dist/runtime/components/tools/SearchTool.d.vue.ts +3 -0
  161. package/dist/runtime/components/tools/SearchTool.vue +149 -0
  162. package/dist/runtime/components/tools/SearchTool.vue.d.ts +3 -0
  163. package/dist/runtime/components/tools/ToolProperties.d.vue.ts +7 -0
  164. package/dist/runtime/components/tools/ToolProperties.vue +174 -0
  165. package/dist/runtime/components/tools/ToolProperties.vue.d.ts +7 -0
  166. package/dist/runtime/components/tools/ZoomControls.d.vue.ts +3 -0
  167. package/dist/runtime/components/tools/ZoomControls.vue +59 -0
  168. package/dist/runtime/components/tools/ZoomControls.vue.d.ts +3 -0
  169. package/dist/runtime/composables/search-utils.d.ts +20 -0
  170. package/dist/runtime/composables/search-utils.js +55 -0
  171. package/dist/runtime/composables/useAnnotationEngine.d.ts +7 -0
  172. package/dist/runtime/composables/useAnnotationEngine.js +70 -0
  173. package/dist/runtime/composables/useAnnotationHistory.d.ts +12 -0
  174. package/dist/runtime/composables/useAnnotationHistory.js +69 -0
  175. package/dist/runtime/composables/useFormFields.d.ts +26 -0
  176. package/dist/runtime/composables/useFormFields.js +112 -0
  177. package/dist/runtime/composables/usePageProxyCache.d.ts +8 -0
  178. package/dist/runtime/composables/usePageProxyCache.js +73 -0
  179. package/dist/runtime/composables/usePageSettings.d.ts +16 -0
  180. package/dist/runtime/composables/usePageSettings.js +66 -0
  181. package/dist/runtime/composables/usePageVirtualization.d.ts +19 -0
  182. package/dist/runtime/composables/usePageVirtualization.js +203 -0
  183. package/dist/runtime/composables/useSearchIndex.d.ts +11 -0
  184. package/dist/runtime/composables/useSearchIndex.js +71 -0
  185. package/dist/runtime/composables/useViewerSearch.d.ts +32 -0
  186. package/dist/runtime/composables/useViewerSearch.js +418 -0
  187. package/dist/runtime/composables/useViewerState.d.ts +62 -0
  188. package/dist/runtime/composables/useViewerState.js +189 -0
  189. package/dist/runtime/composables/viewMode.d.ts +11 -0
  190. package/dist/runtime/composables/viewMode.js +19 -0
  191. package/dist/runtime/plugin.d.ts +2 -0
  192. package/dist/runtime/plugin.js +3 -0
  193. package/dist/runtime/public-types.d.ts +2 -0
  194. package/dist/runtime/public-types.js +0 -0
  195. package/dist/runtime/server/tsconfig.json +3 -0
  196. package/dist/types.d.mts +5 -0
  197. package/package.json +64 -0
@@ -0,0 +1,71 @@
1
+ import { PDFName, PDFNumber, PDFString } from "pdf-lib";
2
+ import { convertKonvaRectToPdfRect, rgbToPdfColor, stringToPDFHexString } from "../engine/utils.js";
3
+ import { AnnotationParser } from "./parse.js";
4
+ const UNKNOWN_USER = "Unknown user";
5
+ export class LineParser extends AnnotationParser {
6
+ async parse() {
7
+ const { annotation, page, pdfDoc } = this;
8
+ const context = pdfDoc.context;
9
+ const pageHeight = page.getHeight();
10
+ const konvaGroup = JSON.parse(annotation.konvaString);
11
+ const lines = (konvaGroup.children ?? []).filter((item) => item.className === "Arrow");
12
+ const groupX = konvaGroup.attrs?.x || 0;
13
+ const groupY = konvaGroup.attrs?.y || 0;
14
+ const scaleX = konvaGroup.attrs?.scaleX || 1;
15
+ const scaleY = konvaGroup.attrs?.scaleY || 1;
16
+ const inkList = context.obj(
17
+ lines.map((line) => {
18
+ const points = line.attrs?.points ?? [];
19
+ const transformedPoints = [];
20
+ for (let i = 0; i < points.length; i += 2) {
21
+ const x = groupX + points[i] * scaleX;
22
+ const y = groupY + points[i + 1] * scaleY;
23
+ transformedPoints.push(x, pageHeight - y);
24
+ }
25
+ return context.obj(transformedPoints);
26
+ })
27
+ );
28
+ const firstLine = lines[0]?.attrs || {};
29
+ const strokeWidth = firstLine.strokeWidth ?? 1;
30
+ const opacity = firstLine.opacity ?? 1;
31
+ const color = firstLine.stroke ?? annotation.color ?? "rgb(255, 0, 0)";
32
+ const [r, g, b] = rgbToPdfColor(color);
33
+ const bs = context.obj({
34
+ W: PDFNumber.of(strokeWidth),
35
+ S: PDFName.of("S")
36
+ });
37
+ const mainAnn = context.obj({
38
+ Type: PDFName.of("Annot"),
39
+ Subtype: PDFName.of("Ink"),
40
+ Rect: convertKonvaRectToPdfRect(annotation.konvaClientRect, pageHeight),
41
+ InkList: inkList,
42
+ C: context.obj([PDFNumber.of(r), PDFNumber.of(g), PDFNumber.of(b)]),
43
+ T: stringToPDFHexString(annotation.title || UNKNOWN_USER),
44
+ Contents: stringToPDFHexString(annotation.contentsObj?.text || ""),
45
+ M: PDFString.of(annotation.date || ""),
46
+ NM: PDFString.of(annotation.id),
47
+ Border: context.obj([0, 0, 0]),
48
+ BS: bs,
49
+ CA: PDFNumber.of(opacity)
50
+ });
51
+ const mainAnnRef = context.register(mainAnn);
52
+ this.addAnnotationToPage(page, mainAnnRef);
53
+ for (const comment of annotation.comments || []) {
54
+ const replyAnn = context.obj({
55
+ Type: PDFName.of("Annot"),
56
+ Subtype: PDFName.of("Text"),
57
+ Rect: convertKonvaRectToPdfRect(annotation.konvaClientRect, pageHeight),
58
+ Contents: stringToPDFHexString(comment.content),
59
+ T: stringToPDFHexString(comment.title || UNKNOWN_USER),
60
+ M: PDFString.of(comment.date || ""),
61
+ C: context.obj([PDFNumber.of(r), PDFNumber.of(g), PDFNumber.of(b)]),
62
+ IRT: mainAnnRef,
63
+ RT: PDFName.of("R"),
64
+ NM: PDFString.of(comment.id),
65
+ Open: false
66
+ });
67
+ const replyAnnRef = context.register(replyAnn);
68
+ this.addAnnotationToPage(page, replyAnnRef);
69
+ }
70
+ }
71
+ }
@@ -0,0 +1,4 @@
1
+ import { AnnotationParser } from './parse.js';
2
+ export declare class PolylineParser extends AnnotationParser {
3
+ parse(): Promise<void>;
4
+ }
@@ -0,0 +1,93 @@
1
+ import { PDFName, PDFNumber, PDFString } from "pdf-lib";
2
+ import { convertKonvaRectToPdfRect, rgbToPdfColor, stringToPDFHexString } from "../engine/utils.js";
3
+ import { AnnotationParser } from "./parse.js";
4
+ const UNKNOWN_USER = "Unknown user";
5
+ function parseSvgPathToPoints(data) {
6
+ const commands = data.match(/[a-z][^a-z]*/gi) || [];
7
+ const points = [];
8
+ for (const cmd of commands) {
9
+ const type = cmd[0];
10
+ const nums = cmd.slice(1).trim().split(/[\s,]+/).map((value) => Number.parseFloat(value));
11
+ if (type === "M" || type === "L") {
12
+ for (let i = 0; i < nums.length; i += 2) {
13
+ points.push(nums[i], nums[i + 1]);
14
+ }
15
+ } else if (type === "Q") {
16
+ if (nums.length >= 4) {
17
+ points.push(nums[2], nums[3]);
18
+ }
19
+ } else if (type === "C") {
20
+ if (nums.length >= 6) {
21
+ points.push(nums[4], nums[5]);
22
+ }
23
+ }
24
+ }
25
+ return points;
26
+ }
27
+ export class PolylineParser extends AnnotationParser {
28
+ async parse() {
29
+ const { annotation, page, pdfDoc } = this;
30
+ const context = pdfDoc.context;
31
+ const pageHeight = page.getHeight();
32
+ const konvaGroup = JSON.parse(annotation.konvaString);
33
+ const lines = (konvaGroup.children ?? []).filter((item) => item.className === "Path");
34
+ const groupX = konvaGroup.attrs?.x || 0;
35
+ const groupY = konvaGroup.attrs?.y || 0;
36
+ const scaleX = konvaGroup.attrs?.scaleX || 1;
37
+ const scaleY = konvaGroup.attrs?.scaleY || 1;
38
+ const inkList = context.obj(
39
+ lines.map((line) => {
40
+ const points = parseSvgPathToPoints(line.attrs?.data ?? "");
41
+ const transformedPoints = [];
42
+ for (let i = 0; i < points.length; i += 2) {
43
+ const x = groupX + points[i] * scaleX;
44
+ const y = groupY + points[i + 1] * scaleY;
45
+ transformedPoints.push(x, pageHeight - y);
46
+ }
47
+ return context.obj(transformedPoints);
48
+ })
49
+ );
50
+ const firstLine = lines[0]?.attrs || {};
51
+ const strokeWidth = firstLine.strokeWidth ?? 1;
52
+ const opacity = firstLine.opacity ?? 1;
53
+ const color = firstLine.stroke ?? annotation.color ?? "rgb(255, 0, 0)";
54
+ const [r, g, b] = rgbToPdfColor(color);
55
+ const bs = context.obj({
56
+ W: PDFNumber.of(strokeWidth),
57
+ S: PDFName.of("S")
58
+ });
59
+ const mainAnn = context.obj({
60
+ Type: PDFName.of("Annot"),
61
+ Subtype: PDFName.of("Ink"),
62
+ Rect: convertKonvaRectToPdfRect(annotation.konvaClientRect, pageHeight),
63
+ InkList: inkList,
64
+ C: context.obj([PDFNumber.of(r), PDFNumber.of(g), PDFNumber.of(b)]),
65
+ T: stringToPDFHexString(annotation.title || UNKNOWN_USER),
66
+ Contents: stringToPDFHexString(annotation.contentsObj?.text || ""),
67
+ M: PDFString.of(annotation.date || ""),
68
+ NM: PDFString.of(annotation.id),
69
+ Border: context.obj([0, 0, 0]),
70
+ BS: bs,
71
+ CA: PDFNumber.of(opacity)
72
+ });
73
+ const mainAnnRef = context.register(mainAnn);
74
+ this.addAnnotationToPage(page, mainAnnRef);
75
+ for (const comment of annotation.comments || []) {
76
+ const replyAnn = context.obj({
77
+ Type: PDFName.of("Annot"),
78
+ Subtype: PDFName.of("Text"),
79
+ Rect: convertKonvaRectToPdfRect(annotation.konvaClientRect, pageHeight),
80
+ Contents: stringToPDFHexString(comment.content),
81
+ T: stringToPDFHexString(comment.title || UNKNOWN_USER),
82
+ M: PDFString.of(comment.date || ""),
83
+ C: context.obj([PDFNumber.of(r), PDFNumber.of(g), PDFNumber.of(b)]),
84
+ IRT: mainAnnRef,
85
+ RT: PDFName.of("R"),
86
+ NM: PDFString.of(comment.id),
87
+ Open: false
88
+ });
89
+ const replyAnnRef = context.register(replyAnn);
90
+ this.addAnnotationToPage(page, replyAnnRef);
91
+ }
92
+ }
93
+ }
@@ -0,0 +1,4 @@
1
+ import { AnnotationParser } from './parse.js';
2
+ export declare class SquareParser extends AnnotationParser {
3
+ parse(): Promise<void>;
4
+ }
@@ -0,0 +1,41 @@
1
+ import { PDFName, PDFString } from "pdf-lib";
2
+ import { convertKonvaRectToPdfRect, rgbToPdfColor, stringToPDFHexString } from "../engine/utils.js";
3
+ import { AnnotationParser } from "./parse.js";
4
+ const UNKNOWN_USER = "Unknown user";
5
+ export class SquareParser extends AnnotationParser {
6
+ async parse() {
7
+ const { annotation, page, pdfDoc } = this;
8
+ const context = pdfDoc.context;
9
+ const pageHeight = page.getHeight();
10
+ const mainAnn = context.obj({
11
+ Type: PDFName.of("Annot"),
12
+ Subtype: PDFName.of("Square"),
13
+ Rect: convertKonvaRectToPdfRect(annotation.konvaClientRect, pageHeight),
14
+ C: rgbToPdfColor(annotation.color || void 0),
15
+ T: stringToPDFHexString(annotation.title || UNKNOWN_USER),
16
+ Contents: stringToPDFHexString(annotation.contentsObj?.text || ""),
17
+ M: PDFString.of(annotation.date || ""),
18
+ NM: PDFString.of(annotation.id),
19
+ Border: [0, 0, 1]
20
+ });
21
+ const mainAnnRef = context.register(mainAnn);
22
+ this.addAnnotationToPage(page, mainAnnRef);
23
+ for (const comment of annotation.comments || []) {
24
+ const replyAnn = context.obj({
25
+ Type: PDFName.of("Annot"),
26
+ Subtype: PDFName.of("Text"),
27
+ Rect: convertKonvaRectToPdfRect(annotation.konvaClientRect, pageHeight),
28
+ Contents: stringToPDFHexString(comment.content),
29
+ T: stringToPDFHexString(comment.title || UNKNOWN_USER),
30
+ M: PDFString.of(comment.date || ""),
31
+ C: rgbToPdfColor(annotation.color || void 0),
32
+ IRT: mainAnnRef,
33
+ RT: PDFName.of("R"),
34
+ NM: PDFString.of(comment.id),
35
+ Open: false
36
+ });
37
+ const replyAnnRef = context.register(replyAnn);
38
+ this.addAnnotationToPage(page, replyAnnRef);
39
+ }
40
+ }
41
+ }
@@ -0,0 +1,4 @@
1
+ import { AnnotationParser } from './parse.js';
2
+ export declare class StampParser extends AnnotationParser {
3
+ parse(): Promise<void>;
4
+ }
@@ -0,0 +1,195 @@
1
+ import { PDFName, PDFNumber, PDFRawStream, PDFString } from "pdf-lib";
2
+ import { convertKonvaRectToPdfRect, stringToPDFHexString } from "../engine/utils.js";
3
+ import { AnnotationParser } from "./parse.js";
4
+ const UNKNOWN_USER = "Unknown user";
5
+ const SVG_RASTER_SCALE = 4;
6
+ const MAX_RASTER_EDGE = 4096;
7
+ function extractBase64Image(dataUrl) {
8
+ const match = dataUrl.match(/^data:(image\/[a-zA-Z0-9.+-]+);base64,(.+)$/);
9
+ if (!match) return null;
10
+ return { mimeType: match[1], base64: match[2] };
11
+ }
12
+ function extractMimeTypeFromUrl(url) {
13
+ const base = url.split(/[?#]/)[0] || "";
14
+ const ext = base.split(".").pop()?.toLowerCase();
15
+ if (!ext) return null;
16
+ if (ext === "jpg" || ext === "jpeg") return "image/jpeg";
17
+ if (ext === "png") return "image/png";
18
+ if (ext === "svg") return "image/svg+xml";
19
+ return null;
20
+ }
21
+ async function fetchBytes(url) {
22
+ if (typeof fetch !== "function") return null;
23
+ try {
24
+ const response = await fetch(url);
25
+ if (!response.ok) return null;
26
+ const mimeType = response.headers.get("content-type")?.split(";")[0]?.trim().toLowerCase() || null;
27
+ const bytes = new Uint8Array(await response.arrayBuffer());
28
+ return { bytes, mimeType };
29
+ } catch {
30
+ return null;
31
+ }
32
+ }
33
+ async function loadImageElement(url) {
34
+ return new Promise((resolve, reject) => {
35
+ const image = new Image();
36
+ image.crossOrigin = "anonymous";
37
+ image.onload = () => resolve(image);
38
+ image.onerror = () => reject(new Error(`Unable to load image: ${url}`));
39
+ image.src = url;
40
+ });
41
+ }
42
+ async function rasterizeImageToPngDataUrl(url, width, height, scale = 1) {
43
+ if (typeof window === "undefined" || typeof document === "undefined") return null;
44
+ try {
45
+ const image = await loadImageElement(url);
46
+ const baseWidth = Math.max(1, Math.round(width || image.naturalWidth || image.width || 1));
47
+ const baseHeight = Math.max(1, Math.round(height || image.naturalHeight || image.height || 1));
48
+ const outputWidth = Math.min(MAX_RASTER_EDGE, Math.max(1, Math.round(baseWidth * scale)));
49
+ const outputHeight = Math.min(MAX_RASTER_EDGE, Math.max(1, Math.round(baseHeight * scale)));
50
+ const canvas = document.createElement("canvas");
51
+ canvas.width = outputWidth;
52
+ canvas.height = outputHeight;
53
+ const ctx = canvas.getContext("2d");
54
+ if (!ctx) return null;
55
+ ctx.imageSmoothingEnabled = true;
56
+ ctx.drawImage(image, 0, 0, outputWidth, outputHeight);
57
+ return canvas.toDataURL("image/png");
58
+ } catch {
59
+ return null;
60
+ }
61
+ }
62
+ async function embedImageSource(pdfDoc, imageSource, outputWidth, outputHeight) {
63
+ const fromDataUrl = extractBase64Image(imageSource);
64
+ if (fromDataUrl) {
65
+ if (fromDataUrl.mimeType.includes("svg")) {
66
+ const dataUrl2 = await rasterizeImageToPngDataUrl(
67
+ imageSource,
68
+ outputWidth,
69
+ outputHeight,
70
+ SVG_RASTER_SCALE
71
+ );
72
+ const parsed2 = dataUrl2 ? extractBase64Image(dataUrl2) : null;
73
+ if (parsed2) {
74
+ return pdfDoc.embedPng(parsed2.base64);
75
+ }
76
+ return null;
77
+ }
78
+ if (fromDataUrl.mimeType.includes("jpeg") || fromDataUrl.mimeType.includes("jpg")) {
79
+ return pdfDoc.embedJpg(fromDataUrl.base64);
80
+ }
81
+ return pdfDoc.embedPng(fromDataUrl.base64);
82
+ }
83
+ const fetched = await fetchBytes(imageSource);
84
+ const mimeFromPath = extractMimeTypeFromUrl(imageSource);
85
+ const mimeType = (fetched?.mimeType || mimeFromPath || "").toLowerCase();
86
+ if (fetched?.bytes) {
87
+ if (mimeType.includes("jpeg") || mimeType.includes("jpg")) {
88
+ return pdfDoc.embedJpg(fetched.bytes);
89
+ }
90
+ if (mimeType.includes("png")) {
91
+ return pdfDoc.embedPng(fetched.bytes);
92
+ }
93
+ if (mimeType.includes("svg")) {
94
+ const dataUrl2 = await rasterizeImageToPngDataUrl(
95
+ imageSource,
96
+ outputWidth,
97
+ outputHeight,
98
+ SVG_RASTER_SCALE
99
+ );
100
+ const parsed2 = dataUrl2 ? extractBase64Image(dataUrl2) : null;
101
+ if (parsed2) {
102
+ return pdfDoc.embedPng(parsed2.base64);
103
+ }
104
+ return null;
105
+ }
106
+ try {
107
+ return await pdfDoc.embedPng(fetched.bytes);
108
+ } catch {
109
+ try {
110
+ return await pdfDoc.embedJpg(fetched.bytes);
111
+ } catch {
112
+ return null;
113
+ }
114
+ }
115
+ }
116
+ const dataUrl = await rasterizeImageToPngDataUrl(imageSource, outputWidth, outputHeight);
117
+ const parsed = dataUrl ? extractBase64Image(dataUrl) : null;
118
+ if (!parsed) return null;
119
+ return pdfDoc.embedPng(parsed.base64);
120
+ }
121
+ export class StampParser extends AnnotationParser {
122
+ async parse() {
123
+ const { annotation, page, pdfDoc } = this;
124
+ const context = pdfDoc.context;
125
+ const [x1, y1, x2, y2] = convertKonvaRectToPdfRect(annotation.konvaClientRect, page.getHeight());
126
+ const pageWidth = page.getWidth();
127
+ const pageHeight = page.getHeight();
128
+ const left = Math.max(0, Math.min(x1, pageWidth));
129
+ const bottom = Math.max(0, Math.min(y1, pageHeight));
130
+ const right = Math.max(left, Math.min(x2, pageWidth));
131
+ const top = Math.max(bottom, Math.min(y2, pageHeight));
132
+ const rect = [PDFNumber.of(left), PDFNumber.of(bottom), PDFNumber.of(right), PDFNumber.of(top)];
133
+ const annotationWidth = Math.max(1, right - left);
134
+ const annotationHeight = Math.max(1, top - bottom);
135
+ let apDict;
136
+ if (annotation.contentsObj?.image) {
137
+ const embeddedImage = await embedImageSource(
138
+ pdfDoc,
139
+ annotation.contentsObj.image,
140
+ annotationWidth,
141
+ annotationHeight
142
+ );
143
+ if (embeddedImage) {
144
+ const appearanceStream = PDFRawStream.of(
145
+ context.obj({
146
+ Type: PDFName.of("XObject"),
147
+ Subtype: PDFName.of("Form"),
148
+ BBox: context.obj([0, 0, annotationWidth, annotationHeight]),
149
+ Resources: context.obj({
150
+ XObject: context.obj({
151
+ Im1: embeddedImage.ref
152
+ })
153
+ })
154
+ }),
155
+ new TextEncoder().encode(`q ${annotationWidth} 0 0 ${annotationHeight} 0 0 cm /Im1 Do Q`)
156
+ );
157
+ const appearanceStreamRef = context.register(appearanceStream);
158
+ apDict = context.obj({ N: appearanceStreamRef });
159
+ }
160
+ }
161
+ const stampAnnDict = {
162
+ Type: PDFName.of("Annot"),
163
+ Subtype: PDFName.of("Stamp"),
164
+ Rect: rect,
165
+ NM: PDFString.of(annotation.id),
166
+ Contents: stringToPDFHexString(annotation.contentsObj?.text || ""),
167
+ T: stringToPDFHexString(annotation.title || UNKNOWN_USER),
168
+ M: PDFString.of(annotation.date || ""),
169
+ Open: false,
170
+ F: PDFNumber.of(128)
171
+ };
172
+ if (apDict) {
173
+ stampAnnDict.AP = apDict;
174
+ }
175
+ const stampAnn = context.obj(stampAnnDict);
176
+ const stampAnnRef = context.register(stampAnn);
177
+ this.addAnnotationToPage(page, stampAnnRef);
178
+ for (const comment of annotation.comments || []) {
179
+ const replyAnn = context.obj({
180
+ Type: PDFName.of("Annot"),
181
+ Subtype: PDFName.of("Text"),
182
+ Rect: convertKonvaRectToPdfRect(annotation.konvaClientRect, pageHeight),
183
+ Contents: stringToPDFHexString(comment.content),
184
+ T: stringToPDFHexString(comment.title || UNKNOWN_USER),
185
+ M: PDFString.of(comment.date || ""),
186
+ IRT: stampAnnRef,
187
+ RT: PDFName.of("R"),
188
+ NM: PDFString.of(comment.id),
189
+ Open: false
190
+ });
191
+ const replyAnnRef = context.register(replyAnn);
192
+ this.addAnnotationToPage(page, replyAnnRef);
193
+ }
194
+ }
195
+ }
@@ -0,0 +1,4 @@
1
+ import { AnnotationParser } from './parse.js';
2
+ export declare class StrikeOutParser extends AnnotationParser {
3
+ parse(): Promise<void>;
4
+ }
@@ -0,0 +1,59 @@
1
+ import { PDFName, PDFString } from "pdf-lib";
2
+ import { convertKonvaRectToPdfRect, rgbToPdfColor, stringToPDFHexString } from "../engine/utils.js";
3
+ import { AnnotationParser } from "./parse.js";
4
+ const UNKNOWN_USER = "Unknown user";
5
+ function buildQuadPoints(konvaString, pageHeight) {
6
+ const konvaGroup = JSON.parse(konvaString);
7
+ const rects = (konvaGroup.children ?? []).filter((item) => item.className === "Rect");
8
+ const quadPoints = [];
9
+ for (const rect of rects) {
10
+ const x = rect.attrs?.x ?? 0;
11
+ const y = rect.attrs?.y ?? 0;
12
+ const width = rect.attrs?.width ?? 0;
13
+ const height = rect.attrs?.height ?? 0;
14
+ const x1 = x;
15
+ const y1 = pageHeight - y;
16
+ const x2 = x + width;
17
+ const y2 = pageHeight - (y + height);
18
+ quadPoints.push(x1, y1, x2, y1, x1, y2, x2, y2);
19
+ }
20
+ return quadPoints;
21
+ }
22
+ export class StrikeOutParser extends AnnotationParser {
23
+ async parse() {
24
+ const { annotation, page, pdfDoc } = this;
25
+ const context = pdfDoc.context;
26
+ const pageHeight = page.getHeight();
27
+ const quadPoints = buildQuadPoints(annotation.konvaString, pageHeight);
28
+ const mainAnn = context.obj({
29
+ Type: PDFName.of("Annot"),
30
+ Subtype: PDFName.of("StrikeOut"),
31
+ Rect: convertKonvaRectToPdfRect(annotation.konvaClientRect, pageHeight),
32
+ QuadPoints: quadPoints,
33
+ C: rgbToPdfColor(annotation.color || void 0),
34
+ T: stringToPDFHexString(annotation.title || UNKNOWN_USER),
35
+ Contents: stringToPDFHexString(annotation.contentsObj?.text || ""),
36
+ M: PDFString.of(annotation.date || ""),
37
+ NM: PDFString.of(annotation.id)
38
+ });
39
+ const mainAnnRef = context.register(mainAnn);
40
+ this.addAnnotationToPage(page, mainAnnRef);
41
+ for (const comment of annotation.comments || []) {
42
+ const replyAnn = context.obj({
43
+ Type: PDFName.of("Annot"),
44
+ Subtype: PDFName.of("Text"),
45
+ Rect: convertKonvaRectToPdfRect(annotation.konvaClientRect, pageHeight),
46
+ Contents: stringToPDFHexString(comment.content),
47
+ T: stringToPDFHexString(comment.title || UNKNOWN_USER),
48
+ M: PDFString.of(comment.date || ""),
49
+ C: rgbToPdfColor(annotation.color || void 0),
50
+ IRT: mainAnnRef,
51
+ RT: PDFName.of("R"),
52
+ NM: PDFString.of(comment.id),
53
+ Open: false
54
+ });
55
+ const replyAnnRef = context.register(replyAnn);
56
+ this.addAnnotationToPage(page, replyAnnRef);
57
+ }
58
+ }
59
+ }
@@ -0,0 +1,4 @@
1
+ import { AnnotationParser } from './parse.js';
2
+ export declare class TextParser extends AnnotationParser {
3
+ parse(): Promise<void>;
4
+ }
@@ -0,0 +1,42 @@
1
+ import { PDFName, PDFString } from "pdf-lib";
2
+ import { convertKonvaRectToPdfRect, rgbToPdfColor, stringToPDFHexString } from "../engine/utils.js";
3
+ import { AnnotationParser } from "./parse.js";
4
+ const UNKNOWN_USER = "Unknown user";
5
+ export class TextParser extends AnnotationParser {
6
+ async parse() {
7
+ const { annotation, page, pdfDoc } = this;
8
+ const rect = convertKonvaRectToPdfRect(annotation.konvaClientRect, page.getHeight());
9
+ const context = pdfDoc.context;
10
+ const mainAnn = context.obj({
11
+ Type: PDFName.of("Annot"),
12
+ Subtype: PDFName.of("Text"),
13
+ Rect: rect,
14
+ NM: PDFString.of(annotation.id),
15
+ Contents: stringToPDFHexString(annotation.contentsObj?.text || ""),
16
+ Name: PDFName.of("Comment"),
17
+ T: stringToPDFHexString(annotation.title || UNKNOWN_USER),
18
+ M: PDFString.of(annotation.date || ""),
19
+ C: rgbToPdfColor(annotation.color || void 0),
20
+ Open: false
21
+ });
22
+ const mainAnnRef = context.register(mainAnn);
23
+ this.addAnnotationToPage(page, mainAnnRef);
24
+ for (const comment of annotation.comments || []) {
25
+ const replyAnn = context.obj({
26
+ Type: PDFName.of("Annot"),
27
+ Subtype: PDFName.of("Text"),
28
+ Rect: rect,
29
+ Contents: stringToPDFHexString(comment.content),
30
+ T: stringToPDFHexString(comment.title || UNKNOWN_USER),
31
+ M: PDFString.of(comment.date || ""),
32
+ C: rgbToPdfColor(annotation.color || void 0),
33
+ IRT: mainAnnRef,
34
+ RT: PDFName.of("R"),
35
+ NM: PDFString.of(comment.id),
36
+ Open: false
37
+ });
38
+ const replyAnnRef = context.register(replyAnn);
39
+ this.addAnnotationToPage(page, replyAnnRef);
40
+ }
41
+ }
42
+ }
@@ -0,0 +1,4 @@
1
+ import { AnnotationParser } from './parse.js';
2
+ export declare class UnderlineParser extends AnnotationParser {
3
+ parse(): Promise<void>;
4
+ }
@@ -0,0 +1,59 @@
1
+ import { PDFName, PDFString } from "pdf-lib";
2
+ import { convertKonvaRectToPdfRect, rgbToPdfColor, stringToPDFHexString } from "../engine/utils.js";
3
+ import { AnnotationParser } from "./parse.js";
4
+ const UNKNOWN_USER = "Unknown user";
5
+ function buildQuadPoints(konvaString, pageHeight) {
6
+ const konvaGroup = JSON.parse(konvaString);
7
+ const rects = (konvaGroup.children ?? []).filter((item) => item.className === "Rect");
8
+ const quadPoints = [];
9
+ for (const rect of rects) {
10
+ const x = rect.attrs?.x ?? 0;
11
+ const y = rect.attrs?.y ?? 0;
12
+ const width = rect.attrs?.width ?? 0;
13
+ const height = rect.attrs?.height ?? 0;
14
+ const x1 = x;
15
+ const y1 = pageHeight - y;
16
+ const x2 = x + width;
17
+ const y2 = pageHeight - (y + height);
18
+ quadPoints.push(x1, y1, x2, y1, x1, y2, x2, y2);
19
+ }
20
+ return quadPoints;
21
+ }
22
+ export class UnderlineParser extends AnnotationParser {
23
+ async parse() {
24
+ const { annotation, page, pdfDoc } = this;
25
+ const context = pdfDoc.context;
26
+ const pageHeight = page.getHeight();
27
+ const quadPoints = buildQuadPoints(annotation.konvaString, pageHeight);
28
+ const mainAnn = context.obj({
29
+ Type: PDFName.of("Annot"),
30
+ Subtype: PDFName.of("Underline"),
31
+ Rect: convertKonvaRectToPdfRect(annotation.konvaClientRect, pageHeight),
32
+ QuadPoints: quadPoints,
33
+ C: rgbToPdfColor(annotation.color || void 0),
34
+ T: stringToPDFHexString(annotation.title || UNKNOWN_USER),
35
+ Contents: stringToPDFHexString(annotation.contentsObj?.text || ""),
36
+ M: PDFString.of(annotation.date || ""),
37
+ NM: PDFString.of(annotation.id)
38
+ });
39
+ const mainAnnRef = context.register(mainAnn);
40
+ this.addAnnotationToPage(page, mainAnnRef);
41
+ for (const comment of annotation.comments || []) {
42
+ const replyAnn = context.obj({
43
+ Type: PDFName.of("Annot"),
44
+ Subtype: PDFName.of("Text"),
45
+ Rect: convertKonvaRectToPdfRect(annotation.konvaClientRect, pageHeight),
46
+ Contents: stringToPDFHexString(comment.content),
47
+ T: stringToPDFHexString(comment.title || UNKNOWN_USER),
48
+ M: PDFString.of(comment.date || ""),
49
+ C: rgbToPdfColor(annotation.color || void 0),
50
+ IRT: mainAnnRef,
51
+ RT: PDFName.of("R"),
52
+ NM: PDFString.of(comment.id),
53
+ Open: false
54
+ });
55
+ const replyAnnRef = context.register(replyAnn);
56
+ this.addAnnotationToPage(page, replyAnnRef);
57
+ }
58
+ }
59
+ }
@@ -0,0 +1 @@
1
+ .kviewer-text-layer{left:0;line-height:1;overflow:hidden;position:absolute;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none;z-index:1}.kviewer-text-layer--interactive{cursor:text;-webkit-user-select:text;-moz-user-select:text;user-select:text}.KViewer_is_painting.KViewer_painting_type_12 .kviewer-annotation-layer,.KViewer_is_painting.KViewer_painting_type_12 .kviewer-annotation-layer *,.KViewer_is_painting.KViewer_painting_type_13 .kviewer-annotation-layer,.KViewer_is_painting.KViewer_painting_type_13 .kviewer-annotation-layer *,.KViewer_is_painting.KViewer_painting_type_5 .kviewer-annotation-layer,.KViewer_is_painting.KViewer_painting_type_5 .kviewer-annotation-layer *,.KViewer_is_painting.KViewer_painting_type_6 .kviewer-annotation-layer,.KViewer_is_painting.KViewer_painting_type_6 .kviewer-annotation-layer *,.KViewer_is_painting.KViewer_painting_type_7 .kviewer-annotation-layer,.KViewer_is_painting.KViewer_painting_type_7 .kviewer-annotation-layer *,.KViewer_is_painting.KViewer_painting_type_8 .kviewer-annotation-layer,.KViewer_is_painting.KViewer_painting_type_8 .kviewer-annotation-layer *{cursor:crosshair!important}.KViewer_is_painting.KViewer_painting_type_4 .kviewer-annotation-layer,.KViewer_is_painting.KViewer_painting_type_4 .kviewer-annotation-layer *{cursor:text!important}.KViewer_is_painting.KViewer_painting_type_11 .kviewer-annotation-layer,.KViewer_is_painting.KViewer_painting_type_11 .kviewer-annotation-layer *{cursor:crosshair!important}.KViewer_selector_hover{cursor:pointer!important}.kviewer-form-layer{left:0;overflow:hidden;position:absolute;top:0}.kviewer-form-field{box-sizing:border-box;position:absolute}.kviewer-form-input{background-color:rgba(224,232,255,.6);border:1px solid transparent;box-sizing:border-box;color:#000;font-family:inherit;height:100%;line-height:normal;margin:0;outline:none;padding:1px 2px;resize:none;width:100%}.kviewer-form-input:hover{background-color:rgba(224,232,255,.8);border-color:rgba(0,0,0,.2)}.kviewer-form-input:focus{background-color:rgba(224,232,255,.9);border-color:var(--color-primary,#3b82f6);outline:2px solid var(--color-primary,#3b82f6)}.kviewer-form-select{-webkit-appearance:auto;-moz-appearance:auto;appearance:auto;cursor:pointer}.kviewer-form-listbox{overflow-y:auto;padding:0}.kviewer-form-listbox option{padding:1px 3px}.kviewer-form-editable-combo{height:100%;position:relative;width:100%}.kviewer-form-editable-combo input{height:100%;width:100%}.kviewer-form-checkbox,.kviewer-form-radio{align-items:center;background:#fff;display:flex;height:100%;justify-content:center;width:100%}.kviewer-form-checkbox input,.kviewer-form-radio input{accent-color:var(--color-primary,#3b82f6);cursor:pointer;height:80%;margin:0;max-height:18px;max-width:18px;width:80%}.kviewer-form-button{background:linear-gradient(180deg,#f0f0f0,#d0d0d0);border:1px solid rgba(0,0,0,.3);box-sizing:border-box;cursor:pointer;font-family:inherit;font-weight:600;height:100%;padding:2px 6px;text-align:center;width:100%}.kviewer-form-button:hover{background:linear-gradient(180deg,#e8e8e8,#c8c8c8)}.kviewer-form-button:active{background:linear-gradient(180deg,#c8c8c8,#d0d0d0)}.kviewer-form-signature{align-items:center;background:rgba(255,255,200,.15);border:1px dashed rgba(0,0,0,.2);cursor:pointer;display:flex;height:100%;justify-content:center;width:100%}.kviewer-form-signature:hover{background:rgba(59,130,246,.08);border-color:var(--color-primary,#3b82f6)}.kviewer-form-signature--filled{background:transparent;border-color:transparent;border-style:solid}.kviewer-form-signature__preview{max-height:100%;max-width:100%;-o-object-fit:contain;object-fit:contain}.kviewer-form-signature__placeholder{color:rgba(0,0,0,.4);font-size:10px;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;