@embedpdf/plugin-annotation 2.2.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1232 -101
- package/dist/index.js.map +1 -1
- package/dist/lib/actions.d.ts +33 -3
- package/dist/lib/annotation-plugin.d.ts +178 -2
- package/dist/lib/handlers/types.d.ts +1 -1
- package/dist/lib/helpers.d.ts +8 -2
- package/dist/lib/selectors.d.ts +97 -8
- package/dist/lib/tools/default-tools.d.ts +39 -11
- package/dist/lib/tools/types.d.ts +22 -4
- package/dist/lib/types.d.ts +278 -1
- package/dist/preact/adapter.d.ts +3 -3
- package/dist/preact/index.cjs +1 -1
- package/dist/preact/index.cjs.map +1 -1
- package/dist/preact/index.js +1133 -403
- package/dist/preact/index.js.map +1 -1
- package/dist/react/adapter.d.ts +1 -1
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.js +1132 -402
- package/dist/react/index.js.map +1 -1
- package/dist/shared/components/annotation-container.d.ts +13 -2
- package/dist/shared/components/annotation-layer.d.ts +6 -2
- package/dist/shared/components/annotations/ink.d.ts +3 -3
- package/dist/shared/components/annotations/link.d.ts +28 -0
- package/dist/shared/components/annotations.d.ts +4 -1
- package/dist/shared/components/group-selection-box.d.ts +32 -0
- package/dist/shared/components/index.d.ts +1 -0
- package/dist/shared/components/text-markup/highlight.d.ts +3 -2
- package/dist/shared/components/text-markup/squiggly.d.ts +3 -2
- package/dist/shared/components/text-markup/strikeout.d.ts +3 -2
- package/dist/shared/components/text-markup/underline.d.ts +3 -2
- package/dist/shared/components/types.d.ts +50 -1
- package/dist/shared/context/index.d.ts +1 -0
- package/dist/shared/context/renderer-registry.d.ts +21 -0
- package/dist/shared/index.d.ts +2 -0
- package/dist/shared-preact/components/annotation-container.d.ts +13 -2
- package/dist/shared-preact/components/annotation-layer.d.ts +6 -2
- package/dist/shared-preact/components/annotations/ink.d.ts +3 -3
- package/dist/shared-preact/components/annotations/link.d.ts +28 -0
- package/dist/shared-preact/components/annotations.d.ts +4 -1
- package/dist/shared-preact/components/group-selection-box.d.ts +32 -0
- package/dist/shared-preact/components/index.d.ts +1 -0
- package/dist/shared-preact/components/text-markup/highlight.d.ts +3 -2
- package/dist/shared-preact/components/text-markup/squiggly.d.ts +3 -2
- package/dist/shared-preact/components/text-markup/strikeout.d.ts +3 -2
- package/dist/shared-preact/components/text-markup/underline.d.ts +3 -2
- package/dist/shared-preact/components/types.d.ts +50 -1
- package/dist/shared-preact/context/index.d.ts +1 -0
- package/dist/shared-preact/context/renderer-registry.d.ts +21 -0
- package/dist/shared-preact/index.d.ts +2 -0
- package/dist/shared-react/components/annotation-container.d.ts +13 -2
- package/dist/shared-react/components/annotation-layer.d.ts +6 -2
- package/dist/shared-react/components/annotations/ink.d.ts +3 -3
- package/dist/shared-react/components/annotations/link.d.ts +28 -0
- package/dist/shared-react/components/annotations.d.ts +4 -1
- package/dist/shared-react/components/group-selection-box.d.ts +32 -0
- package/dist/shared-react/components/index.d.ts +1 -0
- package/dist/shared-react/components/text-markup/highlight.d.ts +3 -2
- package/dist/shared-react/components/text-markup/squiggly.d.ts +3 -2
- package/dist/shared-react/components/text-markup/strikeout.d.ts +3 -2
- package/dist/shared-react/components/text-markup/underline.d.ts +3 -2
- package/dist/shared-react/components/types.d.ts +50 -1
- package/dist/shared-react/context/index.d.ts +1 -0
- package/dist/shared-react/context/renderer-registry.d.ts +21 -0
- package/dist/shared-react/index.d.ts +2 -0
- package/dist/svelte/components/AnnotationLayer.svelte.d.ts +8 -1
- package/dist/svelte/components/Annotations.svelte.d.ts +8 -1
- package/dist/svelte/components/GroupSelectionBox.svelte.d.ts +32 -0
- package/dist/svelte/components/RendererRegistryProvider.svelte.d.ts +7 -0
- package/dist/svelte/components/annotations/Ink.svelte.d.ts +2 -1
- package/dist/svelte/components/annotations/Link.svelte.d.ts +24 -0
- package/dist/svelte/components/annotations/index.d.ts +1 -0
- package/dist/svelte/components/index.d.ts +2 -0
- package/dist/svelte/components/text-markup/Highlight.svelte.d.ts +2 -1
- package/dist/svelte/components/text-markup/Squiggly.svelte.d.ts +2 -1
- package/dist/svelte/components/text-markup/Strikeout.svelte.d.ts +2 -1
- package/dist/svelte/components/text-markup/Underline.svelte.d.ts +2 -1
- package/dist/svelte/components/types.d.ts +2 -0
- package/dist/svelte/context/index.d.ts +2 -0
- package/dist/svelte/context/renderer-registry.svelte.d.ts +20 -0
- package/dist/svelte/context/types.d.ts +33 -0
- package/dist/svelte/index.cjs +1 -1
- package/dist/svelte/index.cjs.map +1 -1
- package/dist/svelte/index.d.ts +2 -0
- package/dist/svelte/index.js +1215 -394
- package/dist/svelte/index.js.map +1 -1
- package/dist/svelte/types.d.ts +7 -0
- package/dist/vue/components/annotation-container.vue.d.ts +3 -1
- package/dist/vue/components/annotation-layer.vue.d.ts +31 -5
- package/dist/vue/components/annotations/free-text.vue.d.ts +1 -1
- package/dist/vue/components/annotations/index.d.ts +1 -0
- package/dist/vue/components/annotations/ink.vue.d.ts +2 -2
- package/dist/vue/components/annotations/line.vue.d.ts +1 -1
- package/dist/vue/components/annotations/link.vue.d.ts +29 -0
- package/dist/vue/components/annotations/polygon.vue.d.ts +1 -1
- package/dist/vue/components/annotations/polyline.vue.d.ts +1 -1
- package/dist/vue/components/annotations/stamp.vue.d.ts +1 -1
- package/dist/vue/components/annotations.vue.d.ts +151 -53
- package/dist/vue/components/group-selection-box.vue.d.ts +73 -0
- package/dist/vue/components/index.d.ts +2 -0
- package/dist/vue/components/preview-renderer.vue.d.ts +1 -1
- package/dist/vue/components/renderer-registry-provider.vue.d.ts +13 -0
- package/dist/vue/components/text-markup/highlight.vue.d.ts +2 -2
- package/dist/vue/components/text-markup/squiggly.vue.d.ts +2 -2
- package/dist/vue/components/text-markup/strikeout.vue.d.ts +2 -2
- package/dist/vue/components/text-markup/underline.vue.d.ts +2 -2
- package/dist/vue/context/index.d.ts +2 -0
- package/dist/vue/context/renderer-registry.d.ts +26 -0
- package/dist/vue/context/types.d.ts +33 -0
- package/dist/vue/hooks/use-annotation.d.ts +7 -5
- package/dist/vue/index.cjs +1 -1
- package/dist/vue/index.cjs.map +1 -1
- package/dist/vue/index.d.ts +3 -1
- package/dist/vue/index.js +1124 -459
- package/dist/vue/index.js.map +1 -1
- package/dist/vue/types.d.ts +8 -1
- package/package.json +10 -10
package/dist/vue/index.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { AnnotationPlugin, initialDocumentState, patching, getAnnotationsByPageIndex, getSelectedAnnotationByPageIndex, isInk, isSquare, isCircle, isLine, isPolyline, isPolygon, isFreeText, isStamp, isUnderline, isStrikeout, isSquiggly, isHighlight } from "@embedpdf/plugin-annotation";
|
|
1
|
+
import { createPluginPackage } from "@embedpdf/core";
|
|
2
|
+
import { AnnotationPlugin, initialDocumentState, patching, getAnnotationsByPageIndex, getSelectedAnnotationIds, resolveInteractionProp, isInk, isSquare, isCircle, isLine, isPolyline, isPolygon, isFreeText, isStamp, isUnderline, isStrikeout, isSquiggly, isHighlight, isLink, AnnotationPluginPackage as AnnotationPluginPackage$1 } from "@embedpdf/plugin-annotation";
|
|
4
3
|
export * from "@embedpdf/plugin-annotation";
|
|
4
|
+
import { ref, toValue, watch, computed, defineComponent, shallowRef, toRaw, useSlots, watchEffect, createElementBlock, openBlock, createElementVNode, createBlock, createCommentVNode, mergeProps, unref, renderSlot, Fragment, renderList, withCtx, resolveDynamicComponent, normalizeStyle, onMounted, toDisplayString, onUnmounted, createVNode, createSlots, normalizeProps, guardReactiveProps, provide, inject, markRaw } from "vue";
|
|
5
5
|
import { useInteractionHandles, useDoublePressProps, CounterRotate, deepToRaw } from "@embedpdf/utils/vue";
|
|
6
|
-
import {
|
|
6
|
+
import { usePlugin, useCapability, useDocumentPermissions, useDocumentState } from "@embedpdf/core/vue";
|
|
7
|
+
import { boundingRectOrEmpty, PdfAnnotationBorderStyle, textAlignmentToCss, standardFontCss, PdfVerticalAlignment, ignore, PdfErrorCode, blendModeToCss, PdfBlendMode, PdfAnnotationSubtype, Rotation } from "@embedpdf/models";
|
|
7
8
|
import { usePointerHandlers } from "@embedpdf/plugin-interaction-manager/vue";
|
|
8
9
|
import { useSelectionCapability } from "@embedpdf/plugin-selection/vue";
|
|
9
10
|
const useAnnotationPlugin = () => usePlugin(AnnotationPlugin.id);
|
|
@@ -36,14 +37,14 @@ const useAnnotation = (documentId) => {
|
|
|
36
37
|
})
|
|
37
38
|
};
|
|
38
39
|
};
|
|
39
|
-
const _hoisted_1$
|
|
40
|
+
const _hoisted_1$a = {
|
|
40
41
|
"data-no-interaction": "",
|
|
41
42
|
style: { display: "contents" }
|
|
42
43
|
};
|
|
43
44
|
const __default__ = {
|
|
44
45
|
inheritAttrs: false
|
|
45
46
|
};
|
|
46
|
-
const _sfc_main$
|
|
47
|
+
const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
47
48
|
...__default__,
|
|
48
49
|
__name: "annotation-container",
|
|
49
50
|
props: {
|
|
@@ -55,6 +56,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
55
56
|
pageHeight: {},
|
|
56
57
|
trackedAnnotation: {},
|
|
57
58
|
isSelected: { type: Boolean },
|
|
59
|
+
isMultiSelected: { type: Boolean, default: false },
|
|
58
60
|
isDraggable: { type: Boolean },
|
|
59
61
|
isResizable: { type: Boolean },
|
|
60
62
|
lockAspectRatio: { type: Boolean, default: false },
|
|
@@ -75,13 +77,15 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
75
77
|
const VERTEX_SIZE = 12;
|
|
76
78
|
const preview = shallowRef(toRaw(props.trackedAnnotation.object));
|
|
77
79
|
const { provides: annotationCapability } = useAnnotationCapability();
|
|
80
|
+
const { plugin: annotationPlugin } = useAnnotationPlugin();
|
|
78
81
|
const permissions = useDocumentPermissions(props.documentId);
|
|
79
82
|
const gestureBaseRef = ref(null);
|
|
83
|
+
const gestureBaseRectRef = shallowRef(null);
|
|
80
84
|
const effectiveIsDraggable = computed(
|
|
81
|
-
() => permissions.value.canModifyAnnotations && props.isDraggable
|
|
85
|
+
() => permissions.value.canModifyAnnotations && props.isDraggable && !props.isMultiSelected
|
|
82
86
|
);
|
|
83
87
|
const effectiveIsResizable = computed(
|
|
84
|
-
() => permissions.value.canModifyAnnotations && props.isResizable
|
|
88
|
+
() => permissions.value.canModifyAnnotations && props.isResizable && !props.isMultiSelected
|
|
85
89
|
);
|
|
86
90
|
const guardedOnDoubleClick = props.onDoubleClick ? (e) => {
|
|
87
91
|
var _a;
|
|
@@ -95,8 +99,9 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
95
99
|
const currentObject = computed(
|
|
96
100
|
() => ({ ...toRaw(props.trackedAnnotation.object), ...toRaw(preview.value) })
|
|
97
101
|
);
|
|
102
|
+
const showOutline = computed(() => props.isSelected && !props.isMultiSelected);
|
|
98
103
|
const shouldShowMenu = computed(() => {
|
|
99
|
-
return props.isSelected && (props.selectionMenu || slots["selection-menu"]);
|
|
104
|
+
return props.isSelected && !props.isMultiSelected && (props.selectionMenu || slots["selection-menu"]);
|
|
100
105
|
});
|
|
101
106
|
const menuRect = computed(() => ({
|
|
102
107
|
origin: {
|
|
@@ -154,30 +159,60 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
154
159
|
maintainAspectRatio: computed(() => props.lockAspectRatio),
|
|
155
160
|
pageRotation: computed(() => props.rotation),
|
|
156
161
|
scale: computed(() => props.scale),
|
|
157
|
-
|
|
162
|
+
// Disable interaction handles when multi-selected
|
|
163
|
+
enabled: computed(() => props.isSelected && !props.isMultiSelected),
|
|
158
164
|
onUpdate: (event) => {
|
|
159
|
-
var _a, _b, _c
|
|
160
|
-
if (!((_a = event.transformData) == null ? void 0 : _a.type)) return;
|
|
165
|
+
var _a, _b, _c;
|
|
166
|
+
if (!((_a = event.transformData) == null ? void 0 : _a.type) || props.isMultiSelected) return;
|
|
167
|
+
const plugin = annotationPlugin.value;
|
|
168
|
+
if (!plugin) return;
|
|
169
|
+
const { type, changes, metadata } = event.transformData;
|
|
170
|
+
const id = props.trackedAnnotation.object.id;
|
|
171
|
+
const pageSize = { width: props.pageWidth, height: props.pageHeight };
|
|
161
172
|
if (event.state === "start") {
|
|
173
|
+
gestureBaseRectRef.value = props.trackedAnnotation.object.rect;
|
|
162
174
|
gestureBaseRef.value = currentObject.value;
|
|
175
|
+
if (type === "move") {
|
|
176
|
+
plugin.startDrag(props.documentId, { annotationIds: [id], pageSize });
|
|
177
|
+
} else if (type === "resize") {
|
|
178
|
+
plugin.startResize(props.documentId, {
|
|
179
|
+
annotationIds: [id],
|
|
180
|
+
pageSize,
|
|
181
|
+
resizeHandle: (metadata == null ? void 0 : metadata.handle) ?? "se"
|
|
182
|
+
});
|
|
183
|
+
}
|
|
163
184
|
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
185
|
+
if (changes.rect && gestureBaseRectRef.value) {
|
|
186
|
+
if (type === "move") {
|
|
187
|
+
const delta = {
|
|
188
|
+
x: changes.rect.origin.x - gestureBaseRectRef.value.origin.x,
|
|
189
|
+
y: changes.rect.origin.y - gestureBaseRectRef.value.origin.y
|
|
190
|
+
};
|
|
191
|
+
plugin.updateDrag(props.documentId, delta);
|
|
192
|
+
} else if (type === "resize") {
|
|
193
|
+
plugin.updateResize(props.documentId, changes.rect);
|
|
194
|
+
}
|
|
173
195
|
}
|
|
174
|
-
if (
|
|
196
|
+
if (type === "vertex-edit" && changes.vertices && props.vertexConfig) {
|
|
197
|
+
const base = gestureBaseRef.value ?? currentObject.value;
|
|
198
|
+
const vertexChanges = props.vertexConfig.transformAnnotation(toRaw(base), changes.vertices);
|
|
199
|
+
const patched = (_b = annotationCapability.value) == null ? void 0 : _b.transformAnnotation(base, {
|
|
200
|
+
type,
|
|
201
|
+
changes: vertexChanges,
|
|
202
|
+
metadata
|
|
203
|
+
});
|
|
204
|
+
if (patched) {
|
|
205
|
+
preview.value = { ...toRaw(preview.value), ...patched };
|
|
206
|
+
if (event.state === "end") {
|
|
207
|
+
(_c = annotationProvides.value) == null ? void 0 : _c.updateAnnotation(props.pageIndex, id, patched);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
if (event.state === "end") {
|
|
212
|
+
gestureBaseRectRef.value = null;
|
|
175
213
|
gestureBaseRef.value = null;
|
|
176
|
-
(
|
|
177
|
-
|
|
178
|
-
props.trackedAnnotation.object.id,
|
|
179
|
-
patched
|
|
180
|
-
);
|
|
214
|
+
if (type === "move") plugin.commitDrag(props.documentId);
|
|
215
|
+
else if (type === "resize") plugin.commitResize(props.documentId);
|
|
181
216
|
}
|
|
182
217
|
}
|
|
183
218
|
},
|
|
@@ -195,22 +230,37 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
195
230
|
includeVertices: !!props.vertexConfig
|
|
196
231
|
});
|
|
197
232
|
const doubleProps = useDoublePressProps(guardedOnDoubleClick);
|
|
198
|
-
|
|
199
|
-
(
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
233
|
+
watchEffect(() => {
|
|
234
|
+
if (props.trackedAnnotation.object) {
|
|
235
|
+
preview.value = props.trackedAnnotation.object;
|
|
236
|
+
}
|
|
237
|
+
});
|
|
238
|
+
watchEffect((onCleanup) => {
|
|
239
|
+
const plugin = annotationPlugin.value;
|
|
240
|
+
if (!plugin) return;
|
|
241
|
+
const id = props.trackedAnnotation.object.id;
|
|
242
|
+
const handleEvent = (event) => {
|
|
243
|
+
var _a;
|
|
244
|
+
if (event.documentId !== props.documentId) return;
|
|
245
|
+
const patch = (_a = event.previewPatches) == null ? void 0 : _a[id];
|
|
246
|
+
if (event.type === "update" && patch) {
|
|
247
|
+
preview.value = { ...toRaw(preview.value), ...patch };
|
|
248
|
+
} else if (event.type === "cancel") {
|
|
249
|
+
preview.value = props.trackedAnnotation.object;
|
|
250
|
+
}
|
|
251
|
+
};
|
|
252
|
+
const unsubs = [plugin.onDragChange(handleEvent), plugin.onResizeChange(handleEvent)];
|
|
253
|
+
onCleanup(() => unsubs.forEach((u) => u()));
|
|
254
|
+
});
|
|
205
255
|
const containerStyle = computed(() => ({
|
|
206
256
|
position: "absolute",
|
|
207
257
|
left: `${currentObject.value.rect.origin.x * props.scale}px`,
|
|
208
258
|
top: `${currentObject.value.rect.origin.y * props.scale}px`,
|
|
209
259
|
width: `${currentObject.value.rect.size.width * props.scale}px`,
|
|
210
260
|
height: `${currentObject.value.rect.size.height * props.scale}px`,
|
|
211
|
-
outline:
|
|
212
|
-
outlineOffset:
|
|
213
|
-
pointerEvents: props.isSelected ? "auto" : "none",
|
|
261
|
+
outline: showOutline.value ? `1px solid ${props.selectionOutlineColor}` : "none",
|
|
262
|
+
outlineOffset: showOutline.value ? `${props.outlineOffset}px` : "0px",
|
|
263
|
+
pointerEvents: props.isSelected && !props.isMultiSelected ? "auto" : "none",
|
|
214
264
|
touchAction: "none",
|
|
215
265
|
cursor: props.isSelected && effectiveIsDraggable.value ? "move" : "default",
|
|
216
266
|
zIndex: props.zIndex
|
|
@@ -221,7 +271,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
221
271
|
}));
|
|
222
272
|
const slots = useSlots();
|
|
223
273
|
return (_ctx, _cache) => {
|
|
224
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
274
|
+
return openBlock(), createElementBlock("div", _hoisted_1$a, [
|
|
225
275
|
createElementVNode("div", mergeProps({ ...effectiveIsDraggable.value && __props.isSelected ? unref(dragProps) : {}, ...unref(doubleProps) }, { style: mergedContainerStyle.value }), [
|
|
226
276
|
renderSlot(_ctx.$slots, "default", { annotation: currentObject.value }),
|
|
227
277
|
__props.isSelected && effectiveIsResizable.value ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(unref(resize), ({ key, style, ...handle }) => {
|
|
@@ -241,7 +291,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
241
291
|
}), null, 16))
|
|
242
292
|
], 64);
|
|
243
293
|
}), 128)) : createCommentVNode("", true),
|
|
244
|
-
__props.isSelected && unref(permissions).canModifyAnnotations && unref(vertices).length > 0 ? (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(unref(vertices), ({ key, style, ...vertex }) => {
|
|
294
|
+
__props.isSelected && unref(permissions).canModifyAnnotations && !__props.isMultiSelected && unref(vertices).length > 0 ? (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(unref(vertices), ({ key, style, ...vertex }) => {
|
|
245
295
|
return openBlock(), createElementBlock(Fragment, { key }, [
|
|
246
296
|
unref(slots)["vertex-handle"] ? renderSlot(_ctx.$slots, "vertex-handle", mergeProps({
|
|
247
297
|
key: 0,
|
|
@@ -280,9 +330,245 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
280
330
|
};
|
|
281
331
|
}
|
|
282
332
|
});
|
|
283
|
-
const _hoisted_1$
|
|
284
|
-
|
|
285
|
-
|
|
333
|
+
const _hoisted_1$9 = {
|
|
334
|
+
key: 0,
|
|
335
|
+
"data-group-selection-box": "",
|
|
336
|
+
"data-no-interaction": ""
|
|
337
|
+
};
|
|
338
|
+
const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
339
|
+
__name: "group-selection-box",
|
|
340
|
+
props: {
|
|
341
|
+
documentId: {},
|
|
342
|
+
pageIndex: {},
|
|
343
|
+
scale: {},
|
|
344
|
+
rotation: {},
|
|
345
|
+
pageWidth: {},
|
|
346
|
+
pageHeight: {},
|
|
347
|
+
selectedAnnotations: {},
|
|
348
|
+
isDraggable: { type: Boolean },
|
|
349
|
+
isResizable: { type: Boolean },
|
|
350
|
+
resizeUI: {},
|
|
351
|
+
selectionOutlineColor: { default: "#007ACC" },
|
|
352
|
+
outlineOffset: { default: 2 },
|
|
353
|
+
zIndex: { default: 100 },
|
|
354
|
+
groupSelectionMenu: {}
|
|
355
|
+
},
|
|
356
|
+
setup(__props) {
|
|
357
|
+
const props = __props;
|
|
358
|
+
const slots = useSlots();
|
|
359
|
+
const { plugin: annotationPlugin } = useAnnotationPlugin();
|
|
360
|
+
const permissions = useDocumentPermissions(() => props.documentId);
|
|
361
|
+
const gestureBase = shallowRef(null);
|
|
362
|
+
const isDraggingRef = ref(false);
|
|
363
|
+
const isResizingRef = ref(false);
|
|
364
|
+
const effectiveIsDraggable = computed(
|
|
365
|
+
() => permissions.value.canModifyAnnotations && props.isDraggable
|
|
366
|
+
);
|
|
367
|
+
const effectiveIsResizable = computed(
|
|
368
|
+
() => permissions.value.canModifyAnnotations && props.isResizable
|
|
369
|
+
);
|
|
370
|
+
const HANDLE_COLOR = computed(() => {
|
|
371
|
+
var _a;
|
|
372
|
+
return ((_a = props.resizeUI) == null ? void 0 : _a.color) ?? "#007ACC";
|
|
373
|
+
});
|
|
374
|
+
const HANDLE_SIZE = computed(() => {
|
|
375
|
+
var _a;
|
|
376
|
+
return ((_a = props.resizeUI) == null ? void 0 : _a.size) ?? 12;
|
|
377
|
+
});
|
|
378
|
+
const groupBox = computed(() => {
|
|
379
|
+
const rects = props.selectedAnnotations.map((ta) => ta.object.rect);
|
|
380
|
+
return boundingRectOrEmpty(rects);
|
|
381
|
+
});
|
|
382
|
+
const previewGroupBox = shallowRef(groupBox.value);
|
|
383
|
+
watch(
|
|
384
|
+
() => groupBox.value,
|
|
385
|
+
(newGroupBox) => {
|
|
386
|
+
if (!isDraggingRef.value && !isResizingRef.value) {
|
|
387
|
+
previewGroupBox.value = newGroupBox;
|
|
388
|
+
}
|
|
389
|
+
},
|
|
390
|
+
{ immediate: true }
|
|
391
|
+
);
|
|
392
|
+
const boxStyle = computed(() => ({
|
|
393
|
+
position: "absolute",
|
|
394
|
+
left: `${previewGroupBox.value.origin.x * props.scale}px`,
|
|
395
|
+
top: `${previewGroupBox.value.origin.y * props.scale}px`,
|
|
396
|
+
width: `${previewGroupBox.value.size.width * props.scale}px`,
|
|
397
|
+
height: `${previewGroupBox.value.size.height * props.scale}px`,
|
|
398
|
+
outline: `2px dashed ${props.selectionOutlineColor}`,
|
|
399
|
+
outlineOffset: `${props.outlineOffset - 1}px`,
|
|
400
|
+
cursor: effectiveIsDraggable.value ? "move" : "default",
|
|
401
|
+
touchAction: "none",
|
|
402
|
+
zIndex: props.zIndex
|
|
403
|
+
}));
|
|
404
|
+
const menuRect = computed(() => ({
|
|
405
|
+
origin: {
|
|
406
|
+
x: previewGroupBox.value.origin.x * props.scale,
|
|
407
|
+
y: previewGroupBox.value.origin.y * props.scale
|
|
408
|
+
},
|
|
409
|
+
size: {
|
|
410
|
+
width: previewGroupBox.value.size.width * props.scale,
|
|
411
|
+
height: previewGroupBox.value.size.height * props.scale
|
|
412
|
+
}
|
|
413
|
+
}));
|
|
414
|
+
const menuContext = computed(() => ({
|
|
415
|
+
type: "group",
|
|
416
|
+
annotations: props.selectedAnnotations,
|
|
417
|
+
pageIndex: props.pageIndex
|
|
418
|
+
}));
|
|
419
|
+
const menuPlacement = computed(() => ({
|
|
420
|
+
suggestTop: false
|
|
421
|
+
}));
|
|
422
|
+
const shouldShowMenu = computed(() => {
|
|
423
|
+
return props.groupSelectionMenu || slots["group-selection-menu"];
|
|
424
|
+
});
|
|
425
|
+
const renderGroupMenu = (rect, menuWrapperProps) => {
|
|
426
|
+
if (!props.groupSelectionMenu) return null;
|
|
427
|
+
return props.groupSelectionMenu({
|
|
428
|
+
rect,
|
|
429
|
+
menuWrapperProps,
|
|
430
|
+
selected: true,
|
|
431
|
+
placement: menuPlacement.value,
|
|
432
|
+
context: menuContext.value
|
|
433
|
+
});
|
|
434
|
+
};
|
|
435
|
+
const elementSnapshot = computed(() => previewGroupBox.value);
|
|
436
|
+
const constraintsSnapshot = computed(() => ({
|
|
437
|
+
minWidth: 20,
|
|
438
|
+
minHeight: 20,
|
|
439
|
+
boundingBox: {
|
|
440
|
+
width: props.pageWidth,
|
|
441
|
+
height: props.pageHeight
|
|
442
|
+
}
|
|
443
|
+
}));
|
|
444
|
+
const { dragProps, resize } = useInteractionHandles({
|
|
445
|
+
controller: {
|
|
446
|
+
element: elementSnapshot,
|
|
447
|
+
vertices: computed(() => []),
|
|
448
|
+
constraints: constraintsSnapshot,
|
|
449
|
+
maintainAspectRatio: computed(() => false),
|
|
450
|
+
pageRotation: computed(() => props.rotation),
|
|
451
|
+
scale: computed(() => props.scale),
|
|
452
|
+
enabled: computed(() => true),
|
|
453
|
+
onUpdate: (event) => {
|
|
454
|
+
var _a, _b;
|
|
455
|
+
if (!((_a = event.transformData) == null ? void 0 : _a.type)) return;
|
|
456
|
+
if (!annotationPlugin.value) return;
|
|
457
|
+
const plugin = annotationPlugin.value;
|
|
458
|
+
const transformType = event.transformData.type;
|
|
459
|
+
const isMove = transformType === "move";
|
|
460
|
+
const isResize = transformType === "resize";
|
|
461
|
+
if (isMove && !effectiveIsDraggable.value) return;
|
|
462
|
+
if (event.state === "start") {
|
|
463
|
+
gestureBase.value = groupBox.value;
|
|
464
|
+
if (isMove) {
|
|
465
|
+
isDraggingRef.value = true;
|
|
466
|
+
plugin.startDrag(props.documentId, {
|
|
467
|
+
annotationIds: props.selectedAnnotations.map((ta) => ta.object.id),
|
|
468
|
+
pageSize: { width: props.pageWidth, height: props.pageHeight }
|
|
469
|
+
});
|
|
470
|
+
} else if (isResize) {
|
|
471
|
+
isResizingRef.value = true;
|
|
472
|
+
plugin.startResize(props.documentId, {
|
|
473
|
+
annotationIds: props.selectedAnnotations.map((ta) => ta.object.id),
|
|
474
|
+
pageSize: { width: props.pageWidth, height: props.pageHeight },
|
|
475
|
+
resizeHandle: ((_b = event.transformData.metadata) == null ? void 0 : _b.handle) ?? "se"
|
|
476
|
+
});
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
const base = gestureBase.value ?? groupBox.value;
|
|
480
|
+
if (isMove && event.transformData.changes.rect) {
|
|
481
|
+
const newRect = event.transformData.changes.rect;
|
|
482
|
+
const rawDelta = {
|
|
483
|
+
x: newRect.origin.x - base.origin.x,
|
|
484
|
+
y: newRect.origin.y - base.origin.y
|
|
485
|
+
};
|
|
486
|
+
const clampedDelta = plugin.updateDrag(props.documentId, rawDelta);
|
|
487
|
+
previewGroupBox.value = {
|
|
488
|
+
...base,
|
|
489
|
+
origin: {
|
|
490
|
+
x: base.origin.x + clampedDelta.x,
|
|
491
|
+
y: base.origin.y + clampedDelta.y
|
|
492
|
+
}
|
|
493
|
+
};
|
|
494
|
+
} else if (isResize && event.transformData.changes.rect) {
|
|
495
|
+
const newGroupBox = event.transformData.changes.rect;
|
|
496
|
+
plugin.updateResize(props.documentId, newGroupBox);
|
|
497
|
+
previewGroupBox.value = newGroupBox;
|
|
498
|
+
}
|
|
499
|
+
if (event.state === "end") {
|
|
500
|
+
gestureBase.value = null;
|
|
501
|
+
if (isMove && isDraggingRef.value) {
|
|
502
|
+
isDraggingRef.value = false;
|
|
503
|
+
plugin.commitDrag(props.documentId);
|
|
504
|
+
} else if (isResize && isResizingRef.value) {
|
|
505
|
+
isResizingRef.value = false;
|
|
506
|
+
plugin.commitResize(props.documentId);
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
},
|
|
511
|
+
resizeUI: {
|
|
512
|
+
handleSize: HANDLE_SIZE.value,
|
|
513
|
+
spacing: props.outlineOffset,
|
|
514
|
+
offsetMode: "outside",
|
|
515
|
+
includeSides: true,
|
|
516
|
+
zIndex: props.zIndex + 1
|
|
517
|
+
},
|
|
518
|
+
vertexUI: {
|
|
519
|
+
vertexSize: 0,
|
|
520
|
+
zIndex: props.zIndex
|
|
521
|
+
},
|
|
522
|
+
includeVertices: false
|
|
523
|
+
});
|
|
524
|
+
return (_ctx, _cache) => {
|
|
525
|
+
return __props.selectedAnnotations.length >= 2 ? (openBlock(), createElementBlock("div", _hoisted_1$9, [
|
|
526
|
+
createElementVNode("div", mergeProps(effectiveIsDraggable.value ? unref(dragProps) : {}, {
|
|
527
|
+
style: boxStyle.value,
|
|
528
|
+
onPointerdown: _cache[0] || (_cache[0] = ($event) => !effectiveIsDraggable.value ? $event.stopPropagation() : void 0)
|
|
529
|
+
}), [
|
|
530
|
+
effectiveIsResizable.value ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(unref(resize), ({ key, style, ...handle }) => {
|
|
531
|
+
return openBlock(), createElementBlock(Fragment, { key }, [
|
|
532
|
+
unref(slots)["resize-handle"] ? renderSlot(_ctx.$slots, "resize-handle", mergeProps({
|
|
533
|
+
key: 0,
|
|
534
|
+
ref_for: true
|
|
535
|
+
}, { key, style, ...handle, backgroundColor: HANDLE_COLOR.value }), () => [
|
|
536
|
+
createElementVNode("div", mergeProps({ ref_for: true }, handle, {
|
|
537
|
+
style: [style, { backgroundColor: HANDLE_COLOR.value }]
|
|
538
|
+
}), null, 16)
|
|
539
|
+
]) : (openBlock(), createElementBlock("div", mergeProps({
|
|
540
|
+
key: 1,
|
|
541
|
+
ref_for: true
|
|
542
|
+
}, handle, {
|
|
543
|
+
style: [style, { backgroundColor: HANDLE_COLOR.value }]
|
|
544
|
+
}), null, 16))
|
|
545
|
+
], 64);
|
|
546
|
+
}), 128)) : createCommentVNode("", true)
|
|
547
|
+
], 16),
|
|
548
|
+
shouldShowMenu.value ? (openBlock(), createBlock(unref(CounterRotate), {
|
|
549
|
+
key: 0,
|
|
550
|
+
rect: menuRect.value,
|
|
551
|
+
rotation: __props.rotation
|
|
552
|
+
}, {
|
|
553
|
+
default: withCtx(({ rect, menuWrapperProps }) => [
|
|
554
|
+
__props.groupSelectionMenu ? (openBlock(), createBlock(resolveDynamicComponent(renderGroupMenu(rect, menuWrapperProps)), { key: 0 })) : renderSlot(_ctx.$slots, "group-selection-menu", {
|
|
555
|
+
key: 1,
|
|
556
|
+
context: menuContext.value,
|
|
557
|
+
selected: true,
|
|
558
|
+
rect,
|
|
559
|
+
placement: menuPlacement.value,
|
|
560
|
+
menuWrapperProps
|
|
561
|
+
})
|
|
562
|
+
]),
|
|
563
|
+
_: 3
|
|
564
|
+
}, 8, ["rect", "rotation"])) : createCommentVNode("", true)
|
|
565
|
+
])) : createCommentVNode("", true);
|
|
566
|
+
};
|
|
567
|
+
}
|
|
568
|
+
});
|
|
569
|
+
const _hoisted_1$8 = ["width", "height", "viewBox"];
|
|
570
|
+
const _hoisted_2$6 = ["cx", "cy", "rx", "ry", "fill", "opacity"];
|
|
571
|
+
const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
286
572
|
__name: "circle",
|
|
287
573
|
props: {
|
|
288
574
|
isSelected: { type: Boolean },
|
|
@@ -348,13 +634,13 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
348
634
|
strokeDasharray: (_a = __props.strokeDashArray) == null ? void 0 : _a.join(",")
|
|
349
635
|
}
|
|
350
636
|
})
|
|
351
|
-
}, null, 44, _hoisted_2$
|
|
352
|
-
], 12, _hoisted_1$
|
|
637
|
+
}, null, 44, _hoisted_2$6)
|
|
638
|
+
], 12, _hoisted_1$8);
|
|
353
639
|
};
|
|
354
640
|
}
|
|
355
641
|
});
|
|
356
|
-
const _hoisted_1$
|
|
357
|
-
const _sfc_main$
|
|
642
|
+
const _hoisted_1$7 = ["contenteditable"];
|
|
643
|
+
const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
358
644
|
__name: "free-text",
|
|
359
645
|
props: {
|
|
360
646
|
isSelected: { type: Boolean },
|
|
@@ -416,7 +702,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
416
702
|
flexDirection: "column",
|
|
417
703
|
justifyContent: anno.verticalAlign === PdfVerticalAlignment.Top ? "flex-start" : anno.verticalAlign === PdfVerticalAlignment.Middle ? "center" : "flex-end",
|
|
418
704
|
display: "flex",
|
|
419
|
-
backgroundColor: anno.backgroundColor,
|
|
705
|
+
backgroundColor: anno.color ?? anno.backgroundColor,
|
|
420
706
|
opacity: anno.opacity,
|
|
421
707
|
width: needsComp ? `${invScalePercent}%` : "100%",
|
|
422
708
|
height: needsComp ? `${invScalePercent}%` : "100%",
|
|
@@ -450,18 +736,18 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
450
736
|
tabindex: "0",
|
|
451
737
|
style: normalizeStyle(editorStyle.value),
|
|
452
738
|
contenteditable: __props.isEditing
|
|
453
|
-
}, toDisplayString(__props.annotation.object.contents), 45, _hoisted_1$
|
|
739
|
+
}, toDisplayString(__props.annotation.object.contents), 45, _hoisted_1$7)
|
|
454
740
|
], 36);
|
|
455
741
|
};
|
|
456
742
|
}
|
|
457
743
|
});
|
|
458
|
-
const _hoisted_1$
|
|
459
|
-
const _hoisted_2$
|
|
460
|
-
const _sfc_main$
|
|
744
|
+
const _hoisted_1$6 = ["width", "height", "viewBox"];
|
|
745
|
+
const _hoisted_2$5 = ["d", "opacity"];
|
|
746
|
+
const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
461
747
|
__name: "ink",
|
|
462
748
|
props: {
|
|
463
749
|
isSelected: { type: Boolean },
|
|
464
|
-
|
|
750
|
+
strokeColor: {},
|
|
465
751
|
opacity: { default: 1 },
|
|
466
752
|
strokeWidth: {},
|
|
467
753
|
inkList: {},
|
|
@@ -471,6 +757,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
471
757
|
},
|
|
472
758
|
setup(__props) {
|
|
473
759
|
const props = __props;
|
|
760
|
+
const resolvedColor = computed(() => props.strokeColor ?? "#000000");
|
|
474
761
|
const paths = computed(() => {
|
|
475
762
|
return props.inkList.map(({ points }) => {
|
|
476
763
|
let d = "";
|
|
@@ -511,22 +798,22 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
511
798
|
style: normalizeStyle({
|
|
512
799
|
cursor: __props.isSelected ? "move" : "pointer",
|
|
513
800
|
pointerEvents: __props.isSelected ? "none" : "visibleStroke",
|
|
514
|
-
stroke:
|
|
801
|
+
stroke: resolvedColor.value,
|
|
515
802
|
strokeWidth: __props.strokeWidth,
|
|
516
803
|
strokeLinecap: "round",
|
|
517
804
|
strokeLinejoin: "round"
|
|
518
805
|
})
|
|
519
|
-
}, null, 44, _hoisted_2$
|
|
806
|
+
}, null, 44, _hoisted_2$5);
|
|
520
807
|
}), 128))
|
|
521
|
-
], 12, _hoisted_1$
|
|
808
|
+
], 12, _hoisted_1$6);
|
|
522
809
|
};
|
|
523
810
|
}
|
|
524
811
|
});
|
|
525
|
-
const _hoisted_1$
|
|
526
|
-
const _hoisted_2$
|
|
527
|
-
const _hoisted_3$
|
|
528
|
-
const _hoisted_4$
|
|
529
|
-
const _sfc_main$
|
|
812
|
+
const _hoisted_1$5 = ["width", "height", "viewBox"];
|
|
813
|
+
const _hoisted_2$4 = ["x1", "y1", "x2", "y2", "opacity"];
|
|
814
|
+
const _hoisted_3$3 = ["d", "transform", "stroke", "fill"];
|
|
815
|
+
const _hoisted_4$3 = ["d", "transform", "stroke", "fill"];
|
|
816
|
+
const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
530
817
|
__name: "line",
|
|
531
818
|
props: {
|
|
532
819
|
color: { default: "transparent" },
|
|
@@ -614,7 +901,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
614
901
|
strokeDasharray: (_a = __props.strokeDashArray) == null ? void 0 : _a.join(",")
|
|
615
902
|
}
|
|
616
903
|
})
|
|
617
|
-
}, null, 44, _hoisted_2$
|
|
904
|
+
}, null, 44, _hoisted_2$4),
|
|
618
905
|
endings.value.start ? (openBlock(), createElementBlock("path", {
|
|
619
906
|
key: 0,
|
|
620
907
|
d: endings.value.start.d,
|
|
@@ -626,7 +913,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
626
913
|
stroke: __props.strokeColor,
|
|
627
914
|
style: normalizeStyle(getEndingStyle(endings.value.start)),
|
|
628
915
|
fill: endings.value.start.filled ? __props.color : "none"
|
|
629
|
-
}, null, 44, _hoisted_3$
|
|
916
|
+
}, null, 44, _hoisted_3$3)) : createCommentVNode("", true),
|
|
630
917
|
endings.value.end ? (openBlock(), createElementBlock("path", {
|
|
631
918
|
key: 1,
|
|
632
919
|
d: endings.value.end.d,
|
|
@@ -638,7 +925,96 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
638
925
|
stroke: __props.strokeColor,
|
|
639
926
|
style: normalizeStyle(getEndingStyle(endings.value.end)),
|
|
640
927
|
fill: endings.value.end.filled ? __props.color : "none"
|
|
641
|
-
}, null, 44, _hoisted_4$
|
|
928
|
+
}, null, 44, _hoisted_4$3)) : createCommentVNode("", true)
|
|
929
|
+
], 12, _hoisted_1$5);
|
|
930
|
+
};
|
|
931
|
+
}
|
|
932
|
+
});
|
|
933
|
+
const _hoisted_1$4 = ["width", "height", "viewBox"];
|
|
934
|
+
const _hoisted_2$3 = ["width", "height"];
|
|
935
|
+
const _hoisted_3$2 = ["y1", "x2", "y2", "stroke", "stroke-width", "stroke-dasharray"];
|
|
936
|
+
const _hoisted_4$2 = ["x", "y", "width", "height", "stroke", "stroke-width", "stroke-dasharray"];
|
|
937
|
+
const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
938
|
+
__name: "link",
|
|
939
|
+
props: {
|
|
940
|
+
isSelected: { type: Boolean },
|
|
941
|
+
strokeColor: { default: "#0000FF" },
|
|
942
|
+
strokeWidth: { default: 2 },
|
|
943
|
+
strokeStyle: { default: PdfAnnotationBorderStyle.UNDERLINE },
|
|
944
|
+
strokeDashArray: {},
|
|
945
|
+
rect: {},
|
|
946
|
+
scale: {},
|
|
947
|
+
onClick: {},
|
|
948
|
+
hasIRT: { type: Boolean, default: false }
|
|
949
|
+
},
|
|
950
|
+
setup(__props) {
|
|
951
|
+
const props = __props;
|
|
952
|
+
const width = computed(() => props.rect.size.width);
|
|
953
|
+
const height = computed(() => props.rect.size.height);
|
|
954
|
+
const svgWidth = computed(() => width.value * props.scale);
|
|
955
|
+
const svgHeight = computed(() => height.value * props.scale);
|
|
956
|
+
const dashArray = computed(() => {
|
|
957
|
+
var _a;
|
|
958
|
+
if (props.strokeStyle === PdfAnnotationBorderStyle.DASHED) {
|
|
959
|
+
return ((_a = props.strokeDashArray) == null ? void 0 : _a.join(",")) ?? `${props.strokeWidth * 3},${props.strokeWidth}`;
|
|
960
|
+
}
|
|
961
|
+
return void 0;
|
|
962
|
+
});
|
|
963
|
+
const isUnderline2 = computed(() => props.strokeStyle === PdfAnnotationBorderStyle.UNDERLINE);
|
|
964
|
+
const hitAreaCursor = computed(
|
|
965
|
+
() => props.hasIRT ? "default" : props.isSelected ? "move" : "pointer"
|
|
966
|
+
);
|
|
967
|
+
const hitAreaPointerEvents = computed(
|
|
968
|
+
() => props.hasIRT ? "none" : props.isSelected ? "none" : "visible"
|
|
969
|
+
);
|
|
970
|
+
return (_ctx, _cache) => {
|
|
971
|
+
return openBlock(), createElementBlock("svg", {
|
|
972
|
+
style: normalizeStyle({
|
|
973
|
+
position: "absolute",
|
|
974
|
+
width: `${svgWidth.value}px`,
|
|
975
|
+
height: `${svgHeight.value}px`,
|
|
976
|
+
pointerEvents: "none",
|
|
977
|
+
zIndex: 2
|
|
978
|
+
}),
|
|
979
|
+
width: svgWidth.value,
|
|
980
|
+
height: svgHeight.value,
|
|
981
|
+
viewBox: `0 0 ${width.value} ${height.value}`
|
|
982
|
+
}, [
|
|
983
|
+
createElementVNode("rect", {
|
|
984
|
+
x: 0,
|
|
985
|
+
y: 0,
|
|
986
|
+
width: width.value,
|
|
987
|
+
height: height.value,
|
|
988
|
+
fill: "transparent",
|
|
989
|
+
onPointerdown: _cache[0] || (_cache[0] = ($event) => __props.hasIRT ? void 0 : __props.onClick),
|
|
990
|
+
onTouchstart: _cache[1] || (_cache[1] = ($event) => __props.hasIRT ? void 0 : __props.onClick),
|
|
991
|
+
style: normalizeStyle({
|
|
992
|
+
cursor: hitAreaCursor.value,
|
|
993
|
+
pointerEvents: hitAreaPointerEvents.value
|
|
994
|
+
})
|
|
995
|
+
}, null, 44, _hoisted_2$3),
|
|
996
|
+
isUnderline2.value ? (openBlock(), createElementBlock("line", {
|
|
997
|
+
key: 0,
|
|
998
|
+
x1: 1,
|
|
999
|
+
y1: height.value - 1,
|
|
1000
|
+
x2: width.value - 1,
|
|
1001
|
+
y2: height.value - 1,
|
|
1002
|
+
stroke: __props.strokeColor,
|
|
1003
|
+
"stroke-width": __props.strokeWidth,
|
|
1004
|
+
"stroke-dasharray": dashArray.value,
|
|
1005
|
+
style: { "pointer-events": "none" }
|
|
1006
|
+
}, null, 8, _hoisted_3$2)) : (openBlock(), createElementBlock("rect", {
|
|
1007
|
+
key: 1,
|
|
1008
|
+
x: __props.strokeWidth / 2,
|
|
1009
|
+
y: __props.strokeWidth / 2,
|
|
1010
|
+
width: Math.max(width.value - __props.strokeWidth, 0),
|
|
1011
|
+
height: Math.max(height.value - __props.strokeWidth, 0),
|
|
1012
|
+
fill: "transparent",
|
|
1013
|
+
stroke: __props.strokeColor,
|
|
1014
|
+
"stroke-width": __props.strokeWidth,
|
|
1015
|
+
"stroke-dasharray": dashArray.value,
|
|
1016
|
+
style: { "pointer-events": "none" }
|
|
1017
|
+
}, null, 8, _hoisted_4$2))
|
|
642
1018
|
], 12, _hoisted_1$4);
|
|
643
1019
|
};
|
|
644
1020
|
}
|
|
@@ -647,7 +1023,7 @@ const _hoisted_1$3 = ["width", "height", "viewBox"];
|
|
|
647
1023
|
const _hoisted_2$2 = ["d", "opacity"];
|
|
648
1024
|
const _hoisted_3$1 = ["d"];
|
|
649
1025
|
const _hoisted_4$1 = ["x", "y", "width", "height", "fill", "stroke", "stroke-width"];
|
|
650
|
-
const _sfc_main$
|
|
1026
|
+
const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
651
1027
|
__name: "polygon",
|
|
652
1028
|
props: {
|
|
653
1029
|
rect: {},
|
|
@@ -749,7 +1125,7 @@ const _hoisted_1$2 = ["width", "height", "viewBox"];
|
|
|
749
1125
|
const _hoisted_2$1 = ["d", "opacity"];
|
|
750
1126
|
const _hoisted_3 = ["d", "transform", "stroke", "fill"];
|
|
751
1127
|
const _hoisted_4 = ["d", "transform", "stroke", "fill"];
|
|
752
|
-
const _sfc_main$
|
|
1128
|
+
const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
753
1129
|
__name: "polyline",
|
|
754
1130
|
props: {
|
|
755
1131
|
rect: {},
|
|
@@ -871,7 +1247,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
871
1247
|
});
|
|
872
1248
|
const _hoisted_1$1 = ["width", "height", "viewBox"];
|
|
873
1249
|
const _hoisted_2 = ["x", "y", "width", "height", "fill", "opacity"];
|
|
874
|
-
const _sfc_main$
|
|
1250
|
+
const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
875
1251
|
__name: "square",
|
|
876
1252
|
props: {
|
|
877
1253
|
isSelected: { type: Boolean },
|
|
@@ -941,7 +1317,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
941
1317
|
}
|
|
942
1318
|
});
|
|
943
1319
|
const _hoisted_1 = ["src"];
|
|
944
|
-
const _sfc_main$
|
|
1320
|
+
const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
945
1321
|
__name: "render-annotation",
|
|
946
1322
|
props: {
|
|
947
1323
|
documentId: {},
|
|
@@ -1037,7 +1413,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
1037
1413
|
};
|
|
1038
1414
|
}
|
|
1039
1415
|
});
|
|
1040
|
-
const _sfc_main$
|
|
1416
|
+
const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
1041
1417
|
__name: "stamp",
|
|
1042
1418
|
props: {
|
|
1043
1419
|
isSelected: { type: Boolean },
|
|
@@ -1063,7 +1439,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
1063
1439
|
onTouchstart: _cache[1] || (_cache[1] = //@ts-ignore
|
|
1064
1440
|
(...args) => __props.onClick && __props.onClick(...args))
|
|
1065
1441
|
}, [
|
|
1066
|
-
createVNode(_sfc_main$
|
|
1442
|
+
createVNode(_sfc_main$b, {
|
|
1067
1443
|
documentId: __props.documentId,
|
|
1068
1444
|
pageIndex: __props.pageIndex,
|
|
1069
1445
|
annotation: { ...__props.annotation.object, id: __props.annotation.object.id },
|
|
@@ -1073,10 +1449,10 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
1073
1449
|
};
|
|
1074
1450
|
}
|
|
1075
1451
|
});
|
|
1076
|
-
const _sfc_main$
|
|
1452
|
+
const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
1077
1453
|
__name: "highlight",
|
|
1078
1454
|
props: {
|
|
1079
|
-
|
|
1455
|
+
strokeColor: {},
|
|
1080
1456
|
opacity: { default: 0.5 },
|
|
1081
1457
|
segmentRects: {},
|
|
1082
1458
|
rect: {},
|
|
@@ -1084,6 +1460,8 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
1084
1460
|
onClick: {}
|
|
1085
1461
|
},
|
|
1086
1462
|
setup(__props) {
|
|
1463
|
+
const props = __props;
|
|
1464
|
+
const resolvedColor = computed(() => props.strokeColor ?? "#FFFF00");
|
|
1087
1465
|
return (_ctx, _cache) => {
|
|
1088
1466
|
return openBlock(true), createElementBlock(Fragment, null, renderList(__props.segmentRects, (b, i) => {
|
|
1089
1467
|
return openBlock(), createElementBlock("div", {
|
|
@@ -1098,7 +1476,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
1098
1476
|
top: `${(__props.rect ? b.origin.y - __props.rect.origin.y : b.origin.y) * __props.scale}px`,
|
|
1099
1477
|
width: `${b.size.width * __props.scale}px`,
|
|
1100
1478
|
height: `${b.size.height * __props.scale}px`,
|
|
1101
|
-
background:
|
|
1479
|
+
background: resolvedColor.value,
|
|
1102
1480
|
opacity: __props.opacity,
|
|
1103
1481
|
pointerEvents: __props.onClick ? "auto" : "none",
|
|
1104
1482
|
cursor: __props.onClick ? "pointer" : "default",
|
|
@@ -1109,10 +1487,10 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
1109
1487
|
};
|
|
1110
1488
|
}
|
|
1111
1489
|
});
|
|
1112
|
-
const _sfc_main$
|
|
1490
|
+
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
1113
1491
|
__name: "squiggly",
|
|
1114
1492
|
props: {
|
|
1115
|
-
|
|
1493
|
+
strokeColor: {},
|
|
1116
1494
|
opacity: { default: 0.5 },
|
|
1117
1495
|
segmentRects: {},
|
|
1118
1496
|
rect: {},
|
|
@@ -1121,6 +1499,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
1121
1499
|
},
|
|
1122
1500
|
setup(__props) {
|
|
1123
1501
|
const props = __props;
|
|
1502
|
+
const resolvedColor = computed(() => props.strokeColor ?? "#FFFF00");
|
|
1124
1503
|
const amplitude = computed(() => 2 * props.scale);
|
|
1125
1504
|
const period = computed(() => 6 * props.scale);
|
|
1126
1505
|
const svgDataUri = computed(() => {
|
|
@@ -1128,7 +1507,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
1128
1507
|
const per = period.value;
|
|
1129
1508
|
const svg = `<svg xmlns="http://www.w3.org/2000/svg" width="${per}" height="${amp * 2}" viewBox="0 0 ${per} ${amp * 2}">
|
|
1130
1509
|
<path d="M0 ${amp} Q ${per / 4} 0 ${per / 2} ${amp} T ${per} ${amp}"
|
|
1131
|
-
fill="none" stroke="${
|
|
1510
|
+
fill="none" stroke="${resolvedColor.value}" stroke-width="${amp}" stroke-linecap="round"/>
|
|
1132
1511
|
</svg>`;
|
|
1133
1512
|
return `url("data:image/svg+xml;utf8,${encodeURIComponent(svg)}")`;
|
|
1134
1513
|
});
|
|
@@ -1171,10 +1550,10 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
1171
1550
|
};
|
|
1172
1551
|
}
|
|
1173
1552
|
});
|
|
1174
|
-
const _sfc_main$
|
|
1553
|
+
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
1175
1554
|
__name: "strikeout",
|
|
1176
1555
|
props: {
|
|
1177
|
-
|
|
1556
|
+
strokeColor: {},
|
|
1178
1557
|
opacity: { default: 0.5 },
|
|
1179
1558
|
segmentRects: {},
|
|
1180
1559
|
rect: {},
|
|
@@ -1183,6 +1562,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
1183
1562
|
},
|
|
1184
1563
|
setup(__props) {
|
|
1185
1564
|
const props = __props;
|
|
1565
|
+
const resolvedColor = computed(() => props.strokeColor ?? "#FFFF00");
|
|
1186
1566
|
const thickness = computed(() => 2 * props.scale);
|
|
1187
1567
|
return (_ctx, _cache) => {
|
|
1188
1568
|
return openBlock(true), createElementBlock(Fragment, null, renderList(__props.segmentRects, (r, i) => {
|
|
@@ -1211,7 +1591,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
1211
1591
|
top: "50%",
|
|
1212
1592
|
width: "100%",
|
|
1213
1593
|
height: `${thickness.value}px`,
|
|
1214
|
-
background:
|
|
1594
|
+
background: resolvedColor.value,
|
|
1215
1595
|
opacity: __props.opacity,
|
|
1216
1596
|
transform: "translateY(-50%)",
|
|
1217
1597
|
pointerEvents: "none"
|
|
@@ -1222,10 +1602,10 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
1222
1602
|
};
|
|
1223
1603
|
}
|
|
1224
1604
|
});
|
|
1225
|
-
const _sfc_main$
|
|
1605
|
+
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
1226
1606
|
__name: "underline",
|
|
1227
1607
|
props: {
|
|
1228
|
-
|
|
1608
|
+
strokeColor: {},
|
|
1229
1609
|
opacity: { default: 0.5 },
|
|
1230
1610
|
segmentRects: {},
|
|
1231
1611
|
rect: {},
|
|
@@ -1234,6 +1614,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
1234
1614
|
},
|
|
1235
1615
|
setup(__props) {
|
|
1236
1616
|
const props = __props;
|
|
1617
|
+
const resolvedColor = computed(() => props.strokeColor ?? "#FFFF00");
|
|
1237
1618
|
const thickness = computed(() => 2 * props.scale);
|
|
1238
1619
|
return (_ctx, _cache) => {
|
|
1239
1620
|
return openBlock(true), createElementBlock(Fragment, null, renderList(__props.segmentRects, (r, i) => {
|
|
@@ -1262,7 +1643,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
1262
1643
|
bottom: 0,
|
|
1263
1644
|
width: "100%",
|
|
1264
1645
|
height: `${thickness.value}px`,
|
|
1265
|
-
background:
|
|
1646
|
+
background: resolvedColor.value,
|
|
1266
1647
|
opacity: __props.opacity,
|
|
1267
1648
|
pointerEvents: "none"
|
|
1268
1649
|
})
|
|
@@ -1272,7 +1653,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
1272
1653
|
};
|
|
1273
1654
|
}
|
|
1274
1655
|
});
|
|
1275
|
-
const _sfc_main$
|
|
1656
|
+
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
1276
1657
|
__name: "annotations",
|
|
1277
1658
|
props: {
|
|
1278
1659
|
documentId: {},
|
|
@@ -1284,30 +1665,37 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
1284
1665
|
resizeUI: {},
|
|
1285
1666
|
vertexUI: {},
|
|
1286
1667
|
selectionOutlineColor: {},
|
|
1287
|
-
selectionMenu: { type: Function }
|
|
1668
|
+
selectionMenu: { type: Function },
|
|
1669
|
+
groupSelectionMenu: { type: Function },
|
|
1670
|
+
annotationRenderers: {}
|
|
1288
1671
|
},
|
|
1289
1672
|
setup(__props) {
|
|
1290
1673
|
const props = __props;
|
|
1674
|
+
const findCustomRenderer = (annotation) => {
|
|
1675
|
+
var _a;
|
|
1676
|
+
return (_a = props.annotationRenderers) == null ? void 0 : _a.find((r) => r.matches(annotation.object));
|
|
1677
|
+
};
|
|
1291
1678
|
const { provides: annotationCapability } = useAnnotationCapability();
|
|
1292
1679
|
const { provides: selectionProvides } = useSelectionCapability();
|
|
1293
1680
|
const annotations = ref([]);
|
|
1681
|
+
const allSelectedIds = ref([]);
|
|
1294
1682
|
const { register } = usePointerHandlers({
|
|
1295
1683
|
documentId: () => props.documentId,
|
|
1296
1684
|
pageIndex: props.pageIndex
|
|
1297
1685
|
});
|
|
1298
|
-
const selectionState = ref(null);
|
|
1299
1686
|
const editingId = ref(null);
|
|
1300
1687
|
const annotationProvides = computed(
|
|
1301
1688
|
() => annotationCapability.value ? annotationCapability.value.forDocument(props.documentId) : null
|
|
1302
1689
|
);
|
|
1690
|
+
const isMultiSelected = computed(() => allSelectedIds.value.length > 1);
|
|
1303
1691
|
watchEffect((onCleanup) => {
|
|
1304
1692
|
if (annotationProvides.value) {
|
|
1305
1693
|
const currentState = annotationProvides.value.getState();
|
|
1306
1694
|
annotations.value = getAnnotationsByPageIndex(currentState, props.pageIndex);
|
|
1307
|
-
|
|
1695
|
+
allSelectedIds.value = getSelectedAnnotationIds(currentState);
|
|
1308
1696
|
const off = annotationProvides.value.onStateChange((state) => {
|
|
1309
1697
|
annotations.value = getAnnotationsByPageIndex(state, props.pageIndex);
|
|
1310
|
-
|
|
1698
|
+
allSelectedIds.value = getSelectedAnnotationIds(state);
|
|
1311
1699
|
});
|
|
1312
1700
|
onCleanup(off);
|
|
1313
1701
|
}
|
|
@@ -1321,13 +1709,32 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
1321
1709
|
const handleClick = (e, annotation) => {
|
|
1322
1710
|
e.stopPropagation();
|
|
1323
1711
|
if (annotationProvides.value && selectionProvides.value) {
|
|
1324
|
-
annotationProvides.value.selectAnnotation(props.pageIndex, annotation.object.id);
|
|
1325
1712
|
selectionProvides.value.clear();
|
|
1713
|
+
const isModifierPressed = "metaKey" in e ? e.metaKey || e.ctrlKey : false;
|
|
1714
|
+
if (isModifierPressed) {
|
|
1715
|
+
annotationProvides.value.toggleSelection(props.pageIndex, annotation.object.id);
|
|
1716
|
+
} else {
|
|
1717
|
+
annotationProvides.value.selectAnnotation(props.pageIndex, annotation.object.id);
|
|
1718
|
+
}
|
|
1326
1719
|
if (annotation.object.id !== editingId.value) {
|
|
1327
1720
|
editingId.value = null;
|
|
1328
1721
|
}
|
|
1329
1722
|
}
|
|
1330
1723
|
};
|
|
1724
|
+
const handleLinkClick = (e, annotation) => {
|
|
1725
|
+
e.stopPropagation();
|
|
1726
|
+
if (!annotationProvides.value || !selectionProvides.value) return;
|
|
1727
|
+
selectionProvides.value.clear();
|
|
1728
|
+
if (annotation.object.inReplyToId) {
|
|
1729
|
+
const parentId = annotation.object.inReplyToId;
|
|
1730
|
+
const parent = annotations.value.find((a) => a.object.id === parentId);
|
|
1731
|
+
if (parent) {
|
|
1732
|
+
annotationProvides.value.selectAnnotation(parent.object.pageIndex, parentId);
|
|
1733
|
+
return;
|
|
1734
|
+
}
|
|
1735
|
+
}
|
|
1736
|
+
annotationProvides.value.selectAnnotation(props.pageIndex, annotation.object.id);
|
|
1737
|
+
};
|
|
1331
1738
|
const handleDoubleClick = (_e, id) => {
|
|
1332
1739
|
if (isFreeText(annotations.value.find((a) => a.object.id === id))) {
|
|
1333
1740
|
editingId.value = id;
|
|
@@ -1341,6 +1748,44 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
1341
1748
|
}
|
|
1342
1749
|
}
|
|
1343
1750
|
});
|
|
1751
|
+
const isSelected = (annotation) => allSelectedIds.value.includes(annotation.object.id);
|
|
1752
|
+
const selectedAnnotationsOnPage = computed(
|
|
1753
|
+
() => annotations.value.filter((anno) => allSelectedIds.value.includes(anno.object.id))
|
|
1754
|
+
);
|
|
1755
|
+
const areAllSelectedDraggable = computed(() => {
|
|
1756
|
+
if (selectedAnnotationsOnPage.value.length < 2) return false;
|
|
1757
|
+
return selectedAnnotationsOnPage.value.every((ta) => {
|
|
1758
|
+
var _a;
|
|
1759
|
+
const tool = (_a = annotationProvides.value) == null ? void 0 : _a.findToolForAnnotation(ta.object);
|
|
1760
|
+
const groupDraggable = resolveInteractionProp(
|
|
1761
|
+
tool == null ? void 0 : tool.interaction.isGroupDraggable,
|
|
1762
|
+
ta.object,
|
|
1763
|
+
true
|
|
1764
|
+
);
|
|
1765
|
+
const singleDraggable = resolveInteractionProp(tool == null ? void 0 : tool.interaction.isDraggable, ta.object, true);
|
|
1766
|
+
return (tool == null ? void 0 : tool.interaction.isGroupDraggable) !== void 0 ? groupDraggable : singleDraggable;
|
|
1767
|
+
});
|
|
1768
|
+
});
|
|
1769
|
+
const areAllSelectedResizable = computed(() => {
|
|
1770
|
+
if (selectedAnnotationsOnPage.value.length < 2) return false;
|
|
1771
|
+
return selectedAnnotationsOnPage.value.every((ta) => {
|
|
1772
|
+
var _a;
|
|
1773
|
+
const tool = (_a = annotationProvides.value) == null ? void 0 : _a.findToolForAnnotation(ta.object);
|
|
1774
|
+
const groupResizable = resolveInteractionProp(
|
|
1775
|
+
tool == null ? void 0 : tool.interaction.isGroupResizable,
|
|
1776
|
+
ta.object,
|
|
1777
|
+
true
|
|
1778
|
+
);
|
|
1779
|
+
const singleResizable = resolveInteractionProp(tool == null ? void 0 : tool.interaction.isResizable, ta.object, true);
|
|
1780
|
+
return (tool == null ? void 0 : tool.interaction.isGroupResizable) !== void 0 ? groupResizable : singleResizable;
|
|
1781
|
+
});
|
|
1782
|
+
});
|
|
1783
|
+
const allSelectedOnSamePage = computed(() => {
|
|
1784
|
+
if (!annotationProvides.value) return false;
|
|
1785
|
+
if (allSelectedIds.value.length < 2) return false;
|
|
1786
|
+
const allSelected = annotationProvides.value.getSelectedAnnotations();
|
|
1787
|
+
return allSelected.every((ta) => ta.object.pageIndex === props.pageIndex);
|
|
1788
|
+
});
|
|
1344
1789
|
const getTool = (annotation) => {
|
|
1345
1790
|
var _a;
|
|
1346
1791
|
return (_a = annotationProvides.value) == null ? void 0 : _a.findToolForAnnotation(annotation.object);
|
|
@@ -1348,16 +1793,23 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
1348
1793
|
const isDraggable = (anno) => {
|
|
1349
1794
|
var _a;
|
|
1350
1795
|
if (isFreeText(anno) && editingId.value === anno.object.id) return false;
|
|
1351
|
-
|
|
1796
|
+
if (isMultiSelected.value) return false;
|
|
1797
|
+
return resolveInteractionProp((_a = getTool(anno)) == null ? void 0 : _a.interaction.isDraggable, anno.object, false);
|
|
1352
1798
|
};
|
|
1353
1799
|
const isResizable = (anno) => {
|
|
1354
1800
|
var _a;
|
|
1355
|
-
|
|
1801
|
+
if (isMultiSelected.value) return false;
|
|
1802
|
+
return resolveInteractionProp((_a = getTool(anno)) == null ? void 0 : _a.interaction.isResizable, anno.object, false);
|
|
1356
1803
|
};
|
|
1357
1804
|
const lockAspectRatio = (anno) => {
|
|
1358
1805
|
var _a;
|
|
1359
|
-
return ((_a = getTool(anno)) == null ? void 0 : _a.interaction.lockAspectRatio
|
|
1806
|
+
return resolveInteractionProp((_a = getTool(anno)) == null ? void 0 : _a.interaction.lockAspectRatio, anno.object, false);
|
|
1360
1807
|
};
|
|
1808
|
+
const showIndividualSelection = (anno) => isSelected(anno) && !isMultiSelected.value;
|
|
1809
|
+
const containerProps = computed(() => {
|
|
1810
|
+
const { selectionMenu: _sm, groupSelectionMenu: _gsm, ...rest } = props;
|
|
1811
|
+
return rest;
|
|
1812
|
+
});
|
|
1361
1813
|
const getVertexConfig = (annotation) => {
|
|
1362
1814
|
if (isLine(annotation)) {
|
|
1363
1815
|
return {
|
|
@@ -1377,363 +1829,499 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
1377
1829
|
return void 0;
|
|
1378
1830
|
};
|
|
1379
1831
|
return (_ctx, _cache) => {
|
|
1380
|
-
return openBlock(
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
isSelected: ((_a2 = selectionState.value) == null ? void 0 : _a2.object.id) === annotation.object.id,
|
|
1832
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
1833
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(annotations.value, (annotation) => {
|
|
1834
|
+
return openBlock(), createElementBlock(Fragment, {
|
|
1835
|
+
key: annotation.object.id
|
|
1836
|
+
}, [
|
|
1837
|
+
findCustomRenderer(annotation) ? (openBlock(), createBlock(_sfc_main$l, mergeProps({
|
|
1838
|
+
key: 0,
|
|
1839
|
+
trackedAnnotation: annotation,
|
|
1840
|
+
isSelected: showIndividualSelection(annotation),
|
|
1841
|
+
isDraggable: isDraggable(annotation),
|
|
1842
|
+
isResizable: isResizable(annotation),
|
|
1843
|
+
lockAspectRatio: lockAspectRatio(annotation),
|
|
1844
|
+
onSelect: (e) => handleClick(e, annotation),
|
|
1845
|
+
selectionMenu: isMultiSelected.value ? void 0 : __props.selectionMenu,
|
|
1846
|
+
style: { mixBlendMode: unref(blendModeToCss)(annotation.object.blendMode ?? unref(PdfBlendMode).Normal) }
|
|
1847
|
+
}, { ref_for: true }, containerProps.value), createSlots({
|
|
1848
|
+
default: withCtx(() => [
|
|
1849
|
+
(openBlock(), createBlock(resolveDynamicComponent(findCustomRenderer(annotation).component), {
|
|
1850
|
+
annotation,
|
|
1851
|
+
isSelected: isSelected(annotation),
|
|
1401
1852
|
scale: __props.scale,
|
|
1853
|
+
pageIndex: __props.pageIndex,
|
|
1402
1854
|
onClick: (e) => handleClick(e, annotation)
|
|
1403
|
-
}
|
|
1404
|
-
]
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
createVNode(_sfc_main$
|
|
1431
|
-
isSelected: (
|
|
1855
|
+
}, null, 8, ["annotation", "isSelected", "scale", "pageIndex", "onClick"]))
|
|
1856
|
+
]),
|
|
1857
|
+
"resize-handle": withCtx((slotProps) => [
|
|
1858
|
+
renderSlot(_ctx.$slots, "resize-handle", mergeProps({ ref_for: true }, slotProps))
|
|
1859
|
+
]),
|
|
1860
|
+
_: 2
|
|
1861
|
+
}, [
|
|
1862
|
+
!isMultiSelected.value ? {
|
|
1863
|
+
name: "selection-menu",
|
|
1864
|
+
fn: withCtx((slotProps) => [
|
|
1865
|
+
renderSlot(_ctx.$slots, "selection-menu", mergeProps({ ref_for: true }, slotProps))
|
|
1866
|
+
]),
|
|
1867
|
+
key: "0"
|
|
1868
|
+
} : void 0
|
|
1869
|
+
]), 1040, ["trackedAnnotation", "isSelected", "isDraggable", "isResizable", "lockAspectRatio", "onSelect", "selectionMenu", "style"])) : unref(isInk)(annotation) ? (openBlock(), createBlock(_sfc_main$l, mergeProps({
|
|
1870
|
+
key: 1,
|
|
1871
|
+
trackedAnnotation: annotation,
|
|
1872
|
+
isSelected: showIndividualSelection(annotation),
|
|
1873
|
+
isDraggable: isDraggable(annotation),
|
|
1874
|
+
isResizable: isResizable(annotation),
|
|
1875
|
+
lockAspectRatio: lockAspectRatio(annotation),
|
|
1876
|
+
onSelect: (e) => handleClick(e, annotation),
|
|
1877
|
+
vertexConfig: getVertexConfig(annotation),
|
|
1878
|
+
selectionMenu: isMultiSelected.value ? void 0 : __props.selectionMenu,
|
|
1879
|
+
style: { mixBlendMode: unref(blendModeToCss)(annotation.object.blendMode ?? unref(PdfBlendMode).Normal) }
|
|
1880
|
+
}, { ref_for: true }, containerProps.value), createSlots({
|
|
1881
|
+
default: withCtx(({ annotation: currentObject }) => [
|
|
1882
|
+
createVNode(_sfc_main$h, mergeProps({ ref_for: true }, currentObject, {
|
|
1883
|
+
isSelected: isSelected(annotation),
|
|
1432
1884
|
scale: __props.scale,
|
|
1433
1885
|
onClick: (e) => handleClick(e, annotation)
|
|
1434
1886
|
}), null, 16, ["isSelected", "scale", "onClick"])
|
|
1435
|
-
]
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
isDraggable:
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1887
|
+
]),
|
|
1888
|
+
"resize-handle": withCtx((slotProps) => [
|
|
1889
|
+
renderSlot(_ctx.$slots, "resize-handle", mergeProps({ ref_for: true }, slotProps))
|
|
1890
|
+
]),
|
|
1891
|
+
"vertex-handle": withCtx((slotProps) => [
|
|
1892
|
+
renderSlot(_ctx.$slots, "vertex-handle", mergeProps({ ref_for: true }, slotProps))
|
|
1893
|
+
]),
|
|
1894
|
+
_: 2
|
|
1895
|
+
}, [
|
|
1896
|
+
!isMultiSelected.value ? {
|
|
1897
|
+
name: "selection-menu",
|
|
1898
|
+
fn: withCtx((slotProps) => [
|
|
1899
|
+
renderSlot(_ctx.$slots, "selection-menu", mergeProps({ ref_for: true }, slotProps))
|
|
1900
|
+
]),
|
|
1901
|
+
key: "0"
|
|
1902
|
+
} : void 0
|
|
1903
|
+
]), 1040, ["trackedAnnotation", "isSelected", "isDraggable", "isResizable", "lockAspectRatio", "onSelect", "vertexConfig", "selectionMenu", "style"])) : unref(isSquare)(annotation) ? (openBlock(), createBlock(_sfc_main$l, mergeProps({
|
|
1904
|
+
key: 2,
|
|
1905
|
+
trackedAnnotation: annotation,
|
|
1906
|
+
isSelected: showIndividualSelection(annotation),
|
|
1907
|
+
isDraggable: isDraggable(annotation),
|
|
1908
|
+
isResizable: isResizable(annotation),
|
|
1909
|
+
lockAspectRatio: lockAspectRatio(annotation),
|
|
1910
|
+
onSelect: (e) => handleClick(e, annotation),
|
|
1911
|
+
vertexConfig: getVertexConfig(annotation),
|
|
1912
|
+
selectionMenu: isMultiSelected.value ? void 0 : __props.selectionMenu,
|
|
1913
|
+
style: { mixBlendMode: unref(blendModeToCss)(annotation.object.blendMode ?? unref(PdfBlendMode).Normal) }
|
|
1914
|
+
}, { ref_for: true }, containerProps.value), createSlots({
|
|
1915
|
+
default: withCtx(({ annotation: currentObject }) => [
|
|
1916
|
+
createVNode(_sfc_main$c, mergeProps({ ref_for: true }, currentObject, {
|
|
1917
|
+
isSelected: isSelected(annotation),
|
|
1463
1918
|
scale: __props.scale,
|
|
1464
1919
|
onClick: (e) => handleClick(e, annotation)
|
|
1465
1920
|
}), null, 16, ["isSelected", "scale", "onClick"])
|
|
1466
|
-
]
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
isDraggable:
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1921
|
+
]),
|
|
1922
|
+
"resize-handle": withCtx((slotProps) => [
|
|
1923
|
+
renderSlot(_ctx.$slots, "resize-handle", mergeProps({ ref_for: true }, slotProps))
|
|
1924
|
+
]),
|
|
1925
|
+
"vertex-handle": withCtx((slotProps) => [
|
|
1926
|
+
renderSlot(_ctx.$slots, "vertex-handle", mergeProps({ ref_for: true }, slotProps))
|
|
1927
|
+
]),
|
|
1928
|
+
_: 2
|
|
1929
|
+
}, [
|
|
1930
|
+
!isMultiSelected.value ? {
|
|
1931
|
+
name: "selection-menu",
|
|
1932
|
+
fn: withCtx((slotProps) => [
|
|
1933
|
+
renderSlot(_ctx.$slots, "selection-menu", mergeProps({ ref_for: true }, slotProps))
|
|
1934
|
+
]),
|
|
1935
|
+
key: "0"
|
|
1936
|
+
} : void 0
|
|
1937
|
+
]), 1040, ["trackedAnnotation", "isSelected", "isDraggable", "isResizable", "lockAspectRatio", "onSelect", "vertexConfig", "selectionMenu", "style"])) : unref(isCircle)(annotation) ? (openBlock(), createBlock(_sfc_main$l, mergeProps({
|
|
1938
|
+
key: 3,
|
|
1939
|
+
trackedAnnotation: annotation,
|
|
1940
|
+
isSelected: showIndividualSelection(annotation),
|
|
1941
|
+
isDraggable: isDraggable(annotation),
|
|
1942
|
+
isResizable: isResizable(annotation),
|
|
1943
|
+
lockAspectRatio: lockAspectRatio(annotation),
|
|
1944
|
+
onSelect: (e) => handleClick(e, annotation),
|
|
1945
|
+
vertexConfig: getVertexConfig(annotation),
|
|
1946
|
+
selectionMenu: isMultiSelected.value ? void 0 : __props.selectionMenu,
|
|
1947
|
+
style: { mixBlendMode: unref(blendModeToCss)(annotation.object.blendMode ?? unref(PdfBlendMode).Normal) }
|
|
1948
|
+
}, { ref_for: true }, containerProps.value), createSlots({
|
|
1949
|
+
default: withCtx(({ annotation: currentObject }) => [
|
|
1950
|
+
createVNode(_sfc_main$j, mergeProps({ ref_for: true }, currentObject, {
|
|
1951
|
+
isSelected: isSelected(annotation),
|
|
1494
1952
|
scale: __props.scale,
|
|
1495
1953
|
onClick: (e) => handleClick(e, annotation)
|
|
1496
1954
|
}), null, 16, ["isSelected", "scale", "onClick"])
|
|
1497
|
-
]
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
isDraggable:
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1955
|
+
]),
|
|
1956
|
+
"resize-handle": withCtx((slotProps) => [
|
|
1957
|
+
renderSlot(_ctx.$slots, "resize-handle", mergeProps({ ref_for: true }, slotProps))
|
|
1958
|
+
]),
|
|
1959
|
+
"vertex-handle": withCtx((slotProps) => [
|
|
1960
|
+
renderSlot(_ctx.$slots, "vertex-handle", mergeProps({ ref_for: true }, slotProps))
|
|
1961
|
+
]),
|
|
1962
|
+
_: 2
|
|
1963
|
+
}, [
|
|
1964
|
+
!isMultiSelected.value ? {
|
|
1965
|
+
name: "selection-menu",
|
|
1966
|
+
fn: withCtx((slotProps) => [
|
|
1967
|
+
renderSlot(_ctx.$slots, "selection-menu", mergeProps({ ref_for: true }, slotProps))
|
|
1968
|
+
]),
|
|
1969
|
+
key: "0"
|
|
1970
|
+
} : void 0
|
|
1971
|
+
]), 1040, ["trackedAnnotation", "isSelected", "isDraggable", "isResizable", "lockAspectRatio", "onSelect", "vertexConfig", "selectionMenu", "style"])) : unref(isLine)(annotation) ? (openBlock(), createBlock(_sfc_main$l, mergeProps({
|
|
1972
|
+
key: 4,
|
|
1973
|
+
trackedAnnotation: annotation,
|
|
1974
|
+
isSelected: showIndividualSelection(annotation),
|
|
1975
|
+
isDraggable: isDraggable(annotation),
|
|
1976
|
+
isResizable: isResizable(annotation),
|
|
1977
|
+
lockAspectRatio: lockAspectRatio(annotation),
|
|
1978
|
+
onSelect: (e) => handleClick(e, annotation),
|
|
1979
|
+
vertexConfig: getVertexConfig(annotation),
|
|
1980
|
+
selectionMenu: isMultiSelected.value ? void 0 : __props.selectionMenu,
|
|
1981
|
+
style: { mixBlendMode: unref(blendModeToCss)(annotation.object.blendMode ?? unref(PdfBlendMode).Normal) }
|
|
1982
|
+
}, { ref_for: true }, containerProps.value), createSlots({
|
|
1983
|
+
default: withCtx(({ annotation: currentObject }) => [
|
|
1984
|
+
createVNode(_sfc_main$g, mergeProps({ ref_for: true }, currentObject, {
|
|
1985
|
+
isSelected: isSelected(annotation),
|
|
1525
1986
|
scale: __props.scale,
|
|
1526
1987
|
onClick: (e) => handleClick(e, annotation)
|
|
1527
1988
|
}), null, 16, ["isSelected", "scale", "onClick"])
|
|
1528
|
-
]
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
isDraggable:
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1989
|
+
]),
|
|
1990
|
+
"resize-handle": withCtx((slotProps) => [
|
|
1991
|
+
renderSlot(_ctx.$slots, "resize-handle", mergeProps({ ref_for: true }, slotProps))
|
|
1992
|
+
]),
|
|
1993
|
+
"vertex-handle": withCtx((slotProps) => [
|
|
1994
|
+
renderSlot(_ctx.$slots, "vertex-handle", mergeProps({ ref_for: true }, slotProps))
|
|
1995
|
+
]),
|
|
1996
|
+
_: 2
|
|
1997
|
+
}, [
|
|
1998
|
+
!isMultiSelected.value ? {
|
|
1999
|
+
name: "selection-menu",
|
|
2000
|
+
fn: withCtx((slotProps) => [
|
|
2001
|
+
renderSlot(_ctx.$slots, "selection-menu", mergeProps({ ref_for: true }, slotProps))
|
|
2002
|
+
]),
|
|
2003
|
+
key: "0"
|
|
2004
|
+
} : void 0
|
|
2005
|
+
]), 1040, ["trackedAnnotation", "isSelected", "isDraggable", "isResizable", "lockAspectRatio", "onSelect", "vertexConfig", "selectionMenu", "style"])) : unref(isPolyline)(annotation) ? (openBlock(), createBlock(_sfc_main$l, mergeProps({
|
|
2006
|
+
key: 5,
|
|
2007
|
+
trackedAnnotation: annotation,
|
|
2008
|
+
isSelected: showIndividualSelection(annotation),
|
|
2009
|
+
isDraggable: isDraggable(annotation),
|
|
2010
|
+
isResizable: isResizable(annotation),
|
|
2011
|
+
lockAspectRatio: lockAspectRatio(annotation),
|
|
2012
|
+
onSelect: (e) => handleClick(e, annotation),
|
|
2013
|
+
vertexConfig: getVertexConfig(annotation),
|
|
2014
|
+
selectionMenu: isMultiSelected.value ? void 0 : __props.selectionMenu,
|
|
2015
|
+
style: { mixBlendMode: unref(blendModeToCss)(annotation.object.blendMode ?? unref(PdfBlendMode).Normal) }
|
|
2016
|
+
}, { ref_for: true }, containerProps.value), createSlots({
|
|
2017
|
+
default: withCtx(({ annotation: currentObject }) => [
|
|
1554
2018
|
createVNode(_sfc_main$d, mergeProps({ ref_for: true }, currentObject, {
|
|
1555
|
-
isSelected: (
|
|
2019
|
+
isSelected: isSelected(annotation),
|
|
2020
|
+
scale: __props.scale,
|
|
2021
|
+
onClick: (e) => handleClick(e, annotation)
|
|
2022
|
+
}), null, 16, ["isSelected", "scale", "onClick"])
|
|
2023
|
+
]),
|
|
2024
|
+
"resize-handle": withCtx((slotProps) => [
|
|
2025
|
+
renderSlot(_ctx.$slots, "resize-handle", mergeProps({ ref_for: true }, slotProps))
|
|
2026
|
+
]),
|
|
2027
|
+
"vertex-handle": withCtx((slotProps) => [
|
|
2028
|
+
renderSlot(_ctx.$slots, "vertex-handle", mergeProps({ ref_for: true }, slotProps))
|
|
2029
|
+
]),
|
|
2030
|
+
_: 2
|
|
2031
|
+
}, [
|
|
2032
|
+
!isMultiSelected.value ? {
|
|
2033
|
+
name: "selection-menu",
|
|
2034
|
+
fn: withCtx((slotProps) => [
|
|
2035
|
+
renderSlot(_ctx.$slots, "selection-menu", mergeProps({ ref_for: true }, slotProps))
|
|
2036
|
+
]),
|
|
2037
|
+
key: "0"
|
|
2038
|
+
} : void 0
|
|
2039
|
+
]), 1040, ["trackedAnnotation", "isSelected", "isDraggable", "isResizable", "lockAspectRatio", "onSelect", "vertexConfig", "selectionMenu", "style"])) : unref(isPolygon)(annotation) ? (openBlock(), createBlock(_sfc_main$l, mergeProps({
|
|
2040
|
+
key: 6,
|
|
2041
|
+
trackedAnnotation: annotation,
|
|
2042
|
+
isSelected: showIndividualSelection(annotation),
|
|
2043
|
+
isDraggable: isDraggable(annotation),
|
|
2044
|
+
isResizable: isResizable(annotation),
|
|
2045
|
+
lockAspectRatio: lockAspectRatio(annotation),
|
|
2046
|
+
onSelect: (e) => handleClick(e, annotation),
|
|
2047
|
+
vertexConfig: getVertexConfig(annotation),
|
|
2048
|
+
selectionMenu: isMultiSelected.value ? void 0 : __props.selectionMenu,
|
|
2049
|
+
style: { mixBlendMode: unref(blendModeToCss)(annotation.object.blendMode ?? unref(PdfBlendMode).Normal) }
|
|
2050
|
+
}, { ref_for: true }, containerProps.value), createSlots({
|
|
2051
|
+
default: withCtx(({ annotation: currentObject }) => [
|
|
2052
|
+
createVNode(_sfc_main$e, mergeProps({ ref_for: true }, currentObject, {
|
|
2053
|
+
isSelected: isSelected(annotation),
|
|
1556
2054
|
scale: __props.scale,
|
|
1557
2055
|
onClick: (e) => handleClick(e, annotation)
|
|
1558
2056
|
}), null, 16, ["isSelected", "scale", "onClick"])
|
|
1559
|
-
]
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
isDraggable:
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
2057
|
+
]),
|
|
2058
|
+
"resize-handle": withCtx((slotProps) => [
|
|
2059
|
+
renderSlot(_ctx.$slots, "resize-handle", mergeProps({ ref_for: true }, slotProps))
|
|
2060
|
+
]),
|
|
2061
|
+
"vertex-handle": withCtx((slotProps) => [
|
|
2062
|
+
renderSlot(_ctx.$slots, "vertex-handle", mergeProps({ ref_for: true }, slotProps))
|
|
2063
|
+
]),
|
|
2064
|
+
_: 2
|
|
2065
|
+
}, [
|
|
2066
|
+
!isMultiSelected.value ? {
|
|
2067
|
+
name: "selection-menu",
|
|
2068
|
+
fn: withCtx((slotProps) => [
|
|
2069
|
+
renderSlot(_ctx.$slots, "selection-menu", mergeProps({ ref_for: true }, slotProps))
|
|
2070
|
+
]),
|
|
2071
|
+
key: "0"
|
|
2072
|
+
} : void 0
|
|
2073
|
+
]), 1040, ["trackedAnnotation", "isSelected", "isDraggable", "isResizable", "lockAspectRatio", "onSelect", "vertexConfig", "selectionMenu", "style"])) : unref(isFreeText)(annotation) ? (openBlock(), createBlock(_sfc_main$l, mergeProps({
|
|
2074
|
+
key: 7,
|
|
2075
|
+
trackedAnnotation: annotation,
|
|
2076
|
+
isSelected: showIndividualSelection(annotation),
|
|
2077
|
+
isDraggable: isDraggable(annotation),
|
|
2078
|
+
isResizable: isResizable(annotation),
|
|
2079
|
+
lockAspectRatio: lockAspectRatio(annotation),
|
|
2080
|
+
onSelect: (e) => handleClick(e, annotation),
|
|
2081
|
+
onDoubleClick: (e) => handleDoubleClick(e, annotation.object.id),
|
|
2082
|
+
vertexConfig: getVertexConfig(annotation),
|
|
2083
|
+
selectionMenu: isMultiSelected.value ? void 0 : __props.selectionMenu,
|
|
2084
|
+
style: { mixBlendMode: unref(blendModeToCss)(annotation.object.blendMode ?? unref(PdfBlendMode).Normal) }
|
|
2085
|
+
}, { ref_for: true }, containerProps.value), createSlots({
|
|
2086
|
+
default: withCtx(({ annotation: currentObject }) => [
|
|
2087
|
+
createVNode(_sfc_main$i, {
|
|
2088
|
+
isSelected: isSelected(annotation),
|
|
1588
2089
|
isEditing: editingId.value === annotation.object.id,
|
|
1589
2090
|
annotation: { ...annotation, object: currentObject },
|
|
1590
2091
|
pageIndex: __props.pageIndex,
|
|
1591
2092
|
scale: __props.scale,
|
|
1592
2093
|
onClick: (e) => handleClick(e, annotation)
|
|
1593
2094
|
}, null, 8, ["isSelected", "isEditing", "annotation", "pageIndex", "scale", "onClick"])
|
|
1594
|
-
]
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
isDraggable:
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
2095
|
+
]),
|
|
2096
|
+
"resize-handle": withCtx((slotProps) => [
|
|
2097
|
+
renderSlot(_ctx.$slots, "resize-handle", mergeProps({ ref_for: true }, slotProps))
|
|
2098
|
+
]),
|
|
2099
|
+
"vertex-handle": withCtx((slotProps) => [
|
|
2100
|
+
renderSlot(_ctx.$slots, "vertex-handle", mergeProps({ ref_for: true }, slotProps))
|
|
2101
|
+
]),
|
|
2102
|
+
_: 2
|
|
2103
|
+
}, [
|
|
2104
|
+
!isMultiSelected.value ? {
|
|
2105
|
+
name: "selection-menu",
|
|
2106
|
+
fn: withCtx((slotProps) => [
|
|
2107
|
+
renderSlot(_ctx.$slots, "selection-menu", mergeProps({ ref_for: true }, slotProps))
|
|
2108
|
+
]),
|
|
2109
|
+
key: "0"
|
|
2110
|
+
} : void 0
|
|
2111
|
+
]), 1040, ["trackedAnnotation", "isSelected", "isDraggable", "isResizable", "lockAspectRatio", "onSelect", "onDoubleClick", "vertexConfig", "selectionMenu", "style"])) : unref(isStamp)(annotation) ? (openBlock(), createBlock(_sfc_main$l, mergeProps({
|
|
2112
|
+
key: 8,
|
|
2113
|
+
trackedAnnotation: annotation,
|
|
2114
|
+
isSelected: showIndividualSelection(annotation),
|
|
2115
|
+
isDraggable: isDraggable(annotation),
|
|
2116
|
+
isResizable: isResizable(annotation),
|
|
2117
|
+
lockAspectRatio: lockAspectRatio(annotation),
|
|
2118
|
+
onSelect: (e) => handleClick(e, annotation),
|
|
2119
|
+
vertexConfig: getVertexConfig(annotation),
|
|
2120
|
+
selectionMenu: isMultiSelected.value ? void 0 : __props.selectionMenu,
|
|
2121
|
+
style: { mixBlendMode: unref(blendModeToCss)(annotation.object.blendMode ?? unref(PdfBlendMode).Normal) }
|
|
2122
|
+
}, { ref_for: true }, containerProps.value), createSlots({
|
|
2123
|
+
default: withCtx(() => [
|
|
2124
|
+
createVNode(_sfc_main$a, {
|
|
1621
2125
|
documentId: __props.documentId,
|
|
1622
|
-
isSelected: (
|
|
2126
|
+
isSelected: isSelected(annotation),
|
|
1623
2127
|
annotation,
|
|
1624
2128
|
pageIndex: __props.pageIndex,
|
|
1625
2129
|
scale: __props.scale,
|
|
1626
2130
|
onClick: (e) => handleClick(e, annotation)
|
|
1627
2131
|
}, null, 8, ["documentId", "isSelected", "annotation", "pageIndex", "scale", "onClick"])
|
|
1628
|
-
]
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
isDraggable:
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
style
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
]),
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
2132
|
+
]),
|
|
2133
|
+
"resize-handle": withCtx((slotProps) => [
|
|
2134
|
+
renderSlot(_ctx.$slots, "resize-handle", mergeProps({ ref_for: true }, slotProps))
|
|
2135
|
+
]),
|
|
2136
|
+
"vertex-handle": withCtx((slotProps) => [
|
|
2137
|
+
renderSlot(_ctx.$slots, "vertex-handle", mergeProps({ ref_for: true }, slotProps))
|
|
2138
|
+
]),
|
|
2139
|
+
_: 2
|
|
2140
|
+
}, [
|
|
2141
|
+
!isMultiSelected.value ? {
|
|
2142
|
+
name: "selection-menu",
|
|
2143
|
+
fn: withCtx((slotProps) => [
|
|
2144
|
+
renderSlot(_ctx.$slots, "selection-menu", mergeProps({ ref_for: true }, slotProps))
|
|
2145
|
+
]),
|
|
2146
|
+
key: "0"
|
|
2147
|
+
} : void 0
|
|
2148
|
+
]), 1040, ["trackedAnnotation", "isSelected", "isDraggable", "isResizable", "lockAspectRatio", "onSelect", "vertexConfig", "selectionMenu", "style"])) : unref(isUnderline)(annotation) ? (openBlock(), createBlock(_sfc_main$l, mergeProps({
|
|
2149
|
+
key: 9,
|
|
2150
|
+
trackedAnnotation: annotation,
|
|
2151
|
+
isSelected: showIndividualSelection(annotation),
|
|
2152
|
+
isDraggable: isDraggable(annotation),
|
|
2153
|
+
isResizable: isResizable(annotation),
|
|
2154
|
+
lockAspectRatio: lockAspectRatio(annotation),
|
|
2155
|
+
onSelect: (e) => handleClick(e, annotation),
|
|
2156
|
+
vertexConfig: getVertexConfig(annotation),
|
|
2157
|
+
selectionMenu: isMultiSelected.value ? void 0 : __props.selectionMenu,
|
|
2158
|
+
zIndex: 0,
|
|
2159
|
+
style: { mixBlendMode: unref(blendModeToCss)(annotation.object.blendMode ?? unref(PdfBlendMode).Normal) }
|
|
2160
|
+
}, { ref_for: true }, containerProps.value), createSlots({
|
|
2161
|
+
default: withCtx(({ annotation: currentObject }) => [
|
|
2162
|
+
createVNode(_sfc_main$6, mergeProps({ ref_for: true }, currentObject, {
|
|
2163
|
+
scale: __props.scale,
|
|
2164
|
+
onClick: (e) => handleClick(e, annotation)
|
|
2165
|
+
}), null, 16, ["scale", "onClick"])
|
|
2166
|
+
]),
|
|
2167
|
+
_: 2
|
|
2168
|
+
}, [
|
|
2169
|
+
!isMultiSelected.value ? {
|
|
2170
|
+
name: "selection-menu",
|
|
2171
|
+
fn: withCtx((slotProps) => [
|
|
2172
|
+
renderSlot(_ctx.$slots, "selection-menu", mergeProps({ ref_for: true }, slotProps))
|
|
2173
|
+
]),
|
|
2174
|
+
key: "0"
|
|
2175
|
+
} : void 0
|
|
2176
|
+
]), 1040, ["trackedAnnotation", "isSelected", "isDraggable", "isResizable", "lockAspectRatio", "onSelect", "vertexConfig", "selectionMenu", "style"])) : unref(isStrikeout)(annotation) ? (openBlock(), createBlock(_sfc_main$l, mergeProps({
|
|
2177
|
+
key: 10,
|
|
2178
|
+
trackedAnnotation: annotation,
|
|
2179
|
+
isSelected: showIndividualSelection(annotation),
|
|
2180
|
+
isDraggable: isDraggable(annotation),
|
|
2181
|
+
isResizable: isResizable(annotation),
|
|
2182
|
+
lockAspectRatio: lockAspectRatio(annotation),
|
|
2183
|
+
onSelect: (e) => handleClick(e, annotation),
|
|
2184
|
+
vertexConfig: getVertexConfig(annotation),
|
|
2185
|
+
selectionMenu: isMultiSelected.value ? void 0 : __props.selectionMenu,
|
|
2186
|
+
zIndex: 0,
|
|
2187
|
+
style: { mixBlendMode: unref(blendModeToCss)(annotation.object.blendMode ?? unref(PdfBlendMode).Normal) }
|
|
2188
|
+
}, { ref_for: true }, containerProps.value), createSlots({
|
|
2189
|
+
default: withCtx(({ annotation: currentObject }) => [
|
|
2190
|
+
createVNode(_sfc_main$7, mergeProps({ ref_for: true }, currentObject, {
|
|
2191
|
+
scale: __props.scale,
|
|
2192
|
+
onClick: (e) => handleClick(e, annotation)
|
|
2193
|
+
}), null, 16, ["scale", "onClick"])
|
|
2194
|
+
]),
|
|
2195
|
+
_: 2
|
|
2196
|
+
}, [
|
|
2197
|
+
!isMultiSelected.value ? {
|
|
2198
|
+
name: "selection-menu",
|
|
2199
|
+
fn: withCtx((slotProps) => [
|
|
2200
|
+
renderSlot(_ctx.$slots, "selection-menu", mergeProps({ ref_for: true }, slotProps))
|
|
2201
|
+
]),
|
|
2202
|
+
key: "0"
|
|
2203
|
+
} : void 0
|
|
2204
|
+
]), 1040, ["trackedAnnotation", "isSelected", "isDraggable", "isResizable", "lockAspectRatio", "onSelect", "vertexConfig", "selectionMenu", "style"])) : unref(isSquiggly)(annotation) ? (openBlock(), createBlock(_sfc_main$l, mergeProps({
|
|
2205
|
+
key: 11,
|
|
2206
|
+
trackedAnnotation: annotation,
|
|
2207
|
+
isSelected: showIndividualSelection(annotation),
|
|
2208
|
+
isDraggable: isDraggable(annotation),
|
|
2209
|
+
isResizable: isResizable(annotation),
|
|
2210
|
+
lockAspectRatio: lockAspectRatio(annotation),
|
|
2211
|
+
onSelect: (e) => handleClick(e, annotation),
|
|
2212
|
+
vertexConfig: getVertexConfig(annotation),
|
|
2213
|
+
selectionMenu: isMultiSelected.value ? void 0 : __props.selectionMenu,
|
|
2214
|
+
zIndex: 0,
|
|
2215
|
+
style: { mixBlendMode: unref(blendModeToCss)(annotation.object.blendMode ?? unref(PdfBlendMode).Normal) }
|
|
2216
|
+
}, { ref_for: true }, containerProps.value), createSlots({
|
|
2217
|
+
default: withCtx(({ annotation: currentObject }) => [
|
|
2218
|
+
createVNode(_sfc_main$8, mergeProps({ ref_for: true }, currentObject, {
|
|
2219
|
+
scale: __props.scale,
|
|
2220
|
+
onClick: (e) => handleClick(e, annotation)
|
|
2221
|
+
}), null, 16, ["scale", "onClick"])
|
|
2222
|
+
]),
|
|
2223
|
+
_: 2
|
|
2224
|
+
}, [
|
|
2225
|
+
!isMultiSelected.value ? {
|
|
2226
|
+
name: "selection-menu",
|
|
2227
|
+
fn: withCtx((slotProps) => [
|
|
2228
|
+
renderSlot(_ctx.$slots, "selection-menu", mergeProps({ ref_for: true }, slotProps))
|
|
2229
|
+
]),
|
|
2230
|
+
key: "0"
|
|
2231
|
+
} : void 0
|
|
2232
|
+
]), 1040, ["trackedAnnotation", "isSelected", "isDraggable", "isResizable", "lockAspectRatio", "onSelect", "vertexConfig", "selectionMenu", "style"])) : unref(isHighlight)(annotation) ? (openBlock(), createBlock(_sfc_main$l, mergeProps({
|
|
2233
|
+
key: 12,
|
|
2234
|
+
trackedAnnotation: annotation,
|
|
2235
|
+
isSelected: showIndividualSelection(annotation),
|
|
2236
|
+
isDraggable: isDraggable(annotation),
|
|
2237
|
+
isResizable: isResizable(annotation),
|
|
2238
|
+
lockAspectRatio: lockAspectRatio(annotation),
|
|
2239
|
+
onSelect: (e) => handleClick(e, annotation),
|
|
2240
|
+
vertexConfig: getVertexConfig(annotation),
|
|
2241
|
+
selectionMenu: isMultiSelected.value ? void 0 : __props.selectionMenu,
|
|
2242
|
+
zIndex: 0,
|
|
2243
|
+
style: {
|
|
2244
|
+
mixBlendMode: unref(blendModeToCss)(annotation.object.blendMode ?? unref(PdfBlendMode).Multiply)
|
|
2245
|
+
}
|
|
2246
|
+
}, { ref_for: true }, containerProps.value), createSlots({
|
|
2247
|
+
default: withCtx(({ annotation: currentObject }) => [
|
|
2248
|
+
createVNode(_sfc_main$9, mergeProps({ ref_for: true }, currentObject, {
|
|
2249
|
+
scale: __props.scale,
|
|
2250
|
+
onClick: (e) => handleClick(e, annotation)
|
|
2251
|
+
}), null, 16, ["scale", "onClick"])
|
|
2252
|
+
]),
|
|
2253
|
+
_: 2
|
|
2254
|
+
}, [
|
|
2255
|
+
!isMultiSelected.value ? {
|
|
2256
|
+
name: "selection-menu",
|
|
2257
|
+
fn: withCtx((slotProps) => [
|
|
2258
|
+
renderSlot(_ctx.$slots, "selection-menu", mergeProps({ ref_for: true }, slotProps))
|
|
2259
|
+
]),
|
|
2260
|
+
key: "0"
|
|
2261
|
+
} : void 0
|
|
2262
|
+
]), 1040, ["trackedAnnotation", "isSelected", "isDraggable", "isResizable", "lockAspectRatio", "onSelect", "vertexConfig", "selectionMenu", "style"])) : unref(isLink)(annotation) ? (openBlock(), createBlock(_sfc_main$l, mergeProps({
|
|
2263
|
+
key: 13,
|
|
2264
|
+
trackedAnnotation: annotation,
|
|
2265
|
+
isSelected: showIndividualSelection(annotation),
|
|
2266
|
+
isMultiSelected: isMultiSelected.value,
|
|
2267
|
+
isDraggable: false,
|
|
2268
|
+
isResizable: false,
|
|
2269
|
+
lockAspectRatio: false,
|
|
2270
|
+
onSelect: (e) => handleLinkClick(e, annotation),
|
|
2271
|
+
selectionMenu: annotation.object.inReplyToId ? void 0 : isMultiSelected.value ? void 0 : __props.selectionMenu,
|
|
2272
|
+
style: { mixBlendMode: unref(blendModeToCss)(annotation.object.blendMode ?? unref(PdfBlendMode).Normal) }
|
|
2273
|
+
}, { ref_for: true }, containerProps.value), createSlots({
|
|
2274
|
+
default: withCtx(({ annotation: currentObject }) => [
|
|
2275
|
+
createVNode(_sfc_main$f, mergeProps({ ref_for: true }, currentObject, {
|
|
2276
|
+
isSelected: isSelected(annotation),
|
|
2277
|
+
scale: __props.scale,
|
|
2278
|
+
onClick: (e) => handleLinkClick(e, annotation),
|
|
2279
|
+
hasIRT: !!annotation.object.inReplyToId
|
|
2280
|
+
}), null, 16, ["isSelected", "scale", "onClick", "hasIRT"])
|
|
2281
|
+
]),
|
|
2282
|
+
"resize-handle": withCtx((slotProps) => [
|
|
2283
|
+
renderSlot(_ctx.$slots, "resize-handle", mergeProps({ ref_for: true }, slotProps))
|
|
2284
|
+
]),
|
|
2285
|
+
_: 2
|
|
2286
|
+
}, [
|
|
2287
|
+
!isMultiSelected.value && !annotation.object.inReplyToId ? {
|
|
2288
|
+
name: "selection-menu",
|
|
2289
|
+
fn: withCtx((slotProps) => [
|
|
2290
|
+
renderSlot(_ctx.$slots, "selection-menu", mergeProps({ ref_for: true }, slotProps))
|
|
2291
|
+
]),
|
|
2292
|
+
key: "0"
|
|
2293
|
+
} : void 0
|
|
2294
|
+
]), 1040, ["trackedAnnotation", "isSelected", "isMultiSelected", "onSelect", "selectionMenu", "style"])) : createCommentVNode("", true)
|
|
2295
|
+
], 64);
|
|
2296
|
+
}), 128)),
|
|
2297
|
+
allSelectedOnSamePage.value && selectedAnnotationsOnPage.value.length >= 2 ? (openBlock(), createBlock(_sfc_main$k, {
|
|
2298
|
+
key: 0,
|
|
2299
|
+
documentId: __props.documentId,
|
|
2300
|
+
pageIndex: __props.pageIndex,
|
|
2301
|
+
scale: __props.scale,
|
|
2302
|
+
rotation: __props.rotation,
|
|
2303
|
+
pageWidth: __props.pageWidth,
|
|
2304
|
+
pageHeight: __props.pageHeight,
|
|
2305
|
+
selectedAnnotations: selectedAnnotationsOnPage.value,
|
|
2306
|
+
isDraggable: areAllSelectedDraggable.value,
|
|
2307
|
+
isResizable: areAllSelectedResizable.value,
|
|
2308
|
+
resizeUI: __props.resizeUI,
|
|
2309
|
+
selectionOutlineColor: __props.selectionOutlineColor,
|
|
2310
|
+
groupSelectionMenu: __props.groupSelectionMenu
|
|
2311
|
+
}, {
|
|
2312
|
+
"group-selection-menu": withCtx((slotProps) => [
|
|
2313
|
+
renderSlot(_ctx.$slots, "group-selection-menu", normalizeProps(guardReactiveProps(slotProps)))
|
|
2314
|
+
]),
|
|
2315
|
+
"resize-handle": withCtx((slotProps) => [
|
|
2316
|
+
renderSlot(_ctx.$slots, "resize-handle", normalizeProps(guardReactiveProps(slotProps)))
|
|
2317
|
+
]),
|
|
2318
|
+
_: 3
|
|
2319
|
+
}, 8, ["documentId", "pageIndex", "scale", "rotation", "pageWidth", "pageHeight", "selectedAnnotations", "isDraggable", "isResizable", "resizeUI", "selectionOutlineColor", "groupSelectionMenu"])) : createCommentVNode("", true)
|
|
2320
|
+
], 64);
|
|
1733
2321
|
};
|
|
1734
2322
|
}
|
|
1735
2323
|
});
|
|
1736
|
-
const _sfc_main$
|
|
2324
|
+
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
1737
2325
|
__name: "text-markup",
|
|
1738
2326
|
props: {
|
|
1739
2327
|
documentId: {},
|
|
@@ -1782,36 +2370,36 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
1782
2370
|
inset: 0
|
|
1783
2371
|
})
|
|
1784
2372
|
}, [
|
|
1785
|
-
activeTool.value.defaults.type === unref(PdfAnnotationSubtype).HIGHLIGHT ? (openBlock(), createBlock(_sfc_main$
|
|
2373
|
+
activeTool.value.defaults.type === unref(PdfAnnotationSubtype).HIGHLIGHT ? (openBlock(), createBlock(_sfc_main$9, {
|
|
1786
2374
|
key: 0,
|
|
1787
|
-
|
|
2375
|
+
strokeColor: activeTool.value.defaults.strokeColor,
|
|
1788
2376
|
opacity: activeTool.value.defaults.opacity,
|
|
1789
2377
|
segmentRects: rects.value,
|
|
1790
2378
|
scale: __props.scale
|
|
1791
|
-
}, null, 8, ["
|
|
2379
|
+
}, null, 8, ["strokeColor", "opacity", "segmentRects", "scale"])) : activeTool.value.defaults.type === unref(PdfAnnotationSubtype).UNDERLINE ? (openBlock(), createBlock(_sfc_main$6, {
|
|
1792
2380
|
key: 1,
|
|
1793
|
-
|
|
2381
|
+
strokeColor: activeTool.value.defaults.strokeColor,
|
|
1794
2382
|
opacity: activeTool.value.defaults.opacity,
|
|
1795
2383
|
segmentRects: rects.value,
|
|
1796
2384
|
scale: __props.scale
|
|
1797
|
-
}, null, 8, ["
|
|
2385
|
+
}, null, 8, ["strokeColor", "opacity", "segmentRects", "scale"])) : activeTool.value.defaults.type === unref(PdfAnnotationSubtype).STRIKEOUT ? (openBlock(), createBlock(_sfc_main$7, {
|
|
1798
2386
|
key: 2,
|
|
1799
|
-
|
|
2387
|
+
strokeColor: activeTool.value.defaults.strokeColor,
|
|
1800
2388
|
opacity: activeTool.value.defaults.opacity,
|
|
1801
2389
|
segmentRects: rects.value,
|
|
1802
2390
|
scale: __props.scale
|
|
1803
|
-
}, null, 8, ["
|
|
2391
|
+
}, null, 8, ["strokeColor", "opacity", "segmentRects", "scale"])) : activeTool.value.defaults.type === unref(PdfAnnotationSubtype).SQUIGGLY ? (openBlock(), createBlock(_sfc_main$8, {
|
|
1804
2392
|
key: 3,
|
|
1805
|
-
|
|
2393
|
+
strokeColor: activeTool.value.defaults.strokeColor,
|
|
1806
2394
|
opacity: activeTool.value.defaults.opacity,
|
|
1807
2395
|
segmentRects: rects.value,
|
|
1808
2396
|
scale: __props.scale
|
|
1809
|
-
}, null, 8, ["
|
|
2397
|
+
}, null, 8, ["strokeColor", "opacity", "segmentRects", "scale"])) : createCommentVNode("", true)
|
|
1810
2398
|
], 4)) : createCommentVNode("", true);
|
|
1811
2399
|
};
|
|
1812
2400
|
}
|
|
1813
2401
|
});
|
|
1814
|
-
const _sfc_main$
|
|
2402
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
1815
2403
|
__name: "preview-renderer",
|
|
1816
2404
|
props: {
|
|
1817
2405
|
preview: {},
|
|
@@ -1832,27 +2420,27 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
1832
2420
|
return openBlock(), createElementBlock("div", {
|
|
1833
2421
|
style: normalizeStyle(style.value)
|
|
1834
2422
|
}, [
|
|
1835
|
-
__props.preview.type === unref(PdfAnnotationSubtype).CIRCLE ? (openBlock(), createBlock(unref(_sfc_main$
|
|
2423
|
+
__props.preview.type === unref(PdfAnnotationSubtype).CIRCLE ? (openBlock(), createBlock(unref(_sfc_main$j), mergeProps({
|
|
1836
2424
|
key: 0,
|
|
1837
2425
|
isSelected: false,
|
|
1838
2426
|
scale: __props.scale
|
|
1839
|
-
}, __props.preview.data), null, 16, ["scale"])) : __props.preview.type === unref(PdfAnnotationSubtype).SQUARE ? (openBlock(), createBlock(unref(_sfc_main$
|
|
2427
|
+
}, __props.preview.data), null, 16, ["scale"])) : __props.preview.type === unref(PdfAnnotationSubtype).SQUARE ? (openBlock(), createBlock(unref(_sfc_main$c), mergeProps({
|
|
1840
2428
|
key: 1,
|
|
1841
2429
|
isSelected: false,
|
|
1842
2430
|
scale: __props.scale
|
|
1843
|
-
}, __props.preview.data), null, 16, ["scale"])) : __props.preview.type === unref(PdfAnnotationSubtype).POLYGON ? (openBlock(), createBlock(unref(_sfc_main$
|
|
2431
|
+
}, __props.preview.data), null, 16, ["scale"])) : __props.preview.type === unref(PdfAnnotationSubtype).POLYGON ? (openBlock(), createBlock(unref(_sfc_main$e), mergeProps({
|
|
1844
2432
|
key: 2,
|
|
1845
2433
|
isSelected: false,
|
|
1846
2434
|
scale: __props.scale
|
|
1847
|
-
}, __props.preview.data), null, 16, ["scale"])) : __props.preview.type === unref(PdfAnnotationSubtype).POLYLINE ? (openBlock(), createBlock(unref(_sfc_main$
|
|
2435
|
+
}, __props.preview.data), null, 16, ["scale"])) : __props.preview.type === unref(PdfAnnotationSubtype).POLYLINE ? (openBlock(), createBlock(unref(_sfc_main$d), mergeProps({
|
|
1848
2436
|
key: 3,
|
|
1849
2437
|
isSelected: false,
|
|
1850
2438
|
scale: __props.scale
|
|
1851
|
-
}, __props.preview.data), null, 16, ["scale"])) : __props.preview.type === unref(PdfAnnotationSubtype).LINE ? (openBlock(), createBlock(unref(_sfc_main$
|
|
2439
|
+
}, __props.preview.data), null, 16, ["scale"])) : __props.preview.type === unref(PdfAnnotationSubtype).LINE ? (openBlock(), createBlock(unref(_sfc_main$g), mergeProps({
|
|
1852
2440
|
key: 4,
|
|
1853
2441
|
isSelected: false,
|
|
1854
2442
|
scale: __props.scale
|
|
1855
|
-
}, __props.preview.data), null, 16, ["scale"])) : __props.preview.type === unref(PdfAnnotationSubtype).INK ? (openBlock(), createBlock(unref(_sfc_main$
|
|
2443
|
+
}, __props.preview.data), null, 16, ["scale"])) : __props.preview.type === unref(PdfAnnotationSubtype).INK ? (openBlock(), createBlock(unref(_sfc_main$h), mergeProps({
|
|
1856
2444
|
key: 5,
|
|
1857
2445
|
isSelected: false,
|
|
1858
2446
|
scale: __props.scale
|
|
@@ -1869,7 +2457,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
1869
2457
|
};
|
|
1870
2458
|
}
|
|
1871
2459
|
});
|
|
1872
|
-
const _sfc_main$
|
|
2460
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
1873
2461
|
__name: "annotation-paint-layer",
|
|
1874
2462
|
props: {
|
|
1875
2463
|
documentId: {},
|
|
@@ -1960,7 +2548,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
1960
2548
|
style: { "display": "none" }
|
|
1961
2549
|
}, null, 512),
|
|
1962
2550
|
(openBlock(true), createElementBlock(Fragment, null, renderList(previews.value.entries(), ([toolId, preview]) => {
|
|
1963
|
-
return openBlock(), createBlock(_sfc_main$
|
|
2551
|
+
return openBlock(), createBlock(_sfc_main$3, {
|
|
1964
2552
|
key: toolId,
|
|
1965
2553
|
preview,
|
|
1966
2554
|
scale: __props.scale
|
|
@@ -1970,7 +2558,46 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
1970
2558
|
};
|
|
1971
2559
|
}
|
|
1972
2560
|
});
|
|
1973
|
-
const
|
|
2561
|
+
const RendererRegistryKey = Symbol(
|
|
2562
|
+
"AnnotationRendererRegistry"
|
|
2563
|
+
);
|
|
2564
|
+
function createRendererRegistry() {
|
|
2565
|
+
const renderers = shallowRef([]);
|
|
2566
|
+
return {
|
|
2567
|
+
register(entries) {
|
|
2568
|
+
const ids = new Set(entries.map((e) => e.id));
|
|
2569
|
+
renderers.value = [...renderers.value.filter((r) => !ids.has(r.id)), ...entries];
|
|
2570
|
+
return () => {
|
|
2571
|
+
renderers.value = renderers.value.filter((r) => !entries.some((e) => e.id === r.id));
|
|
2572
|
+
};
|
|
2573
|
+
},
|
|
2574
|
+
getAll() {
|
|
2575
|
+
return renderers.value;
|
|
2576
|
+
}
|
|
2577
|
+
};
|
|
2578
|
+
}
|
|
2579
|
+
function provideRendererRegistry() {
|
|
2580
|
+
const registry = createRendererRegistry();
|
|
2581
|
+
provide(RendererRegistryKey, registry);
|
|
2582
|
+
return registry;
|
|
2583
|
+
}
|
|
2584
|
+
function useRendererRegistry() {
|
|
2585
|
+
return inject(RendererRegistryKey, null);
|
|
2586
|
+
}
|
|
2587
|
+
function useRegisterRenderers(entries) {
|
|
2588
|
+
const registry = useRendererRegistry();
|
|
2589
|
+
if (!registry) return;
|
|
2590
|
+
const unregister = registry.register(entries);
|
|
2591
|
+
onUnmounted(unregister);
|
|
2592
|
+
}
|
|
2593
|
+
function createRenderer(entry) {
|
|
2594
|
+
return {
|
|
2595
|
+
id: entry.id,
|
|
2596
|
+
matches: entry.matches,
|
|
2597
|
+
component: markRaw(entry.component)
|
|
2598
|
+
};
|
|
2599
|
+
}
|
|
2600
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
1974
2601
|
__name: "annotation-layer",
|
|
1975
2602
|
props: {
|
|
1976
2603
|
documentId: {},
|
|
@@ -1980,10 +2607,24 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1980
2607
|
resizeUI: {},
|
|
1981
2608
|
vertexUI: {},
|
|
1982
2609
|
selectionOutlineColor: {},
|
|
1983
|
-
selectionMenu: { type: Function }
|
|
2610
|
+
selectionMenu: { type: Function },
|
|
2611
|
+
groupSelectionMenu: { type: Function },
|
|
2612
|
+
annotationRenderers: {}
|
|
1984
2613
|
},
|
|
1985
2614
|
setup(__props) {
|
|
1986
2615
|
const props = __props;
|
|
2616
|
+
const registry = useRendererRegistry();
|
|
2617
|
+
const allRenderers = computed(() => {
|
|
2618
|
+
const fromRegistry = (registry == null ? void 0 : registry.getAll()) ?? [];
|
|
2619
|
+
const fromProps = props.annotationRenderers ?? [];
|
|
2620
|
+
const merged = [...fromRegistry];
|
|
2621
|
+
for (const r of fromProps) {
|
|
2622
|
+
const idx = merged.findIndex((m) => m.id === r.id);
|
|
2623
|
+
if (idx >= 0) merged[idx] = r;
|
|
2624
|
+
else merged.push(r);
|
|
2625
|
+
}
|
|
2626
|
+
return merged;
|
|
2627
|
+
});
|
|
1987
2628
|
const documentState = useDocumentState(() => props.documentId);
|
|
1988
2629
|
const page = computed(() => {
|
|
1989
2630
|
var _a, _b, _c;
|
|
@@ -2009,7 +2650,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2009
2650
|
});
|
|
2010
2651
|
return (_ctx, _cache) => {
|
|
2011
2652
|
return openBlock(), createElementBlock("div", null, [
|
|
2012
|
-
createVNode(_sfc_main$
|
|
2653
|
+
createVNode(_sfc_main$5, {
|
|
2013
2654
|
documentId: __props.documentId,
|
|
2014
2655
|
pageIndex: __props.pageIndex,
|
|
2015
2656
|
scale: actualScale.value,
|
|
@@ -2019,11 +2660,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2019
2660
|
resizeUI: __props.resizeUI,
|
|
2020
2661
|
vertexUI: __props.vertexUI,
|
|
2021
2662
|
selectionOutlineColor: __props.selectionOutlineColor,
|
|
2022
|
-
selectionMenu: __props.selectionMenu
|
|
2663
|
+
selectionMenu: __props.selectionMenu,
|
|
2664
|
+
groupSelectionMenu: __props.groupSelectionMenu,
|
|
2665
|
+
annotationRenderers: allRenderers.value
|
|
2023
2666
|
}, {
|
|
2024
2667
|
"selection-menu": withCtx((slotProps) => [
|
|
2025
2668
|
renderSlot(_ctx.$slots, "selection-menu", normalizeProps(guardReactiveProps(slotProps)))
|
|
2026
2669
|
]),
|
|
2670
|
+
"group-selection-menu": withCtx((slotProps) => [
|
|
2671
|
+
renderSlot(_ctx.$slots, "group-selection-menu", normalizeProps(guardReactiveProps(slotProps)))
|
|
2672
|
+
]),
|
|
2027
2673
|
"resize-handle": withCtx((slotProps) => [
|
|
2028
2674
|
renderSlot(_ctx.$slots, "resize-handle", normalizeProps(guardReactiveProps(slotProps)))
|
|
2029
2675
|
]),
|
|
@@ -2031,13 +2677,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2031
2677
|
renderSlot(_ctx.$slots, "vertex-handle", normalizeProps(guardReactiveProps(slotProps)))
|
|
2032
2678
|
]),
|
|
2033
2679
|
_: 3
|
|
2034
|
-
}, 8, ["documentId", "pageIndex", "scale", "rotation", "pageWidth", "pageHeight", "resizeUI", "vertexUI", "selectionOutlineColor", "selectionMenu"]),
|
|
2035
|
-
createVNode(_sfc_main$
|
|
2680
|
+
}, 8, ["documentId", "pageIndex", "scale", "rotation", "pageWidth", "pageHeight", "resizeUI", "vertexUI", "selectionOutlineColor", "selectionMenu", "groupSelectionMenu", "annotationRenderers"]),
|
|
2681
|
+
createVNode(_sfc_main$4, {
|
|
2036
2682
|
documentId: __props.documentId,
|
|
2037
2683
|
pageIndex: __props.pageIndex,
|
|
2038
2684
|
scale: actualScale.value
|
|
2039
2685
|
}, null, 8, ["documentId", "pageIndex", "scale"]),
|
|
2040
|
-
createVNode(_sfc_main$
|
|
2686
|
+
createVNode(_sfc_main$2, {
|
|
2041
2687
|
documentId: __props.documentId,
|
|
2042
2688
|
pageIndex: __props.pageIndex,
|
|
2043
2689
|
scale: actualScale.value
|
|
@@ -2046,28 +2692,47 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2046
2692
|
};
|
|
2047
2693
|
}
|
|
2048
2694
|
});
|
|
2695
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
2696
|
+
__name: "renderer-registry-provider",
|
|
2697
|
+
setup(__props) {
|
|
2698
|
+
provideRendererRegistry();
|
|
2699
|
+
return (_ctx, _cache) => {
|
|
2700
|
+
return renderSlot(_ctx.$slots, "default");
|
|
2701
|
+
};
|
|
2702
|
+
}
|
|
2703
|
+
});
|
|
2704
|
+
const AnnotationPluginPackage = createPluginPackage(AnnotationPluginPackage$1).addWrapper(_sfc_main).build();
|
|
2049
2705
|
export {
|
|
2050
|
-
_sfc_main$
|
|
2051
|
-
_sfc_main as AnnotationLayer,
|
|
2052
|
-
_sfc_main$
|
|
2053
|
-
|
|
2054
|
-
_sfc_main$
|
|
2055
|
-
_sfc_main$
|
|
2056
|
-
_sfc_main$
|
|
2057
|
-
_sfc_main$
|
|
2058
|
-
_sfc_main$
|
|
2059
|
-
_sfc_main$
|
|
2060
|
-
_sfc_main$
|
|
2061
|
-
_sfc_main$
|
|
2062
|
-
_sfc_main$
|
|
2063
|
-
_sfc_main$
|
|
2064
|
-
_sfc_main$
|
|
2065
|
-
_sfc_main$
|
|
2066
|
-
_sfc_main
|
|
2067
|
-
_sfc_main$
|
|
2068
|
-
_sfc_main$
|
|
2706
|
+
_sfc_main$l as AnnotationContainer,
|
|
2707
|
+
_sfc_main$1 as AnnotationLayer,
|
|
2708
|
+
_sfc_main$2 as AnnotationPaintLayer,
|
|
2709
|
+
AnnotationPluginPackage,
|
|
2710
|
+
_sfc_main$5 as Annotations,
|
|
2711
|
+
_sfc_main$j as Circle,
|
|
2712
|
+
_sfc_main$i as FreeText,
|
|
2713
|
+
_sfc_main$k as GroupSelectionBox,
|
|
2714
|
+
_sfc_main$9 as Highlight,
|
|
2715
|
+
_sfc_main$h as Ink,
|
|
2716
|
+
_sfc_main$g as Line,
|
|
2717
|
+
_sfc_main$f as Link,
|
|
2718
|
+
_sfc_main$e as Polygon,
|
|
2719
|
+
_sfc_main$d as Polyline,
|
|
2720
|
+
_sfc_main$3 as PreviewRenderer,
|
|
2721
|
+
_sfc_main$b as RenderAnnotation,
|
|
2722
|
+
_sfc_main as RendererRegistryProvider,
|
|
2723
|
+
_sfc_main$c as Square,
|
|
2724
|
+
_sfc_main$8 as Squiggly,
|
|
2725
|
+
_sfc_main$a as Stamp,
|
|
2726
|
+
_sfc_main$7 as Strikeout,
|
|
2727
|
+
_sfc_main$4 as TextMarkup,
|
|
2728
|
+
_sfc_main$6 as Underline,
|
|
2729
|
+
createRenderer,
|
|
2730
|
+
createRendererRegistry,
|
|
2731
|
+
provideRendererRegistry,
|
|
2069
2732
|
useAnnotation,
|
|
2070
2733
|
useAnnotationCapability,
|
|
2071
|
-
useAnnotationPlugin
|
|
2734
|
+
useAnnotationPlugin,
|
|
2735
|
+
useRegisterRenderers,
|
|
2736
|
+
useRendererRegistry
|
|
2072
2737
|
};
|
|
2073
2738
|
//# sourceMappingURL=index.js.map
|