kviewer 0.2.0 → 0.2.2
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 +47 -0
- package/dist/module.d.mts +8 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +25 -3
- package/dist/runtime/annotation/engine/canvas-resolution.d.ts +7 -0
- package/dist/runtime/annotation/engine/canvas-resolution.js +21 -0
- package/dist/runtime/annotation/engine/editor/editor.d.ts +5 -0
- package/dist/runtime/annotation/engine/editor/editor.js +14 -0
- package/dist/runtime/annotation/engine/editor/selector.d.ts +13 -1
- package/dist/runtime/annotation/engine/editor/selector.js +60 -8
- package/dist/runtime/annotation/engine/painter.d.ts +31 -0
- package/dist/runtime/annotation/engine/painter.js +88 -2
- package/dist/runtime/annotation/engine/store.js +3 -0
- package/dist/runtime/annotation/engine/tools/arrow.js +0 -1
- package/dist/runtime/annotation/engine/tools/circle.js +0 -2
- package/dist/runtime/annotation/engine/tools/free-highlight.js +0 -2
- package/dist/runtime/annotation/engine/tools/freehand.js +0 -2
- package/dist/runtime/annotation/engine/tools/rectangle.js +0 -2
- package/dist/runtime/annotation/engine/types.d.ts +5 -0
- package/dist/runtime/annotation/font-style.d.ts +15 -0
- package/dist/runtime/annotation/font-style.js +19 -0
- package/dist/runtime/annotation/parsers/extractCheckboxStyles.d.ts +8 -0
- package/dist/runtime/annotation/parsers/extractCheckboxStyles.js +24 -1
- package/dist/runtime/annotation/pdf-export/annotation-flags.d.ts +8 -0
- package/dist/runtime/annotation/pdf-export/annotation-flags.js +5 -0
- package/dist/runtime/annotation/pdf-export/export-form-fields.js +3 -1
- package/dist/runtime/annotation/pdf-export/export.js +13 -1
- package/dist/runtime/annotation/pdf-export/parse_circle.js +3 -0
- package/dist/runtime/annotation/pdf-export/parse_freetext.js +31 -19
- package/dist/runtime/annotation/pdf-export/parse_highlight.js +3 -0
- package/dist/runtime/annotation/pdf-export/parse_ink.js +5 -1
- package/dist/runtime/annotation/pdf-export/parse_line.js +5 -1
- package/dist/runtime/annotation/pdf-export/parse_polyline.js +5 -1
- package/dist/runtime/annotation/pdf-export/parse_square.js +3 -0
- package/dist/runtime/annotation/pdf-export/parse_stamp.js +4 -2
- package/dist/runtime/annotation/pdf-export/parse_strikeout.js +3 -0
- package/dist/runtime/annotation/pdf-export/parse_text.js +3 -0
- package/dist/runtime/annotation/pdf-export/parse_underline.js +3 -0
- package/dist/runtime/annotation/pdf-export/unicode-font.d.ts +5 -0
- package/dist/runtime/annotation/pdf-export/unicode-font.js +31 -0
- package/dist/runtime/annotation/pdf-export/winansi.d.ts +17 -0
- package/dist/runtime/annotation/pdf-export/winansi.js +77 -0
- package/dist/runtime/annotation/pdf-import/decode_circle.js +0 -1
- package/dist/runtime/annotation/pdf-import/decode_ink.js +0 -1
- package/dist/runtime/annotation/pdf-import/decode_line.js +0 -1
- package/dist/runtime/annotation/pdf-import/decode_square.js +0 -1
- package/dist/runtime/annotation/pdf-import/extract_stamp_appearance.d.ts +12 -0
- package/dist/runtime/annotation/pdf-import/extract_stamp_appearance.js +17 -4
- package/dist/runtime/annotation/pdf-import/types.d.ts +2 -0
- package/dist/runtime/assets/fonts/LICENSE-LiberationSans +102 -0
- package/dist/runtime/assets/fonts/LiberationSans-Regular.ttf +0 -0
- package/dist/runtime/assets/kviewer.css +1 -1
- package/dist/runtime/components/AnnotationToolbar.vue +6 -4
- package/dist/runtime/components/PdfPage.d.vue.ts +16 -0
- package/dist/runtime/components/PdfPage.vue +170 -9
- package/dist/runtime/components/PdfPage.vue.d.ts +16 -0
- package/dist/runtime/components/PerfHud.d.vue.ts +3 -0
- package/dist/runtime/components/PerfHud.vue +97 -0
- package/dist/runtime/components/PerfHud.vue.d.ts +3 -0
- package/dist/runtime/components/ToolButton.vue +4 -1
- package/dist/runtime/components/Viewer.d.vue.ts +37 -2
- package/dist/runtime/components/Viewer.vue +208 -13
- package/dist/runtime/components/Viewer.vue.d.ts +37 -2
- package/dist/runtime/components/ViewerBar.d.vue.ts +21 -1
- package/dist/runtime/components/ViewerBar.vue +183 -101
- package/dist/runtime/components/ViewerBar.vue.d.ts +21 -1
- package/dist/runtime/components/ViewerTabs.d.vue.ts +10 -2
- package/dist/runtime/components/ViewerTabs.vue +13 -2
- package/dist/runtime/components/ViewerTabs.vue.d.ts +10 -2
- package/dist/runtime/components/form-fields/FormDropdown.vue +50 -19
- package/dist/runtime/components/form-fields/FormSignatureField.vue +4 -2
- package/dist/runtime/components/form-fields/FormTextField.vue +7 -18
- package/dist/runtime/components/modals/FreeTextModal.vue +6 -4
- package/dist/runtime/components/modals/SignatureDrawModal.vue +6 -4
- package/dist/runtime/components/panels/PlacedFieldSidebar.vue +67 -50
- package/dist/runtime/components/panels/SignaturePicker.vue +6 -4
- package/dist/runtime/components/panels/StampPicker.vue +3 -1
- package/dist/runtime/components/tools/AnnotationToolButton.d.vue.ts +10 -0
- package/dist/runtime/components/tools/AnnotationToolButton.vue +33 -0
- package/dist/runtime/components/tools/AnnotationToolButton.vue.d.ts +10 -0
- package/dist/runtime/components/tools/MarqueeTool.vue +3 -1
- package/dist/runtime/components/tools/PageSettings.vue +13 -11
- package/dist/runtime/components/tools/SearchTool.vue +12 -10
- package/dist/runtime/components/tools/ToolProperties.vue +7 -5
- package/dist/runtime/components/tools/ToolbarMenu.d.vue.ts +9 -0
- package/dist/runtime/components/tools/ToolbarMenu.vue +79 -0
- package/dist/runtime/components/tools/ToolbarMenu.vue.d.ts +9 -0
- package/dist/runtime/components/tools/ZoomControls.vue +17 -9
- package/dist/runtime/composables/canvas-limits.d.ts +22 -0
- package/dist/runtime/composables/canvas-limits.js +10 -0
- package/dist/runtime/composables/useFormFields.d.ts +6 -0
- package/dist/runtime/composables/useFormFields.js +28 -0
- package/dist/runtime/composables/useInertiaPanzoom.d.ts +10 -0
- package/dist/runtime/composables/useInertiaPanzoom.js +57 -10
- package/dist/runtime/composables/useKviewerI18n.d.ts +18 -0
- package/dist/runtime/composables/useKviewerI18n.js +29 -0
- package/dist/runtime/composables/usePageVirtualization.d.ts +11 -0
- package/dist/runtime/composables/usePageVirtualization.js +40 -0
- package/dist/runtime/composables/useScriptingManager.d.ts +8 -4
- package/dist/runtime/composables/useScriptingManager.js +2 -0
- package/dist/runtime/composables/useViewerState.d.ts +4 -0
- package/dist/runtime/composables/useViewerState.js +8 -0
- package/dist/runtime/embed/bridge-client.d.ts +9 -1
- package/dist/runtime/embed/bridge-client.js +13 -0
- package/dist/runtime/embed/bridge-host.d.ts +3 -0
- package/dist/runtime/embed/bridge-host.js +30 -8
- package/dist/runtime/embed/protocol.d.ts +21 -0
- package/dist/runtime/i18n/messages.d.ts +252 -0
- package/dist/runtime/i18n/messages.js +249 -0
- package/dist/runtime/public-types.d.ts +2 -0
- package/dist/runtime/toolbar-tools.d.ts +54 -0
- package/dist/runtime/toolbar-tools.js +79 -0
- package/dist/types.d.mts +1 -1
- package/package.json +14 -31
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
export const messages = {
|
|
2
|
+
en: {
|
|
3
|
+
// Common actions
|
|
4
|
+
cancel: "Cancel",
|
|
5
|
+
ok: "OK",
|
|
6
|
+
save: "Save",
|
|
7
|
+
clear: "Clear",
|
|
8
|
+
delete: "Delete",
|
|
9
|
+
download: "Download",
|
|
10
|
+
// Toolbar
|
|
11
|
+
search: "Search",
|
|
12
|
+
marqueeSelect: "Marquee select",
|
|
13
|
+
eraser: "Eraser",
|
|
14
|
+
color: "Color",
|
|
15
|
+
editText: "Edit text",
|
|
16
|
+
strokeWidth: "Stroke width",
|
|
17
|
+
decreaseStrokeWidth: "Decrease stroke width",
|
|
18
|
+
increaseStrokeWidth: "Increase stroke width",
|
|
19
|
+
noProperties: "No properties",
|
|
20
|
+
detectFormFields: "Detect form fields",
|
|
21
|
+
disableFormFieldDetection: "Disable form field detection",
|
|
22
|
+
fitWidth: "Fit width",
|
|
23
|
+
fitPage: "Fit page",
|
|
24
|
+
stamp: "Stamp",
|
|
25
|
+
signature: "Signature",
|
|
26
|
+
// Search panel
|
|
27
|
+
searchPlaceholder: "Find in document...",
|
|
28
|
+
previousMatch: "Previous match",
|
|
29
|
+
nextMatch: "Next match",
|
|
30
|
+
matchCase: "Match case",
|
|
31
|
+
wholeWord: "Whole word",
|
|
32
|
+
highlightAll: "Highlight all",
|
|
33
|
+
closeSearch: "Close search",
|
|
34
|
+
noResults: "No results",
|
|
35
|
+
typeToSearch: "Type to search",
|
|
36
|
+
// Modals
|
|
37
|
+
freeText: "Free text",
|
|
38
|
+
startTyping: "Start typing...",
|
|
39
|
+
drawSignature: "Draw signature",
|
|
40
|
+
noSavedSignatures: "No saved signatures",
|
|
41
|
+
addSignature: "Add signature",
|
|
42
|
+
selectedCount: "{count} selected",
|
|
43
|
+
// Page settings menu
|
|
44
|
+
pageTransition: "Page transition",
|
|
45
|
+
continuous: "Continuous",
|
|
46
|
+
pageByPage: "Page by page",
|
|
47
|
+
rotate: "Rotate",
|
|
48
|
+
rotateClockwise: "Clockwise",
|
|
49
|
+
rotateCounterclockwise: "Counterclockwise",
|
|
50
|
+
layout: "Layout",
|
|
51
|
+
singlePage: "Single page",
|
|
52
|
+
twoPages: "Two pages",
|
|
53
|
+
stylusMode: "Stylus mode",
|
|
54
|
+
fullscreen: "Fullscreen",
|
|
55
|
+
// Form-field sidebar
|
|
56
|
+
fieldProperties: "Field properties",
|
|
57
|
+
fieldName: "Field name",
|
|
58
|
+
fieldNameHint: "Shared names group radio buttons and bind multiple widgets to the same value.",
|
|
59
|
+
required: "Required",
|
|
60
|
+
readOnly: "Read-only",
|
|
61
|
+
multiLine: "Multi-line",
|
|
62
|
+
maxLength: "Max length",
|
|
63
|
+
noLimit: "No limit",
|
|
64
|
+
style: "Style",
|
|
65
|
+
checkboxStyleHint: "Glyph drawn when checked. Saved as /MK /CA on export.",
|
|
66
|
+
options: "Options",
|
|
67
|
+
optionLabelPlaceholder: "Label",
|
|
68
|
+
addOption: "Add option",
|
|
69
|
+
comboBox: "Combo box (collapsible)",
|
|
70
|
+
allowCustomText: "Allow custom text",
|
|
71
|
+
multiSelect: "Multi-select",
|
|
72
|
+
promptText: "Prompt text",
|
|
73
|
+
clickToSign: "Click to sign",
|
|
74
|
+
promptTextHint: 'Shown on the unsigned widget. Defaults to "{default}".',
|
|
75
|
+
lockFieldsAfterSigning: "Lock fields after signing",
|
|
76
|
+
lockFieldsHint: "Once this signature is filled, listed fields become read-only inside the viewer. Not preserved on PDF export.",
|
|
77
|
+
lockNone: "None",
|
|
78
|
+
lockAllOther: "All other fields",
|
|
79
|
+
lockSelectedOnly: "Selected fields only",
|
|
80
|
+
lockAllExceptSelected: "All except selected",
|
|
81
|
+
lockTheseFields: "Lock these fields",
|
|
82
|
+
lockAllFieldsExcept: "Lock all fields except",
|
|
83
|
+
noOtherNamedFields: "No other named fields in the document.",
|
|
84
|
+
group: "Group",
|
|
85
|
+
newGroup: "+ New group",
|
|
86
|
+
radioGroupHint: "Radios sharing a group act as one \u2014 picking one clears the others.",
|
|
87
|
+
optionValue: "Option value",
|
|
88
|
+
optionValueHint: "Value stored when this option is selected. Must be unique inside the group.",
|
|
89
|
+
typeLabel: "Type",
|
|
90
|
+
pageLabel: "Page",
|
|
91
|
+
deleteField: "Delete field",
|
|
92
|
+
selectFieldHint: "Select a placed field to edit its properties.",
|
|
93
|
+
fieldTypeText: "Text field",
|
|
94
|
+
fieldTypeCheckbox: "Checkbox",
|
|
95
|
+
fieldTypeRadio: "Radio button",
|
|
96
|
+
fieldTypeSignature: "Signature field",
|
|
97
|
+
fieldTypeDropdown: "Dropdown",
|
|
98
|
+
fieldTypeButton: "Button",
|
|
99
|
+
fieldTypeGeneric: "Field",
|
|
100
|
+
fieldOnPage: "{type} on page {page}",
|
|
101
|
+
// Checkbox glyph styles
|
|
102
|
+
styleCheck: "Check",
|
|
103
|
+
styleCross: "Cross",
|
|
104
|
+
styleDiamond: "Diamond",
|
|
105
|
+
styleCircle: "Circle",
|
|
106
|
+
styleStar: "Star",
|
|
107
|
+
styleSquare: "Square",
|
|
108
|
+
// Tool tooltips (keyed from the engine tool `name`)
|
|
109
|
+
toolSelect: "Select",
|
|
110
|
+
toolHighlight: "Highlight",
|
|
111
|
+
toolStrikeout: "Strike out",
|
|
112
|
+
toolUnderline: "Underline",
|
|
113
|
+
toolRectangle: "Rectangle",
|
|
114
|
+
toolCircle: "Ellipse",
|
|
115
|
+
toolNote: "Note",
|
|
116
|
+
toolArrow: "Arrow",
|
|
117
|
+
toolCloud: "Cloud",
|
|
118
|
+
toolFreehand: "Pen",
|
|
119
|
+
toolFreeHighlight: "Highlighter",
|
|
120
|
+
toolFreeText: "Text",
|
|
121
|
+
toolSignature: "Signature",
|
|
122
|
+
toolStamp: "Stamp",
|
|
123
|
+
toolFormText: "Text field",
|
|
124
|
+
toolFormCheckbox: "Checkbox",
|
|
125
|
+
toolFormSignature: "Signature field",
|
|
126
|
+
toolFormRadio: "Radio button",
|
|
127
|
+
toolEraser: "Eraser"
|
|
128
|
+
},
|
|
129
|
+
de: {
|
|
130
|
+
cancel: "Abbrechen",
|
|
131
|
+
ok: "OK",
|
|
132
|
+
save: "Speichern",
|
|
133
|
+
clear: "Leeren",
|
|
134
|
+
delete: "L\xF6schen",
|
|
135
|
+
download: "Herunterladen",
|
|
136
|
+
search: "Suchen",
|
|
137
|
+
marqueeSelect: "Mehrfachauswahl",
|
|
138
|
+
eraser: "Radierer",
|
|
139
|
+
color: "Farbe",
|
|
140
|
+
editText: "Text bearbeiten",
|
|
141
|
+
strokeWidth: "Linienst\xE4rke",
|
|
142
|
+
decreaseStrokeWidth: "Linienst\xE4rke verringern",
|
|
143
|
+
increaseStrokeWidth: "Linienst\xE4rke erh\xF6hen",
|
|
144
|
+
noProperties: "Keine Eigenschaften",
|
|
145
|
+
detectFormFields: "Formularfelder erkennen",
|
|
146
|
+
disableFormFieldDetection: "Formularfeld-Erkennung deaktivieren",
|
|
147
|
+
fitWidth: "Seitenbreite",
|
|
148
|
+
fitPage: "Ganze Seite",
|
|
149
|
+
stamp: "Stempel",
|
|
150
|
+
signature: "Unterschrift",
|
|
151
|
+
searchPlaceholder: "Im Dokument suchen...",
|
|
152
|
+
previousMatch: "Vorheriger Treffer",
|
|
153
|
+
nextMatch: "N\xE4chster Treffer",
|
|
154
|
+
matchCase: "Gro\xDF-/Kleinschreibung",
|
|
155
|
+
wholeWord: "Ganzes Wort",
|
|
156
|
+
highlightAll: "Alle hervorheben",
|
|
157
|
+
closeSearch: "Suche schlie\xDFen",
|
|
158
|
+
noResults: "Keine Treffer",
|
|
159
|
+
typeToSearch: "Suchbegriff eingeben",
|
|
160
|
+
freeText: "Freitext",
|
|
161
|
+
startTyping: "Text eingeben...",
|
|
162
|
+
drawSignature: "Unterschrift zeichnen",
|
|
163
|
+
noSavedSignatures: "Keine gespeicherten Unterschriften",
|
|
164
|
+
addSignature: "Unterschrift hinzuf\xFCgen",
|
|
165
|
+
selectedCount: "{count} ausgew\xE4hlt",
|
|
166
|
+
pageTransition: "Seiten\xFCbergang",
|
|
167
|
+
continuous: "Fortlaufend",
|
|
168
|
+
pageByPage: "Seite f\xFCr Seite",
|
|
169
|
+
rotate: "Drehen",
|
|
170
|
+
rotateClockwise: "Im Uhrzeigersinn",
|
|
171
|
+
rotateCounterclockwise: "Gegen den Uhrzeigersinn",
|
|
172
|
+
layout: "Layout",
|
|
173
|
+
singlePage: "Einseitig",
|
|
174
|
+
twoPages: "Zweiseitig",
|
|
175
|
+
stylusMode: "Stiftmodus",
|
|
176
|
+
fullscreen: "Vollbildansicht",
|
|
177
|
+
fieldProperties: "Feldeigenschaften",
|
|
178
|
+
fieldName: "Feldname",
|
|
179
|
+
fieldNameHint: "Gleiche Namen gruppieren Optionsfelder und verbinden mehrere Widgets mit demselben Wert.",
|
|
180
|
+
required: "Pflichtfeld",
|
|
181
|
+
readOnly: "Schreibgesch\xFCtzt",
|
|
182
|
+
multiLine: "Mehrzeilig",
|
|
183
|
+
maxLength: "Maximale L\xE4nge",
|
|
184
|
+
noLimit: "Kein Limit",
|
|
185
|
+
style: "Stil",
|
|
186
|
+
checkboxStyleHint: "Symbol im angekreuzten Zustand. Wird beim Export als /MK /CA gespeichert.",
|
|
187
|
+
options: "Optionen",
|
|
188
|
+
optionLabelPlaceholder: "Beschriftung",
|
|
189
|
+
addOption: "Option hinzuf\xFCgen",
|
|
190
|
+
comboBox: "Kombinationsfeld (aufklappbar)",
|
|
191
|
+
allowCustomText: "Eigenen Text erlauben",
|
|
192
|
+
multiSelect: "Mehrfachauswahl",
|
|
193
|
+
promptText: "Hinweistext",
|
|
194
|
+
clickToSign: "Zum Unterschreiben klicken",
|
|
195
|
+
promptTextHint: 'Wird auf dem nicht unterschriebenen Feld angezeigt. Standard: "{default}".',
|
|
196
|
+
lockFieldsAfterSigning: "Felder nach Unterschrift sperren",
|
|
197
|
+
lockFieldsHint: "Sobald diese Unterschrift ausgef\xFCllt ist, werden die gew\xE4hlten Felder im Viewer schreibgesch\xFCtzt. Wird beim PDF-Export nicht \xFCbernommen.",
|
|
198
|
+
lockNone: "Keine",
|
|
199
|
+
lockAllOther: "Alle anderen Felder",
|
|
200
|
+
lockSelectedOnly: "Nur ausgew\xE4hlte Felder",
|
|
201
|
+
lockAllExceptSelected: "Alle au\xDFer ausgew\xE4hlte",
|
|
202
|
+
lockTheseFields: "Diese Felder sperren",
|
|
203
|
+
lockAllFieldsExcept: "Alle Felder sperren au\xDFer",
|
|
204
|
+
noOtherNamedFields: "Keine weiteren benannten Felder im Dokument.",
|
|
205
|
+
group: "Gruppe",
|
|
206
|
+
newGroup: "+ Neue Gruppe",
|
|
207
|
+
radioGroupHint: "Optionsfelder derselben Gruppe wirken als eines \u2014 die Auswahl eines Feldes hebt die anderen auf.",
|
|
208
|
+
optionValue: "Optionswert",
|
|
209
|
+
optionValueHint: "Wert, der bei Auswahl dieser Option gespeichert wird. Muss innerhalb der Gruppe eindeutig sein.",
|
|
210
|
+
typeLabel: "Typ",
|
|
211
|
+
pageLabel: "Seite",
|
|
212
|
+
deleteField: "Feld l\xF6schen",
|
|
213
|
+
selectFieldHint: "W\xE4hlen Sie ein platziertes Feld aus, um seine Eigenschaften zu bearbeiten.",
|
|
214
|
+
fieldTypeText: "Textfeld",
|
|
215
|
+
fieldTypeCheckbox: "Kontrollk\xE4stchen",
|
|
216
|
+
fieldTypeRadio: "Optionsfeld",
|
|
217
|
+
fieldTypeSignature: "Unterschriftsfeld",
|
|
218
|
+
fieldTypeDropdown: "Auswahlliste",
|
|
219
|
+
fieldTypeButton: "Schaltfl\xE4che",
|
|
220
|
+
fieldTypeGeneric: "Feld",
|
|
221
|
+
fieldOnPage: "{type} auf Seite {page}",
|
|
222
|
+
styleCheck: "Haken",
|
|
223
|
+
styleCross: "Kreuz",
|
|
224
|
+
styleDiamond: "Raute",
|
|
225
|
+
styleCircle: "Kreis",
|
|
226
|
+
styleStar: "Stern",
|
|
227
|
+
styleSquare: "Quadrat",
|
|
228
|
+
toolSelect: "Ausw\xE4hlen",
|
|
229
|
+
toolHighlight: "Hervorheben",
|
|
230
|
+
toolStrikeout: "Durchstreichen",
|
|
231
|
+
toolUnderline: "Unterstreichen",
|
|
232
|
+
toolRectangle: "Rechteck",
|
|
233
|
+
toolCircle: "Ellipse",
|
|
234
|
+
toolNote: "Notiz",
|
|
235
|
+
toolArrow: "Pfeil",
|
|
236
|
+
toolCloud: "Wolke",
|
|
237
|
+
toolFreehand: "Stift",
|
|
238
|
+
toolFreeHighlight: "Marker",
|
|
239
|
+
toolFreeText: "Text",
|
|
240
|
+
toolSignature: "Unterschrift",
|
|
241
|
+
toolStamp: "Stempel",
|
|
242
|
+
toolFormText: "Textfeld",
|
|
243
|
+
toolFormCheckbox: "Kontrollk\xE4stchen",
|
|
244
|
+
toolFormSignature: "Unterschriftsfeld",
|
|
245
|
+
toolFormRadio: "Optionsfeld",
|
|
246
|
+
toolEraser: "Radierer"
|
|
247
|
+
}
|
|
248
|
+
};
|
|
249
|
+
export const KVIEWER_LOCALES = Object.keys(messages);
|
|
@@ -2,6 +2,7 @@ export type { ExportPdfOptions } from './annotation/pdf-export/export.js';
|
|
|
2
2
|
export type { ViewerTabItem, AddTabOptions } from './components/ViewerTabs.vue.js';
|
|
3
3
|
export type { AddFormFieldPayload, CheckboxStyle, FormFieldDefinition, FormFieldOrigin, FormFieldType, FormFieldValue, SignatureData, SignatureHandlers, } from './annotation/engine/types.js';
|
|
4
4
|
export type { ViewMode } from './composables/viewMode.js';
|
|
5
|
+
export type { ViewerState, ActiveTool } from './composables/useViewerState.js';
|
|
5
6
|
export type { KViewerApi, KViewerEmbedBridgeOptions, } from './embed/bridge-host.js';
|
|
6
7
|
export { useKViewerEmbedBridge } from './embed/bridge-host.js';
|
|
7
8
|
export type { KViewerEmbedClientOptions } from './embed/bridge-client.js';
|
|
@@ -9,3 +10,4 @@ export { KViewerEmbedClient } from './embed/bridge-client.js';
|
|
|
9
10
|
export type { EventName as KViewerEmbedEventName, EventPayloads as KViewerEmbedEventPayloads, MethodName as KViewerEmbedMethodName, } from './embed/protocol.js';
|
|
10
11
|
export { KVIEWER_EMBED_PROTOCOL_VERSION } from './embed/protocol.js';
|
|
11
12
|
export type { ViewerMenuItem, ViewerMenuButtonItem, ViewerMenuCheckboxItem, ViewerMenuSeparatorItem, } from './menu-items.js';
|
|
13
|
+
export type { ViewerToolId, ViewerTopToolId, ViewerBottomToolId, ViewerLayoutToolId, ViewerToolEntry, ViewerToolSlot, } from './toolbar-tools.js';
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { InjectionKey, Ref } from 'vue';
|
|
2
|
+
import { AnnotationType } from './annotation/engine/types.js';
|
|
3
|
+
/** Built-in tools that live in the top navigation row. Each maps to a
|
|
4
|
+
* whole self-contained sub-component. `hand` / `marquee` are readonly-gated. */
|
|
5
|
+
export type ViewerTopToolId = 'menu' | 'pageSettings' | 'zoom' | 'hand' | 'marquee' | 'pageInfo' | 'search';
|
|
6
|
+
/** Built-in tools that live in the second (annotation) row, controlled
|
|
7
|
+
* per individual button. IDs match the annotation `name` in
|
|
8
|
+
* `annotation/engine/config.ts` (so `freeHighlight` never collides with
|
|
9
|
+
* the text-selection `highlight`). The `select`/`highlight`/`strikeout`/
|
|
10
|
+
* `underline`/`circle`/`note`/`arrow`/`cloud` entries have no button in
|
|
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';
|
|
13
|
+
/** Layout primitives usable in either row. `separator` draws a vertical
|
|
14
|
+
* divider; `spacer` pushes everything after it to the right (flex
|
|
15
|
+
* `ml-auto`) — this is how you reproduce today's right-aligned group. */
|
|
16
|
+
export type ViewerLayoutToolId = 'separator' | 'spacer';
|
|
17
|
+
export type ViewerToolId = ViewerTopToolId | ViewerBottomToolId | ViewerLayoutToolId;
|
|
18
|
+
/** A custom toolbar button, rendered from the host-supplied `#tool-<name>`
|
|
19
|
+
* slot at this position. Mirrors the `menuItems` discriminated-union
|
|
20
|
+
* pattern. See {@link ViewerToolEntry}. */
|
|
21
|
+
export interface ViewerToolSlot {
|
|
22
|
+
type: 'slot';
|
|
23
|
+
/** Stable key for v-for; also the slot name unless `name` is set. */
|
|
24
|
+
key: string;
|
|
25
|
+
/** Slot-name suffix — the host fills `#tool-<name>`. Defaults to `key`. */
|
|
26
|
+
name?: string;
|
|
27
|
+
/** Which row to place this custom button in. When omitted it inherits
|
|
28
|
+
* the row of the preceding entry (top until the first bottom tool). */
|
|
29
|
+
row?: 'top' | 'bottom';
|
|
30
|
+
}
|
|
31
|
+
/** One entry in the `tools` prop: either a built-in tool ID (a plain
|
|
32
|
+
* string — controls presence + order) or a {@link ViewerToolSlot} object
|
|
33
|
+
* that injects a custom button via a named slot. */
|
|
34
|
+
export type ViewerToolEntry = ViewerToolId | ViewerToolSlot;
|
|
35
|
+
/** Top-row built-in IDs. */
|
|
36
|
+
export declare const TOP_TOOL_IDS: ReadonlySet<string>;
|
|
37
|
+
/** Top-row tools hidden whenever `readonly` is true. */
|
|
38
|
+
export declare const READONLY_HIDDEN_TOP: ReadonlySet<string>;
|
|
39
|
+
/** Form-mode bottom-row tools — render only when `formEditMode` is on. */
|
|
40
|
+
export declare const FORM_TOOLS: ReadonlySet<string>;
|
|
41
|
+
/** Draw/annotate-mode bottom-row tools — render only when `formEditMode`
|
|
42
|
+
* is off (matches today's center swap). */
|
|
43
|
+
export declare const DRAW_TOOLS: ReadonlySet<string>;
|
|
44
|
+
/** Bottom-row built-in IDs (everything that is not top-row or layout). */
|
|
45
|
+
export declare const BOTTOM_TOOL_IDS: ReadonlySet<string>;
|
|
46
|
+
/** Maps an annotation-button ID to the {@link AnnotationType} it selects.
|
|
47
|
+
* `stamp`/`signature` are pickers and `undo`/`redo`/`properties` are not
|
|
48
|
+
* annotation tools, so they are intentionally absent. `eraser` is handled
|
|
49
|
+
* separately (it is not an annotation type). */
|
|
50
|
+
export declare const ANNOTATION_TOOL_TYPES: Partial<Record<string, AnnotationType>>;
|
|
51
|
+
/** Injection key for the toolbar `styleVersion` ref. `ViewerBar` provides
|
|
52
|
+
* it (bumped when `ToolProperties` edits a tool's style) so standalone
|
|
53
|
+
* `AnnotationToolButton`s refresh their color indicator. */
|
|
54
|
+
export declare const STYLE_VERSION_KEY: InjectionKey<Ref<number>>;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { AnnotationType } from "./annotation/engine/types.js";
|
|
2
|
+
export const TOP_TOOL_IDS = /* @__PURE__ */ new Set([
|
|
3
|
+
"menu",
|
|
4
|
+
"pageSettings",
|
|
5
|
+
"zoom",
|
|
6
|
+
"hand",
|
|
7
|
+
"marquee",
|
|
8
|
+
"pageInfo",
|
|
9
|
+
"search"
|
|
10
|
+
]);
|
|
11
|
+
export const READONLY_HIDDEN_TOP = /* @__PURE__ */ new Set([
|
|
12
|
+
"hand",
|
|
13
|
+
"marquee"
|
|
14
|
+
]);
|
|
15
|
+
export const FORM_TOOLS = /* @__PURE__ */ new Set([
|
|
16
|
+
"formText",
|
|
17
|
+
"formCheckbox",
|
|
18
|
+
"formRadio",
|
|
19
|
+
"formSignature"
|
|
20
|
+
]);
|
|
21
|
+
export const DRAW_TOOLS = /* @__PURE__ */ new Set([
|
|
22
|
+
"freehand",
|
|
23
|
+
"freeHighlight",
|
|
24
|
+
"freeText",
|
|
25
|
+
"stamp",
|
|
26
|
+
"signature",
|
|
27
|
+
"rectangle",
|
|
28
|
+
"select",
|
|
29
|
+
"highlight",
|
|
30
|
+
"strikeout",
|
|
31
|
+
"underline",
|
|
32
|
+
"circle",
|
|
33
|
+
"note",
|
|
34
|
+
"arrow",
|
|
35
|
+
"cloud"
|
|
36
|
+
]);
|
|
37
|
+
export const BOTTOM_TOOL_IDS = /* @__PURE__ */ new Set([
|
|
38
|
+
"properties",
|
|
39
|
+
"freehand",
|
|
40
|
+
"freeHighlight",
|
|
41
|
+
"freeText",
|
|
42
|
+
"stamp",
|
|
43
|
+
"signature",
|
|
44
|
+
"rectangle",
|
|
45
|
+
"formText",
|
|
46
|
+
"formCheckbox",
|
|
47
|
+
"formRadio",
|
|
48
|
+
"formSignature",
|
|
49
|
+
"undo",
|
|
50
|
+
"redo",
|
|
51
|
+
"eraser",
|
|
52
|
+
"select",
|
|
53
|
+
"highlight",
|
|
54
|
+
"strikeout",
|
|
55
|
+
"underline",
|
|
56
|
+
"circle",
|
|
57
|
+
"note",
|
|
58
|
+
"arrow",
|
|
59
|
+
"cloud"
|
|
60
|
+
]);
|
|
61
|
+
export const ANNOTATION_TOOL_TYPES = {
|
|
62
|
+
freehand: AnnotationType.FREEHAND,
|
|
63
|
+
freeHighlight: AnnotationType.FREE_HIGHLIGHT,
|
|
64
|
+
freeText: AnnotationType.FREETEXT,
|
|
65
|
+
rectangle: AnnotationType.RECTANGLE,
|
|
66
|
+
formText: AnnotationType.FORM_TEXT,
|
|
67
|
+
formCheckbox: AnnotationType.FORM_CHECKBOX,
|
|
68
|
+
formRadio: AnnotationType.FORM_RADIO,
|
|
69
|
+
formSignature: AnnotationType.FORM_SIGNATURE,
|
|
70
|
+
select: AnnotationType.SELECT,
|
|
71
|
+
highlight: AnnotationType.HIGHLIGHT,
|
|
72
|
+
strikeout: AnnotationType.STRIKEOUT,
|
|
73
|
+
underline: AnnotationType.UNDERLINE,
|
|
74
|
+
circle: AnnotationType.CIRCLE,
|
|
75
|
+
note: AnnotationType.NOTE,
|
|
76
|
+
arrow: AnnotationType.ARROW,
|
|
77
|
+
cloud: AnnotationType.CLOUD
|
|
78
|
+
};
|
|
79
|
+
export const STYLE_VERSION_KEY = Symbol("kviewer-style-version");
|
package/dist/types.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { type AddFormFieldPayload, type CheckboxStyle, type ExportPdfOptions, type FormFieldDefinition, type FormFieldOrigin, type FormFieldType, type FormFieldValue, type KVIEWER_EMBED_PROTOCOL_VERSION, type KViewerApi, type KViewerEmbedBridgeOptions, type KViewerEmbedClient, type KViewerEmbedClientOptions, type KViewerEmbedEventName, type KViewerEmbedEventPayloads, type KViewerEmbedMethodName, type SignatureData, type SignatureHandlers, type ViewMode, type ViewerMenuButtonItem, type ViewerMenuCheckboxItem, type ViewerMenuItem, type ViewerMenuSeparatorItem, type useKViewerEmbedBridge } from '../dist/runtime/public-types.js'
|
|
1
|
+
export { type ActiveTool, type AddFormFieldPayload, type CheckboxStyle, type ExportPdfOptions, type FormFieldDefinition, type FormFieldOrigin, type FormFieldType, type FormFieldValue, type KVIEWER_EMBED_PROTOCOL_VERSION, type KViewerApi, type KViewerEmbedBridgeOptions, type KViewerEmbedClient, type KViewerEmbedClientOptions, type KViewerEmbedEventName, type KViewerEmbedEventPayloads, type KViewerEmbedMethodName, type SignatureData, type SignatureHandlers, type ViewMode, type ViewerBottomToolId, type ViewerLayoutToolId, type ViewerMenuButtonItem, type ViewerMenuCheckboxItem, type ViewerMenuItem, type ViewerMenuSeparatorItem, type ViewerState, type ViewerToolEntry, type ViewerToolId, type ViewerToolSlot, type ViewerTopToolId, type useKViewerEmbedBridge } from '../dist/runtime/public-types.js'
|
|
2
2
|
|
|
3
3
|
export { default } from './module.mjs'
|
|
4
4
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kviewer",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Kabema PDF Editor",
|
|
5
5
|
"repository": "kabema/kviewer",
|
|
6
6
|
"license": "MIT",
|
|
@@ -28,26 +28,14 @@
|
|
|
28
28
|
"playground",
|
|
29
29
|
"docs"
|
|
30
30
|
],
|
|
31
|
-
"scripts": {
|
|
32
|
-
"prepack": "nuxt-module-build build",
|
|
33
|
-
"dev": "npm run dev:prepare && portless kviewer nuxt dev playground",
|
|
34
|
-
"dev:build": "nuxt build playground",
|
|
35
|
-
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxt prepare playground",
|
|
36
|
-
"release": "npm run lint && npm run test && npm run prepack && changelogen --release && npm publish && git push --follow-tags",
|
|
37
|
-
"lint": "eslint .",
|
|
38
|
-
"test": "vitest run --exclude '**/e2e/**'",
|
|
39
|
-
"test:watch": "vitest watch",
|
|
40
|
-
"test:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit",
|
|
41
|
-
"test:e2e": "playwright test",
|
|
42
|
-
"test:e2e:ui": "playwright test --ui"
|
|
43
|
-
},
|
|
44
31
|
"dependencies": {
|
|
45
32
|
"@iconify-json/lucide": "^1.2.101",
|
|
46
33
|
"@nuxt/kit": "^4.4.2",
|
|
47
34
|
"@nuxt/ui": "^4.6.0",
|
|
35
|
+
"@pdf-lib/fontkit": "^1.1.1",
|
|
48
36
|
"konva": "^10.2.3",
|
|
49
37
|
"pdf-lib": "^1.17.1",
|
|
50
|
-
"pdfjs-dist": "^
|
|
38
|
+
"pdfjs-dist": "^6.0.227",
|
|
51
39
|
"tailwindcss": "^4.2.2"
|
|
52
40
|
},
|
|
53
41
|
"devDependencies": {
|
|
@@ -70,20 +58,15 @@
|
|
|
70
58
|
"vitest": "^4.1.1",
|
|
71
59
|
"vue-tsc": "^3.2.6"
|
|
72
60
|
},
|
|
73
|
-
"
|
|
74
|
-
|
|
75
|
-
"
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
],
|
|
84
|
-
"overrides": {
|
|
85
|
-
"vue": "^3.5.32",
|
|
86
|
-
"vue-router": "^5.0.4"
|
|
87
|
-
}
|
|
61
|
+
"scripts": {
|
|
62
|
+
"dev": "npm run dev:prepare && portless kviewer nuxt dev playground",
|
|
63
|
+
"dev:build": "nuxt build playground",
|
|
64
|
+
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxt prepare playground",
|
|
65
|
+
"lint": "eslint .",
|
|
66
|
+
"test": "vitest run --exclude '**/e2e/**'",
|
|
67
|
+
"test:watch": "vitest watch",
|
|
68
|
+
"test:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit",
|
|
69
|
+
"test:e2e": "playwright test",
|
|
70
|
+
"test:e2e:ui": "playwright test --ui"
|
|
88
71
|
}
|
|
89
|
-
}
|
|
72
|
+
}
|