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,46 @@
1
+ <template>
2
+ <UPopover v-if="state.stamps.value.length > 0" v-model:open="popoverOpen">
3
+ <button
4
+ class="relative flex items-center justify-center w-8 h-8 rounded-md transition-colors cursor-pointer"
5
+ :class="isActive ? 'bg-default text-highlighted' : 'text-muted hover:bg-default/50 hover:text-highlighted'"
6
+ title="Stamp"
7
+ >
8
+ <UIcon name="i-lucide-stamp" class="text-lg" />
9
+ </button>
10
+ <template #content>
11
+ <div class="p-3">
12
+ <div class="grid grid-cols-3 gap-3">
13
+ <button
14
+ v-for="stamp in state.stamps.value"
15
+ :key="stamp.id"
16
+ class="flex items-center justify-center w-16 h-16 rounded-lg bg-white border-2 cursor-pointer transition-colors"
17
+ :class="state.activeStamp.value?.id === stamp.id ? 'border-primary' : 'border-transparent hover:border-muted'"
18
+ :title="stamp.name"
19
+ @click="selectStamp(stamp)"
20
+ >
21
+ <img
22
+ :src="stamp.previewUrl || stamp.imageUrl"
23
+ :alt="stamp.name"
24
+ class="w-10 h-10 object-contain"
25
+ >
26
+ </button>
27
+ </div>
28
+ </div>
29
+ </template>
30
+ </UPopover>
31
+ </template>
32
+
33
+ <script setup>
34
+ import { ref, computed } from "vue";
35
+ import { useViewerState } from "../../composables/useViewerState";
36
+ import { AnnotationType } from "../../annotation/engine/types";
37
+ const state = useViewerState();
38
+ const popoverOpen = ref(false);
39
+ const isActive = computed(() => state.activeTool.value === AnnotationType.STAMP);
40
+ function selectStamp(stamp) {
41
+ state.activeStamp.value = stamp;
42
+ const dataTransfer = stamp.width || stamp.height ? JSON.stringify({ url: stamp.imageUrl, width: stamp.width, height: stamp.height }) : stamp.imageUrl;
43
+ state.selectTool(AnnotationType.STAMP, dataTransfer);
44
+ popoverOpen.value = false;
45
+ }
46
+ </script>
@@ -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;
@@ -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;
@@ -0,0 +1,32 @@
1
+ <template>
2
+ <div class="flex items-center gap-1">
3
+ <UButton
4
+ icon="i-lucide-undo-2"
5
+ variant="ghost"
6
+ color="neutral"
7
+ size="sm"
8
+ :disabled="!state.history.canUndo.value"
9
+ @click="state.history.undo"
10
+ />
11
+ <UButton
12
+ icon="i-lucide-redo-2"
13
+ variant="ghost"
14
+ color="neutral"
15
+ size="sm"
16
+ :disabled="!state.history.canRedo.value"
17
+ @click="state.history.redo"
18
+ />
19
+ <UButton
20
+ icon="i-lucide-eraser"
21
+ :variant="state.activeTool.value === 'eraser' ? 'soft' : 'ghost'"
22
+ color="neutral"
23
+ size="sm"
24
+ @click="state.selectTool('eraser')"
25
+ />
26
+ </div>
27
+ </template>
28
+
29
+ <script setup>
30
+ import { useViewerState } from "../../composables/useViewerState";
31
+ const state = useViewerState();
32
+ </script>
@@ -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;
@@ -0,0 +1,6 @@
1
+ type __VLS_Props = {
2
+ styleVersion: number;
3
+ };
4
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
5
+ declare const _default: typeof __VLS_export;
6
+ export default _default;
@@ -0,0 +1,57 @@
1
+ <template>
2
+ <div class="flex items-center gap-1">
3
+ <ToolButton
4
+ :tool="getDef(AnnotationType.FREEHAND)"
5
+ :active="state.activeTool.value === AnnotationType.FREEHAND"
6
+ :indicator-color="indicatorColors[AnnotationType.FREEHAND]"
7
+ @click="state.selectTool(AnnotationType.FREEHAND)"
8
+ />
9
+ <ToolButton
10
+ :tool="getDef(AnnotationType.FREE_HIGHLIGHT)"
11
+ :active="state.activeTool.value === AnnotationType.FREE_HIGHLIGHT"
12
+ :indicator-color="indicatorColors[AnnotationType.FREE_HIGHLIGHT]"
13
+ @click="state.selectTool(AnnotationType.FREE_HIGHLIGHT)"
14
+ />
15
+ <ToolButton
16
+ :tool="getDef(AnnotationType.FREETEXT)"
17
+ :active="state.activeTool.value === AnnotationType.FREETEXT"
18
+ @click="state.selectTool(AnnotationType.FREETEXT)"
19
+ />
20
+ <StampPicker />
21
+ <SignaturePicker />
22
+ <ToolButton
23
+ :tool="getDef(AnnotationType.RECTANGLE)"
24
+ :active="state.activeTool.value === AnnotationType.RECTANGLE"
25
+ :indicator-color="indicatorColors[AnnotationType.RECTANGLE]"
26
+ @click="state.selectTool(AnnotationType.RECTANGLE)"
27
+ />
28
+ </div>
29
+ </template>
30
+
31
+ <script setup>
32
+ import { computed } from "vue";
33
+ import { useViewerState } from "../../composables/useViewerState";
34
+ import { AnnotationType } from "../../annotation/engine/types";
35
+ import { annotationDefinitions } from "../../annotation/engine/config";
36
+ import ToolButton from "../ToolButton.vue";
37
+ import StampPicker from "../panels/StampPicker.vue";
38
+ import SignaturePicker from "../panels/SignaturePicker.vue";
39
+ const props = defineProps({
40
+ styleVersion: { type: Number, required: true }
41
+ });
42
+ const state = useViewerState();
43
+ function getDef(type) {
44
+ return annotationDefinitions.find((d) => d.type === type);
45
+ }
46
+ const indicatorColors = computed(() => {
47
+ const version = props.styleVersion;
48
+ return {
49
+ [AnnotationType.FREEHAND]: getIndicatorColor(AnnotationType.FREEHAND, version),
50
+ [AnnotationType.FREE_HIGHLIGHT]: getIndicatorColor(AnnotationType.FREE_HIGHLIGHT, version),
51
+ [AnnotationType.RECTANGLE]: getIndicatorColor(AnnotationType.RECTANGLE, version)
52
+ };
53
+ });
54
+ function getIndicatorColor(type, _version) {
55
+ return getDef(type)?.style?.color;
56
+ }
57
+ </script>
@@ -0,0 +1,6 @@
1
+ type __VLS_Props = {
2
+ styleVersion: number;
3
+ };
4
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
5
+ declare const _default: typeof __VLS_export;
6
+ export default _default;
@@ -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;
@@ -0,0 +1,14 @@
1
+ <template>
2
+ <UButton
3
+ icon="i-lucide-hand"
4
+ :variant="state.activeTool.value === 'hand' ? 'soft' : 'ghost'"
5
+ color="neutral"
6
+ size="xs"
7
+ @click="state.selectTool('hand')"
8
+ />
9
+ </template>
10
+
11
+ <script setup>
12
+ import { useViewerState } from "../../composables/useViewerState";
13
+ const state = useViewerState();
14
+ </script>
@@ -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;
@@ -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;
@@ -0,0 +1,15 @@
1
+ <template>
2
+ <UButton
3
+ icon="i-lucide-square-dashed-mouse-pointer"
4
+ :variant="state.activeTool.value === 'marquee' ? 'soft' : 'ghost'"
5
+ color="neutral"
6
+ size="xs"
7
+ title="Marquee Select"
8
+ @click="state.selectTool('marquee')"
9
+ />
10
+ </template>
11
+
12
+ <script setup>
13
+ import { useViewerState } from "../../composables/useViewerState";
14
+ const state = useViewerState();
15
+ </script>
@@ -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;
@@ -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;
@@ -0,0 +1,10 @@
1
+ <template>
2
+ <span v-if="state.totalPages.value" class="text-xs text-muted">
3
+ {{ state.totalPages.value }} pages
4
+ </span>
5
+ </template>
6
+
7
+ <script setup>
8
+ import { useViewerState } from "../../composables/useViewerState";
9
+ const state = useViewerState();
10
+ </script>
@@ -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;
@@ -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;
@@ -0,0 +1,92 @@
1
+ <template>
2
+ <UDropdownMenu :items="menuItems" :content="{ align: 'start' }">
3
+ <UButton
4
+ icon="i-lucide-file-cog"
5
+ variant="ghost"
6
+ color="neutral"
7
+ size="xs"
8
+ />
9
+ </UDropdownMenu>
10
+ </template>
11
+
12
+ <script setup>
13
+ import { computed } from "vue";
14
+ import { usePageSettings } from "../../composables/usePageSettings";
15
+ import { useViewerState } from "../../composables/useViewerState";
16
+ const settings = usePageSettings();
17
+ const state = useViewerState();
18
+ const menuItems = computed(() => [
19
+ [
20
+ {
21
+ label: "Seiten\xFCbergang",
22
+ type: "label"
23
+ },
24
+ {
25
+ label: "Fortlaufend",
26
+ icon: "i-lucide-rows-3",
27
+ type: "checkbox",
28
+ checked: settings.pageTransition.value === "continuous",
29
+ onUpdateChecked: () => settings.setPageTransition("continuous")
30
+ },
31
+ {
32
+ label: "Seite f\xFCr Seite",
33
+ icon: "i-lucide-file",
34
+ type: "checkbox",
35
+ checked: settings.pageTransition.value === "single-page",
36
+ onUpdateChecked: () => settings.setPageTransition("single-page")
37
+ }
38
+ ],
39
+ [
40
+ {
41
+ label: "Drehen",
42
+ type: "label"
43
+ },
44
+ {
45
+ label: "Im Uhrzeigersinn",
46
+ icon: "i-lucide-rotate-cw",
47
+ onSelect: () => settings.rotateCW()
48
+ },
49
+ {
50
+ label: "Gegen den Uhrzeigersinn",
51
+ icon: "i-lucide-rotate-ccw",
52
+ onSelect: () => settings.rotateCCW()
53
+ }
54
+ ],
55
+ [
56
+ {
57
+ label: "Layout",
58
+ type: "label"
59
+ },
60
+ {
61
+ label: "Einseitig",
62
+ icon: "i-lucide-square",
63
+ type: "checkbox",
64
+ checked: settings.layoutMode.value === "single",
65
+ onUpdateChecked: () => settings.setLayoutMode("single")
66
+ },
67
+ {
68
+ label: "Zweiseitig",
69
+ icon: "i-lucide-columns-2",
70
+ type: "checkbox",
71
+ checked: settings.layoutMode.value === "double",
72
+ onUpdateChecked: () => settings.setLayoutMode("double")
73
+ }
74
+ ],
75
+ [
76
+ {
77
+ label: "Stiftmodus",
78
+ icon: "i-lucide-pen-tool",
79
+ type: "checkbox",
80
+ checked: state.stylusMode.value,
81
+ onUpdateChecked: () => state.setStylusMode(!state.stylusMode.value)
82
+ }
83
+ ],
84
+ [
85
+ {
86
+ label: "Vollbildansicht",
87
+ icon: "i-lucide-maximize",
88
+ onSelect: () => settings.toggleFullscreen()
89
+ }
90
+ ]
91
+ ]);
92
+ </script>
@@ -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;
@@ -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;
@@ -0,0 +1,149 @@
1
+ <template>
2
+ <div class="flex items-center gap-1">
3
+ <UButton
4
+ icon="i-lucide-search"
5
+ :variant="search.isOpen.value ? 'soft' : 'ghost'"
6
+ color="neutral"
7
+ size="xs"
8
+ title="Search"
9
+ @click="toggleOpen"
10
+ />
11
+
12
+ <div
13
+ v-if="search.isOpen.value"
14
+ class="flex items-center gap-1 rounded-md border border-default bg-default px-2 py-1"
15
+ >
16
+ <UInput
17
+ ref="queryInputRef"
18
+ :model-value="search.query.value"
19
+ placeholder="Find in document..."
20
+ variant="outline"
21
+ color="neutral"
22
+ size="xs"
23
+ class="w-56"
24
+ @update:model-value="onQueryChange"
25
+ @keydown="onInputKeydown"
26
+ />
27
+
28
+ <span class="min-w-16 text-center text-[11px] text-muted">
29
+ {{ statusLabel }}
30
+ </span>
31
+
32
+ <UButton
33
+ icon="i-lucide-chevron-up"
34
+ variant="ghost"
35
+ color="neutral"
36
+ size="xs"
37
+ :disabled="!hasMatches"
38
+ title="Previous match"
39
+ @click="search.findPrevious"
40
+ />
41
+ <UButton
42
+ icon="i-lucide-chevron-down"
43
+ variant="ghost"
44
+ color="neutral"
45
+ size="xs"
46
+ :disabled="!hasMatches"
47
+ title="Next match"
48
+ @click="search.findNext"
49
+ />
50
+
51
+ <UButton
52
+ :variant="search.matchCase.value ? 'soft' : 'ghost'"
53
+ color="neutral"
54
+ size="xs"
55
+ title="Match Case"
56
+ @click="search.toggleMatchCase"
57
+ >
58
+ Aa
59
+ </UButton>
60
+ <UButton
61
+ :variant="search.wholeWord.value ? 'soft' : 'ghost'"
62
+ color="neutral"
63
+ size="xs"
64
+ title="Whole Word"
65
+ @click="search.toggleWholeWord"
66
+ >
67
+ W
68
+ </UButton>
69
+ <UButton
70
+ :variant="search.highlightAll.value ? 'soft' : 'ghost'"
71
+ color="neutral"
72
+ size="xs"
73
+ title="Highlight All"
74
+ @click="search.toggleHighlightAll"
75
+ >
76
+ All
77
+ </UButton>
78
+
79
+ <UButton
80
+ icon="i-lucide-x"
81
+ variant="ghost"
82
+ color="neutral"
83
+ size="xs"
84
+ title="Close search"
85
+ @click="search.close"
86
+ />
87
+ </div>
88
+ </div>
89
+ </template>
90
+
91
+ <script setup>
92
+ import { computed, nextTick, onMounted, ref, watch } from "vue";
93
+ import { useViewerSearch } from "../../composables/useViewerSearch";
94
+ const search = useViewerSearch();
95
+ const queryInputRef = ref(null);
96
+ const hasMatches = computed(() => search.totalMatches.value > 0);
97
+ const statusLabel = computed(() => {
98
+ if (!search.query.value) return "Type to search";
99
+ if (search.notFound.value) return "No results";
100
+ return `${search.currentMatch.value}/${search.totalMatches.value}`;
101
+ });
102
+ function resolveInputElement() {
103
+ const input = queryInputRef.value?.inputRef ?? queryInputRef.value?.$el?.querySelector("input") ?? null;
104
+ if (input instanceof HTMLInputElement) {
105
+ search.setInputElement(input);
106
+ }
107
+ }
108
+ function toggleOpen() {
109
+ if (search.isOpen.value) {
110
+ search.close();
111
+ return;
112
+ }
113
+ search.open();
114
+ nextTick(() => {
115
+ resolveInputElement();
116
+ search.focusInput();
117
+ });
118
+ }
119
+ function onQueryChange(value) {
120
+ search.setQuery(String(value ?? ""));
121
+ }
122
+ function onInputKeydown(event) {
123
+ if (event.key === "Enter") {
124
+ event.preventDefault();
125
+ if (event.shiftKey) {
126
+ search.findPrevious();
127
+ } else {
128
+ search.findNext();
129
+ }
130
+ }
131
+ if (event.key === "Escape") {
132
+ event.preventDefault();
133
+ search.close();
134
+ }
135
+ }
136
+ onMounted(() => {
137
+ resolveInputElement();
138
+ });
139
+ watch(
140
+ () => search.isOpen.value,
141
+ (open) => {
142
+ if (!open) return;
143
+ nextTick(() => {
144
+ resolveInputElement();
145
+ search.focusInput();
146
+ });
147
+ }
148
+ );
149
+ </script>
@@ -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;
@@ -0,0 +1,7 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
2
+ styleUpdated: () => any;
3
+ }, string, import("vue").PublicProps, Readonly<{}> & Readonly<{
4
+ onStyleUpdated?: (() => any) | undefined;
5
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
6
+ declare const _default: typeof __VLS_export;
7
+ export default _default;