@embedpdf/plugin-annotation 2.2.0 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1196 -92
- package/dist/index.js.map +1 -1
- package/dist/lib/actions.d.ts +31 -2
- package/dist/lib/annotation-plugin.d.ts +177 -2
- package/dist/lib/handlers/types.d.ts +1 -1
- package/dist/lib/helpers.d.ts +6 -1
- 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 +7 -1
- package/dist/lib/types.d.ts +265 -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 +857 -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 +857 -403
- package/dist/react/index.js.map +1 -1
- package/dist/shared/components/annotation-container.d.ts +8 -1
- package/dist/shared/components/annotation-layer.d.ts +4 -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 +2 -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 +7 -0
- package/dist/shared-preact/components/annotation-container.d.ts +8 -1
- package/dist/shared-preact/components/annotation-layer.d.ts +4 -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 +2 -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 +7 -0
- package/dist/shared-react/components/annotation-container.d.ts +8 -1
- package/dist/shared-react/components/annotation-layer.d.ts +4 -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 +2 -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 +7 -0
- package/dist/svelte/components/AnnotationLayer.svelte.d.ts +5 -1
- package/dist/svelte/components/Annotations.svelte.d.ts +5 -1
- package/dist/svelte/components/GroupSelectionBox.svelte.d.ts +32 -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 +1 -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/index.cjs +1 -1
- package/dist/svelte/index.cjs.map +1 -1
- package/dist/svelte/index.js +905 -255
- 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 +2 -0
- package/dist/vue/components/annotation-layer.vue.d.ts +28 -5
- 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.vue.d.ts +65 -1
- package/dist/vue/components/group-selection-box.vue.d.ts +73 -0
- package/dist/vue/components/index.d.ts +1 -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/hooks/use-annotation.d.ts +2 -0
- package/dist/vue/index.cjs +1 -1
- package/dist/vue/index.cjs.map +1 -1
- package/dist/vue/index.js +946 -406
- package/dist/vue/index.js.map +1 -1
- package/dist/vue/types.d.ts +7 -0
- package/package.json +10 -10
package/dist/svelte/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as $ from "svelte/internal/client";
|
|
2
|
-
import { AnnotationPlugin, initialDocumentState, patching, getAnnotationsByPageIndex,
|
|
2
|
+
import { AnnotationPlugin, initialDocumentState, patching, getAnnotationsByPageIndex, getSelectedAnnotationIds, isInk, isSquare, isCircle, isUnderline, isStrikeout, isSquiggly, isHighlight, isLine, isPolyline, isPolygon, isFreeText, isStamp, isLink } from "@embedpdf/plugin-annotation";
|
|
3
3
|
export * from "@embedpdf/plugin-annotation";
|
|
4
4
|
import { useCapability, usePlugin, useDocumentPermissions, useDocumentState } from "@embedpdf/core/svelte";
|
|
5
5
|
import "svelte/internal/disclose-version";
|
|
6
6
|
import { useInteractionHandles, deepToRaw, doublePress, CounterRotate } from "@embedpdf/utils/svelte";
|
|
7
|
-
import {
|
|
7
|
+
import { untrack } from "svelte";
|
|
8
|
+
import { PdfAnnotationBorderStyle, PdfVerticalAlignment, textAlignmentToCss, standardFontCss, ignore, PdfErrorCode, boundingRectOrEmpty, blendModeToCss, PdfBlendMode, PdfAnnotationSubtype, Rotation } from "@embedpdf/models";
|
|
8
9
|
import { usePointerHandlers } from "@embedpdf/plugin-interaction-manager/svelte";
|
|
9
10
|
import { useSelectionCapability } from "@embedpdf/plugin-selection/svelte";
|
|
10
11
|
const useAnnotationCapability = () => useCapability(AnnotationPlugin.id);
|
|
@@ -38,10 +39,10 @@ const useAnnotation = (getDocumentId) => {
|
|
|
38
39
|
};
|
|
39
40
|
var root_6$1 = $.from_html(`<div></div>`);
|
|
40
41
|
var root_10 = $.from_html(`<div></div>`);
|
|
41
|
-
var root$
|
|
42
|
+
var root$c = $.from_html(`<div data-no-interaction=""><div><!> <!> <!></div> <!></div>`);
|
|
42
43
|
function AnnotationContainer($$anchor, $$props) {
|
|
43
44
|
$.push($$props, true);
|
|
44
|
-
let lockAspectRatio = $.prop($$props, "lockAspectRatio", 3, false), propsClass = $.prop($$props, "class", 3, ""), outlineOffset = $.prop($$props, "outlineOffset", 3, 1), zIndex = $.prop($$props, "zIndex", 3, 20), selectionOutlineColor = $.prop($$props, "selectionOutlineColor", 3, "#007ACC"), restProps = $.rest_props($$props, [
|
|
45
|
+
let isMultiSelected = $.prop($$props, "isMultiSelected", 3, false), lockAspectRatio = $.prop($$props, "lockAspectRatio", 3, false), propsClass = $.prop($$props, "class", 3, ""), outlineOffset = $.prop($$props, "outlineOffset", 3, 1), zIndex = $.prop($$props, "zIndex", 3, 20), selectionOutlineColor = $.prop($$props, "selectionOutlineColor", 3, "#007ACC"), restProps = $.rest_props($$props, [
|
|
45
46
|
"$$slots",
|
|
46
47
|
"$$events",
|
|
47
48
|
"$$legacy",
|
|
@@ -54,6 +55,7 @@ function AnnotationContainer($$anchor, $$props) {
|
|
|
54
55
|
"trackedAnnotation",
|
|
55
56
|
"children",
|
|
56
57
|
"isSelected",
|
|
58
|
+
"isMultiSelected",
|
|
57
59
|
"isDraggable",
|
|
58
60
|
"isResizable",
|
|
59
61
|
"lockAspectRatio",
|
|
@@ -73,10 +75,12 @@ function AnnotationContainer($$anchor, $$props) {
|
|
|
73
75
|
]);
|
|
74
76
|
let preview = $.state($.proxy($$props.trackedAnnotation.object));
|
|
75
77
|
let annotationCapability = useAnnotationCapability();
|
|
78
|
+
const annotationPlugin = useAnnotationPlugin();
|
|
76
79
|
const permissions = useDocumentPermissions(() => $$props.documentId);
|
|
77
80
|
let gestureBaseRef = $.state(null);
|
|
78
|
-
|
|
79
|
-
const
|
|
81
|
+
let gestureBaseRectRef = $.state(null);
|
|
82
|
+
const effectiveIsDraggable = $.derived(() => permissions.canModifyAnnotations && $$props.isDraggable && !isMultiSelected());
|
|
83
|
+
const effectiveIsResizable = $.derived(() => permissions.canModifyAnnotations && $$props.isResizable && !isMultiSelected());
|
|
80
84
|
const guardedOnDoubleClick = $.derived(() => permissions.canModifyAnnotations && $$props.onDoubleClick ? $$props.onDoubleClick : void 0);
|
|
81
85
|
const annotationProvides = $.derived(() => annotationCapability.provides ? annotationCapability.provides.forDocument($$props.documentId) : null);
|
|
82
86
|
let currentObject = $.derived(() => $.get(preview) ? { ...$$props.trackedAnnotation.object, ...$.get(preview) } : $$props.trackedAnnotation.object);
|
|
@@ -96,11 +100,32 @@ function AnnotationContainer($$anchor, $$props) {
|
|
|
96
100
|
var _a;
|
|
97
101
|
return ((_a = $$props.vertexUI) == null ? void 0 : _a.size) ?? 12;
|
|
98
102
|
});
|
|
103
|
+
const showOutline = $.derived(() => $$props.isSelected && !isMultiSelected());
|
|
99
104
|
$.user_effect(() => {
|
|
100
105
|
if ($$props.trackedAnnotation.object) {
|
|
101
106
|
$.set(preview, $$props.trackedAnnotation.object, true);
|
|
102
107
|
}
|
|
103
108
|
});
|
|
109
|
+
$.user_effect(() => {
|
|
110
|
+
const plugin = annotationPlugin.plugin;
|
|
111
|
+
if (!plugin) return;
|
|
112
|
+
const id = $$props.trackedAnnotation.object.id;
|
|
113
|
+
const handleEvent = (event) => {
|
|
114
|
+
var _a;
|
|
115
|
+
if (event.documentId !== $$props.documentId) return;
|
|
116
|
+
const patch = (_a = event.previewPatches) == null ? void 0 : _a[id];
|
|
117
|
+
if (event.type === "update" && patch) {
|
|
118
|
+
$.set(preview, { ...untrack(() => $.get(preview)), ...patch }, true);
|
|
119
|
+
} else if (event.type === "cancel") {
|
|
120
|
+
$.set(preview, $$props.trackedAnnotation.object, true);
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
const unsubs = [
|
|
124
|
+
plugin.onDragChange(handleEvent),
|
|
125
|
+
plugin.onResizeChange(handleEvent)
|
|
126
|
+
];
|
|
127
|
+
return () => unsubs.forEach((u) => u());
|
|
128
|
+
});
|
|
104
129
|
const interactionHandles = useInteractionHandles(() => {
|
|
105
130
|
var _a;
|
|
106
131
|
return {
|
|
@@ -115,28 +140,62 @@ function AnnotationContainer($$anchor, $$props) {
|
|
|
115
140
|
maintainAspectRatio: lockAspectRatio(),
|
|
116
141
|
pageRotation: $$props.rotation,
|
|
117
142
|
scale: $$props.scale,
|
|
118
|
-
|
|
143
|
+
// Disable interaction handles when multi-selected
|
|
144
|
+
enabled: $$props.isSelected && !isMultiSelected(),
|
|
119
145
|
onUpdate: (event) => {
|
|
120
|
-
var _a2, _b, _c
|
|
121
|
-
if (!((_a2 = event.transformData) == null ? void 0 : _a2.type)) return;
|
|
146
|
+
var _a2, _b, _c;
|
|
147
|
+
if (!((_a2 = event.transformData) == null ? void 0 : _a2.type) || isMultiSelected()) return;
|
|
148
|
+
const plugin = annotationPlugin.plugin;
|
|
149
|
+
if (!plugin) return;
|
|
150
|
+
const { type, changes, metadata } = event.transformData;
|
|
151
|
+
const id = $$props.trackedAnnotation.object.id;
|
|
152
|
+
const pageSize = { width: $$props.pageWidth, height: $$props.pageHeight };
|
|
122
153
|
if (event.state === "start") {
|
|
123
|
-
$.set(
|
|
154
|
+
$.set(gestureBaseRectRef, $$props.trackedAnnotation.object.rect, true);
|
|
155
|
+
$.set(
|
|
156
|
+
gestureBaseRef,
|
|
157
|
+
$$props.trackedAnnotation.object,
|
|
158
|
+
// For vertex edit
|
|
159
|
+
true
|
|
160
|
+
);
|
|
161
|
+
if (type === "move") {
|
|
162
|
+
plugin.startDrag($$props.documentId, { annotationIds: [id], pageSize });
|
|
163
|
+
} else if (type === "resize") {
|
|
164
|
+
plugin.startResize($$props.documentId, {
|
|
165
|
+
annotationIds: [id],
|
|
166
|
+
pageSize,
|
|
167
|
+
resizeHandle: (metadata == null ? void 0 : metadata.handle) ?? "se"
|
|
168
|
+
});
|
|
169
|
+
}
|
|
124
170
|
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
171
|
+
if (changes.rect && $.get(gestureBaseRectRef)) {
|
|
172
|
+
if (type === "move") {
|
|
173
|
+
const delta = {
|
|
174
|
+
x: changes.rect.origin.x - $.get(gestureBaseRectRef).origin.x,
|
|
175
|
+
y: changes.rect.origin.y - $.get(gestureBaseRectRef).origin.y
|
|
176
|
+
};
|
|
177
|
+
plugin.updateDrag($$props.documentId, delta);
|
|
178
|
+
} else if (type === "resize") {
|
|
179
|
+
plugin.updateResize($$props.documentId, changes.rect);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
if (type === "vertex-edit" && changes.vertices && $$props.vertexConfig) {
|
|
183
|
+
const base = $.get(gestureBaseRef) ?? $$props.trackedAnnotation.object;
|
|
184
|
+
const vertexChanges = $$props.vertexConfig.transformAnnotation(base, changes.vertices);
|
|
185
|
+
const patched = (_b = annotationCapability.provides) == null ? void 0 : _b.transformAnnotation(base, { type, changes: vertexChanges, metadata });
|
|
186
|
+
if (patched) {
|
|
187
|
+
$.set(preview, { ...$.get(preview), ...patched }, true);
|
|
188
|
+
if (event.state === "end") {
|
|
189
|
+
const sanitized = deepToRaw(patched);
|
|
190
|
+
(_c = $.get(annotationProvides)) == null ? void 0 : _c.updateAnnotation($$props.pageIndex, id, sanitized);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
135
193
|
}
|
|
136
|
-
if (event.state === "end"
|
|
194
|
+
if (event.state === "end") {
|
|
195
|
+
$.set(gestureBaseRectRef, null);
|
|
137
196
|
$.set(gestureBaseRef, null);
|
|
138
|
-
|
|
139
|
-
|
|
197
|
+
if (type === "move") plugin.commitDrag($$props.documentId);
|
|
198
|
+
else if (type === "resize") plugin.commitResize($$props.documentId);
|
|
140
199
|
}
|
|
141
200
|
}
|
|
142
201
|
},
|
|
@@ -153,7 +212,7 @@ function AnnotationContainer($$anchor, $$props) {
|
|
|
153
212
|
});
|
|
154
213
|
const resizeHandles = $.derived(() => interactionHandles.resize);
|
|
155
214
|
const vertexHandles = $.derived(() => interactionHandles.vertices);
|
|
156
|
-
const shouldShowMenu = $.derived(() => $$props.isSelected && (!!$$props.selectionMenu || !!$$props.selectionMenuSnippet));
|
|
215
|
+
const shouldShowMenu = $.derived(() => $$props.isSelected && !isMultiSelected() && (!!$$props.selectionMenu || !!$$props.selectionMenuSnippet));
|
|
157
216
|
function buildContext() {
|
|
158
217
|
return {
|
|
159
218
|
type: "annotation",
|
|
@@ -171,7 +230,7 @@ function AnnotationContainer($$anchor, $$props) {
|
|
|
171
230
|
menuWrapperProps
|
|
172
231
|
};
|
|
173
232
|
}
|
|
174
|
-
var div = root$
|
|
233
|
+
var div = root$c();
|
|
175
234
|
var div_1 = $.child(div);
|
|
176
235
|
$.attribute_effect(div_1, () => ({
|
|
177
236
|
...$.get(effectiveIsDraggable) && $$props.isSelected ? interactionHandles.dragProps : {},
|
|
@@ -184,9 +243,9 @@ function AnnotationContainer($$anchor, $$props) {
|
|
|
184
243
|
top: `${$.get(currentObject).rect.origin.y * $$props.scale}px`,
|
|
185
244
|
width: `${$.get(currentObject).rect.size.width * $$props.scale}px`,
|
|
186
245
|
height: `${$.get(currentObject).rect.size.height * $$props.scale}px`,
|
|
187
|
-
outline:
|
|
188
|
-
"outline-offset":
|
|
189
|
-
"pointer-events": $$props.isSelected ? "auto" : "none",
|
|
246
|
+
outline: $.get(showOutline) ? `1px solid ${selectionOutlineColor()}` : "none",
|
|
247
|
+
"outline-offset": $.get(showOutline) ? `${outlineOffset()}px` : "0px",
|
|
248
|
+
"pointer-events": $$props.isSelected && !isMultiSelected() ? "auto" : "none",
|
|
190
249
|
"touch-action": "none",
|
|
191
250
|
cursor: $$props.isSelected && $.get(effectiveIsDraggable) ? "move" : "default",
|
|
192
251
|
"z-index": zIndex()
|
|
@@ -310,7 +369,7 @@ function AnnotationContainer($$anchor, $$props) {
|
|
|
310
369
|
$.append($$anchor2, fragment_5);
|
|
311
370
|
};
|
|
312
371
|
$.if(node_7, ($$render) => {
|
|
313
|
-
if ($$props.isSelected && permissions.canModifyAnnotations) $$render(consequent_4);
|
|
372
|
+
if ($$props.isSelected && permissions.canModifyAnnotations && !isMultiSelected()) $$render(consequent_4);
|
|
314
373
|
});
|
|
315
374
|
}
|
|
316
375
|
$.reset(div_1);
|
|
@@ -405,14 +464,15 @@ function AnnotationContainer($$anchor, $$props) {
|
|
|
405
464
|
$.append($$anchor, div);
|
|
406
465
|
$.pop();
|
|
407
466
|
}
|
|
408
|
-
var root_1$
|
|
467
|
+
var root_1$b = $.from_html(`<div></div>`);
|
|
409
468
|
function Highlight($$anchor, $$props) {
|
|
410
469
|
$.push($$props, true);
|
|
411
|
-
let
|
|
470
|
+
let opacity = $.prop($$props, "opacity", 3, 0.5);
|
|
471
|
+
const resolvedColor = $.derived(() => $$props.strokeColor ?? "#FFFF00");
|
|
412
472
|
var fragment = $.comment();
|
|
413
473
|
var node = $.first_child(fragment);
|
|
414
474
|
$.each(node, 17, () => $$props.segmentRects, $.index, ($$anchor2, b) => {
|
|
415
|
-
var div = root_1$
|
|
475
|
+
var div = root_1$b();
|
|
416
476
|
$.attribute_effect(
|
|
417
477
|
div,
|
|
418
478
|
($0) => ({
|
|
@@ -427,7 +487,7 @@ function Highlight($$anchor, $$props) {
|
|
|
427
487
|
top: `${($$props.rect ? $.get(b).origin.y - $$props.rect.origin.y : $.get(b).origin.y) * $$props.scale}px`,
|
|
428
488
|
width: `${$.get(b).size.width * $$props.scale}px`,
|
|
429
489
|
height: `${$.get(b).size.height * $$props.scale}px`,
|
|
430
|
-
background:
|
|
490
|
+
background: $.get(resolvedColor),
|
|
431
491
|
opacity: opacity(),
|
|
432
492
|
"pointer-events": $$props.onClick ? "auto" : "none",
|
|
433
493
|
cursor: $$props.onClick ? "pointer" : "default",
|
|
@@ -443,15 +503,16 @@ function Highlight($$anchor, $$props) {
|
|
|
443
503
|
$.append($$anchor, fragment);
|
|
444
504
|
$.pop();
|
|
445
505
|
}
|
|
446
|
-
var root_1$
|
|
506
|
+
var root_1$a = $.from_html(`<div><div></div></div>`);
|
|
447
507
|
function Underline($$anchor, $$props) {
|
|
448
508
|
$.push($$props, true);
|
|
449
|
-
let
|
|
509
|
+
let opacity = $.prop($$props, "opacity", 3, 0.5);
|
|
510
|
+
const resolvedColor = $.derived(() => $$props.strokeColor ?? "#FFFF00");
|
|
450
511
|
const thickness = $.derived(() => 2 * $$props.scale);
|
|
451
512
|
var fragment = $.comment();
|
|
452
513
|
var node = $.first_child(fragment);
|
|
453
514
|
$.each(node, 17, () => $$props.segmentRects, $.index, ($$anchor2, r) => {
|
|
454
|
-
var div = root_1$
|
|
515
|
+
var div = root_1$a();
|
|
455
516
|
$.attribute_effect(
|
|
456
517
|
div,
|
|
457
518
|
($0) => ({
|
|
@@ -485,7 +546,7 @@ function Underline($$anchor, $$props) {
|
|
|
485
546
|
bottom: "0",
|
|
486
547
|
width: "100%",
|
|
487
548
|
height: `${$.get(thickness) ?? ""}px`,
|
|
488
|
-
background:
|
|
549
|
+
background: $.get(resolvedColor),
|
|
489
550
|
opacity: opacity(),
|
|
490
551
|
"pointer-events": "none"
|
|
491
552
|
}));
|
|
@@ -494,15 +555,16 @@ function Underline($$anchor, $$props) {
|
|
|
494
555
|
$.append($$anchor, fragment);
|
|
495
556
|
$.pop();
|
|
496
557
|
}
|
|
497
|
-
var root_1$
|
|
558
|
+
var root_1$9 = $.from_html(`<div><div></div></div>`);
|
|
498
559
|
function Strikeout($$anchor, $$props) {
|
|
499
560
|
$.push($$props, true);
|
|
500
|
-
let
|
|
561
|
+
let opacity = $.prop($$props, "opacity", 3, 0.5);
|
|
562
|
+
const resolvedColor = $.derived(() => $$props.strokeColor ?? "#FFFF00");
|
|
501
563
|
const thickness = $.derived(() => 2 * $$props.scale);
|
|
502
564
|
var fragment = $.comment();
|
|
503
565
|
var node = $.first_child(fragment);
|
|
504
566
|
$.each(node, 17, () => $$props.segmentRects, $.index, ($$anchor2, r) => {
|
|
505
|
-
var div = root_1$
|
|
567
|
+
var div = root_1$9();
|
|
506
568
|
$.attribute_effect(
|
|
507
569
|
div,
|
|
508
570
|
($0) => ({
|
|
@@ -536,7 +598,7 @@ function Strikeout($$anchor, $$props) {
|
|
|
536
598
|
top: "50%",
|
|
537
599
|
width: "100%",
|
|
538
600
|
height: `${$.get(thickness) ?? ""}px`,
|
|
539
|
-
background:
|
|
601
|
+
background: $.get(resolvedColor),
|
|
540
602
|
opacity: opacity(),
|
|
541
603
|
transform: "translateY(-50%)",
|
|
542
604
|
"pointer-events": "none"
|
|
@@ -546,21 +608,22 @@ function Strikeout($$anchor, $$props) {
|
|
|
546
608
|
$.append($$anchor, fragment);
|
|
547
609
|
$.pop();
|
|
548
610
|
}
|
|
549
|
-
var root_1$
|
|
611
|
+
var root_1$8 = $.from_html(`<div><div></div></div>`);
|
|
550
612
|
function Squiggly($$anchor, $$props) {
|
|
551
613
|
$.push($$props, true);
|
|
552
|
-
let
|
|
614
|
+
let opacity = $.prop($$props, "opacity", 3, 0.5);
|
|
615
|
+
const resolvedColor = $.derived(() => $$props.strokeColor ?? "#FFFF00");
|
|
553
616
|
const amplitude = $.derived(() => 2 * $$props.scale);
|
|
554
617
|
const period = $.derived(() => 6 * $$props.scale);
|
|
555
618
|
const svg = $.derived(() => `<svg xmlns="http://www.w3.org/2000/svg" width="${$.get(period)}" height="${$.get(amplitude) * 2}" viewBox="0 0 ${$.get(period)} ${$.get(amplitude) * 2}">
|
|
556
619
|
<path d="M0 ${$.get(amplitude)} Q ${$.get(period) / 4} 0 ${$.get(period) / 2} ${$.get(amplitude)} T ${$.get(period)} ${$.get(amplitude)}"
|
|
557
|
-
fill="none" stroke="${
|
|
620
|
+
fill="none" stroke="${$.get(resolvedColor)}" stroke-width="${$.get(amplitude)}" stroke-linecap="round"/>
|
|
558
621
|
</svg>`);
|
|
559
622
|
const svgDataUri = $.derived(() => `url("data:image/svg+xml;utf8,${encodeURIComponent($.get(svg))}")`);
|
|
560
623
|
var fragment = $.comment();
|
|
561
624
|
var node = $.first_child(fragment);
|
|
562
625
|
$.each(node, 17, () => $$props.segmentRects, $.index, ($$anchor2, r) => {
|
|
563
|
-
var div = root_1$
|
|
626
|
+
var div = root_1$8();
|
|
564
627
|
$.attribute_effect(
|
|
565
628
|
div,
|
|
566
629
|
($0) => ({
|
|
@@ -605,11 +668,12 @@ function Squiggly($$anchor, $$props) {
|
|
|
605
668
|
$.append($$anchor, fragment);
|
|
606
669
|
$.pop();
|
|
607
670
|
}
|
|
608
|
-
var root_1$
|
|
609
|
-
var root$
|
|
671
|
+
var root_1$7 = $.from_svg(`<path fill="none"></path>`);
|
|
672
|
+
var root$b = $.from_svg(`<svg></svg>`);
|
|
610
673
|
function Ink($$anchor, $$props) {
|
|
611
674
|
$.push($$props, true);
|
|
612
|
-
let
|
|
675
|
+
let opacity = $.prop($$props, "opacity", 3, 1);
|
|
676
|
+
const resolvedColor = $.derived(() => $$props.strokeColor ?? "#000000");
|
|
613
677
|
const paths = $.derived(() => $$props.inkList.map(({ points }) => {
|
|
614
678
|
let d = "";
|
|
615
679
|
for (let i = 0; i < points.length; i++) {
|
|
@@ -622,10 +686,10 @@ function Ink($$anchor, $$props) {
|
|
|
622
686
|
}));
|
|
623
687
|
const width = $.derived(() => $$props.rect.size.width * $$props.scale);
|
|
624
688
|
const height = $.derived(() => $$props.rect.size.height * $$props.scale);
|
|
625
|
-
var svg = root$
|
|
689
|
+
var svg = root$b();
|
|
626
690
|
let styles;
|
|
627
691
|
$.each(svg, 21, () => $.get(paths), $.index, ($$anchor2, d) => {
|
|
628
|
-
var path = root_1$
|
|
692
|
+
var path = root_1$7();
|
|
629
693
|
path.__pointerdown = function(...$$args) {
|
|
630
694
|
var _a;
|
|
631
695
|
(_a = $$props.onClick) == null ? void 0 : _a.apply(this, $$args);
|
|
@@ -641,7 +705,7 @@ function Ink($$anchor, $$props) {
|
|
|
641
705
|
styles_1 = $.set_style(path, "", styles_1, {
|
|
642
706
|
cursor: $$props.isSelected ? "move" : "pointer",
|
|
643
707
|
"pointer-events": $$props.isSelected ? "none" : "visibleStroke",
|
|
644
|
-
stroke:
|
|
708
|
+
stroke: $.get(resolvedColor),
|
|
645
709
|
"stroke-width": $$props.strokeWidth,
|
|
646
710
|
"stroke-linecap": "round",
|
|
647
711
|
"stroke-linejoin": "round"
|
|
@@ -660,7 +724,7 @@ function Ink($$anchor, $$props) {
|
|
|
660
724
|
$.pop();
|
|
661
725
|
}
|
|
662
726
|
$.delegate(["pointerdown", "touchstart"]);
|
|
663
|
-
var root$
|
|
727
|
+
var root$a = $.from_svg(`<svg><rect></rect></svg>`);
|
|
664
728
|
function Square($$anchor, $$props) {
|
|
665
729
|
$.push($$props, true);
|
|
666
730
|
let color = $.prop($$props, "color", 3, "#000000"), opacity = $.prop($$props, "opacity", 3, 1), strokeStyle = $.prop($$props, "strokeStyle", 19, () => PdfAnnotationBorderStyle.SOLID);
|
|
@@ -682,7 +746,7 @@ function Square($$anchor, $$props) {
|
|
|
682
746
|
var _a;
|
|
683
747
|
return strokeStyle() === PdfAnnotationBorderStyle.DASHED ? (_a = $$props.strokeDashArray) == null ? void 0 : _a.join(",") : void 0;
|
|
684
748
|
});
|
|
685
|
-
var svg = root$
|
|
749
|
+
var svg = root$a();
|
|
686
750
|
let styles;
|
|
687
751
|
var rect_1 = $.child(svg);
|
|
688
752
|
rect_1.__pointerdown = function(...$$args) {
|
|
@@ -721,7 +785,7 @@ function Square($$anchor, $$props) {
|
|
|
721
785
|
$.pop();
|
|
722
786
|
}
|
|
723
787
|
$.delegate(["pointerdown", "touchstart"]);
|
|
724
|
-
var root$
|
|
788
|
+
var root$9 = $.from_svg(`<svg><ellipse></ellipse></svg>`);
|
|
725
789
|
function Circle($$anchor, $$props) {
|
|
726
790
|
$.push($$props, true);
|
|
727
791
|
let color = $.prop($$props, "color", 3, "#000000"), opacity = $.prop($$props, "opacity", 3, 1), strokeStyle = $.prop($$props, "strokeStyle", 19, () => PdfAnnotationBorderStyle.SOLID);
|
|
@@ -743,7 +807,7 @@ function Circle($$anchor, $$props) {
|
|
|
743
807
|
let svgWidth = $.derived(() => $.get(width) * $$props.scale);
|
|
744
808
|
let svgHeight = $.derived(() => $.get(height) * $$props.scale);
|
|
745
809
|
let peValue = $.derived(() => $$props.isSelected ? "none" : color() === "transparent" ? "visibleStroke" : "visible");
|
|
746
|
-
var svg = root$
|
|
810
|
+
var svg = root$9();
|
|
747
811
|
let styles;
|
|
748
812
|
var ellipse = $.child(svg);
|
|
749
813
|
ellipse.__pointerdown = (e) => {
|
|
@@ -791,9 +855,9 @@ function Circle($$anchor, $$props) {
|
|
|
791
855
|
$.pop();
|
|
792
856
|
}
|
|
793
857
|
$.delegate(["pointerdown", "touchstart"]);
|
|
794
|
-
var root_1$
|
|
795
|
-
var root_2$
|
|
796
|
-
var root$
|
|
858
|
+
var root_1$6 = $.from_svg(`<path></path>`);
|
|
859
|
+
var root_2$4 = $.from_svg(`<path></path>`);
|
|
860
|
+
var root$8 = $.from_svg(`<svg><line></line><!><!></svg>`);
|
|
797
861
|
function Line($$anchor, $$props) {
|
|
798
862
|
$.push($$props, true);
|
|
799
863
|
let color = $.prop($$props, "color", 3, "transparent"), opacity = $.prop($$props, "opacity", 3, 1), strokeColor = $.prop($$props, "strokeColor", 3, "#000000"), strokeStyle = $.prop($$props, "strokeStyle", 19, () => PdfAnnotationBorderStyle.SOLID);
|
|
@@ -815,7 +879,7 @@ function Line($$anchor, $$props) {
|
|
|
815
879
|
var _a;
|
|
816
880
|
return strokeStyle() === PdfAnnotationBorderStyle.DASHED ? (_a = $$props.strokeDashArray) == null ? void 0 : _a.join(",") : void 0;
|
|
817
881
|
});
|
|
818
|
-
var svg = root$
|
|
882
|
+
var svg = root$8();
|
|
819
883
|
let styles;
|
|
820
884
|
var line = $.child(svg);
|
|
821
885
|
line.__pointerdown = function(...$$args) {
|
|
@@ -830,7 +894,7 @@ function Line($$anchor, $$props) {
|
|
|
830
894
|
var node = $.sibling(line);
|
|
831
895
|
{
|
|
832
896
|
var consequent = ($$anchor2) => {
|
|
833
|
-
var path = root_1$
|
|
897
|
+
var path = root_1$6();
|
|
834
898
|
path.__pointerdown = function(...$$args) {
|
|
835
899
|
var _a;
|
|
836
900
|
(_a = $$props.onClick) == null ? void 0 : _a.apply(this, $$args);
|
|
@@ -862,7 +926,7 @@ function Line($$anchor, $$props) {
|
|
|
862
926
|
var node_1 = $.sibling(node);
|
|
863
927
|
{
|
|
864
928
|
var consequent_1 = ($$anchor2) => {
|
|
865
|
-
var path_1 = root_2$
|
|
929
|
+
var path_1 = root_2$4();
|
|
866
930
|
path_1.__pointerdown = function(...$$args) {
|
|
867
931
|
var _a;
|
|
868
932
|
(_a = $$props.onClick) == null ? void 0 : _a.apply(this, $$args);
|
|
@@ -915,9 +979,9 @@ function Line($$anchor, $$props) {
|
|
|
915
979
|
$.pop();
|
|
916
980
|
}
|
|
917
981
|
$.delegate(["pointerdown", "touchstart"]);
|
|
918
|
-
var root_1$
|
|
919
|
-
var root_2$
|
|
920
|
-
var root$
|
|
982
|
+
var root_1$5 = $.from_svg(`<path></path>`);
|
|
983
|
+
var root_2$3 = $.from_svg(`<path></path>`);
|
|
984
|
+
var root$7 = $.from_svg(`<svg><path></path><!><!></svg>`);
|
|
921
985
|
function Polyline($$anchor, $$props) {
|
|
922
986
|
$.push($$props, true);
|
|
923
987
|
let color = $.prop($$props, "color", 3, "transparent"), strokeColor = $.prop($$props, "strokeColor", 3, "#000000"), opacity = $.prop($$props, "opacity", 3, 1);
|
|
@@ -959,7 +1023,7 @@ function Polyline($$anchor, $$props) {
|
|
|
959
1023
|
});
|
|
960
1024
|
const width = $.derived(() => $$props.rect.size.width * $$props.scale);
|
|
961
1025
|
const height = $.derived(() => $$props.rect.size.height * $$props.scale);
|
|
962
|
-
var svg = root$
|
|
1026
|
+
var svg = root$7();
|
|
963
1027
|
let styles;
|
|
964
1028
|
var path = $.child(svg);
|
|
965
1029
|
path.__pointerdown = function(...$$args) {
|
|
@@ -974,7 +1038,7 @@ function Polyline($$anchor, $$props) {
|
|
|
974
1038
|
var node = $.sibling(path);
|
|
975
1039
|
{
|
|
976
1040
|
var consequent = ($$anchor2) => {
|
|
977
|
-
var path_1 = root_1$
|
|
1041
|
+
var path_1 = root_1$5();
|
|
978
1042
|
path_1.__pointerdown = function(...$$args) {
|
|
979
1043
|
var _a;
|
|
980
1044
|
(_a = $$props.onClick) == null ? void 0 : _a.apply(this, $$args);
|
|
@@ -1005,7 +1069,7 @@ function Polyline($$anchor, $$props) {
|
|
|
1005
1069
|
var node_1 = $.sibling(node);
|
|
1006
1070
|
{
|
|
1007
1071
|
var consequent_1 = ($$anchor2) => {
|
|
1008
|
-
var path_2 = root_2$
|
|
1072
|
+
var path_2 = root_2$3();
|
|
1009
1073
|
path_2.__pointerdown = function(...$$args) {
|
|
1010
1074
|
var _a;
|
|
1011
1075
|
(_a = $$props.onClick) == null ? void 0 : _a.apply(this, $$args);
|
|
@@ -1055,9 +1119,9 @@ function Polyline($$anchor, $$props) {
|
|
|
1055
1119
|
$.pop();
|
|
1056
1120
|
}
|
|
1057
1121
|
$.delegate(["pointerdown", "touchstart"]);
|
|
1058
|
-
var root_1$
|
|
1059
|
-
var root_2$
|
|
1060
|
-
var root$
|
|
1122
|
+
var root_1$4 = $.from_svg(`<path fill="none"></path>`);
|
|
1123
|
+
var root_2$2 = $.from_svg(`<rect></rect>`);
|
|
1124
|
+
var root$6 = $.from_svg(`<svg><path></path><!><!></svg>`);
|
|
1061
1125
|
function Polygon($$anchor, $$props) {
|
|
1062
1126
|
$.push($$props, true);
|
|
1063
1127
|
let color = $.prop($$props, "color", 3, "transparent"), strokeColor = $.prop($$props, "strokeColor", 3, "#000000"), opacity = $.prop($$props, "opacity", 3, 1), strokeStyle = $.prop($$props, "strokeStyle", 19, () => PdfAnnotationBorderStyle.SOLID), handleSize = $.prop($$props, "handleSize", 3, 14);
|
|
@@ -1076,7 +1140,7 @@ function Polygon($$anchor, $$props) {
|
|
|
1076
1140
|
var _a;
|
|
1077
1141
|
return strokeStyle() === PdfAnnotationBorderStyle.DASHED ? (_a = $$props.strokeDashArray) == null ? void 0 : _a.join(",") : void 0;
|
|
1078
1142
|
});
|
|
1079
|
-
var svg = root$
|
|
1143
|
+
var svg = root$6();
|
|
1080
1144
|
let styles;
|
|
1081
1145
|
var path = $.child(svg);
|
|
1082
1146
|
path.__pointerdown = function(...$$args) {
|
|
@@ -1091,7 +1155,7 @@ function Polygon($$anchor, $$props) {
|
|
|
1091
1155
|
var node = $.sibling(path);
|
|
1092
1156
|
{
|
|
1093
1157
|
var consequent = ($$anchor2) => {
|
|
1094
|
-
var path_1 = root_1$
|
|
1158
|
+
var path_1 = root_1$4();
|
|
1095
1159
|
let styles_2;
|
|
1096
1160
|
$.template_effect(() => {
|
|
1097
1161
|
$.set_attribute(path_1, "d", `M ${$.get(localPts)[$.get(localPts).length - 1].x} ${$.get(localPts)[$.get(localPts).length - 1].y} L ${$.get(localPts)[0].x} ${$.get(localPts)[0].y}`);
|
|
@@ -1111,7 +1175,7 @@ function Polygon($$anchor, $$props) {
|
|
|
1111
1175
|
var node_1 = $.sibling(node);
|
|
1112
1176
|
{
|
|
1113
1177
|
var consequent_1 = ($$anchor2) => {
|
|
1114
|
-
var rect_1 = root_2$
|
|
1178
|
+
var rect_1 = root_2$2();
|
|
1115
1179
|
$.set_attribute(rect_1, "opacity", 0.4);
|
|
1116
1180
|
$.template_effect(() => {
|
|
1117
1181
|
$.set_attribute(rect_1, "x", $.get(localPts)[0].x - handleSize() / $$props.scale / 2);
|
|
@@ -1151,7 +1215,7 @@ function Polygon($$anchor, $$props) {
|
|
|
1151
1215
|
$.pop();
|
|
1152
1216
|
}
|
|
1153
1217
|
$.delegate(["pointerdown", "touchstart"]);
|
|
1154
|
-
var root$
|
|
1218
|
+
var root$5 = $.from_html(`<div><span tabindex="0"> </span></div>`);
|
|
1155
1219
|
function FreeText($$anchor, $$props) {
|
|
1156
1220
|
$.push($$props, true);
|
|
1157
1221
|
const annotationCapability = useAnnotationCapability();
|
|
@@ -1192,7 +1256,7 @@ function FreeText($$anchor, $$props) {
|
|
|
1192
1256
|
const outerW = $.derived(() => $$props.annotation.object.rect.size.width * $$props.scale);
|
|
1193
1257
|
const outerH = $.derived(() => $$props.annotation.object.rect.size.height * $$props.scale);
|
|
1194
1258
|
const justify = $.derived(() => $$props.annotation.object.verticalAlign === PdfVerticalAlignment.Top ? "flex-start" : $$props.annotation.object.verticalAlign === PdfVerticalAlignment.Middle ? "center" : "flex-end");
|
|
1195
|
-
var div = root$
|
|
1259
|
+
var div = root$5();
|
|
1196
1260
|
div.__pointerdown = function(...$$args) {
|
|
1197
1261
|
var _a;
|
|
1198
1262
|
(_a = $$props.onClick) == null ? void 0 : _a.apply(this, $$args);
|
|
@@ -1231,7 +1295,7 @@ function FreeText($$anchor, $$props) {
|
|
|
1231
1295
|
"font-size": `${$.get(adjustedFontPx)}px`,
|
|
1232
1296
|
"font-family": standardFontCss($$props.annotation.object.fontFamily),
|
|
1233
1297
|
"text-align": textAlignmentToCss($$props.annotation.object.textAlign),
|
|
1234
|
-
"background-color": $$props.annotation.object.backgroundColor,
|
|
1298
|
+
"background-color": $$props.annotation.object.color ?? $$props.annotation.object.backgroundColor,
|
|
1235
1299
|
opacity: $$props.annotation.object.opacity,
|
|
1236
1300
|
width: $.get(needsComp) ? `${$.get(invScalePercent)}%` : "100%",
|
|
1237
1301
|
height: $.get(needsComp) ? `${$.get(invScalePercent)}%` : "100%",
|
|
@@ -1249,7 +1313,7 @@ function FreeText($$anchor, $$props) {
|
|
|
1249
1313
|
$.pop();
|
|
1250
1314
|
}
|
|
1251
1315
|
$.delegate(["pointerdown", "touchstart"]);
|
|
1252
|
-
var root_1$
|
|
1316
|
+
var root_1$3 = $.from_html(`<img/>`);
|
|
1253
1317
|
function RenderAnnotation($$anchor, $$props) {
|
|
1254
1318
|
$.push($$props, true);
|
|
1255
1319
|
let scaleFactor = $.prop($$props, "scaleFactor", 3, 1), restProps = $.rest_props($$props, [
|
|
@@ -1307,7 +1371,7 @@ function RenderAnnotation($$anchor, $$props) {
|
|
|
1307
1371
|
var node = $.first_child(fragment);
|
|
1308
1372
|
{
|
|
1309
1373
|
var consequent = ($$anchor2) => {
|
|
1310
|
-
var img = root_1$
|
|
1374
|
+
var img = root_1$3();
|
|
1311
1375
|
$.attribute_effect(img, () => ({
|
|
1312
1376
|
alt: "",
|
|
1313
1377
|
src: $.get(imageUrl),
|
|
@@ -1326,14 +1390,14 @@ function RenderAnnotation($$anchor, $$props) {
|
|
|
1326
1390
|
$.append($$anchor, fragment);
|
|
1327
1391
|
$.pop();
|
|
1328
1392
|
}
|
|
1329
|
-
var root$
|
|
1393
|
+
var root$4 = $.from_html(`<div><!></div>`);
|
|
1330
1394
|
function Stamp($$anchor, $$props) {
|
|
1331
1395
|
$.push($$props, true);
|
|
1332
1396
|
let annotationProp = $.derived(() => ({
|
|
1333
1397
|
...$$props.annotation.object,
|
|
1334
1398
|
id: $$props.annotation.object.id
|
|
1335
1399
|
}));
|
|
1336
|
-
var div = root$
|
|
1400
|
+
var div = root$4();
|
|
1337
1401
|
let styles;
|
|
1338
1402
|
div.__pointerdown = function(...$$args) {
|
|
1339
1403
|
var _a;
|
|
@@ -1367,6 +1431,392 @@ function Stamp($$anchor, $$props) {
|
|
|
1367
1431
|
$.pop();
|
|
1368
1432
|
}
|
|
1369
1433
|
$.delegate(["pointerdown", "touchstart"]);
|
|
1434
|
+
var root_1$2 = $.from_svg(`<line></line>`);
|
|
1435
|
+
var root_2$1 = $.from_svg(`<rect fill="transparent"></rect>`);
|
|
1436
|
+
var root$3 = $.from_svg(`<svg><rect fill="transparent"></rect><!></svg>`);
|
|
1437
|
+
function Link($$anchor, $$props) {
|
|
1438
|
+
$.push($$props, true);
|
|
1439
|
+
let strokeColor = $.prop($$props, "strokeColor", 3, "#0000FF"), strokeWidth = $.prop($$props, "strokeWidth", 3, 2), strokeStyle = $.prop($$props, "strokeStyle", 19, () => PdfAnnotationBorderStyle.UNDERLINE), hasIRT = $.prop($$props, "hasIRT", 3, false);
|
|
1440
|
+
const width = $.derived(() => $$props.rect.size.width);
|
|
1441
|
+
const height = $.derived(() => $$props.rect.size.height);
|
|
1442
|
+
const svgWidth = $.derived(() => $.get(width) * $$props.scale);
|
|
1443
|
+
const svgHeight = $.derived(() => $.get(height) * $$props.scale);
|
|
1444
|
+
const dashArray = $.derived(() => {
|
|
1445
|
+
var _a;
|
|
1446
|
+
if (strokeStyle() === PdfAnnotationBorderStyle.DASHED) {
|
|
1447
|
+
return ((_a = $$props.strokeDashArray) == null ? void 0 : _a.join(",")) ?? `${strokeWidth() * 3},${strokeWidth()}`;
|
|
1448
|
+
}
|
|
1449
|
+
return void 0;
|
|
1450
|
+
});
|
|
1451
|
+
const isUnderline2 = $.derived(() => strokeStyle() === PdfAnnotationBorderStyle.UNDERLINE);
|
|
1452
|
+
const hitAreaCursor = $.derived(() => hasIRT() ? "default" : $$props.isSelected ? "move" : "pointer");
|
|
1453
|
+
const hitAreaPointerEvents = $.derived(() => hasIRT() ? "none" : $$props.isSelected ? "none" : "visible");
|
|
1454
|
+
var svg = root$3();
|
|
1455
|
+
let styles;
|
|
1456
|
+
var rect_1 = $.child(svg);
|
|
1457
|
+
$.set_attribute(rect_1, "x", 0);
|
|
1458
|
+
$.set_attribute(rect_1, "y", 0);
|
|
1459
|
+
rect_1.__pointerdown = function(...$$args) {
|
|
1460
|
+
var _a;
|
|
1461
|
+
(_a = hasIRT() ? void 0 : $$props.onClick) == null ? void 0 : _a.apply(this, $$args);
|
|
1462
|
+
};
|
|
1463
|
+
rect_1.__touchstart = function(...$$args) {
|
|
1464
|
+
var _a;
|
|
1465
|
+
(_a = hasIRT() ? void 0 : $$props.onClick) == null ? void 0 : _a.apply(this, $$args);
|
|
1466
|
+
};
|
|
1467
|
+
let styles_1;
|
|
1468
|
+
var node = $.sibling(rect_1);
|
|
1469
|
+
{
|
|
1470
|
+
var consequent = ($$anchor2) => {
|
|
1471
|
+
var line = root_1$2();
|
|
1472
|
+
$.set_attribute(line, "x1", 1);
|
|
1473
|
+
$.set_style(line, "", {}, { "pointer-events": "none" });
|
|
1474
|
+
$.template_effect(() => {
|
|
1475
|
+
$.set_attribute(line, "y1", $.get(height) - 1);
|
|
1476
|
+
$.set_attribute(line, "x2", $.get(width) - 1);
|
|
1477
|
+
$.set_attribute(line, "y2", $.get(height) - 1);
|
|
1478
|
+
$.set_attribute(line, "stroke", strokeColor());
|
|
1479
|
+
$.set_attribute(line, "stroke-width", strokeWidth());
|
|
1480
|
+
$.set_attribute(line, "stroke-dasharray", $.get(dashArray));
|
|
1481
|
+
});
|
|
1482
|
+
$.append($$anchor2, line);
|
|
1483
|
+
};
|
|
1484
|
+
var alternate = ($$anchor2) => {
|
|
1485
|
+
var rect_2 = root_2$1();
|
|
1486
|
+
$.set_style(rect_2, "", {}, { "pointer-events": "none" });
|
|
1487
|
+
$.template_effect(
|
|
1488
|
+
($0, $1) => {
|
|
1489
|
+
$.set_attribute(rect_2, "x", strokeWidth() / 2);
|
|
1490
|
+
$.set_attribute(rect_2, "y", strokeWidth() / 2);
|
|
1491
|
+
$.set_attribute(rect_2, "width", $0);
|
|
1492
|
+
$.set_attribute(rect_2, "height", $1);
|
|
1493
|
+
$.set_attribute(rect_2, "stroke", strokeColor());
|
|
1494
|
+
$.set_attribute(rect_2, "stroke-width", strokeWidth());
|
|
1495
|
+
$.set_attribute(rect_2, "stroke-dasharray", $.get(dashArray));
|
|
1496
|
+
},
|
|
1497
|
+
[
|
|
1498
|
+
() => Math.max($.get(width) - strokeWidth(), 0),
|
|
1499
|
+
() => Math.max($.get(height) - strokeWidth(), 0)
|
|
1500
|
+
]
|
|
1501
|
+
);
|
|
1502
|
+
$.append($$anchor2, rect_2);
|
|
1503
|
+
};
|
|
1504
|
+
$.if(node, ($$render) => {
|
|
1505
|
+
if ($.get(isUnderline2)) $$render(consequent);
|
|
1506
|
+
else $$render(alternate, false);
|
|
1507
|
+
});
|
|
1508
|
+
}
|
|
1509
|
+
$.reset(svg);
|
|
1510
|
+
$.template_effect(() => {
|
|
1511
|
+
styles = $.set_style(svg, "position: absolute; z-index: 2; pointer-events: none;", styles, {
|
|
1512
|
+
width: `${$.get(svgWidth) ?? ""}px`,
|
|
1513
|
+
height: `${$.get(svgHeight) ?? ""}px`
|
|
1514
|
+
});
|
|
1515
|
+
$.set_attribute(svg, "width", $.get(svgWidth));
|
|
1516
|
+
$.set_attribute(svg, "height", $.get(svgHeight));
|
|
1517
|
+
$.set_attribute(svg, "viewBox", `0 0 ${$.get(width) ?? ""} ${$.get(height) ?? ""}`);
|
|
1518
|
+
$.set_attribute(rect_1, "width", $.get(width));
|
|
1519
|
+
$.set_attribute(rect_1, "height", $.get(height));
|
|
1520
|
+
styles_1 = $.set_style(rect_1, "", styles_1, {
|
|
1521
|
+
cursor: $.get(hitAreaCursor),
|
|
1522
|
+
"pointer-events": $.get(hitAreaPointerEvents)
|
|
1523
|
+
});
|
|
1524
|
+
});
|
|
1525
|
+
$.append($$anchor, svg);
|
|
1526
|
+
$.pop();
|
|
1527
|
+
}
|
|
1528
|
+
$.delegate(["pointerdown", "touchstart"]);
|
|
1529
|
+
var root_5$1 = $.from_html(`<div></div>`);
|
|
1530
|
+
var root_1$1 = $.from_html(`<div data-group-selection-box="" data-no-interaction=""><div><!></div> <!></div>`);
|
|
1531
|
+
function GroupSelectionBox($$anchor, $$props) {
|
|
1532
|
+
$.push($$props, true);
|
|
1533
|
+
let selectionOutlineColor = $.prop($$props, "selectionOutlineColor", 3, "#007ACC"), outlineOffset = $.prop($$props, "outlineOffset", 3, 2), zIndex = $.prop($$props, "zIndex", 3, 100);
|
|
1534
|
+
const annotationPlugin = useAnnotationPlugin();
|
|
1535
|
+
let gestureBase = $.state(null);
|
|
1536
|
+
let isDraggingRef = $.state(false);
|
|
1537
|
+
let isResizingRef = $.state(false);
|
|
1538
|
+
function getGroupBox() {
|
|
1539
|
+
const rects = $$props.selectedAnnotations.map((ta) => ta.object.rect);
|
|
1540
|
+
return boundingRectOrEmpty(rects);
|
|
1541
|
+
}
|
|
1542
|
+
const groupBox = $.derived(getGroupBox);
|
|
1543
|
+
let previewGroupBox = $.state($.proxy(getGroupBox()));
|
|
1544
|
+
$.user_effect(() => {
|
|
1545
|
+
if (!$.get(isDraggingRef) && !$.get(isResizingRef)) {
|
|
1546
|
+
const newBox = $.get(groupBox);
|
|
1547
|
+
if ($.get(previewGroupBox).origin.x !== newBox.origin.x || $.get(previewGroupBox).origin.y !== newBox.origin.y || $.get(previewGroupBox).size.width !== newBox.size.width || $.get(previewGroupBox).size.height !== newBox.size.height) {
|
|
1548
|
+
$.set(previewGroupBox, newBox, true);
|
|
1549
|
+
}
|
|
1550
|
+
}
|
|
1551
|
+
});
|
|
1552
|
+
const HANDLE_COLOR = $.derived(() => {
|
|
1553
|
+
var _a;
|
|
1554
|
+
return ((_a = $$props.resizeUI) == null ? void 0 : _a.color) ?? "#007ACC";
|
|
1555
|
+
});
|
|
1556
|
+
const HANDLE_SIZE = $.derived(() => {
|
|
1557
|
+
var _a;
|
|
1558
|
+
return ((_a = $$props.resizeUI) == null ? void 0 : _a.size) ?? 12;
|
|
1559
|
+
});
|
|
1560
|
+
const interactionHandles = useInteractionHandles(() => ({
|
|
1561
|
+
controller: {
|
|
1562
|
+
element: $.get(previewGroupBox),
|
|
1563
|
+
constraints: {
|
|
1564
|
+
minWidth: 20,
|
|
1565
|
+
minHeight: 20,
|
|
1566
|
+
boundingBox: { width: $$props.pageWidth, height: $$props.pageHeight }
|
|
1567
|
+
},
|
|
1568
|
+
maintainAspectRatio: false,
|
|
1569
|
+
pageRotation: $$props.rotation,
|
|
1570
|
+
scale: $$props.scale,
|
|
1571
|
+
enabled: true,
|
|
1572
|
+
onUpdate: (event) => {
|
|
1573
|
+
var _a, _b;
|
|
1574
|
+
if (!((_a = event.transformData) == null ? void 0 : _a.type)) return;
|
|
1575
|
+
if (!annotationPlugin.plugin) return;
|
|
1576
|
+
const plugin = annotationPlugin.plugin;
|
|
1577
|
+
const transformType = event.transformData.type;
|
|
1578
|
+
const isMove = transformType === "move";
|
|
1579
|
+
const isResize = transformType === "resize";
|
|
1580
|
+
if (isMove && !$$props.isDraggable) return;
|
|
1581
|
+
if (event.state === "start") {
|
|
1582
|
+
$.set(gestureBase, getGroupBox(), true);
|
|
1583
|
+
if (isMove) {
|
|
1584
|
+
$.set(isDraggingRef, true);
|
|
1585
|
+
plugin.startDrag($$props.documentId, {
|
|
1586
|
+
annotationIds: $$props.selectedAnnotations.map((ta) => ta.object.id),
|
|
1587
|
+
pageSize: { width: $$props.pageWidth, height: $$props.pageHeight }
|
|
1588
|
+
});
|
|
1589
|
+
} else if (isResize) {
|
|
1590
|
+
$.set(isResizingRef, true);
|
|
1591
|
+
plugin.startResize($$props.documentId, {
|
|
1592
|
+
annotationIds: $$props.selectedAnnotations.map((ta) => ta.object.id),
|
|
1593
|
+
pageSize: { width: $$props.pageWidth, height: $$props.pageHeight },
|
|
1594
|
+
resizeHandle: ((_b = event.transformData.metadata) == null ? void 0 : _b.handle) ?? "se"
|
|
1595
|
+
});
|
|
1596
|
+
}
|
|
1597
|
+
}
|
|
1598
|
+
const base = $.get(gestureBase) ?? getGroupBox();
|
|
1599
|
+
if (isMove && event.transformData.changes.rect) {
|
|
1600
|
+
const newRect = event.transformData.changes.rect;
|
|
1601
|
+
const rawDelta = {
|
|
1602
|
+
x: newRect.origin.x - base.origin.x,
|
|
1603
|
+
y: newRect.origin.y - base.origin.y
|
|
1604
|
+
};
|
|
1605
|
+
const clampedDelta = plugin.updateDrag($$props.documentId, rawDelta);
|
|
1606
|
+
$.set(
|
|
1607
|
+
previewGroupBox,
|
|
1608
|
+
{
|
|
1609
|
+
...base,
|
|
1610
|
+
origin: {
|
|
1611
|
+
x: base.origin.x + clampedDelta.x,
|
|
1612
|
+
y: base.origin.y + clampedDelta.y
|
|
1613
|
+
}
|
|
1614
|
+
},
|
|
1615
|
+
true
|
|
1616
|
+
);
|
|
1617
|
+
} else if (isResize && event.transformData.changes.rect) {
|
|
1618
|
+
const newGroupBox = event.transformData.changes.rect;
|
|
1619
|
+
plugin.updateResize($$props.documentId, newGroupBox);
|
|
1620
|
+
$.set(previewGroupBox, newGroupBox, true);
|
|
1621
|
+
}
|
|
1622
|
+
if (event.state === "end") {
|
|
1623
|
+
$.set(gestureBase, null);
|
|
1624
|
+
if (isMove && $.get(isDraggingRef)) {
|
|
1625
|
+
$.set(isDraggingRef, false);
|
|
1626
|
+
plugin.commitDrag($$props.documentId);
|
|
1627
|
+
} else if (isResize && $.get(isResizingRef)) {
|
|
1628
|
+
$.set(isResizingRef, false);
|
|
1629
|
+
plugin.commitResize($$props.documentId);
|
|
1630
|
+
}
|
|
1631
|
+
}
|
|
1632
|
+
}
|
|
1633
|
+
},
|
|
1634
|
+
resizeUI: {
|
|
1635
|
+
handleSize: $.get(HANDLE_SIZE),
|
|
1636
|
+
spacing: outlineOffset(),
|
|
1637
|
+
offsetMode: "outside",
|
|
1638
|
+
includeSides: true,
|
|
1639
|
+
zIndex: zIndex() + 1
|
|
1640
|
+
},
|
|
1641
|
+
vertexUI: { vertexSize: 0, zIndex: zIndex() },
|
|
1642
|
+
includeVertices: false
|
|
1643
|
+
}));
|
|
1644
|
+
const resizeHandles = $.derived(() => interactionHandles.resize);
|
|
1645
|
+
const shouldShowMenu = $.derived(() => !!$$props.groupSelectionMenu || !!$$props.groupSelectionMenuSnippet);
|
|
1646
|
+
function buildContext() {
|
|
1647
|
+
return {
|
|
1648
|
+
type: "group",
|
|
1649
|
+
annotations: $$props.selectedAnnotations,
|
|
1650
|
+
pageIndex: $$props.pageIndex
|
|
1651
|
+
};
|
|
1652
|
+
}
|
|
1653
|
+
function buildMenuProps(rect, menuWrapperProps) {
|
|
1654
|
+
return {
|
|
1655
|
+
context: buildContext(),
|
|
1656
|
+
selected: true,
|
|
1657
|
+
rect,
|
|
1658
|
+
placement: { suggestTop: false },
|
|
1659
|
+
menuWrapperProps
|
|
1660
|
+
};
|
|
1661
|
+
}
|
|
1662
|
+
var fragment = $.comment();
|
|
1663
|
+
var node = $.first_child(fragment);
|
|
1664
|
+
{
|
|
1665
|
+
var consequent_6 = ($$anchor2) => {
|
|
1666
|
+
var div = root_1$1();
|
|
1667
|
+
var div_1 = $.child(div);
|
|
1668
|
+
$.attribute_effect(div_1, () => ({
|
|
1669
|
+
...$$props.isDraggable ? interactionHandles.dragProps : { onpointerdown: (e) => e.stopPropagation() },
|
|
1670
|
+
[$.STYLE]: {
|
|
1671
|
+
position: "absolute",
|
|
1672
|
+
left: `${$.get(previewGroupBox).origin.x * $$props.scale}px`,
|
|
1673
|
+
top: `${$.get(previewGroupBox).origin.y * $$props.scale}px`,
|
|
1674
|
+
width: `${$.get(previewGroupBox).size.width * $$props.scale}px`,
|
|
1675
|
+
height: `${$.get(previewGroupBox).size.height * $$props.scale}px`,
|
|
1676
|
+
outline: `2px dashed ${selectionOutlineColor() ?? ""}`,
|
|
1677
|
+
"outline-offset": `${outlineOffset() - 1}px`,
|
|
1678
|
+
cursor: $$props.isDraggable ? "move" : "default",
|
|
1679
|
+
"touch-action": "none",
|
|
1680
|
+
"z-index": zIndex()
|
|
1681
|
+
}
|
|
1682
|
+
}));
|
|
1683
|
+
var node_1 = $.child(div_1);
|
|
1684
|
+
{
|
|
1685
|
+
var consequent_1 = ($$anchor3) => {
|
|
1686
|
+
var fragment_1 = $.comment();
|
|
1687
|
+
var node_2 = $.first_child(fragment_1);
|
|
1688
|
+
$.each(node_2, 17, () => $.get(resizeHandles), ({ key, style: handleStyle, ...hProps }) => key, ($$anchor4, $$item) => {
|
|
1689
|
+
let handleStyle = () => $.get($$item).style;
|
|
1690
|
+
let hProps = () => $.exclude_from_object($.get($$item), ["key", "style"]);
|
|
1691
|
+
var fragment_2 = $.comment();
|
|
1692
|
+
var node_3 = $.first_child(fragment_2);
|
|
1693
|
+
{
|
|
1694
|
+
var consequent = ($$anchor5) => {
|
|
1695
|
+
var fragment_3 = $.comment();
|
|
1696
|
+
var node_4 = $.first_child(fragment_3);
|
|
1697
|
+
{
|
|
1698
|
+
let $0 = $.derived(() => ({ ...hProps(), backgroundColor: $.get(HANDLE_COLOR) }));
|
|
1699
|
+
$.snippet(node_4, () => $$props.resizeUI.component, () => $.get($0));
|
|
1700
|
+
}
|
|
1701
|
+
$.append($$anchor5, fragment_3);
|
|
1702
|
+
};
|
|
1703
|
+
var alternate = ($$anchor5) => {
|
|
1704
|
+
var div_2 = root_5$1();
|
|
1705
|
+
$.attribute_effect(div_2, () => ({
|
|
1706
|
+
...hProps(),
|
|
1707
|
+
style: `${handleStyle() ?? ""}; background-color: ${$.get(HANDLE_COLOR) ?? ""};`
|
|
1708
|
+
}));
|
|
1709
|
+
$.append($$anchor5, div_2);
|
|
1710
|
+
};
|
|
1711
|
+
$.if(node_3, ($$render) => {
|
|
1712
|
+
var _a;
|
|
1713
|
+
if ((_a = $$props.resizeUI) == null ? void 0 : _a.component) $$render(consequent);
|
|
1714
|
+
else $$render(alternate, false);
|
|
1715
|
+
});
|
|
1716
|
+
}
|
|
1717
|
+
$.append($$anchor4, fragment_2);
|
|
1718
|
+
});
|
|
1719
|
+
$.append($$anchor3, fragment_1);
|
|
1720
|
+
};
|
|
1721
|
+
$.if(node_1, ($$render) => {
|
|
1722
|
+
if ($$props.isResizable) $$render(consequent_1);
|
|
1723
|
+
});
|
|
1724
|
+
}
|
|
1725
|
+
$.reset(div_1);
|
|
1726
|
+
var node_5 = $.sibling(div_1, 2);
|
|
1727
|
+
{
|
|
1728
|
+
var consequent_5 = ($$anchor3) => {
|
|
1729
|
+
{
|
|
1730
|
+
const children = ($$anchor4, $$arg0) => {
|
|
1731
|
+
let rect = () => $$arg0 == null ? void 0 : $$arg0().rect;
|
|
1732
|
+
let menuWrapperProps = () => $$arg0 == null ? void 0 : $$arg0().menuWrapperProps;
|
|
1733
|
+
const menuProps = $.derived(() => buildMenuProps(rect(), menuWrapperProps()));
|
|
1734
|
+
var fragment_5 = $.comment();
|
|
1735
|
+
var node_6 = $.first_child(fragment_5);
|
|
1736
|
+
{
|
|
1737
|
+
var consequent_3 = ($$anchor5) => {
|
|
1738
|
+
const result = $.derived(() => $$props.groupSelectionMenu($.get(menuProps)));
|
|
1739
|
+
var fragment_6 = $.comment();
|
|
1740
|
+
var node_7 = $.first_child(fragment_6);
|
|
1741
|
+
{
|
|
1742
|
+
var consequent_2 = ($$anchor6) => {
|
|
1743
|
+
var fragment_7 = $.comment();
|
|
1744
|
+
var node_8 = $.first_child(fragment_7);
|
|
1745
|
+
$.component(node_8, () => $.get(result).component, ($$anchor7, result_component) => {
|
|
1746
|
+
result_component($$anchor7, $.spread_props(() => $.get(result).props));
|
|
1747
|
+
});
|
|
1748
|
+
$.append($$anchor6, fragment_7);
|
|
1749
|
+
};
|
|
1750
|
+
$.if(node_7, ($$render) => {
|
|
1751
|
+
if ($.get(result)) $$render(consequent_2);
|
|
1752
|
+
});
|
|
1753
|
+
}
|
|
1754
|
+
$.append($$anchor5, fragment_6);
|
|
1755
|
+
};
|
|
1756
|
+
var alternate_1 = ($$anchor5) => {
|
|
1757
|
+
var fragment_8 = $.comment();
|
|
1758
|
+
var node_9 = $.first_child(fragment_8);
|
|
1759
|
+
{
|
|
1760
|
+
var consequent_4 = ($$anchor6) => {
|
|
1761
|
+
var fragment_9 = $.comment();
|
|
1762
|
+
var node_10 = $.first_child(fragment_9);
|
|
1763
|
+
$.snippet(node_10, () => $$props.groupSelectionMenuSnippet, () => $.get(menuProps));
|
|
1764
|
+
$.append($$anchor6, fragment_9);
|
|
1765
|
+
};
|
|
1766
|
+
$.if(
|
|
1767
|
+
node_9,
|
|
1768
|
+
($$render) => {
|
|
1769
|
+
if ($$props.groupSelectionMenuSnippet) $$render(consequent_4);
|
|
1770
|
+
},
|
|
1771
|
+
true
|
|
1772
|
+
);
|
|
1773
|
+
}
|
|
1774
|
+
$.append($$anchor5, fragment_8);
|
|
1775
|
+
};
|
|
1776
|
+
$.if(node_6, ($$render) => {
|
|
1777
|
+
if ($$props.groupSelectionMenu) $$render(consequent_3);
|
|
1778
|
+
else $$render(alternate_1, false);
|
|
1779
|
+
});
|
|
1780
|
+
}
|
|
1781
|
+
$.append($$anchor4, fragment_5);
|
|
1782
|
+
};
|
|
1783
|
+
let $0 = $.derived(() => ({
|
|
1784
|
+
origin: {
|
|
1785
|
+
x: $.get(previewGroupBox).origin.x * $$props.scale,
|
|
1786
|
+
y: $.get(previewGroupBox).origin.y * $$props.scale
|
|
1787
|
+
},
|
|
1788
|
+
size: {
|
|
1789
|
+
width: $.get(previewGroupBox).size.width * $$props.scale,
|
|
1790
|
+
height: $.get(previewGroupBox).size.height * $$props.scale
|
|
1791
|
+
}
|
|
1792
|
+
}));
|
|
1793
|
+
CounterRotate($$anchor3, {
|
|
1794
|
+
get rect() {
|
|
1795
|
+
return $.get($0);
|
|
1796
|
+
},
|
|
1797
|
+
get rotation() {
|
|
1798
|
+
return $$props.rotation;
|
|
1799
|
+
},
|
|
1800
|
+
children,
|
|
1801
|
+
$$slots: { default: true }
|
|
1802
|
+
});
|
|
1803
|
+
}
|
|
1804
|
+
};
|
|
1805
|
+
$.if(node_5, ($$render) => {
|
|
1806
|
+
if ($.get(shouldShowMenu)) $$render(consequent_5);
|
|
1807
|
+
});
|
|
1808
|
+
}
|
|
1809
|
+
$.reset(div);
|
|
1810
|
+
$.append($$anchor2, div);
|
|
1811
|
+
};
|
|
1812
|
+
$.if(node, ($$render) => {
|
|
1813
|
+
if ($$props.selectedAnnotations.length >= 2) $$render(consequent_6);
|
|
1814
|
+
});
|
|
1815
|
+
}
|
|
1816
|
+
$.append($$anchor, fragment);
|
|
1817
|
+
$.pop();
|
|
1818
|
+
}
|
|
1819
|
+
var root$2 = $.from_html(`<!> <!>`, 1);
|
|
1370
1820
|
function Annotations($$anchor, $$props) {
|
|
1371
1821
|
$.push($$props, true);
|
|
1372
1822
|
let annotationsProps = $.rest_props($$props, ["$$slots", "$$events", "$$legacy"]);
|
|
@@ -1374,17 +1824,18 @@ function Annotations($$anchor, $$props) {
|
|
|
1374
1824
|
const selectionCapability = useSelectionCapability();
|
|
1375
1825
|
const pointerHandlers = usePointerHandlers({ documentId: $$props.documentId, pageIndex: $$props.pageIndex });
|
|
1376
1826
|
let annotations = $.state($.proxy([]));
|
|
1377
|
-
let
|
|
1827
|
+
let allSelectedIds = $.state($.proxy([]));
|
|
1378
1828
|
let editingId = $.state(null);
|
|
1379
1829
|
const annotationProvides = $.derived(() => annotationCapability.provides ? annotationCapability.provides.forDocument($$props.documentId) : null);
|
|
1830
|
+
const isMultiSelected = $.derived(() => $.get(allSelectedIds).length > 1);
|
|
1380
1831
|
$.user_effect(() => {
|
|
1381
1832
|
if (!$.get(annotationProvides)) return;
|
|
1382
1833
|
const currentState = $.get(annotationProvides).getState();
|
|
1383
1834
|
$.set(annotations, getAnnotationsByPageIndex(currentState, $$props.pageIndex), true);
|
|
1384
|
-
$.set(
|
|
1835
|
+
$.set(allSelectedIds, getSelectedAnnotationIds(currentState), true);
|
|
1385
1836
|
const off = $.get(annotationProvides).onStateChange((state) => {
|
|
1386
1837
|
$.set(annotations, getAnnotationsByPageIndex(state, $$props.pageIndex), true);
|
|
1387
|
-
$.set(
|
|
1838
|
+
$.set(allSelectedIds, getSelectedAnnotationIds(state), true);
|
|
1388
1839
|
});
|
|
1389
1840
|
return () => off == null ? void 0 : off();
|
|
1390
1841
|
});
|
|
@@ -1402,20 +1853,59 @@ function Annotations($$anchor, $$props) {
|
|
|
1402
1853
|
function handleClick(e, annotation) {
|
|
1403
1854
|
e.stopPropagation();
|
|
1404
1855
|
if ($.get(annotationProvides) && selectionCapability.provides) {
|
|
1405
|
-
$.get(annotationProvides).selectAnnotation($$props.pageIndex, annotation.object.id);
|
|
1406
1856
|
selectionCapability.provides.clear();
|
|
1857
|
+
const isModifierPressed = "metaKey" in e ? e.metaKey || e.ctrlKey : false;
|
|
1858
|
+
if (isModifierPressed) {
|
|
1859
|
+
$.get(annotationProvides).toggleSelection($$props.pageIndex, annotation.object.id);
|
|
1860
|
+
} else {
|
|
1861
|
+
$.get(annotationProvides).selectAnnotation($$props.pageIndex, annotation.object.id);
|
|
1862
|
+
}
|
|
1407
1863
|
if (annotation.object.id !== $.get(editingId)) {
|
|
1408
1864
|
$.set(editingId, null);
|
|
1409
1865
|
}
|
|
1410
1866
|
}
|
|
1411
1867
|
}
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1868
|
+
function handleLinkClick(e, annotation) {
|
|
1869
|
+
e.stopPropagation();
|
|
1870
|
+
if (!$.get(annotationProvides) || !selectionCapability.provides) return;
|
|
1871
|
+
selectionCapability.provides.clear();
|
|
1872
|
+
if (annotation.object.inReplyToId) {
|
|
1873
|
+
const parentId = annotation.object.inReplyToId;
|
|
1874
|
+
const parent = $.get(annotations).find((a) => a.object.id === parentId);
|
|
1875
|
+
if (parent) {
|
|
1876
|
+
$.get(annotationProvides).selectAnnotation(parent.object.pageIndex, parentId);
|
|
1877
|
+
return;
|
|
1878
|
+
}
|
|
1879
|
+
}
|
|
1880
|
+
$.get(annotationProvides).selectAnnotation($$props.pageIndex, annotation.object.id);
|
|
1881
|
+
}
|
|
1882
|
+
const selectedAnnotationsOnPage = $.derived(() => $.get(annotations).filter((anno) => $.get(allSelectedIds).includes(anno.object.id)));
|
|
1883
|
+
const areAllSelectedDraggable = $.derived(() => {
|
|
1884
|
+
if ($.get(selectedAnnotationsOnPage).length < 2) return false;
|
|
1885
|
+
return $.get(selectedAnnotationsOnPage).every((ta) => {
|
|
1416
1886
|
var _a;
|
|
1417
|
-
|
|
1887
|
+
const tool = (_a = $.get(annotationProvides)) == null ? void 0 : _a.findToolForAnnotation(ta.object);
|
|
1888
|
+
return (tool == null ? void 0 : tool.interaction.isGroupDraggable) ?? (tool == null ? void 0 : tool.interaction.isDraggable) ?? true;
|
|
1418
1889
|
});
|
|
1890
|
+
});
|
|
1891
|
+
const areAllSelectedResizable = $.derived(() => {
|
|
1892
|
+
if ($.get(selectedAnnotationsOnPage).length < 2) return false;
|
|
1893
|
+
return $.get(selectedAnnotationsOnPage).every((ta) => {
|
|
1894
|
+
var _a;
|
|
1895
|
+
const tool = (_a = $.get(annotationProvides)) == null ? void 0 : _a.findToolForAnnotation(ta.object);
|
|
1896
|
+
return (tool == null ? void 0 : tool.interaction.isGroupResizable) ?? (tool == null ? void 0 : tool.interaction.isResizable) ?? true;
|
|
1897
|
+
});
|
|
1898
|
+
});
|
|
1899
|
+
const allSelectedOnSamePage = $.derived(() => {
|
|
1900
|
+
if (!$.get(annotationProvides)) return false;
|
|
1901
|
+
if ($.get(allSelectedIds).length < 2) return false;
|
|
1902
|
+
const allSelected = $.get(annotationProvides).getSelectedAnnotations();
|
|
1903
|
+
return allSelected.every((ta) => ta.object.pageIndex === $$props.pageIndex);
|
|
1904
|
+
});
|
|
1905
|
+
var fragment = root$2();
|
|
1906
|
+
var node = $.first_child(fragment);
|
|
1907
|
+
$.each(node, 17, () => $.get(annotations), (annotation) => annotation.object.id, ($$anchor2, annotation) => {
|
|
1908
|
+
const isSelected = $.derived(() => $.get(allSelectedIds).includes($.get(annotation).object.id));
|
|
1419
1909
|
const isEditing = $.derived(() => $.get(editingId) === $.get(annotation).object.id);
|
|
1420
1910
|
const tool = $.derived(() => {
|
|
1421
1911
|
var _a;
|
|
@@ -1438,40 +1928,43 @@ function Annotations($$anchor, $$props) {
|
|
|
1438
1928
|
onClick: (e) => handleClick(e, $.get(annotation))
|
|
1439
1929
|
}));
|
|
1440
1930
|
};
|
|
1441
|
-
let $0 = $.derived(() =>
|
|
1442
|
-
var _a;
|
|
1443
|
-
return ((_a = $.get(tool)) == null ? void 0 : _a.interaction.isDraggable) ?? true;
|
|
1444
|
-
});
|
|
1931
|
+
let $0 = $.derived(() => $.get(isSelected) && !$.get(isMultiSelected));
|
|
1445
1932
|
let $1 = $.derived(() => {
|
|
1446
1933
|
var _a;
|
|
1447
|
-
return ((_a = $.get(tool)) == null ? void 0 : _a.interaction.
|
|
1934
|
+
return (((_a = $.get(tool)) == null ? void 0 : _a.interaction.isDraggable) ?? true) && !$.get(isMultiSelected);
|
|
1448
1935
|
});
|
|
1449
1936
|
let $2 = $.derived(() => {
|
|
1937
|
+
var _a;
|
|
1938
|
+
return (((_a = $.get(tool)) == null ? void 0 : _a.interaction.isResizable) ?? true) && !$.get(isMultiSelected);
|
|
1939
|
+
});
|
|
1940
|
+
let $3 = $.derived(() => {
|
|
1450
1941
|
var _a;
|
|
1451
1942
|
return ((_a = $.get(tool)) == null ? void 0 : _a.interaction.lockAspectRatio) ?? false;
|
|
1452
1943
|
});
|
|
1944
|
+
let $4 = $.derived(() => $.get(isMultiSelected) ? void 0 : $$props.selectionMenu);
|
|
1945
|
+
let $5 = $.derived(() => $.get(isMultiSelected) ? void 0 : $$props.selectionMenuSnippet);
|
|
1453
1946
|
AnnotationContainer($$anchor3, $.spread_props(
|
|
1454
1947
|
{
|
|
1455
1948
|
get trackedAnnotation() {
|
|
1456
1949
|
return $.get(annotation);
|
|
1457
1950
|
},
|
|
1458
1951
|
get isSelected() {
|
|
1459
|
-
return $.get(
|
|
1952
|
+
return $.get($0);
|
|
1460
1953
|
},
|
|
1461
1954
|
get isDraggable() {
|
|
1462
|
-
return $.get($
|
|
1955
|
+
return $.get($1);
|
|
1463
1956
|
},
|
|
1464
1957
|
get isResizable() {
|
|
1465
|
-
return $.get($
|
|
1958
|
+
return $.get($2);
|
|
1466
1959
|
},
|
|
1467
1960
|
get lockAspectRatio() {
|
|
1468
|
-
return $.get($
|
|
1961
|
+
return $.get($3);
|
|
1469
1962
|
},
|
|
1470
1963
|
get selectionMenu() {
|
|
1471
|
-
return
|
|
1964
|
+
return $.get($4);
|
|
1472
1965
|
},
|
|
1473
1966
|
get selectionMenuSnippet() {
|
|
1474
|
-
return
|
|
1967
|
+
return $.get($5);
|
|
1475
1968
|
},
|
|
1476
1969
|
onSelect: (e) => handleClick(e, $.get(annotation)),
|
|
1477
1970
|
get style() {
|
|
@@ -1483,7 +1976,7 @@ function Annotations($$anchor, $$props) {
|
|
|
1483
1976
|
));
|
|
1484
1977
|
}
|
|
1485
1978
|
};
|
|
1486
|
-
var
|
|
1979
|
+
var alternate_11 = ($$anchor3) => {
|
|
1487
1980
|
var fragment_4 = $.comment();
|
|
1488
1981
|
var node_2 = $.first_child(fragment_4);
|
|
1489
1982
|
{
|
|
@@ -1500,40 +1993,43 @@ function Annotations($$anchor, $$props) {
|
|
|
1500
1993
|
onClick: (e) => handleClick(e, $.get(annotation))
|
|
1501
1994
|
}));
|
|
1502
1995
|
};
|
|
1503
|
-
let $0 = $.derived(() =>
|
|
1504
|
-
var _a;
|
|
1505
|
-
return ((_a = $.get(tool)) == null ? void 0 : _a.interaction.isDraggable) ?? true;
|
|
1506
|
-
});
|
|
1996
|
+
let $0 = $.derived(() => $.get(isSelected) && !$.get(isMultiSelected));
|
|
1507
1997
|
let $1 = $.derived(() => {
|
|
1508
1998
|
var _a;
|
|
1509
|
-
return ((_a = $.get(tool)) == null ? void 0 : _a.interaction.
|
|
1999
|
+
return (((_a = $.get(tool)) == null ? void 0 : _a.interaction.isDraggable) ?? true) && !$.get(isMultiSelected);
|
|
1510
2000
|
});
|
|
1511
2001
|
let $2 = $.derived(() => {
|
|
2002
|
+
var _a;
|
|
2003
|
+
return (((_a = $.get(tool)) == null ? void 0 : _a.interaction.isResizable) ?? true) && !$.get(isMultiSelected);
|
|
2004
|
+
});
|
|
2005
|
+
let $3 = $.derived(() => {
|
|
1512
2006
|
var _a;
|
|
1513
2007
|
return ((_a = $.get(tool)) == null ? void 0 : _a.interaction.lockAspectRatio) ?? false;
|
|
1514
2008
|
});
|
|
2009
|
+
let $4 = $.derived(() => $.get(isMultiSelected) ? void 0 : $$props.selectionMenu);
|
|
2010
|
+
let $5 = $.derived(() => $.get(isMultiSelected) ? void 0 : $$props.selectionMenuSnippet);
|
|
1515
2011
|
AnnotationContainer($$anchor4, $.spread_props(
|
|
1516
2012
|
{
|
|
1517
2013
|
get trackedAnnotation() {
|
|
1518
2014
|
return $.get(annotation);
|
|
1519
2015
|
},
|
|
1520
2016
|
get isSelected() {
|
|
1521
|
-
return $.get(
|
|
2017
|
+
return $.get($0);
|
|
1522
2018
|
},
|
|
1523
2019
|
get isDraggable() {
|
|
1524
|
-
return $.get($
|
|
2020
|
+
return $.get($1);
|
|
1525
2021
|
},
|
|
1526
2022
|
get isResizable() {
|
|
1527
|
-
return $.get($
|
|
2023
|
+
return $.get($2);
|
|
1528
2024
|
},
|
|
1529
2025
|
get lockAspectRatio() {
|
|
1530
|
-
return $.get($
|
|
2026
|
+
return $.get($3);
|
|
1531
2027
|
},
|
|
1532
2028
|
get selectionMenu() {
|
|
1533
|
-
return
|
|
2029
|
+
return $.get($4);
|
|
1534
2030
|
},
|
|
1535
2031
|
get selectionMenuSnippet() {
|
|
1536
|
-
return
|
|
2032
|
+
return $.get($5);
|
|
1537
2033
|
},
|
|
1538
2034
|
onSelect: (e) => handleClick(e, $.get(annotation)),
|
|
1539
2035
|
get style() {
|
|
@@ -1545,7 +2041,7 @@ function Annotations($$anchor, $$props) {
|
|
|
1545
2041
|
));
|
|
1546
2042
|
}
|
|
1547
2043
|
};
|
|
1548
|
-
var
|
|
2044
|
+
var alternate_10 = ($$anchor4) => {
|
|
1549
2045
|
var fragment_7 = $.comment();
|
|
1550
2046
|
var node_3 = $.first_child(fragment_7);
|
|
1551
2047
|
{
|
|
@@ -1562,40 +2058,43 @@ function Annotations($$anchor, $$props) {
|
|
|
1562
2058
|
onClick: (e) => handleClick(e, $.get(annotation))
|
|
1563
2059
|
}));
|
|
1564
2060
|
};
|
|
1565
|
-
let $0 = $.derived(() =>
|
|
1566
|
-
var _a;
|
|
1567
|
-
return ((_a = $.get(tool)) == null ? void 0 : _a.interaction.isDraggable) ?? true;
|
|
1568
|
-
});
|
|
2061
|
+
let $0 = $.derived(() => $.get(isSelected) && !$.get(isMultiSelected));
|
|
1569
2062
|
let $1 = $.derived(() => {
|
|
1570
2063
|
var _a;
|
|
1571
|
-
return ((_a = $.get(tool)) == null ? void 0 : _a.interaction.
|
|
2064
|
+
return (((_a = $.get(tool)) == null ? void 0 : _a.interaction.isDraggable) ?? true) && !$.get(isMultiSelected);
|
|
1572
2065
|
});
|
|
1573
2066
|
let $2 = $.derived(() => {
|
|
2067
|
+
var _a;
|
|
2068
|
+
return (((_a = $.get(tool)) == null ? void 0 : _a.interaction.isResizable) ?? true) && !$.get(isMultiSelected);
|
|
2069
|
+
});
|
|
2070
|
+
let $3 = $.derived(() => {
|
|
1574
2071
|
var _a;
|
|
1575
2072
|
return ((_a = $.get(tool)) == null ? void 0 : _a.interaction.lockAspectRatio) ?? false;
|
|
1576
2073
|
});
|
|
2074
|
+
let $4 = $.derived(() => $.get(isMultiSelected) ? void 0 : $$props.selectionMenu);
|
|
2075
|
+
let $5 = $.derived(() => $.get(isMultiSelected) ? void 0 : $$props.selectionMenuSnippet);
|
|
1577
2076
|
AnnotationContainer($$anchor5, $.spread_props(
|
|
1578
2077
|
{
|
|
1579
2078
|
get trackedAnnotation() {
|
|
1580
2079
|
return $.get(annotation);
|
|
1581
2080
|
},
|
|
1582
2081
|
get isSelected() {
|
|
1583
|
-
return $.get(
|
|
2082
|
+
return $.get($0);
|
|
1584
2083
|
},
|
|
1585
2084
|
get isDraggable() {
|
|
1586
|
-
return $.get($
|
|
2085
|
+
return $.get($1);
|
|
1587
2086
|
},
|
|
1588
2087
|
get isResizable() {
|
|
1589
|
-
return $.get($
|
|
2088
|
+
return $.get($2);
|
|
1590
2089
|
},
|
|
1591
2090
|
get lockAspectRatio() {
|
|
1592
|
-
return $.get($
|
|
2091
|
+
return $.get($3);
|
|
1593
2092
|
},
|
|
1594
2093
|
get selectionMenu() {
|
|
1595
|
-
return
|
|
2094
|
+
return $.get($4);
|
|
1596
2095
|
},
|
|
1597
2096
|
get selectionMenuSnippet() {
|
|
1598
|
-
return
|
|
2097
|
+
return $.get($5);
|
|
1599
2098
|
},
|
|
1600
2099
|
onSelect: (e) => handleClick(e, $.get(annotation)),
|
|
1601
2100
|
get style() {
|
|
@@ -1607,7 +2106,7 @@ function Annotations($$anchor, $$props) {
|
|
|
1607
2106
|
));
|
|
1608
2107
|
}
|
|
1609
2108
|
};
|
|
1610
|
-
var
|
|
2109
|
+
var alternate_9 = ($$anchor5) => {
|
|
1611
2110
|
var fragment_10 = $.comment();
|
|
1612
2111
|
var node_4 = $.first_child(fragment_10);
|
|
1613
2112
|
{
|
|
@@ -1621,40 +2120,43 @@ function Annotations($$anchor, $$props) {
|
|
|
1621
2120
|
onClick: (e) => handleClick(e, $.get(annotation))
|
|
1622
2121
|
}));
|
|
1623
2122
|
};
|
|
1624
|
-
let $0 = $.derived(() =>
|
|
1625
|
-
var _a;
|
|
1626
|
-
return ((_a = $.get(tool)) == null ? void 0 : _a.interaction.isDraggable) ?? false;
|
|
1627
|
-
});
|
|
2123
|
+
let $0 = $.derived(() => $.get(isSelected) && !$.get(isMultiSelected));
|
|
1628
2124
|
let $1 = $.derived(() => {
|
|
1629
2125
|
var _a;
|
|
1630
|
-
return ((_a = $.get(tool)) == null ? void 0 : _a.interaction.
|
|
2126
|
+
return (((_a = $.get(tool)) == null ? void 0 : _a.interaction.isDraggable) ?? false) && !$.get(isMultiSelected);
|
|
1631
2127
|
});
|
|
1632
2128
|
let $2 = $.derived(() => {
|
|
2129
|
+
var _a;
|
|
2130
|
+
return (((_a = $.get(tool)) == null ? void 0 : _a.interaction.isResizable) ?? false) && !$.get(isMultiSelected);
|
|
2131
|
+
});
|
|
2132
|
+
let $3 = $.derived(() => {
|
|
1633
2133
|
var _a;
|
|
1634
2134
|
return ((_a = $.get(tool)) == null ? void 0 : _a.interaction.lockAspectRatio) ?? false;
|
|
1635
2135
|
});
|
|
2136
|
+
let $4 = $.derived(() => $.get(isMultiSelected) ? void 0 : $$props.selectionMenu);
|
|
2137
|
+
let $5 = $.derived(() => $.get(isMultiSelected) ? void 0 : $$props.selectionMenuSnippet);
|
|
1636
2138
|
AnnotationContainer($$anchor6, $.spread_props(
|
|
1637
2139
|
{
|
|
1638
2140
|
get trackedAnnotation() {
|
|
1639
2141
|
return $.get(annotation);
|
|
1640
2142
|
},
|
|
1641
2143
|
get isSelected() {
|
|
1642
|
-
return $.get(
|
|
2144
|
+
return $.get($0);
|
|
1643
2145
|
},
|
|
1644
2146
|
get isDraggable() {
|
|
1645
|
-
return $.get($
|
|
2147
|
+
return $.get($1);
|
|
1646
2148
|
},
|
|
1647
2149
|
get isResizable() {
|
|
1648
|
-
return $.get($
|
|
2150
|
+
return $.get($2);
|
|
1649
2151
|
},
|
|
1650
2152
|
get lockAspectRatio() {
|
|
1651
|
-
return $.get($
|
|
2153
|
+
return $.get($3);
|
|
1652
2154
|
},
|
|
1653
2155
|
get selectionMenu() {
|
|
1654
|
-
return
|
|
2156
|
+
return $.get($4);
|
|
1655
2157
|
},
|
|
1656
2158
|
get selectionMenuSnippet() {
|
|
1657
|
-
return
|
|
2159
|
+
return $.get($5);
|
|
1658
2160
|
},
|
|
1659
2161
|
onSelect: (e) => handleClick(e, $.get(annotation)),
|
|
1660
2162
|
zIndex: 0,
|
|
@@ -1667,7 +2169,7 @@ function Annotations($$anchor, $$props) {
|
|
|
1667
2169
|
));
|
|
1668
2170
|
}
|
|
1669
2171
|
};
|
|
1670
|
-
var
|
|
2172
|
+
var alternate_8 = ($$anchor6) => {
|
|
1671
2173
|
var fragment_13 = $.comment();
|
|
1672
2174
|
var node_5 = $.first_child(fragment_13);
|
|
1673
2175
|
{
|
|
@@ -1681,40 +2183,43 @@ function Annotations($$anchor, $$props) {
|
|
|
1681
2183
|
onClick: (e) => handleClick(e, $.get(annotation))
|
|
1682
2184
|
}));
|
|
1683
2185
|
};
|
|
1684
|
-
let $0 = $.derived(() =>
|
|
1685
|
-
var _a;
|
|
1686
|
-
return ((_a = $.get(tool)) == null ? void 0 : _a.interaction.isDraggable) ?? false;
|
|
1687
|
-
});
|
|
2186
|
+
let $0 = $.derived(() => $.get(isSelected) && !$.get(isMultiSelected));
|
|
1688
2187
|
let $1 = $.derived(() => {
|
|
1689
2188
|
var _a;
|
|
1690
|
-
return ((_a = $.get(tool)) == null ? void 0 : _a.interaction.
|
|
2189
|
+
return (((_a = $.get(tool)) == null ? void 0 : _a.interaction.isDraggable) ?? false) && !$.get(isMultiSelected);
|
|
1691
2190
|
});
|
|
1692
2191
|
let $2 = $.derived(() => {
|
|
2192
|
+
var _a;
|
|
2193
|
+
return (((_a = $.get(tool)) == null ? void 0 : _a.interaction.isResizable) ?? false) && !$.get(isMultiSelected);
|
|
2194
|
+
});
|
|
2195
|
+
let $3 = $.derived(() => {
|
|
1693
2196
|
var _a;
|
|
1694
2197
|
return ((_a = $.get(tool)) == null ? void 0 : _a.interaction.lockAspectRatio) ?? false;
|
|
1695
2198
|
});
|
|
2199
|
+
let $4 = $.derived(() => $.get(isMultiSelected) ? void 0 : $$props.selectionMenu);
|
|
2200
|
+
let $5 = $.derived(() => $.get(isMultiSelected) ? void 0 : $$props.selectionMenuSnippet);
|
|
1696
2201
|
AnnotationContainer($$anchor7, $.spread_props(
|
|
1697
2202
|
{
|
|
1698
2203
|
get trackedAnnotation() {
|
|
1699
2204
|
return $.get(annotation);
|
|
1700
2205
|
},
|
|
1701
2206
|
get isSelected() {
|
|
1702
|
-
return $.get(
|
|
2207
|
+
return $.get($0);
|
|
1703
2208
|
},
|
|
1704
2209
|
get isDraggable() {
|
|
1705
|
-
return $.get($
|
|
2210
|
+
return $.get($1);
|
|
1706
2211
|
},
|
|
1707
2212
|
get isResizable() {
|
|
1708
|
-
return $.get($
|
|
2213
|
+
return $.get($2);
|
|
1709
2214
|
},
|
|
1710
2215
|
get lockAspectRatio() {
|
|
1711
|
-
return $.get($
|
|
2216
|
+
return $.get($3);
|
|
1712
2217
|
},
|
|
1713
2218
|
get selectionMenu() {
|
|
1714
|
-
return
|
|
2219
|
+
return $.get($4);
|
|
1715
2220
|
},
|
|
1716
2221
|
get selectionMenuSnippet() {
|
|
1717
|
-
return
|
|
2222
|
+
return $.get($5);
|
|
1718
2223
|
},
|
|
1719
2224
|
onSelect: (e) => handleClick(e, $.get(annotation)),
|
|
1720
2225
|
zIndex: 0,
|
|
@@ -1727,7 +2232,7 @@ function Annotations($$anchor, $$props) {
|
|
|
1727
2232
|
));
|
|
1728
2233
|
}
|
|
1729
2234
|
};
|
|
1730
|
-
var
|
|
2235
|
+
var alternate_7 = ($$anchor7) => {
|
|
1731
2236
|
var fragment_16 = $.comment();
|
|
1732
2237
|
var node_6 = $.first_child(fragment_16);
|
|
1733
2238
|
{
|
|
@@ -1741,40 +2246,43 @@ function Annotations($$anchor, $$props) {
|
|
|
1741
2246
|
onClick: (e) => handleClick(e, $.get(annotation))
|
|
1742
2247
|
}));
|
|
1743
2248
|
};
|
|
1744
|
-
let $0 = $.derived(() =>
|
|
1745
|
-
var _a;
|
|
1746
|
-
return ((_a = $.get(tool)) == null ? void 0 : _a.interaction.isDraggable) ?? false;
|
|
1747
|
-
});
|
|
2249
|
+
let $0 = $.derived(() => $.get(isSelected) && !$.get(isMultiSelected));
|
|
1748
2250
|
let $1 = $.derived(() => {
|
|
1749
2251
|
var _a;
|
|
1750
|
-
return ((_a = $.get(tool)) == null ? void 0 : _a.interaction.
|
|
2252
|
+
return (((_a = $.get(tool)) == null ? void 0 : _a.interaction.isDraggable) ?? false) && !$.get(isMultiSelected);
|
|
1751
2253
|
});
|
|
1752
2254
|
let $2 = $.derived(() => {
|
|
2255
|
+
var _a;
|
|
2256
|
+
return (((_a = $.get(tool)) == null ? void 0 : _a.interaction.isResizable) ?? false) && !$.get(isMultiSelected);
|
|
2257
|
+
});
|
|
2258
|
+
let $3 = $.derived(() => {
|
|
1753
2259
|
var _a;
|
|
1754
2260
|
return ((_a = $.get(tool)) == null ? void 0 : _a.interaction.lockAspectRatio) ?? false;
|
|
1755
2261
|
});
|
|
2262
|
+
let $4 = $.derived(() => $.get(isMultiSelected) ? void 0 : $$props.selectionMenu);
|
|
2263
|
+
let $5 = $.derived(() => $.get(isMultiSelected) ? void 0 : $$props.selectionMenuSnippet);
|
|
1756
2264
|
AnnotationContainer($$anchor8, $.spread_props(
|
|
1757
2265
|
{
|
|
1758
2266
|
get trackedAnnotation() {
|
|
1759
2267
|
return $.get(annotation);
|
|
1760
2268
|
},
|
|
1761
2269
|
get isSelected() {
|
|
1762
|
-
return $.get(
|
|
2270
|
+
return $.get($0);
|
|
1763
2271
|
},
|
|
1764
2272
|
get isDraggable() {
|
|
1765
|
-
return $.get($
|
|
2273
|
+
return $.get($1);
|
|
1766
2274
|
},
|
|
1767
2275
|
get isResizable() {
|
|
1768
|
-
return $.get($
|
|
2276
|
+
return $.get($2);
|
|
1769
2277
|
},
|
|
1770
2278
|
get lockAspectRatio() {
|
|
1771
|
-
return $.get($
|
|
2279
|
+
return $.get($3);
|
|
1772
2280
|
},
|
|
1773
2281
|
get selectionMenu() {
|
|
1774
|
-
return
|
|
2282
|
+
return $.get($4);
|
|
1775
2283
|
},
|
|
1776
2284
|
get selectionMenuSnippet() {
|
|
1777
|
-
return
|
|
2285
|
+
return $.get($5);
|
|
1778
2286
|
},
|
|
1779
2287
|
onSelect: (e) => handleClick(e, $.get(annotation)),
|
|
1780
2288
|
zIndex: 0,
|
|
@@ -1787,7 +2295,7 @@ function Annotations($$anchor, $$props) {
|
|
|
1787
2295
|
));
|
|
1788
2296
|
}
|
|
1789
2297
|
};
|
|
1790
|
-
var
|
|
2298
|
+
var alternate_6 = ($$anchor8) => {
|
|
1791
2299
|
var fragment_19 = $.comment();
|
|
1792
2300
|
var node_7 = $.first_child(fragment_19);
|
|
1793
2301
|
{
|
|
@@ -1801,46 +2309,49 @@ function Annotations($$anchor, $$props) {
|
|
|
1801
2309
|
onClick: (e) => handleClick(e, $.get(annotation))
|
|
1802
2310
|
}));
|
|
1803
2311
|
};
|
|
1804
|
-
let $0 = $.derived(() =>
|
|
1805
|
-
var _a;
|
|
1806
|
-
return ((_a = $.get(tool)) == null ? void 0 : _a.interaction.isDraggable) ?? false;
|
|
1807
|
-
});
|
|
2312
|
+
let $0 = $.derived(() => $.get(isSelected) && !$.get(isMultiSelected));
|
|
1808
2313
|
let $1 = $.derived(() => {
|
|
1809
2314
|
var _a;
|
|
1810
|
-
return ((_a = $.get(tool)) == null ? void 0 : _a.interaction.
|
|
2315
|
+
return (((_a = $.get(tool)) == null ? void 0 : _a.interaction.isDraggable) ?? false) && !$.get(isMultiSelected);
|
|
1811
2316
|
});
|
|
1812
2317
|
let $2 = $.derived(() => {
|
|
2318
|
+
var _a;
|
|
2319
|
+
return (((_a = $.get(tool)) == null ? void 0 : _a.interaction.isResizable) ?? false) && !$.get(isMultiSelected);
|
|
2320
|
+
});
|
|
2321
|
+
let $3 = $.derived(() => {
|
|
1813
2322
|
var _a;
|
|
1814
2323
|
return ((_a = $.get(tool)) == null ? void 0 : _a.interaction.lockAspectRatio) ?? false;
|
|
1815
2324
|
});
|
|
1816
|
-
let $
|
|
2325
|
+
let $4 = $.derived(() => $.get(isMultiSelected) ? void 0 : $$props.selectionMenu);
|
|
2326
|
+
let $5 = $.derived(() => $.get(isMultiSelected) ? void 0 : $$props.selectionMenuSnippet);
|
|
2327
|
+
let $6 = $.derived(() => blendModeToCss($.get(annotation).object.blendMode ?? PdfBlendMode.Multiply));
|
|
1817
2328
|
AnnotationContainer($$anchor9, $.spread_props(
|
|
1818
2329
|
{
|
|
1819
2330
|
get trackedAnnotation() {
|
|
1820
2331
|
return $.get(annotation);
|
|
1821
2332
|
},
|
|
1822
2333
|
get isSelected() {
|
|
1823
|
-
return $.get(
|
|
2334
|
+
return $.get($0);
|
|
1824
2335
|
},
|
|
1825
2336
|
get isDraggable() {
|
|
1826
|
-
return $.get($
|
|
2337
|
+
return $.get($1);
|
|
1827
2338
|
},
|
|
1828
2339
|
get isResizable() {
|
|
1829
|
-
return $.get($
|
|
2340
|
+
return $.get($2);
|
|
1830
2341
|
},
|
|
1831
2342
|
get lockAspectRatio() {
|
|
1832
|
-
return $.get($
|
|
2343
|
+
return $.get($3);
|
|
1833
2344
|
},
|
|
1834
2345
|
onSelect: (e) => handleClick(e, $.get(annotation)),
|
|
1835
2346
|
zIndex: 0,
|
|
1836
2347
|
get selectionMenu() {
|
|
1837
|
-
return
|
|
2348
|
+
return $.get($4);
|
|
1838
2349
|
},
|
|
1839
2350
|
get selectionMenuSnippet() {
|
|
1840
|
-
return
|
|
2351
|
+
return $.get($5);
|
|
1841
2352
|
},
|
|
1842
2353
|
get style() {
|
|
1843
|
-
return `mix-blend-mode: ${$.get($
|
|
2354
|
+
return `mix-blend-mode: ${$.get($6) ?? ""}`;
|
|
1844
2355
|
}
|
|
1845
2356
|
},
|
|
1846
2357
|
() => annotationsProps,
|
|
@@ -1848,7 +2359,7 @@ function Annotations($$anchor, $$props) {
|
|
|
1848
2359
|
));
|
|
1849
2360
|
}
|
|
1850
2361
|
};
|
|
1851
|
-
var
|
|
2362
|
+
var alternate_5 = ($$anchor9) => {
|
|
1852
2363
|
var fragment_22 = $.comment();
|
|
1853
2364
|
var node_8 = $.first_child(fragment_22);
|
|
1854
2365
|
{
|
|
@@ -1865,40 +2376,43 @@ function Annotations($$anchor, $$props) {
|
|
|
1865
2376
|
onClick: (e) => handleClick(e, $.get(annotation))
|
|
1866
2377
|
}));
|
|
1867
2378
|
};
|
|
1868
|
-
let $0 = $.derived(() =>
|
|
1869
|
-
var _a;
|
|
1870
|
-
return ((_a = $.get(tool)) == null ? void 0 : _a.interaction.isDraggable) ?? true;
|
|
1871
|
-
});
|
|
2379
|
+
let $0 = $.derived(() => $.get(isSelected) && !$.get(isMultiSelected));
|
|
1872
2380
|
let $1 = $.derived(() => {
|
|
1873
2381
|
var _a;
|
|
1874
|
-
return ((_a = $.get(tool)) == null ? void 0 : _a.interaction.
|
|
2382
|
+
return (((_a = $.get(tool)) == null ? void 0 : _a.interaction.isDraggable) ?? true) && !$.get(isMultiSelected);
|
|
1875
2383
|
});
|
|
1876
2384
|
let $2 = $.derived(() => {
|
|
2385
|
+
var _a;
|
|
2386
|
+
return (((_a = $.get(tool)) == null ? void 0 : _a.interaction.isResizable) ?? false) && !$.get(isMultiSelected);
|
|
2387
|
+
});
|
|
2388
|
+
let $3 = $.derived(() => {
|
|
1877
2389
|
var _a;
|
|
1878
2390
|
return ((_a = $.get(tool)) == null ? void 0 : _a.interaction.lockAspectRatio) ?? false;
|
|
1879
2391
|
});
|
|
2392
|
+
let $4 = $.derived(() => $.get(isMultiSelected) ? void 0 : $$props.selectionMenu);
|
|
2393
|
+
let $5 = $.derived(() => $.get(isMultiSelected) ? void 0 : $$props.selectionMenuSnippet);
|
|
1880
2394
|
AnnotationContainer($$anchor10, $.spread_props(
|
|
1881
2395
|
{
|
|
1882
2396
|
get trackedAnnotation() {
|
|
1883
2397
|
return $.get(annotation);
|
|
1884
2398
|
},
|
|
1885
2399
|
get isSelected() {
|
|
1886
|
-
return $.get(
|
|
2400
|
+
return $.get($0);
|
|
1887
2401
|
},
|
|
1888
2402
|
get isDraggable() {
|
|
1889
|
-
return $.get($
|
|
2403
|
+
return $.get($1);
|
|
1890
2404
|
},
|
|
1891
2405
|
get isResizable() {
|
|
1892
|
-
return $.get($
|
|
2406
|
+
return $.get($2);
|
|
1893
2407
|
},
|
|
1894
2408
|
get lockAspectRatio() {
|
|
1895
|
-
return $.get($
|
|
2409
|
+
return $.get($3);
|
|
1896
2410
|
},
|
|
1897
2411
|
get selectionMenu() {
|
|
1898
|
-
return
|
|
2412
|
+
return $.get($4);
|
|
1899
2413
|
},
|
|
1900
2414
|
get selectionMenuSnippet() {
|
|
1901
|
-
return
|
|
2415
|
+
return $.get($5);
|
|
1902
2416
|
},
|
|
1903
2417
|
onSelect: (e) => handleClick(e, $.get(annotation)),
|
|
1904
2418
|
vertexConfig: {
|
|
@@ -1914,7 +2428,7 @@ function Annotations($$anchor, $$props) {
|
|
|
1914
2428
|
));
|
|
1915
2429
|
}
|
|
1916
2430
|
};
|
|
1917
|
-
var
|
|
2431
|
+
var alternate_4 = ($$anchor10) => {
|
|
1918
2432
|
var fragment_25 = $.comment();
|
|
1919
2433
|
var node_9 = $.first_child(fragment_25);
|
|
1920
2434
|
{
|
|
@@ -1931,40 +2445,43 @@ function Annotations($$anchor, $$props) {
|
|
|
1931
2445
|
onClick: (e) => handleClick(e, $.get(annotation))
|
|
1932
2446
|
}));
|
|
1933
2447
|
};
|
|
1934
|
-
let $0 = $.derived(() =>
|
|
2448
|
+
let $0 = $.derived(() => $.get(isMultiSelected) ? void 0 : $$props.selectionMenu);
|
|
2449
|
+
let $1 = $.derived(() => $.get(isMultiSelected) ? void 0 : $$props.selectionMenuSnippet);
|
|
2450
|
+
let $2 = $.derived(() => {
|
|
1935
2451
|
var _a;
|
|
1936
|
-
return ((_a = $.get(tool)) == null ? void 0 : _a.interaction.isDraggable) ?? true;
|
|
2452
|
+
return (((_a = $.get(tool)) == null ? void 0 : _a.interaction.isDraggable) ?? true) && !$.get(isMultiSelected);
|
|
1937
2453
|
});
|
|
1938
|
-
let $
|
|
2454
|
+
let $3 = $.derived(() => {
|
|
1939
2455
|
var _a;
|
|
1940
|
-
return ((_a = $.get(tool)) == null ? void 0 : _a.interaction.isResizable) ?? false;
|
|
2456
|
+
return (((_a = $.get(tool)) == null ? void 0 : _a.interaction.isResizable) ?? false) && !$.get(isMultiSelected);
|
|
1941
2457
|
});
|
|
1942
|
-
let $
|
|
2458
|
+
let $4 = $.derived(() => {
|
|
1943
2459
|
var _a;
|
|
1944
2460
|
return ((_a = $.get(tool)) == null ? void 0 : _a.interaction.lockAspectRatio) ?? false;
|
|
1945
2461
|
});
|
|
2462
|
+
let $5 = $.derived(() => $.get(isSelected) && !$.get(isMultiSelected));
|
|
1946
2463
|
AnnotationContainer($$anchor11, $.spread_props(
|
|
1947
2464
|
{
|
|
1948
2465
|
get trackedAnnotation() {
|
|
1949
2466
|
return $.get(annotation);
|
|
1950
2467
|
},
|
|
1951
2468
|
get selectionMenu() {
|
|
1952
|
-
return
|
|
2469
|
+
return $.get($0);
|
|
1953
2470
|
},
|
|
1954
2471
|
get selectionMenuSnippet() {
|
|
1955
|
-
return
|
|
2472
|
+
return $.get($1);
|
|
1956
2473
|
},
|
|
1957
2474
|
get isDraggable() {
|
|
1958
|
-
return $.get($
|
|
2475
|
+
return $.get($2);
|
|
1959
2476
|
},
|
|
1960
2477
|
get isResizable() {
|
|
1961
|
-
return $.get($
|
|
2478
|
+
return $.get($3);
|
|
1962
2479
|
},
|
|
1963
2480
|
get lockAspectRatio() {
|
|
1964
|
-
return $.get($
|
|
2481
|
+
return $.get($4);
|
|
1965
2482
|
},
|
|
1966
2483
|
get isSelected() {
|
|
1967
|
-
return $.get(
|
|
2484
|
+
return $.get($5);
|
|
1968
2485
|
},
|
|
1969
2486
|
onSelect: (e) => handleClick(e, $.get(annotation)),
|
|
1970
2487
|
vertexConfig: {
|
|
@@ -1980,7 +2497,7 @@ function Annotations($$anchor, $$props) {
|
|
|
1980
2497
|
));
|
|
1981
2498
|
}
|
|
1982
2499
|
};
|
|
1983
|
-
var
|
|
2500
|
+
var alternate_3 = ($$anchor11) => {
|
|
1984
2501
|
var fragment_28 = $.comment();
|
|
1985
2502
|
var node_10 = $.first_child(fragment_28);
|
|
1986
2503
|
{
|
|
@@ -1997,40 +2514,43 @@ function Annotations($$anchor, $$props) {
|
|
|
1997
2514
|
onClick: (e) => handleClick(e, $.get(annotation))
|
|
1998
2515
|
}));
|
|
1999
2516
|
};
|
|
2000
|
-
let $0 = $.derived(() =>
|
|
2001
|
-
var _a;
|
|
2002
|
-
return ((_a = $.get(tool)) == null ? void 0 : _a.interaction.isDraggable) ?? true;
|
|
2003
|
-
});
|
|
2517
|
+
let $0 = $.derived(() => $.get(isSelected) && !$.get(isMultiSelected));
|
|
2004
2518
|
let $1 = $.derived(() => {
|
|
2005
2519
|
var _a;
|
|
2006
|
-
return ((_a = $.get(tool)) == null ? void 0 : _a.interaction.
|
|
2520
|
+
return (((_a = $.get(tool)) == null ? void 0 : _a.interaction.isDraggable) ?? true) && !$.get(isMultiSelected);
|
|
2007
2521
|
});
|
|
2008
2522
|
let $2 = $.derived(() => {
|
|
2523
|
+
var _a;
|
|
2524
|
+
return (((_a = $.get(tool)) == null ? void 0 : _a.interaction.isResizable) ?? false) && !$.get(isMultiSelected);
|
|
2525
|
+
});
|
|
2526
|
+
let $3 = $.derived(() => {
|
|
2009
2527
|
var _a;
|
|
2010
2528
|
return ((_a = $.get(tool)) == null ? void 0 : _a.interaction.lockAspectRatio) ?? false;
|
|
2011
2529
|
});
|
|
2530
|
+
let $4 = $.derived(() => $.get(isMultiSelected) ? void 0 : $$props.selectionMenu);
|
|
2531
|
+
let $5 = $.derived(() => $.get(isMultiSelected) ? void 0 : $$props.selectionMenuSnippet);
|
|
2012
2532
|
AnnotationContainer($$anchor12, $.spread_props(
|
|
2013
2533
|
{
|
|
2014
2534
|
get trackedAnnotation() {
|
|
2015
2535
|
return $.get(annotation);
|
|
2016
2536
|
},
|
|
2017
2537
|
get isSelected() {
|
|
2018
|
-
return $.get(
|
|
2538
|
+
return $.get($0);
|
|
2019
2539
|
},
|
|
2020
2540
|
get isDraggable() {
|
|
2021
|
-
return $.get($
|
|
2541
|
+
return $.get($1);
|
|
2022
2542
|
},
|
|
2023
2543
|
get isResizable() {
|
|
2024
|
-
return $.get($
|
|
2544
|
+
return $.get($2);
|
|
2025
2545
|
},
|
|
2026
2546
|
get lockAspectRatio() {
|
|
2027
|
-
return $.get($
|
|
2547
|
+
return $.get($3);
|
|
2028
2548
|
},
|
|
2029
2549
|
get selectionMenu() {
|
|
2030
|
-
return
|
|
2550
|
+
return $.get($4);
|
|
2031
2551
|
},
|
|
2032
2552
|
get selectionMenuSnippet() {
|
|
2033
|
-
return
|
|
2553
|
+
return $.get($5);
|
|
2034
2554
|
},
|
|
2035
2555
|
onSelect: (e) => handleClick(e, $.get(annotation)),
|
|
2036
2556
|
vertexConfig: {
|
|
@@ -2046,7 +2566,7 @@ function Annotations($$anchor, $$props) {
|
|
|
2046
2566
|
));
|
|
2047
2567
|
}
|
|
2048
2568
|
};
|
|
2049
|
-
var
|
|
2569
|
+
var alternate_2 = ($$anchor12) => {
|
|
2050
2570
|
var fragment_31 = $.comment();
|
|
2051
2571
|
var node_11 = $.first_child(fragment_31);
|
|
2052
2572
|
{
|
|
@@ -2078,45 +2598,48 @@ function Annotations($$anchor, $$props) {
|
|
|
2078
2598
|
});
|
|
2079
2599
|
}
|
|
2080
2600
|
};
|
|
2081
|
-
let $0 = $.derived(() =>
|
|
2082
|
-
var _a;
|
|
2083
|
-
return (((_a = $.get(tool)) == null ? void 0 : _a.interaction.isDraggable) ?? true) && !$.get(isEditing);
|
|
2084
|
-
});
|
|
2601
|
+
let $0 = $.derived(() => $.get(isSelected) && !$.get(isMultiSelected));
|
|
2085
2602
|
let $1 = $.derived(() => {
|
|
2086
2603
|
var _a;
|
|
2087
|
-
return ((_a = $.get(tool)) == null ? void 0 : _a.interaction.
|
|
2604
|
+
return (((_a = $.get(tool)) == null ? void 0 : _a.interaction.isDraggable) ?? true) && !$.get(isEditing) && !$.get(isMultiSelected);
|
|
2088
2605
|
});
|
|
2089
2606
|
let $2 = $.derived(() => {
|
|
2607
|
+
var _a;
|
|
2608
|
+
return (((_a = $.get(tool)) == null ? void 0 : _a.interaction.isResizable) ?? true) && !$.get(isMultiSelected);
|
|
2609
|
+
});
|
|
2610
|
+
let $3 = $.derived(() => {
|
|
2090
2611
|
var _a;
|
|
2091
2612
|
return ((_a = $.get(tool)) == null ? void 0 : _a.interaction.lockAspectRatio) ?? false;
|
|
2092
2613
|
});
|
|
2093
|
-
let $
|
|
2614
|
+
let $4 = $.derived(() => $.get(isMultiSelected) ? void 0 : $$props.selectionMenu);
|
|
2615
|
+
let $5 = $.derived(() => $.get(isMultiSelected) ? void 0 : $$props.selectionMenuSnippet);
|
|
2616
|
+
let $6 = $.derived(() => blendModeToCss($.get(annotation).object.blendMode ?? PdfBlendMode.Normal));
|
|
2094
2617
|
AnnotationContainer($$anchor13, $.spread_props(
|
|
2095
2618
|
{
|
|
2096
2619
|
get trackedAnnotation() {
|
|
2097
2620
|
return $.get(annotation);
|
|
2098
2621
|
},
|
|
2099
2622
|
get isSelected() {
|
|
2100
|
-
return $.get(
|
|
2623
|
+
return $.get($0);
|
|
2101
2624
|
},
|
|
2102
2625
|
get isDraggable() {
|
|
2103
|
-
return $.get($
|
|
2626
|
+
return $.get($1);
|
|
2104
2627
|
},
|
|
2105
2628
|
get isResizable() {
|
|
2106
|
-
return $.get($
|
|
2629
|
+
return $.get($2);
|
|
2107
2630
|
},
|
|
2108
2631
|
get lockAspectRatio() {
|
|
2109
|
-
return $.get($
|
|
2632
|
+
return $.get($3);
|
|
2110
2633
|
},
|
|
2111
2634
|
get selectionMenu() {
|
|
2112
|
-
return
|
|
2635
|
+
return $.get($4);
|
|
2113
2636
|
},
|
|
2114
2637
|
get selectionMenuSnippet() {
|
|
2115
|
-
return
|
|
2638
|
+
return $.get($5);
|
|
2116
2639
|
},
|
|
2117
2640
|
onSelect: (e) => handleClick(e, $.get(annotation)),
|
|
2118
2641
|
get style() {
|
|
2119
|
-
return `mix-blend-mode: ${$.get($
|
|
2642
|
+
return `mix-blend-mode: ${$.get($6) ?? ""}`;
|
|
2120
2643
|
},
|
|
2121
2644
|
onDoubleClick: (e) => {
|
|
2122
2645
|
e.stopPropagation();
|
|
@@ -2128,7 +2651,7 @@ function Annotations($$anchor, $$props) {
|
|
|
2128
2651
|
));
|
|
2129
2652
|
}
|
|
2130
2653
|
};
|
|
2131
|
-
var
|
|
2654
|
+
var alternate_1 = ($$anchor13) => {
|
|
2132
2655
|
var fragment_34 = $.comment();
|
|
2133
2656
|
var node_12 = $.first_child(fragment_34);
|
|
2134
2657
|
{
|
|
@@ -2154,40 +2677,43 @@ function Annotations($$anchor, $$props) {
|
|
|
2154
2677
|
onClick: (e) => handleClick(e, $.get(annotation))
|
|
2155
2678
|
});
|
|
2156
2679
|
};
|
|
2157
|
-
let $0 = $.derived(() =>
|
|
2158
|
-
var _a;
|
|
2159
|
-
return ((_a = $.get(tool)) == null ? void 0 : _a.interaction.isDraggable) ?? true;
|
|
2160
|
-
});
|
|
2680
|
+
let $0 = $.derived(() => $.get(isSelected) && !$.get(isMultiSelected));
|
|
2161
2681
|
let $1 = $.derived(() => {
|
|
2162
2682
|
var _a;
|
|
2163
|
-
return ((_a = $.get(tool)) == null ? void 0 : _a.interaction.
|
|
2683
|
+
return (((_a = $.get(tool)) == null ? void 0 : _a.interaction.isDraggable) ?? true) && !$.get(isMultiSelected);
|
|
2164
2684
|
});
|
|
2165
2685
|
let $2 = $.derived(() => {
|
|
2686
|
+
var _a;
|
|
2687
|
+
return (((_a = $.get(tool)) == null ? void 0 : _a.interaction.isResizable) ?? true) && !$.get(isMultiSelected);
|
|
2688
|
+
});
|
|
2689
|
+
let $3 = $.derived(() => {
|
|
2166
2690
|
var _a;
|
|
2167
2691
|
return ((_a = $.get(tool)) == null ? void 0 : _a.interaction.lockAspectRatio) ?? false;
|
|
2168
2692
|
});
|
|
2693
|
+
let $4 = $.derived(() => $.get(isMultiSelected) ? void 0 : $$props.selectionMenu);
|
|
2694
|
+
let $5 = $.derived(() => $.get(isMultiSelected) ? void 0 : $$props.selectionMenuSnippet);
|
|
2169
2695
|
AnnotationContainer($$anchor14, $.spread_props(
|
|
2170
2696
|
{
|
|
2171
2697
|
get trackedAnnotation() {
|
|
2172
2698
|
return $.get(annotation);
|
|
2173
2699
|
},
|
|
2174
2700
|
get isSelected() {
|
|
2175
|
-
return $.get(
|
|
2701
|
+
return $.get($0);
|
|
2176
2702
|
},
|
|
2177
2703
|
get isDraggable() {
|
|
2178
|
-
return $.get($
|
|
2704
|
+
return $.get($1);
|
|
2179
2705
|
},
|
|
2180
2706
|
get isResizable() {
|
|
2181
|
-
return $.get($
|
|
2707
|
+
return $.get($2);
|
|
2182
2708
|
},
|
|
2183
2709
|
get lockAspectRatio() {
|
|
2184
|
-
return $.get($
|
|
2710
|
+
return $.get($3);
|
|
2185
2711
|
},
|
|
2186
2712
|
get selectionMenu() {
|
|
2187
|
-
return
|
|
2713
|
+
return $.get($4);
|
|
2188
2714
|
},
|
|
2189
2715
|
get selectionMenuSnippet() {
|
|
2190
|
-
return
|
|
2716
|
+
return $.get($5);
|
|
2191
2717
|
},
|
|
2192
2718
|
onSelect: (e) => handleClick(e, $.get(annotation)),
|
|
2193
2719
|
get style() {
|
|
@@ -2199,10 +2725,75 @@ function Annotations($$anchor, $$props) {
|
|
|
2199
2725
|
));
|
|
2200
2726
|
}
|
|
2201
2727
|
};
|
|
2728
|
+
var alternate = ($$anchor14) => {
|
|
2729
|
+
var fragment_37 = $.comment();
|
|
2730
|
+
var node_13 = $.first_child(fragment_37);
|
|
2731
|
+
{
|
|
2732
|
+
var consequent_12 = ($$anchor15) => {
|
|
2733
|
+
const hasIRT = $.derived(() => !!$.get(annotation).object.inReplyToId);
|
|
2734
|
+
{
|
|
2735
|
+
const children = ($$anchor16, obj = $.noop) => {
|
|
2736
|
+
Link($$anchor16, $.spread_props(obj, {
|
|
2737
|
+
get isSelected() {
|
|
2738
|
+
return $.get(isSelected);
|
|
2739
|
+
},
|
|
2740
|
+
get scale() {
|
|
2741
|
+
return $$props.scale;
|
|
2742
|
+
},
|
|
2743
|
+
onClick: (e) => handleLinkClick(e, $.get(annotation)),
|
|
2744
|
+
get hasIRT() {
|
|
2745
|
+
return $.get(hasIRT);
|
|
2746
|
+
}
|
|
2747
|
+
}));
|
|
2748
|
+
};
|
|
2749
|
+
let $0 = $.derived(() => $.get(isSelected) && !$.get(isMultiSelected));
|
|
2750
|
+
let $1 = $.derived(() => $.get(hasIRT) ? void 0 : $.get(isMultiSelected) ? void 0 : $$props.selectionMenu);
|
|
2751
|
+
let $2 = $.derived(() => $.get(hasIRT) ? void 0 : $.get(isMultiSelected) ? void 0 : $$props.selectionMenuSnippet);
|
|
2752
|
+
AnnotationContainer($$anchor15, $.spread_props(
|
|
2753
|
+
{
|
|
2754
|
+
get trackedAnnotation() {
|
|
2755
|
+
return $.get(annotation);
|
|
2756
|
+
},
|
|
2757
|
+
get isSelected() {
|
|
2758
|
+
return $.get($0);
|
|
2759
|
+
},
|
|
2760
|
+
get isMultiSelected() {
|
|
2761
|
+
return $.get(isMultiSelected);
|
|
2762
|
+
},
|
|
2763
|
+
isDraggable: false,
|
|
2764
|
+
isResizable: false,
|
|
2765
|
+
lockAspectRatio: false,
|
|
2766
|
+
get selectionMenu() {
|
|
2767
|
+
return $.get($1);
|
|
2768
|
+
},
|
|
2769
|
+
get selectionMenuSnippet() {
|
|
2770
|
+
return $.get($2);
|
|
2771
|
+
},
|
|
2772
|
+
onSelect: (e) => handleLinkClick(e, $.get(annotation)),
|
|
2773
|
+
get style() {
|
|
2774
|
+
return `mix-blend-mode: ${$.get(mixBlendMode) ?? ""}`;
|
|
2775
|
+
}
|
|
2776
|
+
},
|
|
2777
|
+
() => annotationsProps,
|
|
2778
|
+
{ children, $$slots: { default: true } }
|
|
2779
|
+
));
|
|
2780
|
+
}
|
|
2781
|
+
};
|
|
2782
|
+
$.if(
|
|
2783
|
+
node_13,
|
|
2784
|
+
($$render) => {
|
|
2785
|
+
if (isLink($.get(annotation))) $$render(consequent_12);
|
|
2786
|
+
},
|
|
2787
|
+
true
|
|
2788
|
+
);
|
|
2789
|
+
}
|
|
2790
|
+
$.append($$anchor14, fragment_37);
|
|
2791
|
+
};
|
|
2202
2792
|
$.if(
|
|
2203
2793
|
node_12,
|
|
2204
2794
|
($$render) => {
|
|
2205
2795
|
if (isStamp($.get(annotation))) $$render(consequent_11);
|
|
2796
|
+
else $$render(alternate, false);
|
|
2206
2797
|
},
|
|
2207
2798
|
true
|
|
2208
2799
|
);
|
|
@@ -2213,7 +2804,7 @@ function Annotations($$anchor, $$props) {
|
|
|
2213
2804
|
node_11,
|
|
2214
2805
|
($$render) => {
|
|
2215
2806
|
if (isFreeText($.get(annotation))) $$render(consequent_10);
|
|
2216
|
-
else $$render(
|
|
2807
|
+
else $$render(alternate_1, false);
|
|
2217
2808
|
},
|
|
2218
2809
|
true
|
|
2219
2810
|
);
|
|
@@ -2224,7 +2815,7 @@ function Annotations($$anchor, $$props) {
|
|
|
2224
2815
|
node_10,
|
|
2225
2816
|
($$render) => {
|
|
2226
2817
|
if (isPolygon($.get(annotation))) $$render(consequent_9);
|
|
2227
|
-
else $$render(
|
|
2818
|
+
else $$render(alternate_2, false);
|
|
2228
2819
|
},
|
|
2229
2820
|
true
|
|
2230
2821
|
);
|
|
@@ -2235,7 +2826,7 @@ function Annotations($$anchor, $$props) {
|
|
|
2235
2826
|
node_9,
|
|
2236
2827
|
($$render) => {
|
|
2237
2828
|
if (isPolyline($.get(annotation))) $$render(consequent_8);
|
|
2238
|
-
else $$render(
|
|
2829
|
+
else $$render(alternate_3, false);
|
|
2239
2830
|
},
|
|
2240
2831
|
true
|
|
2241
2832
|
);
|
|
@@ -2246,7 +2837,7 @@ function Annotations($$anchor, $$props) {
|
|
|
2246
2837
|
node_8,
|
|
2247
2838
|
($$render) => {
|
|
2248
2839
|
if (isLine($.get(annotation))) $$render(consequent_7);
|
|
2249
|
-
else $$render(
|
|
2840
|
+
else $$render(alternate_4, false);
|
|
2250
2841
|
},
|
|
2251
2842
|
true
|
|
2252
2843
|
);
|
|
@@ -2257,7 +2848,7 @@ function Annotations($$anchor, $$props) {
|
|
|
2257
2848
|
node_7,
|
|
2258
2849
|
($$render) => {
|
|
2259
2850
|
if (isHighlight($.get(annotation))) $$render(consequent_6);
|
|
2260
|
-
else $$render(
|
|
2851
|
+
else $$render(alternate_5, false);
|
|
2261
2852
|
},
|
|
2262
2853
|
true
|
|
2263
2854
|
);
|
|
@@ -2268,7 +2859,7 @@ function Annotations($$anchor, $$props) {
|
|
|
2268
2859
|
node_6,
|
|
2269
2860
|
($$render) => {
|
|
2270
2861
|
if (isSquiggly($.get(annotation))) $$render(consequent_5);
|
|
2271
|
-
else $$render(
|
|
2862
|
+
else $$render(alternate_6, false);
|
|
2272
2863
|
},
|
|
2273
2864
|
true
|
|
2274
2865
|
);
|
|
@@ -2279,7 +2870,7 @@ function Annotations($$anchor, $$props) {
|
|
|
2279
2870
|
node_5,
|
|
2280
2871
|
($$render) => {
|
|
2281
2872
|
if (isStrikeout($.get(annotation))) $$render(consequent_4);
|
|
2282
|
-
else $$render(
|
|
2873
|
+
else $$render(alternate_7, false);
|
|
2283
2874
|
},
|
|
2284
2875
|
true
|
|
2285
2876
|
);
|
|
@@ -2290,7 +2881,7 @@ function Annotations($$anchor, $$props) {
|
|
|
2290
2881
|
node_4,
|
|
2291
2882
|
($$render) => {
|
|
2292
2883
|
if (isUnderline($.get(annotation))) $$render(consequent_3);
|
|
2293
|
-
else $$render(
|
|
2884
|
+
else $$render(alternate_8, false);
|
|
2294
2885
|
},
|
|
2295
2886
|
true
|
|
2296
2887
|
);
|
|
@@ -2301,7 +2892,7 @@ function Annotations($$anchor, $$props) {
|
|
|
2301
2892
|
node_3,
|
|
2302
2893
|
($$render) => {
|
|
2303
2894
|
if (isCircle($.get(annotation))) $$render(consequent_2);
|
|
2304
|
-
else $$render(
|
|
2895
|
+
else $$render(alternate_9, false);
|
|
2305
2896
|
},
|
|
2306
2897
|
true
|
|
2307
2898
|
);
|
|
@@ -2312,7 +2903,7 @@ function Annotations($$anchor, $$props) {
|
|
|
2312
2903
|
node_2,
|
|
2313
2904
|
($$render) => {
|
|
2314
2905
|
if (isSquare($.get(annotation))) $$render(consequent_1);
|
|
2315
|
-
else $$render(
|
|
2906
|
+
else $$render(alternate_10, false);
|
|
2316
2907
|
},
|
|
2317
2908
|
true
|
|
2318
2909
|
);
|
|
@@ -2321,11 +2912,60 @@ function Annotations($$anchor, $$props) {
|
|
|
2321
2912
|
};
|
|
2322
2913
|
$.if(node_1, ($$render) => {
|
|
2323
2914
|
if (isInk($.get(annotation))) $$render(consequent);
|
|
2324
|
-
else $$render(
|
|
2915
|
+
else $$render(alternate_11, false);
|
|
2325
2916
|
});
|
|
2326
2917
|
}
|
|
2327
2918
|
$.append($$anchor2, fragment_1);
|
|
2328
2919
|
});
|
|
2920
|
+
var node_14 = $.sibling(node, 2);
|
|
2921
|
+
{
|
|
2922
|
+
var consequent_13 = ($$anchor2) => {
|
|
2923
|
+
GroupSelectionBox($$anchor2, {
|
|
2924
|
+
get documentId() {
|
|
2925
|
+
return $$props.documentId;
|
|
2926
|
+
},
|
|
2927
|
+
get pageIndex() {
|
|
2928
|
+
return $$props.pageIndex;
|
|
2929
|
+
},
|
|
2930
|
+
get scale() {
|
|
2931
|
+
return $$props.scale;
|
|
2932
|
+
},
|
|
2933
|
+
get rotation() {
|
|
2934
|
+
return $$props.rotation;
|
|
2935
|
+
},
|
|
2936
|
+
get pageWidth() {
|
|
2937
|
+
return $$props.pageWidth;
|
|
2938
|
+
},
|
|
2939
|
+
get pageHeight() {
|
|
2940
|
+
return $$props.pageHeight;
|
|
2941
|
+
},
|
|
2942
|
+
get selectedAnnotations() {
|
|
2943
|
+
return $.get(selectedAnnotationsOnPage);
|
|
2944
|
+
},
|
|
2945
|
+
get isDraggable() {
|
|
2946
|
+
return $.get(areAllSelectedDraggable);
|
|
2947
|
+
},
|
|
2948
|
+
get isResizable() {
|
|
2949
|
+
return $.get(areAllSelectedResizable);
|
|
2950
|
+
},
|
|
2951
|
+
get resizeUI() {
|
|
2952
|
+
return $$props.resizeUI;
|
|
2953
|
+
},
|
|
2954
|
+
get selectionOutlineColor() {
|
|
2955
|
+
return $$props.selectionOutlineColor;
|
|
2956
|
+
},
|
|
2957
|
+
get groupSelectionMenu() {
|
|
2958
|
+
return $$props.groupSelectionMenu;
|
|
2959
|
+
},
|
|
2960
|
+
get groupSelectionMenuSnippet() {
|
|
2961
|
+
return $$props.groupSelectionMenuSnippet;
|
|
2962
|
+
}
|
|
2963
|
+
});
|
|
2964
|
+
};
|
|
2965
|
+
$.if(node_14, ($$render) => {
|
|
2966
|
+
if ($.get(allSelectedOnSamePage) && $.get(selectedAnnotationsOnPage).length >= 2) $$render(consequent_13);
|
|
2967
|
+
});
|
|
2968
|
+
}
|
|
2329
2969
|
$.append($$anchor, fragment);
|
|
2330
2970
|
$.pop();
|
|
2331
2971
|
}
|
|
@@ -2376,14 +3016,14 @@ function TextMarkup($$anchor, $$props) {
|
|
|
2376
3016
|
{
|
|
2377
3017
|
let $0 = $.derived(() => {
|
|
2378
3018
|
var _a;
|
|
2379
|
-
return (_a = $.get(activeTool).defaults) == null ? void 0 : _a.
|
|
3019
|
+
return (_a = $.get(activeTool).defaults) == null ? void 0 : _a.strokeColor;
|
|
2380
3020
|
});
|
|
2381
3021
|
let $1 = $.derived(() => {
|
|
2382
3022
|
var _a;
|
|
2383
3023
|
return (_a = $.get(activeTool).defaults) == null ? void 0 : _a.opacity;
|
|
2384
3024
|
});
|
|
2385
3025
|
Underline(node_2, {
|
|
2386
|
-
get
|
|
3026
|
+
get strokeColor() {
|
|
2387
3027
|
return $.get($0);
|
|
2388
3028
|
},
|
|
2389
3029
|
get opacity() {
|
|
@@ -2417,14 +3057,14 @@ function TextMarkup($$anchor, $$props) {
|
|
|
2417
3057
|
{
|
|
2418
3058
|
let $0 = $.derived(() => {
|
|
2419
3059
|
var _a;
|
|
2420
|
-
return (_a = $.get(activeTool).defaults) == null ? void 0 : _a.
|
|
3060
|
+
return (_a = $.get(activeTool).defaults) == null ? void 0 : _a.strokeColor;
|
|
2421
3061
|
});
|
|
2422
3062
|
let $1 = $.derived(() => {
|
|
2423
3063
|
var _a;
|
|
2424
3064
|
return (_a = $.get(activeTool).defaults) == null ? void 0 : _a.opacity;
|
|
2425
3065
|
});
|
|
2426
3066
|
Highlight(node_4, {
|
|
2427
|
-
get
|
|
3067
|
+
get strokeColor() {
|
|
2428
3068
|
return $.get($0);
|
|
2429
3069
|
},
|
|
2430
3070
|
get opacity() {
|
|
@@ -2458,14 +3098,14 @@ function TextMarkup($$anchor, $$props) {
|
|
|
2458
3098
|
{
|
|
2459
3099
|
let $0 = $.derived(() => {
|
|
2460
3100
|
var _a;
|
|
2461
|
-
return (_a = $.get(activeTool).defaults) == null ? void 0 : _a.
|
|
3101
|
+
return (_a = $.get(activeTool).defaults) == null ? void 0 : _a.strokeColor;
|
|
2462
3102
|
});
|
|
2463
3103
|
let $1 = $.derived(() => {
|
|
2464
3104
|
var _a;
|
|
2465
3105
|
return (_a = $.get(activeTool).defaults) == null ? void 0 : _a.opacity;
|
|
2466
3106
|
});
|
|
2467
3107
|
Strikeout(node_6, {
|
|
2468
|
-
get
|
|
3108
|
+
get strokeColor() {
|
|
2469
3109
|
return $.get($0);
|
|
2470
3110
|
},
|
|
2471
3111
|
get opacity() {
|
|
@@ -2499,14 +3139,14 @@ function TextMarkup($$anchor, $$props) {
|
|
|
2499
3139
|
{
|
|
2500
3140
|
let $0 = $.derived(() => {
|
|
2501
3141
|
var _a;
|
|
2502
|
-
return (_a = $.get(activeTool).defaults) == null ? void 0 : _a.
|
|
3142
|
+
return (_a = $.get(activeTool).defaults) == null ? void 0 : _a.strokeColor;
|
|
2503
3143
|
});
|
|
2504
3144
|
let $1 = $.derived(() => {
|
|
2505
3145
|
var _a;
|
|
2506
3146
|
return (_a = $.get(activeTool).defaults) == null ? void 0 : _a.opacity;
|
|
2507
3147
|
});
|
|
2508
3148
|
Squiggly(node_8, {
|
|
2509
|
-
get
|
|
3149
|
+
get strokeColor() {
|
|
2510
3150
|
return $.get($0);
|
|
2511
3151
|
},
|
|
2512
3152
|
get opacity() {
|
|
@@ -2963,6 +3603,8 @@ function AnnotationLayer($$anchor, $$props) {
|
|
|
2963
3603
|
"rotation",
|
|
2964
3604
|
"selectionMenu",
|
|
2965
3605
|
"selectionMenuSnippet",
|
|
3606
|
+
"groupSelectionMenu",
|
|
3607
|
+
"groupSelectionMenuSnippet",
|
|
2966
3608
|
"resizeUI",
|
|
2967
3609
|
"vertexUI",
|
|
2968
3610
|
"selectionOutlineColor",
|
|
@@ -3004,6 +3646,12 @@ function AnnotationLayer($$anchor, $$props) {
|
|
|
3004
3646
|
get selectionMenuSnippet() {
|
|
3005
3647
|
return $$props.selectionMenuSnippet;
|
|
3006
3648
|
},
|
|
3649
|
+
get groupSelectionMenu() {
|
|
3650
|
+
return $$props.groupSelectionMenu;
|
|
3651
|
+
},
|
|
3652
|
+
get groupSelectionMenuSnippet() {
|
|
3653
|
+
return $$props.groupSelectionMenuSnippet;
|
|
3654
|
+
},
|
|
3007
3655
|
get pageIndex() {
|
|
3008
3656
|
return $$props.pageIndex;
|
|
3009
3657
|
},
|
|
@@ -3067,9 +3715,11 @@ export {
|
|
|
3067
3715
|
Annotations,
|
|
3068
3716
|
Circle,
|
|
3069
3717
|
FreeText,
|
|
3718
|
+
GroupSelectionBox,
|
|
3070
3719
|
Highlight,
|
|
3071
3720
|
Ink,
|
|
3072
3721
|
Line,
|
|
3722
|
+
Link,
|
|
3073
3723
|
Polygon,
|
|
3074
3724
|
Polyline,
|
|
3075
3725
|
PreviewRenderer,
|