@embedpdf/plugin-annotation 2.9.1 → 2.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3086 -2654
- package/dist/index.js.map +1 -1
- package/dist/lib/actions.d.ts +25 -6
- package/dist/lib/annotation-plugin.d.ts +16 -12
- package/dist/lib/handlers/index.d.ts +1 -0
- package/dist/lib/handlers/link.handler.d.ts +3 -0
- package/dist/lib/handlers/types.d.ts +9 -1
- package/dist/lib/helpers.d.ts +12 -5
- package/dist/lib/index.d.ts +4 -0
- package/dist/lib/reducer.d.ts +1 -1
- package/dist/lib/tools/default-tools.d.ts +147 -301
- package/dist/lib/tools/tools-utils.d.ts +448 -22
- package/dist/lib/tools/types.d.ts +35 -2
- package/dist/lib/types.d.ts +105 -24
- package/dist/preact/index.cjs +1 -1
- package/dist/preact/index.cjs.map +1 -1
- package/dist/preact/index.js +192 -87
- package/dist/preact/index.js.map +1 -1
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.js +192 -87
- package/dist/react/index.js.map +1 -1
- package/dist/shared/components/annotation-navigation-handler.d.ts +1 -0
- package/dist/shared/components/annotations/link-locked.d.ts +3 -0
- package/dist/shared/components/annotations/stamp.d.ts +1 -1
- package/dist/shared/components/preview-renderer.d.ts +4 -3
- package/dist/shared/components/types.d.ts +21 -4
- package/dist/shared/hooks/index.d.ts +1 -0
- package/dist/shared/hooks/use-annotation.d.ts +2 -2
- package/dist/shared/hooks/use-ios-zoom-prevention.d.ts +16 -0
- package/dist/shared-preact/components/annotation-navigation-handler.d.ts +1 -0
- package/dist/shared-preact/components/annotations/link-locked.d.ts +3 -0
- package/dist/shared-preact/components/annotations/stamp.d.ts +1 -1
- package/dist/shared-preact/components/preview-renderer.d.ts +4 -3
- package/dist/shared-preact/components/types.d.ts +21 -4
- package/dist/shared-preact/hooks/index.d.ts +1 -0
- package/dist/shared-preact/hooks/use-annotation.d.ts +2 -2
- package/dist/shared-preact/hooks/use-ios-zoom-prevention.d.ts +15 -0
- package/dist/shared-react/components/annotation-navigation-handler.d.ts +1 -0
- package/dist/shared-react/components/annotations/link-locked.d.ts +3 -0
- package/dist/shared-react/components/annotations/stamp.d.ts +1 -1
- package/dist/shared-react/components/preview-renderer.d.ts +4 -3
- package/dist/shared-react/components/types.d.ts +21 -4
- package/dist/shared-react/hooks/index.d.ts +1 -0
- package/dist/shared-react/hooks/use-annotation.d.ts +2 -2
- package/dist/shared-react/hooks/use-ios-zoom-prevention.d.ts +16 -0
- package/dist/svelte/components/AnnotationNavigationHandler.svelte.d.ts +3 -0
- package/dist/svelte/components/PreviewRenderer.svelte.d.ts +3 -2
- package/dist/svelte/components/annotations/LinkLockedMode.svelte.d.ts +5 -0
- package/dist/svelte/components/annotations/LinkPreview.svelte.d.ts +10 -0
- package/dist/svelte/components/annotations/Stamp.svelte.d.ts +1 -1
- package/dist/svelte/context/renderer-registry.svelte.d.ts +1 -1
- package/dist/svelte/context/types.d.ts +20 -3
- package/dist/svelte/hooks/index.d.ts +1 -0
- package/dist/svelte/hooks/use-annotation.svelte.d.ts +1 -1
- package/dist/svelte/hooks/use-ios-zoom-prevention.svelte.d.ts +6 -0
- package/dist/svelte/index.cjs +1 -1
- package/dist/svelte/index.cjs.map +1 -1
- package/dist/svelte/index.js +401 -228
- package/dist/svelte/index.js.map +1 -1
- package/dist/vue/components/annotation-navigation-handler.vue.d.ts +3 -0
- package/dist/vue/components/annotations/link-locked.vue.d.ts +5 -0
- package/dist/vue/components/annotations/link-preview.vue.d.ts +10 -0
- package/dist/vue/components/annotations/stamp.vue.d.ts +2 -2
- package/dist/vue/components/preview-renderer.vue.d.ts +3 -2
- package/dist/vue/context/renderer-registry.d.ts +1 -1
- package/dist/vue/context/types.d.ts +20 -3
- package/dist/vue/hooks/index.d.ts +1 -0
- package/dist/vue/hooks/use-annotation.d.ts +24 -2
- package/dist/vue/hooks/use-ios-zoom-prevention.d.ts +7 -0
- package/dist/vue/index.cjs +1 -1
- package/dist/vue/index.cjs.map +1 -1
- package/dist/vue/index.js +402 -262
- package/dist/vue/index.js.map +1 -1
- package/package.json +12 -10
package/dist/vue/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { createPluginPackage } from "@embedpdf/core";
|
|
2
|
-
import { AnnotationPlugin, initialDocumentState, inferRotationCenterFromRects, generateCloudyRectanglePath, generateCloudyEllipsePath, patching, generateCloudyPolygonPath, resolveInteractionProp, getAnnotationsByPageIndex, getSelectedAnnotationIds, AnnotationPluginPackage as AnnotationPluginPackage$1 } from "@embedpdf/plugin-annotation";
|
|
2
|
+
import { AnnotationPlugin, initialDocumentState, inferRotationCenterFromRects, generateCloudyRectanglePath, generateCloudyEllipsePath, patching, generateCloudyPolygonPath, LockModeType, getAnnotationCategories, hasLockedFlag, isCategoryLocked, resolveInteractionProp, getAnnotationsByPageIndex, getSelectedAnnotationIds, AnnotationPluginPackage as AnnotationPluginPackage$1 } from "@embedpdf/plugin-annotation";
|
|
3
3
|
export * from "@embedpdf/plugin-annotation";
|
|
4
|
-
import { defineComponent, ref, watchEffect, openBlock, createElementBlock, normalizeStyle, createCommentVNode, toValue, watch, computed, shallowRef, toRaw, useSlots, createElementVNode, renderSlot, createBlock, Fragment, unref, normalizeProps, mergeProps, renderList, withCtx, resolveDynamicComponent, Teleport, toDisplayString, markRaw, provide, inject, onUnmounted,
|
|
4
|
+
import { defineComponent, ref, watchEffect, openBlock, createElementBlock, normalizeStyle, createCommentVNode, toValue, watch, computed, shallowRef, toRaw, useSlots, createElementVNode, renderSlot, createBlock, Fragment, unref, normalizeProps, mergeProps, renderList, withCtx, resolveDynamicComponent, Teleport, toDisplayString, markRaw, provide, inject, onUnmounted, nextTick, createVNode, createSlots, guardReactiveProps, onMounted } from "vue";
|
|
5
5
|
import { getCounterRotation } from "@embedpdf/utils";
|
|
6
6
|
import { useInteractionHandles, useDoublePressProps, CounterRotate, deepToRaw } from "@embedpdf/utils/vue";
|
|
7
|
-
import {
|
|
7
|
+
import { usePlugin, useCapability, useDocumentPermissions, useDocumentState } from "@embedpdf/core/vue";
|
|
8
8
|
import { boundingRectOrEmpty, PdfAnnotationBorderStyle, PdfVerticalAlignment, textAlignmentToCss, standardFontCssProperties, ignore, PdfErrorCode, getContrastStrokeColor, PdfBlendMode, PdfAnnotationSubtype, blendModeToCss } from "@embedpdf/models";
|
|
9
9
|
import { usePointerHandlers } from "@embedpdf/plugin-interaction-manager/vue";
|
|
10
10
|
import { useSelectionCapability } from "@embedpdf/plugin-selection/vue";
|
|
11
|
-
const _hoisted_1$
|
|
12
|
-
const _sfc_main$
|
|
11
|
+
const _hoisted_1$e = ["src"];
|
|
12
|
+
const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
13
13
|
__name: "appearance-image",
|
|
14
14
|
props: {
|
|
15
15
|
appearance: {},
|
|
@@ -52,7 +52,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
|
52
52
|
userSelect: "none",
|
|
53
53
|
...__props.style
|
|
54
54
|
})
|
|
55
|
-
}, null, 44, _hoisted_1$
|
|
55
|
+
}, null, 44, _hoisted_1$e)) : createCommentVNode("", true);
|
|
56
56
|
};
|
|
57
57
|
}
|
|
58
58
|
});
|
|
@@ -86,13 +86,46 @@ const useAnnotation = (documentId) => {
|
|
|
86
86
|
})
|
|
87
87
|
};
|
|
88
88
|
};
|
|
89
|
-
const
|
|
89
|
+
const MIN_IOS_FOCUS_FONT_PX = 16;
|
|
90
|
+
function detectIOS() {
|
|
91
|
+
try {
|
|
92
|
+
const nav = navigator;
|
|
93
|
+
return /iPad|iPhone|iPod/.test(navigator.userAgent) || navigator.platform === "MacIntel" && (nav == null ? void 0 : nav.maxTouchPoints) > 1;
|
|
94
|
+
} catch {
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
let _isIOS;
|
|
99
|
+
function getIsIOS() {
|
|
100
|
+
if (_isIOS === void 0) {
|
|
101
|
+
_isIOS = detectIOS();
|
|
102
|
+
}
|
|
103
|
+
return _isIOS;
|
|
104
|
+
}
|
|
105
|
+
function useIOSZoomPrevention(computedFontPx, active) {
|
|
106
|
+
const isIOS = getIsIOS();
|
|
107
|
+
return computed(() => {
|
|
108
|
+
const px = toValue(computedFontPx);
|
|
109
|
+
const isActive = toValue(active);
|
|
110
|
+
const needsComp = isIOS && isActive && px > 0 && px < MIN_IOS_FOCUS_FONT_PX;
|
|
111
|
+
const adjustedFontPx = needsComp ? MIN_IOS_FOCUS_FONT_PX : px;
|
|
112
|
+
const scaleComp = needsComp ? px / MIN_IOS_FOCUS_FONT_PX : 1;
|
|
113
|
+
const wrapperStyle = needsComp ? {
|
|
114
|
+
width: `${100 / scaleComp}%`,
|
|
115
|
+
height: `${100 / scaleComp}%`,
|
|
116
|
+
transform: `scale(${scaleComp})`,
|
|
117
|
+
transformOrigin: "top left"
|
|
118
|
+
} : void 0;
|
|
119
|
+
return { needsComp, adjustedFontPx, scaleComp, wrapperStyle };
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
const _hoisted_1$d = ["width", "height", "stroke"];
|
|
90
123
|
const _hoisted_2$a = ["width", "height", "stroke"];
|
|
91
|
-
const __default__$
|
|
124
|
+
const __default__$f = {
|
|
92
125
|
inheritAttrs: false
|
|
93
126
|
};
|
|
94
|
-
const _sfc_main$
|
|
95
|
-
...__default__$
|
|
127
|
+
const _sfc_main$F = /* @__PURE__ */ defineComponent({
|
|
128
|
+
...__default__$f,
|
|
96
129
|
__name: "annotation-container",
|
|
97
130
|
props: {
|
|
98
131
|
scale: {},
|
|
@@ -656,7 +689,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
|
656
689
|
annotation: childObject.value,
|
|
657
690
|
appearanceActive: apActive.value
|
|
658
691
|
}),
|
|
659
|
-
((_a = __props.appearance) == null ? void 0 : _a.normal) ? (openBlock(), createBlock(_sfc_main$
|
|
692
|
+
((_a = __props.appearance) == null ? void 0 : _a.normal) ? (openBlock(), createBlock(_sfc_main$G, {
|
|
660
693
|
key: 0,
|
|
661
694
|
appearance: __props.appearance.normal,
|
|
662
695
|
style: normalizeStyle({ display: apActive.value ? "block" : "none" })
|
|
@@ -705,7 +738,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
|
705
738
|
}, [..._cache[2] || (_cache[2] = [
|
|
706
739
|
createElementVNode("path", { d: "M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8" }, null, -1),
|
|
707
740
|
createElementVNode("path", { d: "M21 3v5h-5" }, null, -1)
|
|
708
|
-
])], 8, _hoisted_1$
|
|
741
|
+
])], 8, _hoisted_1$d))
|
|
709
742
|
], 16)
|
|
710
743
|
]) : (openBlock(), createElementBlock("div", mergeProps({ key: 2 }, rotationHandleBindings.value, { style: rotationHandleStyle.value }), [
|
|
711
744
|
(openBlock(), createElementBlock("svg", {
|
|
@@ -840,14 +873,14 @@ function getAnnotationScreenBounds(annotation, scale, rotation) {
|
|
|
840
873
|
bottom: top + maxY
|
|
841
874
|
};
|
|
842
875
|
}
|
|
843
|
-
const _hoisted_1$
|
|
876
|
+
const _hoisted_1$c = {
|
|
844
877
|
key: 0,
|
|
845
878
|
"data-group-selection-box": "",
|
|
846
879
|
"data-no-interaction": ""
|
|
847
880
|
};
|
|
848
881
|
const _hoisted_2$9 = ["width", "height", "stroke"];
|
|
849
882
|
const _hoisted_3$9 = ["width", "height", "stroke"];
|
|
850
|
-
const _sfc_main$
|
|
883
|
+
const _sfc_main$E = /* @__PURE__ */ defineComponent({
|
|
851
884
|
__name: "group-selection-box",
|
|
852
885
|
props: {
|
|
853
886
|
documentId: {},
|
|
@@ -1307,7 +1340,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
|
1307
1340
|
currentRotation: computed(() => liveRotation.value ?? 0)
|
|
1308
1341
|
});
|
|
1309
1342
|
return (_ctx, _cache) => {
|
|
1310
|
-
return __props.selectedAnnotations.length >= 2 ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
1343
|
+
return __props.selectedAnnotations.length >= 2 ? (openBlock(), createElementBlock("div", _hoisted_1$c, [
|
|
1311
1344
|
createElementVNode("div", {
|
|
1312
1345
|
style: normalizeStyle(outerStyle.value)
|
|
1313
1346
|
}, [
|
|
@@ -1466,14 +1499,79 @@ function createRenderer(entry) {
|
|
|
1466
1499
|
isDraggable: entry.isDraggable,
|
|
1467
1500
|
onDoubleClick: entry.onDoubleClick,
|
|
1468
1501
|
selectOverride: entry.selectOverride,
|
|
1469
|
-
hideSelectionMenu: entry.hideSelectionMenu
|
|
1502
|
+
hideSelectionMenu: entry.hideSelectionMenu,
|
|
1503
|
+
renderPreview: entry.renderPreview ? markRaw(entry.renderPreview) : void 0,
|
|
1504
|
+
hiddenWhenLocked: entry.hiddenWhenLocked,
|
|
1505
|
+
renderLocked: entry.renderLocked ? markRaw(entry.renderLocked) : void 0
|
|
1470
1506
|
};
|
|
1471
1507
|
}
|
|
1472
|
-
const
|
|
1508
|
+
const __default__$e = { inheritAttrs: false };
|
|
1509
|
+
const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
1510
|
+
...__default__$e,
|
|
1511
|
+
__name: "link-locked",
|
|
1512
|
+
props: {
|
|
1513
|
+
annotation: {},
|
|
1514
|
+
currentObject: {},
|
|
1515
|
+
isSelected: { type: Boolean },
|
|
1516
|
+
isEditing: { type: Boolean },
|
|
1517
|
+
scale: {},
|
|
1518
|
+
pageIndex: {},
|
|
1519
|
+
documentId: {},
|
|
1520
|
+
onClick: { type: Function },
|
|
1521
|
+
appearanceActive: { type: Boolean }
|
|
1522
|
+
},
|
|
1523
|
+
setup(__props) {
|
|
1524
|
+
const props = __props;
|
|
1525
|
+
const { provides } = useAnnotationCapability();
|
|
1526
|
+
const handleClick = () => {
|
|
1527
|
+
const target = props.annotation.object.target;
|
|
1528
|
+
if (!target || !provides.value) return;
|
|
1529
|
+
provides.value.forDocument(props.documentId).navigateTarget(target);
|
|
1530
|
+
};
|
|
1531
|
+
return (_ctx, _cache) => {
|
|
1532
|
+
return openBlock(), createElementBlock("div", {
|
|
1533
|
+
onClick: handleClick,
|
|
1534
|
+
style: {
|
|
1535
|
+
width: "100%",
|
|
1536
|
+
height: "100%",
|
|
1537
|
+
cursor: "pointer",
|
|
1538
|
+
pointerEvents: "auto"
|
|
1539
|
+
}
|
|
1540
|
+
});
|
|
1541
|
+
};
|
|
1542
|
+
}
|
|
1543
|
+
});
|
|
1544
|
+
const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
1545
|
+
__name: "link-preview",
|
|
1546
|
+
props: {
|
|
1547
|
+
data: {},
|
|
1548
|
+
bounds: {},
|
|
1549
|
+
scale: {}
|
|
1550
|
+
},
|
|
1551
|
+
setup(__props) {
|
|
1552
|
+
const props = __props;
|
|
1553
|
+
const style = computed(() => ({
|
|
1554
|
+
position: "absolute",
|
|
1555
|
+
left: 0,
|
|
1556
|
+
top: 0,
|
|
1557
|
+
width: `${props.bounds.size.width * props.scale}px`,
|
|
1558
|
+
height: `${props.bounds.size.height * props.scale}px`,
|
|
1559
|
+
borderBottom: `${props.data.strokeWidth * props.scale}px solid ${props.data.strokeColor}`,
|
|
1560
|
+
backgroundColor: "rgba(0, 0, 255, 0.05)",
|
|
1561
|
+
boxSizing: "border-box"
|
|
1562
|
+
}));
|
|
1563
|
+
return (_ctx, _cache) => {
|
|
1564
|
+
return openBlock(), createElementBlock("div", {
|
|
1565
|
+
style: normalizeStyle(style.value)
|
|
1566
|
+
}, null, 4);
|
|
1567
|
+
};
|
|
1568
|
+
}
|
|
1569
|
+
});
|
|
1570
|
+
const _hoisted_1$b = ["width", "height", "viewBox"];
|
|
1473
1571
|
const _hoisted_2$8 = ["d", "stroke-width"];
|
|
1474
1572
|
const _hoisted_3$8 = ["d", "opacity"];
|
|
1475
1573
|
const __default__$d = { inheritAttrs: false };
|
|
1476
|
-
const _sfc_main$
|
|
1574
|
+
const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
1477
1575
|
...__default__$d,
|
|
1478
1576
|
__name: "ink",
|
|
1479
1577
|
props: {
|
|
@@ -1531,8 +1629,8 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
|
1531
1629
|
onPointerdown: _cache[0] || (_cache[0] = //@ts-ignore
|
|
1532
1630
|
(...args) => __props.onClick && __props.onClick(...args)),
|
|
1533
1631
|
style: normalizeStyle({
|
|
1534
|
-
cursor: __props.isSelected ? "move" : "pointer",
|
|
1535
|
-
pointerEvents: __props.isSelected ? "none" : "visibleStroke",
|
|
1632
|
+
cursor: __props.isSelected ? "move" : __props.onClick ? "pointer" : "default",
|
|
1633
|
+
pointerEvents: !__props.onClick ? "none" : __props.isSelected ? "none" : "visibleStroke",
|
|
1536
1634
|
strokeLinecap: "round",
|
|
1537
1635
|
strokeLinejoin: "round"
|
|
1538
1636
|
})
|
|
@@ -1553,11 +1651,11 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
|
1553
1651
|
})
|
|
1554
1652
|
}, null, 12, _hoisted_3$8);
|
|
1555
1653
|
}), 128)) : createCommentVNode("", true)
|
|
1556
|
-
], 12, _hoisted_1$
|
|
1654
|
+
], 12, _hoisted_1$b);
|
|
1557
1655
|
};
|
|
1558
1656
|
}
|
|
1559
1657
|
});
|
|
1560
|
-
const _sfc_main$
|
|
1658
|
+
const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
1561
1659
|
__name: "ink-renderer",
|
|
1562
1660
|
props: {
|
|
1563
1661
|
annotation: {},
|
|
@@ -1572,7 +1670,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
|
1572
1670
|
},
|
|
1573
1671
|
setup(__props) {
|
|
1574
1672
|
return (_ctx, _cache) => {
|
|
1575
|
-
return openBlock(), createBlock(_sfc_main$
|
|
1673
|
+
return openBlock(), createBlock(_sfc_main$B, mergeProps(__props.currentObject, {
|
|
1576
1674
|
isSelected: __props.isSelected,
|
|
1577
1675
|
scale: __props.scale,
|
|
1578
1676
|
onClick: __props.onClick,
|
|
@@ -1581,13 +1679,13 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
|
1581
1679
|
};
|
|
1582
1680
|
}
|
|
1583
1681
|
});
|
|
1584
|
-
const _hoisted_1$
|
|
1682
|
+
const _hoisted_1$a = ["width", "height", "viewBox"];
|
|
1585
1683
|
const _hoisted_2$7 = ["d", "stroke-width"];
|
|
1586
1684
|
const _hoisted_3$7 = ["x", "y", "width", "height", "stroke-width"];
|
|
1587
1685
|
const _hoisted_4$6 = ["d", "fill", "opacity"];
|
|
1588
1686
|
const _hoisted_5$5 = ["x", "y", "width", "height", "fill", "opacity"];
|
|
1589
1687
|
const __default__$c = { inheritAttrs: false };
|
|
1590
|
-
const _sfc_main$
|
|
1688
|
+
const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
1591
1689
|
...__default__$c,
|
|
1592
1690
|
__name: "square",
|
|
1593
1691
|
props: {
|
|
@@ -1659,8 +1757,8 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
|
1659
1757
|
onPointerdown: _cache[0] || (_cache[0] = //@ts-ignore
|
|
1660
1758
|
(...args) => __props.onClick && __props.onClick(...args)),
|
|
1661
1759
|
style: normalizeStyle({
|
|
1662
|
-
cursor: __props.isSelected ? "move" : "pointer",
|
|
1663
|
-
pointerEvents: __props.isSelected ? "none" : __props.color === "transparent" ? "visibleStroke" : "visible"
|
|
1760
|
+
cursor: __props.isSelected ? "move" : __props.onClick ? "pointer" : "default",
|
|
1761
|
+
pointerEvents: !__props.onClick ? "none" : __props.isSelected ? "none" : __props.color === "transparent" ? "visibleStroke" : "visible"
|
|
1664
1762
|
})
|
|
1665
1763
|
}, null, 44, _hoisted_2$7)) : (openBlock(), createElementBlock("rect", {
|
|
1666
1764
|
key: 1,
|
|
@@ -1674,8 +1772,8 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
|
1674
1772
|
onPointerdown: _cache[1] || (_cache[1] = //@ts-ignore
|
|
1675
1773
|
(...args) => __props.onClick && __props.onClick(...args)),
|
|
1676
1774
|
style: normalizeStyle({
|
|
1677
|
-
cursor: __props.isSelected ? "move" : "pointer",
|
|
1678
|
-
pointerEvents: __props.isSelected ? "none" : __props.color === "transparent" ? "visibleStroke" : "visible"
|
|
1775
|
+
cursor: __props.isSelected ? "move" : __props.onClick ? "pointer" : "default",
|
|
1776
|
+
pointerEvents: !__props.onClick ? "none" : __props.isSelected ? "none" : __props.color === "transparent" ? "visibleStroke" : "visible"
|
|
1679
1777
|
})
|
|
1680
1778
|
}, null, 44, _hoisted_3$7)),
|
|
1681
1779
|
!__props.appearanceActive ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
@@ -1708,11 +1806,11 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
|
1708
1806
|
})
|
|
1709
1807
|
}, null, 12, _hoisted_5$5))
|
|
1710
1808
|
], 64)) : createCommentVNode("", true)
|
|
1711
|
-
], 12, _hoisted_1$
|
|
1809
|
+
], 12, _hoisted_1$a);
|
|
1712
1810
|
};
|
|
1713
1811
|
}
|
|
1714
1812
|
});
|
|
1715
|
-
const _sfc_main$
|
|
1813
|
+
const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
1716
1814
|
__name: "square-renderer",
|
|
1717
1815
|
props: {
|
|
1718
1816
|
annotation: {},
|
|
@@ -1727,7 +1825,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
1727
1825
|
},
|
|
1728
1826
|
setup(__props) {
|
|
1729
1827
|
return (_ctx, _cache) => {
|
|
1730
|
-
return openBlock(), createBlock(_sfc_main$
|
|
1828
|
+
return openBlock(), createBlock(_sfc_main$z, mergeProps(__props.currentObject, {
|
|
1731
1829
|
isSelected: __props.isSelected,
|
|
1732
1830
|
scale: __props.scale,
|
|
1733
1831
|
onClick: __props.onClick,
|
|
@@ -1736,13 +1834,13 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
1736
1834
|
};
|
|
1737
1835
|
}
|
|
1738
1836
|
});
|
|
1739
|
-
const _hoisted_1$
|
|
1837
|
+
const _hoisted_1$9 = ["width", "height", "viewBox"];
|
|
1740
1838
|
const _hoisted_2$6 = ["d", "stroke-width"];
|
|
1741
1839
|
const _hoisted_3$6 = ["cx", "cy", "rx", "ry", "stroke-width"];
|
|
1742
1840
|
const _hoisted_4$5 = ["d", "fill", "opacity"];
|
|
1743
1841
|
const _hoisted_5$4 = ["cx", "cy", "rx", "ry", "fill", "opacity"];
|
|
1744
1842
|
const __default__$b = { inheritAttrs: false };
|
|
1745
|
-
const _sfc_main$
|
|
1843
|
+
const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
1746
1844
|
...__default__$b,
|
|
1747
1845
|
__name: "circle",
|
|
1748
1846
|
props: {
|
|
@@ -1816,8 +1914,8 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
|
1816
1914
|
onPointerdown: _cache[0] || (_cache[0] = //@ts-ignore
|
|
1817
1915
|
(...args) => __props.onClick && __props.onClick(...args)),
|
|
1818
1916
|
style: normalizeStyle({
|
|
1819
|
-
cursor: __props.isSelected ? "move" : "pointer",
|
|
1820
|
-
pointerEvents: __props.isSelected ? "none" : __props.color === "transparent" ? "visibleStroke" : "visible"
|
|
1917
|
+
cursor: __props.isSelected ? "move" : __props.onClick ? "pointer" : "default",
|
|
1918
|
+
pointerEvents: !__props.onClick ? "none" : __props.isSelected ? "none" : __props.color === "transparent" ? "visibleStroke" : "visible"
|
|
1821
1919
|
})
|
|
1822
1920
|
}, null, 44, _hoisted_2$6)) : (openBlock(), createElementBlock("ellipse", {
|
|
1823
1921
|
key: 1,
|
|
@@ -1831,8 +1929,8 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
|
1831
1929
|
onPointerdown: _cache[1] || (_cache[1] = //@ts-ignore
|
|
1832
1930
|
(...args) => __props.onClick && __props.onClick(...args)),
|
|
1833
1931
|
style: normalizeStyle({
|
|
1834
|
-
cursor: __props.isSelected ? "move" : "pointer",
|
|
1835
|
-
pointerEvents: __props.isSelected ? "none" : __props.color === "transparent" ? "visibleStroke" : "visible"
|
|
1932
|
+
cursor: __props.isSelected ? "move" : __props.onClick ? "pointer" : "default",
|
|
1933
|
+
pointerEvents: !__props.onClick ? "none" : __props.isSelected ? "none" : __props.color === "transparent" ? "visibleStroke" : "visible"
|
|
1836
1934
|
})
|
|
1837
1935
|
}, null, 44, _hoisted_3$6)),
|
|
1838
1936
|
!__props.appearanceActive ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
@@ -1865,11 +1963,11 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
|
1865
1963
|
})
|
|
1866
1964
|
}, null, 12, _hoisted_5$4))
|
|
1867
1965
|
], 64)) : createCommentVNode("", true)
|
|
1868
|
-
], 12, _hoisted_1$
|
|
1966
|
+
], 12, _hoisted_1$9);
|
|
1869
1967
|
};
|
|
1870
1968
|
}
|
|
1871
1969
|
});
|
|
1872
|
-
const _sfc_main$
|
|
1970
|
+
const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
1873
1971
|
__name: "circle-renderer",
|
|
1874
1972
|
props: {
|
|
1875
1973
|
annotation: {},
|
|
@@ -1884,7 +1982,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
1884
1982
|
},
|
|
1885
1983
|
setup(__props) {
|
|
1886
1984
|
return (_ctx, _cache) => {
|
|
1887
|
-
return openBlock(), createBlock(_sfc_main$
|
|
1985
|
+
return openBlock(), createBlock(_sfc_main$x, mergeProps(__props.currentObject, {
|
|
1888
1986
|
isSelected: __props.isSelected,
|
|
1889
1987
|
scale: __props.scale,
|
|
1890
1988
|
onClick: __props.onClick,
|
|
@@ -1893,7 +1991,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
1893
1991
|
};
|
|
1894
1992
|
}
|
|
1895
1993
|
});
|
|
1896
|
-
const _hoisted_1$
|
|
1994
|
+
const _hoisted_1$8 = ["width", "height", "viewBox"];
|
|
1897
1995
|
const _hoisted_2$5 = ["x1", "y1", "x2", "y2", "stroke-width"];
|
|
1898
1996
|
const _hoisted_3$5 = ["d", "transform", "stroke-width"];
|
|
1899
1997
|
const _hoisted_4$4 = ["d", "transform", "stroke-width"];
|
|
@@ -1901,7 +1999,7 @@ const _hoisted_5$3 = ["x1", "y1", "x2", "y2", "opacity"];
|
|
|
1901
1999
|
const _hoisted_6$2 = ["d", "transform", "stroke", "fill"];
|
|
1902
2000
|
const _hoisted_7$1 = ["d", "transform", "stroke", "fill"];
|
|
1903
2001
|
const __default__$a = { inheritAttrs: false };
|
|
1904
|
-
const _sfc_main$
|
|
2002
|
+
const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
1905
2003
|
...__default__$a,
|
|
1906
2004
|
__name: "line",
|
|
1907
2005
|
props: {
|
|
@@ -1973,8 +2071,8 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
1973
2071
|
onPointerdown: _cache[0] || (_cache[0] = //@ts-ignore
|
|
1974
2072
|
(...args) => __props.onClick && __props.onClick(...args)),
|
|
1975
2073
|
style: normalizeStyle({
|
|
1976
|
-
cursor: __props.isSelected ? "move" : "pointer",
|
|
1977
|
-
pointerEvents: __props.isSelected ? "none" : "visibleStroke",
|
|
2074
|
+
cursor: __props.isSelected ? "move" : __props.onClick ? "pointer" : "default",
|
|
2075
|
+
pointerEvents: !__props.onClick ? "none" : __props.isSelected ? "none" : "visibleStroke",
|
|
1978
2076
|
strokeLinecap: "butt"
|
|
1979
2077
|
})
|
|
1980
2078
|
}, null, 44, _hoisted_2$5),
|
|
@@ -1988,8 +2086,8 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
1988
2086
|
onPointerdown: _cache[1] || (_cache[1] = //@ts-ignore
|
|
1989
2087
|
(...args) => __props.onClick && __props.onClick(...args)),
|
|
1990
2088
|
style: normalizeStyle({
|
|
1991
|
-
cursor: __props.isSelected ? "move" : "pointer",
|
|
1992
|
-
pointerEvents: __props.isSelected ? "none" : endings.value.start.filled ? "visible" : "visibleStroke",
|
|
2089
|
+
cursor: __props.isSelected ? "move" : __props.onClick ? "pointer" : "default",
|
|
2090
|
+
pointerEvents: !__props.onClick ? "none" : __props.isSelected ? "none" : endings.value.start.filled ? "visible" : "visibleStroke",
|
|
1993
2091
|
strokeLinecap: "butt"
|
|
1994
2092
|
})
|
|
1995
2093
|
}, null, 44, _hoisted_3$5)) : createCommentVNode("", true),
|
|
@@ -2003,8 +2101,8 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
2003
2101
|
onPointerdown: _cache[2] || (_cache[2] = //@ts-ignore
|
|
2004
2102
|
(...args) => __props.onClick && __props.onClick(...args)),
|
|
2005
2103
|
style: normalizeStyle({
|
|
2006
|
-
cursor: __props.isSelected ? "move" : "pointer",
|
|
2007
|
-
pointerEvents: __props.isSelected ? "none" : endings.value.end.filled ? "visible" : "visibleStroke",
|
|
2104
|
+
cursor: __props.isSelected ? "move" : __props.onClick ? "pointer" : "default",
|
|
2105
|
+
pointerEvents: !__props.onClick ? "none" : __props.isSelected ? "none" : endings.value.end.filled ? "visible" : "visibleStroke",
|
|
2008
2106
|
strokeLinecap: "butt"
|
|
2009
2107
|
})
|
|
2010
2108
|
}, null, 44, _hoisted_4$4)) : createCommentVNode("", true),
|
|
@@ -2056,11 +2154,11 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
2056
2154
|
})
|
|
2057
2155
|
}, null, 12, _hoisted_7$1)) : createCommentVNode("", true)
|
|
2058
2156
|
], 64)) : createCommentVNode("", true)
|
|
2059
|
-
], 12, _hoisted_1$
|
|
2157
|
+
], 12, _hoisted_1$8);
|
|
2060
2158
|
};
|
|
2061
2159
|
}
|
|
2062
2160
|
});
|
|
2063
|
-
const _sfc_main$
|
|
2161
|
+
const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
2064
2162
|
__name: "line-renderer",
|
|
2065
2163
|
props: {
|
|
2066
2164
|
annotation: {},
|
|
@@ -2075,7 +2173,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
2075
2173
|
},
|
|
2076
2174
|
setup(__props) {
|
|
2077
2175
|
return (_ctx, _cache) => {
|
|
2078
|
-
return openBlock(), createBlock(_sfc_main$
|
|
2176
|
+
return openBlock(), createBlock(_sfc_main$v, mergeProps(__props.currentObject, {
|
|
2079
2177
|
isSelected: __props.isSelected,
|
|
2080
2178
|
scale: __props.scale,
|
|
2081
2179
|
onClick: __props.onClick,
|
|
@@ -2084,7 +2182,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
2084
2182
|
};
|
|
2085
2183
|
}
|
|
2086
2184
|
});
|
|
2087
|
-
const _hoisted_1$
|
|
2185
|
+
const _hoisted_1$7 = ["width", "height", "viewBox"];
|
|
2088
2186
|
const _hoisted_2$4 = ["d", "stroke-width"];
|
|
2089
2187
|
const _hoisted_3$4 = ["d", "transform", "stroke-width"];
|
|
2090
2188
|
const _hoisted_4$3 = ["d", "transform", "stroke-width"];
|
|
@@ -2092,7 +2190,7 @@ const _hoisted_5$2 = ["d", "opacity"];
|
|
|
2092
2190
|
const _hoisted_6$1 = ["d", "transform", "stroke", "fill"];
|
|
2093
2191
|
const _hoisted_7 = ["d", "transform", "stroke", "fill"];
|
|
2094
2192
|
const __default__$9 = { inheritAttrs: false };
|
|
2095
|
-
const _sfc_main$
|
|
2193
|
+
const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
2096
2194
|
...__default__$9,
|
|
2097
2195
|
__name: "polyline",
|
|
2098
2196
|
props: {
|
|
@@ -2178,8 +2276,8 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
2178
2276
|
onPointerdown: _cache[0] || (_cache[0] = //@ts-ignore
|
|
2179
2277
|
(...args) => __props.onClick && __props.onClick(...args)),
|
|
2180
2278
|
style: normalizeStyle({
|
|
2181
|
-
cursor: __props.isSelected ? "move" : "pointer",
|
|
2182
|
-
pointerEvents: __props.isSelected ? "none" : "visibleStroke",
|
|
2279
|
+
cursor: __props.isSelected ? "move" : __props.onClick ? "pointer" : "default",
|
|
2280
|
+
pointerEvents: !__props.onClick ? "none" : __props.isSelected ? "none" : "visibleStroke",
|
|
2183
2281
|
strokeLinecap: "butt",
|
|
2184
2282
|
strokeLinejoin: "miter"
|
|
2185
2283
|
})
|
|
@@ -2194,8 +2292,8 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
2194
2292
|
onPointerdown: _cache[1] || (_cache[1] = //@ts-ignore
|
|
2195
2293
|
(...args) => __props.onClick && __props.onClick(...args)),
|
|
2196
2294
|
style: normalizeStyle({
|
|
2197
|
-
cursor: __props.isSelected ? "move" : "pointer",
|
|
2198
|
-
pointerEvents: __props.isSelected ? "none" : endings.value.start.filled ? "visible" : "visibleStroke",
|
|
2295
|
+
cursor: __props.isSelected ? "move" : __props.onClick ? "pointer" : "default",
|
|
2296
|
+
pointerEvents: !__props.onClick ? "none" : __props.isSelected ? "none" : endings.value.start.filled ? "visible" : "visibleStroke",
|
|
2199
2297
|
strokeLinecap: "butt"
|
|
2200
2298
|
})
|
|
2201
2299
|
}, null, 44, _hoisted_3$4)) : createCommentVNode("", true),
|
|
@@ -2209,8 +2307,8 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
2209
2307
|
onPointerdown: _cache[2] || (_cache[2] = //@ts-ignore
|
|
2210
2308
|
(...args) => __props.onClick && __props.onClick(...args)),
|
|
2211
2309
|
style: normalizeStyle({
|
|
2212
|
-
cursor: __props.isSelected ? "move" : "pointer",
|
|
2213
|
-
pointerEvents: __props.isSelected ? "none" : endings.value.end.filled ? "visible" : "visibleStroke",
|
|
2310
|
+
cursor: __props.isSelected ? "move" : __props.onClick ? "pointer" : "default",
|
|
2311
|
+
pointerEvents: !__props.onClick ? "none" : __props.isSelected ? "none" : endings.value.end.filled ? "visible" : "visibleStroke",
|
|
2214
2312
|
strokeLinecap: "butt"
|
|
2215
2313
|
})
|
|
2216
2314
|
}, null, 44, _hoisted_4$3)) : createCommentVNode("", true),
|
|
@@ -2261,11 +2359,11 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
2261
2359
|
})
|
|
2262
2360
|
}, null, 12, _hoisted_7)) : createCommentVNode("", true)
|
|
2263
2361
|
], 64)) : createCommentVNode("", true)
|
|
2264
|
-
], 12, _hoisted_1$
|
|
2362
|
+
], 12, _hoisted_1$7);
|
|
2265
2363
|
};
|
|
2266
2364
|
}
|
|
2267
2365
|
});
|
|
2268
|
-
const _sfc_main$
|
|
2366
|
+
const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
2269
2367
|
__name: "polyline-renderer",
|
|
2270
2368
|
props: {
|
|
2271
2369
|
annotation: {},
|
|
@@ -2280,7 +2378,7 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
2280
2378
|
},
|
|
2281
2379
|
setup(__props) {
|
|
2282
2380
|
return (_ctx, _cache) => {
|
|
2283
|
-
return openBlock(), createBlock(_sfc_main$
|
|
2381
|
+
return openBlock(), createBlock(_sfc_main$t, mergeProps(__props.currentObject, {
|
|
2284
2382
|
isSelected: __props.isSelected,
|
|
2285
2383
|
scale: __props.scale,
|
|
2286
2384
|
onClick: __props.onClick,
|
|
@@ -2289,14 +2387,14 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
2289
2387
|
};
|
|
2290
2388
|
}
|
|
2291
2389
|
});
|
|
2292
|
-
const _hoisted_1$
|
|
2390
|
+
const _hoisted_1$6 = ["width", "height", "viewBox"];
|
|
2293
2391
|
const _hoisted_2$3 = ["d", "stroke-width"];
|
|
2294
2392
|
const _hoisted_3$3 = ["d", "opacity"];
|
|
2295
2393
|
const _hoisted_4$2 = ["d", "opacity"];
|
|
2296
2394
|
const _hoisted_5$1 = ["d"];
|
|
2297
2395
|
const _hoisted_6 = ["x", "y", "width", "height", "fill", "stroke", "stroke-width"];
|
|
2298
2396
|
const __default__$8 = { inheritAttrs: false };
|
|
2299
|
-
const _sfc_main$
|
|
2397
|
+
const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
2300
2398
|
...__default__$8,
|
|
2301
2399
|
__name: "polygon",
|
|
2302
2400
|
props: {
|
|
@@ -2373,8 +2471,8 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
|
2373
2471
|
onPointerdown: _cache[0] || (_cache[0] = //@ts-ignore
|
|
2374
2472
|
(...args) => __props.onClick && __props.onClick(...args)),
|
|
2375
2473
|
style: normalizeStyle({
|
|
2376
|
-
cursor: __props.isSelected ? "move" : "pointer",
|
|
2377
|
-
pointerEvents: __props.isSelected ? "none" : __props.color === "transparent" ? "visibleStroke" : "visible",
|
|
2474
|
+
cursor: __props.isSelected ? "move" : __props.onClick ? "pointer" : "default",
|
|
2475
|
+
pointerEvents: !__props.onClick ? "none" : __props.isSelected ? "none" : __props.color === "transparent" ? "visibleStroke" : "visible",
|
|
2378
2476
|
strokeLinecap: "butt",
|
|
2379
2477
|
strokeLinejoin: "miter"
|
|
2380
2478
|
})
|
|
@@ -2433,11 +2531,11 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
|
2433
2531
|
}, null, 8, _hoisted_6)) : createCommentVNode("", true)
|
|
2434
2532
|
], 64))
|
|
2435
2533
|
], 64)) : createCommentVNode("", true)
|
|
2436
|
-
], 12, _hoisted_1$
|
|
2534
|
+
], 12, _hoisted_1$6);
|
|
2437
2535
|
};
|
|
2438
2536
|
}
|
|
2439
2537
|
});
|
|
2440
|
-
const _sfc_main$
|
|
2538
|
+
const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
2441
2539
|
__name: "polygon-renderer",
|
|
2442
2540
|
props: {
|
|
2443
2541
|
annotation: {},
|
|
@@ -2452,7 +2550,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
2452
2550
|
},
|
|
2453
2551
|
setup(__props) {
|
|
2454
2552
|
return (_ctx, _cache) => {
|
|
2455
|
-
return openBlock(), createBlock(_sfc_main$
|
|
2553
|
+
return openBlock(), createBlock(_sfc_main$r, mergeProps(__props.currentObject, {
|
|
2456
2554
|
isSelected: __props.isSelected,
|
|
2457
2555
|
scale: __props.scale,
|
|
2458
2556
|
onClick: __props.onClick,
|
|
@@ -2461,9 +2559,9 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
2461
2559
|
};
|
|
2462
2560
|
}
|
|
2463
2561
|
});
|
|
2464
|
-
const _hoisted_1$
|
|
2562
|
+
const _hoisted_1$5 = ["contenteditable"];
|
|
2465
2563
|
const __default__$7 = { inheritAttrs: false };
|
|
2466
|
-
const _sfc_main$
|
|
2564
|
+
const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
2467
2565
|
...__default__$7,
|
|
2468
2566
|
__name: "free-text",
|
|
2469
2567
|
props: {
|
|
@@ -2487,15 +2585,10 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
2487
2585
|
return ((_a = annotationCapability.value) == null ? void 0 : _a.forDocument(props.documentId)) ?? null;
|
|
2488
2586
|
}
|
|
2489
2587
|
);
|
|
2490
|
-
const
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
isIOS.value = /iPad|iPhone|iPod/.test(navigator.userAgent) || navigator.platform === "MacIntel" && (nav == null ? void 0 : nav.maxTouchPoints) > 1;
|
|
2495
|
-
} catch {
|
|
2496
|
-
isIOS.value = false;
|
|
2497
|
-
}
|
|
2498
|
-
});
|
|
2588
|
+
const ios = useIOSZoomPrevention(
|
|
2589
|
+
() => props.annotation.object.fontSize * props.scale,
|
|
2590
|
+
() => props.isEditing
|
|
2591
|
+
);
|
|
2499
2592
|
watch(
|
|
2500
2593
|
() => props.isEditing,
|
|
2501
2594
|
async (editing) => {
|
|
@@ -2531,11 +2624,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
2531
2624
|
};
|
|
2532
2625
|
const editorStyle = computed(() => {
|
|
2533
2626
|
const { object: anno } = props.annotation;
|
|
2534
|
-
const
|
|
2535
|
-
const MIN_IOS_FOCUS_FONT_PX = 16;
|
|
2536
|
-
const needsComp = isIOS.value && props.isEditing && computedFontPx > 0 && computedFontPx < MIN_IOS_FOCUS_FONT_PX;
|
|
2537
|
-
const adjustedFontPx = needsComp ? MIN_IOS_FOCUS_FONT_PX : computedFontPx;
|
|
2538
|
-
const scaleComp = needsComp ? computedFontPx / MIN_IOS_FOCUS_FONT_PX : 1;
|
|
2627
|
+
const { needsComp, adjustedFontPx, scaleComp } = ios.value;
|
|
2539
2628
|
const invScalePercent = needsComp ? 100 / scaleComp : 100;
|
|
2540
2629
|
return {
|
|
2541
2630
|
color: anno.fontColor,
|
|
@@ -2551,7 +2640,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
2551
2640
|
height: needsComp ? `${invScalePercent}%` : "100%",
|
|
2552
2641
|
lineHeight: "1.18",
|
|
2553
2642
|
overflow: "hidden",
|
|
2554
|
-
cursor: props.isEditing ? "text" : "pointer",
|
|
2643
|
+
cursor: props.isEditing ? "text" : props.onClick ? "pointer" : "default",
|
|
2555
2644
|
outline: "none",
|
|
2556
2645
|
transform: needsComp ? `scale(${scaleComp})` : void 0,
|
|
2557
2646
|
transformOrigin: "top left"
|
|
@@ -2564,7 +2653,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
2564
2653
|
width: `${__props.annotation.object.rect.size.width * __props.scale}px`,
|
|
2565
2654
|
height: `${__props.annotation.object.rect.size.height * __props.scale}px`,
|
|
2566
2655
|
cursor: __props.isSelected && !__props.isEditing ? "move" : "default",
|
|
2567
|
-
pointerEvents: __props.isSelected && !__props.isEditing ? "none" : "auto",
|
|
2656
|
+
pointerEvents: !__props.onClick ? "none" : __props.isSelected && !__props.isEditing ? "none" : "auto",
|
|
2568
2657
|
zIndex: 2,
|
|
2569
2658
|
opacity: __props.appearanceActive ? 0 : 1
|
|
2570
2659
|
}),
|
|
@@ -2578,12 +2667,12 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
2578
2667
|
tabindex: "0",
|
|
2579
2668
|
style: normalizeStyle(editorStyle.value),
|
|
2580
2669
|
contenteditable: __props.isEditing
|
|
2581
|
-
}, toDisplayString(__props.annotation.object.contents), 45, _hoisted_1$
|
|
2670
|
+
}, toDisplayString(__props.annotation.object.contents), 45, _hoisted_1$5)
|
|
2582
2671
|
], 36);
|
|
2583
2672
|
};
|
|
2584
2673
|
}
|
|
2585
2674
|
});
|
|
2586
|
-
const _sfc_main$
|
|
2675
|
+
const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
2587
2676
|
__name: "free-text-renderer",
|
|
2588
2677
|
props: {
|
|
2589
2678
|
annotation: {},
|
|
@@ -2598,7 +2687,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
2598
2687
|
},
|
|
2599
2688
|
setup(__props) {
|
|
2600
2689
|
return (_ctx, _cache) => {
|
|
2601
|
-
return openBlock(), createBlock(_sfc_main$
|
|
2690
|
+
return openBlock(), createBlock(_sfc_main$p, {
|
|
2602
2691
|
documentId: __props.documentId,
|
|
2603
2692
|
isSelected: __props.isSelected,
|
|
2604
2693
|
isEditing: __props.isEditing,
|
|
@@ -2611,8 +2700,8 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
2611
2700
|
};
|
|
2612
2701
|
}
|
|
2613
2702
|
});
|
|
2614
|
-
const _hoisted_1$
|
|
2615
|
-
const _sfc_main$
|
|
2703
|
+
const _hoisted_1$4 = ["src"];
|
|
2704
|
+
const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
2616
2705
|
__name: "render-annotation",
|
|
2617
2706
|
props: {
|
|
2618
2707
|
documentId: {},
|
|
@@ -2707,12 +2796,12 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
2707
2796
|
display: "block",
|
|
2708
2797
|
...__props.style
|
|
2709
2798
|
})
|
|
2710
|
-
}, null, 44, _hoisted_1$
|
|
2799
|
+
}, null, 44, _hoisted_1$4)) : createCommentVNode("", true);
|
|
2711
2800
|
};
|
|
2712
2801
|
}
|
|
2713
2802
|
});
|
|
2714
2803
|
const __default__$6 = { inheritAttrs: false };
|
|
2715
|
-
const _sfc_main$
|
|
2804
|
+
const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
2716
2805
|
...__default__$6,
|
|
2717
2806
|
__name: "stamp",
|
|
2718
2807
|
props: {
|
|
@@ -2735,13 +2824,13 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
2735
2824
|
width: "100%",
|
|
2736
2825
|
height: "100%",
|
|
2737
2826
|
zIndex: 2,
|
|
2738
|
-
pointerEvents: __props.isSelected ? "none" : "auto",
|
|
2739
|
-
cursor: "pointer"
|
|
2827
|
+
pointerEvents: !__props.onClick ? "none" : __props.isSelected ? "none" : "auto",
|
|
2828
|
+
cursor: __props.onClick ? "pointer" : "default"
|
|
2740
2829
|
}),
|
|
2741
2830
|
onPointerdown: _cache[0] || (_cache[0] = //@ts-ignore
|
|
2742
2831
|
(...args) => __props.onClick && __props.onClick(...args))
|
|
2743
2832
|
}, [
|
|
2744
|
-
createVNode(_sfc_main$
|
|
2833
|
+
createVNode(_sfc_main$n, {
|
|
2745
2834
|
documentId: __props.documentId,
|
|
2746
2835
|
pageIndex: __props.pageIndex,
|
|
2747
2836
|
annotation: { ...__props.annotation.object, id: __props.annotation.object.id },
|
|
@@ -2752,7 +2841,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
2752
2841
|
};
|
|
2753
2842
|
}
|
|
2754
2843
|
});
|
|
2755
|
-
const _sfc_main$
|
|
2844
|
+
const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
2756
2845
|
__name: "stamp-renderer",
|
|
2757
2846
|
props: {
|
|
2758
2847
|
annotation: {},
|
|
@@ -2767,7 +2856,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
|
2767
2856
|
},
|
|
2768
2857
|
setup(__props) {
|
|
2769
2858
|
return (_ctx, _cache) => {
|
|
2770
|
-
return openBlock(), createBlock(_sfc_main$
|
|
2859
|
+
return openBlock(), createBlock(_sfc_main$m, {
|
|
2771
2860
|
isSelected: __props.isSelected,
|
|
2772
2861
|
annotation: __props.annotation,
|
|
2773
2862
|
documentId: __props.documentId,
|
|
@@ -2778,12 +2867,12 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
|
2778
2867
|
};
|
|
2779
2868
|
}
|
|
2780
2869
|
});
|
|
2781
|
-
const _hoisted_1$
|
|
2870
|
+
const _hoisted_1$3 = ["width", "height", "viewBox"];
|
|
2782
2871
|
const _hoisted_2$2 = ["width", "height"];
|
|
2783
2872
|
const _hoisted_3$2 = ["y1", "x2", "y2", "stroke", "stroke-width", "stroke-dasharray"];
|
|
2784
2873
|
const _hoisted_4$1 = ["x", "y", "width", "height", "stroke", "stroke-width", "stroke-dasharray"];
|
|
2785
2874
|
const __default__$5 = { inheritAttrs: false };
|
|
2786
|
-
const _sfc_main$
|
|
2875
|
+
const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
2787
2876
|
...__default__$5,
|
|
2788
2877
|
__name: "link",
|
|
2789
2878
|
props: {
|
|
@@ -2812,10 +2901,10 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
2812
2901
|
});
|
|
2813
2902
|
const isUnderline = computed(() => props.strokeStyle === PdfAnnotationBorderStyle.UNDERLINE);
|
|
2814
2903
|
const hitAreaCursor = computed(
|
|
2815
|
-
() => props.hasIRT ? "default" : props.isSelected ? "move" : "pointer"
|
|
2904
|
+
() => props.hasIRT || !props.onClick ? "default" : props.isSelected ? "move" : "pointer"
|
|
2816
2905
|
);
|
|
2817
2906
|
const hitAreaPointerEvents = computed(
|
|
2818
|
-
() => props.hasIRT ? "none" : props.isSelected ? "none" : "visible"
|
|
2907
|
+
() => props.hasIRT || !props.onClick ? "none" : props.isSelected ? "none" : "visible"
|
|
2819
2908
|
);
|
|
2820
2909
|
return (_ctx, _cache) => {
|
|
2821
2910
|
return openBlock(), createElementBlock("svg", {
|
|
@@ -2867,11 +2956,11 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
2867
2956
|
"stroke-dasharray": dashArray.value,
|
|
2868
2957
|
style: { "pointer-events": "none" }
|
|
2869
2958
|
}, null, 8, _hoisted_4$1))
|
|
2870
|
-
], 12, _hoisted_1$
|
|
2959
|
+
], 12, _hoisted_1$3);
|
|
2871
2960
|
};
|
|
2872
2961
|
}
|
|
2873
2962
|
});
|
|
2874
|
-
const _sfc_main$
|
|
2963
|
+
const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
2875
2964
|
__name: "link-renderer",
|
|
2876
2965
|
props: {
|
|
2877
2966
|
annotation: {},
|
|
@@ -2886,7 +2975,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
2886
2975
|
},
|
|
2887
2976
|
setup(__props) {
|
|
2888
2977
|
return (_ctx, _cache) => {
|
|
2889
|
-
return openBlock(), createBlock(_sfc_main$
|
|
2978
|
+
return openBlock(), createBlock(_sfc_main$k, mergeProps(__props.currentObject, {
|
|
2890
2979
|
isSelected: __props.isSelected,
|
|
2891
2980
|
scale: __props.scale,
|
|
2892
2981
|
onClick: __props.onClick,
|
|
@@ -2896,7 +2985,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
2896
2985
|
}
|
|
2897
2986
|
});
|
|
2898
2987
|
const __default__$4 = { inheritAttrs: false };
|
|
2899
|
-
const _sfc_main$
|
|
2988
|
+
const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
2900
2989
|
...__default__$4,
|
|
2901
2990
|
__name: "highlight",
|
|
2902
2991
|
props: {
|
|
@@ -2934,7 +3023,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
2934
3023
|
};
|
|
2935
3024
|
}
|
|
2936
3025
|
});
|
|
2937
|
-
const _sfc_main$
|
|
3026
|
+
const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
2938
3027
|
__name: "highlight-renderer",
|
|
2939
3028
|
props: {
|
|
2940
3029
|
annotation: {},
|
|
@@ -2949,7 +3038,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
2949
3038
|
},
|
|
2950
3039
|
setup(__props) {
|
|
2951
3040
|
return (_ctx, _cache) => {
|
|
2952
|
-
return openBlock(), createBlock(_sfc_main$
|
|
3041
|
+
return openBlock(), createBlock(_sfc_main$i, mergeProps(__props.currentObject, {
|
|
2953
3042
|
scale: __props.scale,
|
|
2954
3043
|
onClick: __props.onClick,
|
|
2955
3044
|
appearanceActive: __props.appearanceActive
|
|
@@ -2958,7 +3047,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
2958
3047
|
}
|
|
2959
3048
|
});
|
|
2960
3049
|
const __default__$3 = { inheritAttrs: false };
|
|
2961
|
-
const _sfc_main$
|
|
3050
|
+
const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
2962
3051
|
...__default__$3,
|
|
2963
3052
|
__name: "underline",
|
|
2964
3053
|
props: {
|
|
@@ -3010,7 +3099,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
3010
3099
|
};
|
|
3011
3100
|
}
|
|
3012
3101
|
});
|
|
3013
|
-
const _sfc_main$
|
|
3102
|
+
const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
3014
3103
|
__name: "underline-renderer",
|
|
3015
3104
|
props: {
|
|
3016
3105
|
annotation: {},
|
|
@@ -3025,7 +3114,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
3025
3114
|
},
|
|
3026
3115
|
setup(__props) {
|
|
3027
3116
|
return (_ctx, _cache) => {
|
|
3028
|
-
return openBlock(), createBlock(_sfc_main$
|
|
3117
|
+
return openBlock(), createBlock(_sfc_main$g, mergeProps(__props.currentObject, {
|
|
3029
3118
|
scale: __props.scale,
|
|
3030
3119
|
onClick: __props.onClick,
|
|
3031
3120
|
appearanceActive: __props.appearanceActive
|
|
@@ -3034,7 +3123,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
3034
3123
|
}
|
|
3035
3124
|
});
|
|
3036
3125
|
const __default__$2 = { inheritAttrs: false };
|
|
3037
|
-
const _sfc_main$
|
|
3126
|
+
const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
3038
3127
|
...__default__$2,
|
|
3039
3128
|
__name: "strikeout",
|
|
3040
3129
|
props: {
|
|
@@ -3087,7 +3176,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
3087
3176
|
};
|
|
3088
3177
|
}
|
|
3089
3178
|
});
|
|
3090
|
-
const _sfc_main$
|
|
3179
|
+
const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
3091
3180
|
__name: "strikeout-renderer",
|
|
3092
3181
|
props: {
|
|
3093
3182
|
annotation: {},
|
|
@@ -3102,7 +3191,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
3102
3191
|
},
|
|
3103
3192
|
setup(__props) {
|
|
3104
3193
|
return (_ctx, _cache) => {
|
|
3105
|
-
return openBlock(), createBlock(_sfc_main$
|
|
3194
|
+
return openBlock(), createBlock(_sfc_main$e, mergeProps(__props.currentObject, {
|
|
3106
3195
|
scale: __props.scale,
|
|
3107
3196
|
onClick: __props.onClick,
|
|
3108
3197
|
appearanceActive: __props.appearanceActive
|
|
@@ -3111,7 +3200,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
3111
3200
|
}
|
|
3112
3201
|
});
|
|
3113
3202
|
const __default__$1 = { inheritAttrs: false };
|
|
3114
|
-
const _sfc_main$
|
|
3203
|
+
const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
3115
3204
|
...__default__$1,
|
|
3116
3205
|
__name: "squiggly",
|
|
3117
3206
|
props: {
|
|
@@ -3175,7 +3264,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
3175
3264
|
};
|
|
3176
3265
|
}
|
|
3177
3266
|
});
|
|
3178
|
-
const _sfc_main$
|
|
3267
|
+
const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
3179
3268
|
__name: "squiggly-renderer",
|
|
3180
3269
|
props: {
|
|
3181
3270
|
annotation: {},
|
|
@@ -3190,7 +3279,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
3190
3279
|
},
|
|
3191
3280
|
setup(__props) {
|
|
3192
3281
|
return (_ctx, _cache) => {
|
|
3193
|
-
return openBlock(), createBlock(_sfc_main$
|
|
3282
|
+
return openBlock(), createBlock(_sfc_main$c, mergeProps(__props.currentObject, {
|
|
3194
3283
|
scale: __props.scale,
|
|
3195
3284
|
onClick: __props.onClick,
|
|
3196
3285
|
appearanceActive: __props.appearanceActive
|
|
@@ -3198,11 +3287,11 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
3198
3287
|
};
|
|
3199
3288
|
}
|
|
3200
3289
|
});
|
|
3201
|
-
const _hoisted_1$
|
|
3290
|
+
const _hoisted_1$2 = ["width", "height", "viewBox"];
|
|
3202
3291
|
const _hoisted_2$1 = ["d"];
|
|
3203
3292
|
const _hoisted_3$1 = ["d", "fill", "stroke", "opacity"];
|
|
3204
3293
|
const __default__ = { inheritAttrs: false };
|
|
3205
|
-
const _sfc_main$
|
|
3294
|
+
const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
3206
3295
|
...__default__,
|
|
3207
3296
|
__name: "caret",
|
|
3208
3297
|
props: {
|
|
@@ -3253,8 +3342,8 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
3253
3342
|
onPointerdown: _cache[0] || (_cache[0] = //@ts-ignore
|
|
3254
3343
|
(...args) => __props.onClick && __props.onClick(...args)),
|
|
3255
3344
|
style: normalizeStyle({
|
|
3256
|
-
cursor: __props.isSelected ? "move" : "pointer",
|
|
3257
|
-
pointerEvents: __props.isSelected ? "none" : "visible"
|
|
3345
|
+
cursor: __props.isSelected ? "move" : __props.onClick ? "pointer" : "default",
|
|
3346
|
+
pointerEvents: !__props.onClick ? "none" : __props.isSelected ? "none" : "visible"
|
|
3258
3347
|
})
|
|
3259
3348
|
}, null, 44, _hoisted_2$1),
|
|
3260
3349
|
!__props.appearanceActive ? (openBlock(), createElementBlock("path", {
|
|
@@ -3267,11 +3356,11 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
3267
3356
|
"fill-rule": "evenodd",
|
|
3268
3357
|
style: { pointerEvents: "none" }
|
|
3269
3358
|
}, null, 8, _hoisted_3$1)) : createCommentVNode("", true)
|
|
3270
|
-
], 12, _hoisted_1$
|
|
3359
|
+
], 12, _hoisted_1$2);
|
|
3271
3360
|
};
|
|
3272
3361
|
}
|
|
3273
3362
|
});
|
|
3274
|
-
const _sfc_main$
|
|
3363
|
+
const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
3275
3364
|
__name: "caret-renderer",
|
|
3276
3365
|
props: {
|
|
3277
3366
|
annotation: {},
|
|
@@ -3286,7 +3375,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
3286
3375
|
},
|
|
3287
3376
|
setup(__props) {
|
|
3288
3377
|
return (_ctx, _cache) => {
|
|
3289
|
-
return openBlock(), createBlock(_sfc_main$
|
|
3378
|
+
return openBlock(), createBlock(_sfc_main$a, mergeProps(__props.currentObject, {
|
|
3290
3379
|
isSelected: __props.isSelected,
|
|
3291
3380
|
scale: __props.scale,
|
|
3292
3381
|
onClick: __props.onClick,
|
|
@@ -3295,7 +3384,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
3295
3384
|
};
|
|
3296
3385
|
}
|
|
3297
3386
|
});
|
|
3298
|
-
const _hoisted_1 = {
|
|
3387
|
+
const _hoisted_1$1 = {
|
|
3299
3388
|
key: 0,
|
|
3300
3389
|
style: { position: "absolute", inset: 0, pointerEvents: "none" },
|
|
3301
3390
|
viewBox: "0 0 20 20",
|
|
@@ -3306,7 +3395,7 @@ const _hoisted_2 = ["fill", "opacity", "stroke"];
|
|
|
3306
3395
|
const _hoisted_3 = ["stroke"];
|
|
3307
3396
|
const _hoisted_4 = ["stroke"];
|
|
3308
3397
|
const _hoisted_5 = ["stroke"];
|
|
3309
|
-
const _sfc_main$
|
|
3398
|
+
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
3310
3399
|
__name: "text",
|
|
3311
3400
|
props: {
|
|
3312
3401
|
isSelected: { type: Boolean },
|
|
@@ -3324,13 +3413,13 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
3324
3413
|
position: "absolute",
|
|
3325
3414
|
inset: 0,
|
|
3326
3415
|
zIndex: 2,
|
|
3327
|
-
pointerEvents: __props.isSelected ? "none" : "auto",
|
|
3328
|
-
cursor: __props.isSelected ? "move" : "pointer"
|
|
3416
|
+
pointerEvents: !__props.onClick ? "none" : __props.isSelected ? "none" : "auto",
|
|
3417
|
+
cursor: __props.isSelected ? "move" : __props.onClick ? "pointer" : "default"
|
|
3329
3418
|
}),
|
|
3330
3419
|
onPointerdown: _cache[0] || (_cache[0] = //@ts-ignore
|
|
3331
3420
|
(...args) => __props.onClick && __props.onClick(...args))
|
|
3332
3421
|
}, [
|
|
3333
|
-
!__props.appearanceActive ? (openBlock(), createElementBlock("svg", _hoisted_1, [
|
|
3422
|
+
!__props.appearanceActive ? (openBlock(), createElementBlock("svg", _hoisted_1$1, [
|
|
3334
3423
|
createElementVNode("path", {
|
|
3335
3424
|
d: "M 0.5 15.5 L 0.5 0.5 L 19.5 0.5 L 19.5 15.5 L 8.5 15.5 L 6.5 19.5 L 4.5 15.5 Z",
|
|
3336
3425
|
fill: __props.color,
|
|
@@ -3368,7 +3457,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
3368
3457
|
};
|
|
3369
3458
|
}
|
|
3370
3459
|
});
|
|
3371
|
-
const _sfc_main$
|
|
3460
|
+
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
3372
3461
|
__name: "text-renderer",
|
|
3373
3462
|
props: {
|
|
3374
3463
|
annotation: {},
|
|
@@ -3383,7 +3472,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
3383
3472
|
},
|
|
3384
3473
|
setup(__props) {
|
|
3385
3474
|
return (_ctx, _cache) => {
|
|
3386
|
-
return openBlock(), createBlock(_sfc_main$
|
|
3475
|
+
return openBlock(), createBlock(_sfc_main$8, {
|
|
3387
3476
|
isSelected: __props.isSelected,
|
|
3388
3477
|
color: __props.currentObject.strokeColor ?? __props.currentObject.color,
|
|
3389
3478
|
opacity: __props.currentObject.opacity,
|
|
@@ -3397,25 +3486,25 @@ const builtInRenderers = [
|
|
|
3397
3486
|
createRenderer({
|
|
3398
3487
|
id: "ink",
|
|
3399
3488
|
matches: (a) => a.type === PdfAnnotationSubtype.INK,
|
|
3400
|
-
component: _sfc_main$
|
|
3489
|
+
component: _sfc_main$A,
|
|
3401
3490
|
interactionDefaults: { isDraggable: true, isResizable: true, isRotatable: true }
|
|
3402
3491
|
}),
|
|
3403
3492
|
createRenderer({
|
|
3404
3493
|
id: "square",
|
|
3405
3494
|
matches: (a) => a.type === PdfAnnotationSubtype.SQUARE,
|
|
3406
|
-
component: _sfc_main$
|
|
3495
|
+
component: _sfc_main$y,
|
|
3407
3496
|
interactionDefaults: { isDraggable: true, isResizable: true, isRotatable: true }
|
|
3408
3497
|
}),
|
|
3409
3498
|
createRenderer({
|
|
3410
3499
|
id: "circle",
|
|
3411
3500
|
matches: (a) => a.type === PdfAnnotationSubtype.CIRCLE,
|
|
3412
|
-
component: _sfc_main$
|
|
3501
|
+
component: _sfc_main$w,
|
|
3413
3502
|
interactionDefaults: { isDraggable: true, isResizable: true, isRotatable: true }
|
|
3414
3503
|
}),
|
|
3415
3504
|
createRenderer({
|
|
3416
3505
|
id: "line",
|
|
3417
3506
|
matches: (a) => a.type === PdfAnnotationSubtype.LINE,
|
|
3418
|
-
component: _sfc_main$
|
|
3507
|
+
component: _sfc_main$u,
|
|
3419
3508
|
vertexConfig: {
|
|
3420
3509
|
extractVertices: (a) => [a.linePoints.start, a.linePoints.end],
|
|
3421
3510
|
transformAnnotation: (a, v) => ({
|
|
@@ -3428,7 +3517,7 @@ const builtInRenderers = [
|
|
|
3428
3517
|
createRenderer({
|
|
3429
3518
|
id: "polyline",
|
|
3430
3519
|
matches: (a) => a.type === PdfAnnotationSubtype.POLYLINE,
|
|
3431
|
-
component: _sfc_main$
|
|
3520
|
+
component: _sfc_main$s,
|
|
3432
3521
|
vertexConfig: {
|
|
3433
3522
|
extractVertices: (a) => a.vertices,
|
|
3434
3523
|
transformAnnotation: (a, vertices) => ({ ...a, vertices })
|
|
@@ -3438,7 +3527,7 @@ const builtInRenderers = [
|
|
|
3438
3527
|
createRenderer({
|
|
3439
3528
|
id: "polygon",
|
|
3440
3529
|
matches: (a) => a.type === PdfAnnotationSubtype.POLYGON,
|
|
3441
|
-
component: _sfc_main$
|
|
3530
|
+
component: _sfc_main$q,
|
|
3442
3531
|
vertexConfig: {
|
|
3443
3532
|
extractVertices: (a) => a.vertices,
|
|
3444
3533
|
transformAnnotation: (a, vertices) => ({ ...a, vertices })
|
|
@@ -3448,7 +3537,7 @@ const builtInRenderers = [
|
|
|
3448
3537
|
createRenderer({
|
|
3449
3538
|
id: "highlight",
|
|
3450
3539
|
matches: (a) => a.type === PdfAnnotationSubtype.HIGHLIGHT,
|
|
3451
|
-
component: _sfc_main$
|
|
3540
|
+
component: _sfc_main$h,
|
|
3452
3541
|
zIndex: 0,
|
|
3453
3542
|
interactionDefaults: { isDraggable: false, isResizable: false, isRotatable: false },
|
|
3454
3543
|
defaultBlendMode: PdfBlendMode.Multiply
|
|
@@ -3456,40 +3545,40 @@ const builtInRenderers = [
|
|
|
3456
3545
|
createRenderer({
|
|
3457
3546
|
id: "underline",
|
|
3458
3547
|
matches: (a) => a.type === PdfAnnotationSubtype.UNDERLINE,
|
|
3459
|
-
component: _sfc_main$
|
|
3548
|
+
component: _sfc_main$f,
|
|
3460
3549
|
zIndex: 0,
|
|
3461
3550
|
interactionDefaults: { isDraggable: false, isResizable: false, isRotatable: false }
|
|
3462
3551
|
}),
|
|
3463
3552
|
createRenderer({
|
|
3464
3553
|
id: "strikeout",
|
|
3465
3554
|
matches: (a) => a.type === PdfAnnotationSubtype.STRIKEOUT,
|
|
3466
|
-
component: _sfc_main$
|
|
3555
|
+
component: _sfc_main$d,
|
|
3467
3556
|
zIndex: 0,
|
|
3468
3557
|
interactionDefaults: { isDraggable: false, isResizable: false, isRotatable: false }
|
|
3469
3558
|
}),
|
|
3470
3559
|
createRenderer({
|
|
3471
3560
|
id: "squiggly",
|
|
3472
3561
|
matches: (a) => a.type === PdfAnnotationSubtype.SQUIGGLY,
|
|
3473
|
-
component: _sfc_main$
|
|
3562
|
+
component: _sfc_main$b,
|
|
3474
3563
|
zIndex: 0,
|
|
3475
3564
|
interactionDefaults: { isDraggable: false, isResizable: false, isRotatable: false }
|
|
3476
3565
|
}),
|
|
3477
3566
|
createRenderer({
|
|
3478
3567
|
id: "text",
|
|
3479
3568
|
matches: (a) => a.type === PdfAnnotationSubtype.TEXT && !a.inReplyToId,
|
|
3480
|
-
component: _sfc_main$
|
|
3569
|
+
component: _sfc_main$7,
|
|
3481
3570
|
interactionDefaults: { isDraggable: true, isResizable: false, isRotatable: false }
|
|
3482
3571
|
}),
|
|
3483
3572
|
createRenderer({
|
|
3484
3573
|
id: "caret",
|
|
3485
3574
|
matches: (a) => a.type === PdfAnnotationSubtype.CARET,
|
|
3486
|
-
component: _sfc_main$
|
|
3575
|
+
component: _sfc_main$9,
|
|
3487
3576
|
interactionDefaults: { isDraggable: false, isResizable: false, isRotatable: false }
|
|
3488
3577
|
}),
|
|
3489
3578
|
createRenderer({
|
|
3490
3579
|
id: "freeText",
|
|
3491
3580
|
matches: (a) => a.type === PdfAnnotationSubtype.FREETEXT,
|
|
3492
|
-
component: _sfc_main$
|
|
3581
|
+
component: _sfc_main$o,
|
|
3493
3582
|
interactionDefaults: { isDraggable: true, isResizable: true, isRotatable: true },
|
|
3494
3583
|
isDraggable: (toolDraggable, { isEditing }) => toolDraggable && !isEditing,
|
|
3495
3584
|
onDoubleClick: (id, setEditingId) => setEditingId(id)
|
|
@@ -3497,15 +3586,16 @@ const builtInRenderers = [
|
|
|
3497
3586
|
createRenderer({
|
|
3498
3587
|
id: "stamp",
|
|
3499
3588
|
matches: (a) => a.type === PdfAnnotationSubtype.STAMP,
|
|
3500
|
-
component: _sfc_main$
|
|
3589
|
+
component: _sfc_main$l,
|
|
3501
3590
|
useAppearanceStream: false,
|
|
3502
3591
|
interactionDefaults: { isDraggable: true, isResizable: true, isRotatable: true }
|
|
3503
3592
|
}),
|
|
3504
3593
|
createRenderer({
|
|
3505
3594
|
id: "link",
|
|
3506
3595
|
matches: (a) => a.type === PdfAnnotationSubtype.LINK,
|
|
3507
|
-
component: _sfc_main$
|
|
3508
|
-
|
|
3596
|
+
component: _sfc_main$j,
|
|
3597
|
+
renderPreview: _sfc_main$C,
|
|
3598
|
+
interactionDefaults: { isDraggable: true, isResizable: true, isRotatable: false },
|
|
3509
3599
|
useAppearanceStream: false,
|
|
3510
3600
|
selectOverride: (e, annotation, helpers) => {
|
|
3511
3601
|
e.stopPropagation();
|
|
@@ -3521,10 +3611,11 @@ const builtInRenderers = [
|
|
|
3521
3611
|
}
|
|
3522
3612
|
helpers.selectAnnotation(helpers.pageIndex, annotation.object.id);
|
|
3523
3613
|
},
|
|
3524
|
-
hideSelectionMenu: (a) => !!a.inReplyToId
|
|
3614
|
+
hideSelectionMenu: (a) => !!a.inReplyToId,
|
|
3615
|
+
renderLocked: _sfc_main$D
|
|
3525
3616
|
})
|
|
3526
3617
|
];
|
|
3527
|
-
const _sfc_main$
|
|
3618
|
+
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
3528
3619
|
__name: "annotations",
|
|
3529
3620
|
props: {
|
|
3530
3621
|
documentId: {},
|
|
@@ -3555,6 +3646,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
3555
3646
|
});
|
|
3556
3647
|
const editingId = ref(null);
|
|
3557
3648
|
const appearanceMap = shallowRef({});
|
|
3649
|
+
const lockedMode = shallowRef({ type: LockModeType.None });
|
|
3558
3650
|
let prevScale = props.scale;
|
|
3559
3651
|
const annotationProvides = computed(
|
|
3560
3652
|
() => annotationCapability.value ? annotationCapability.value.forDocument(props.documentId) : null
|
|
@@ -3586,6 +3678,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
3586
3678
|
const syncState = (state) => {
|
|
3587
3679
|
annotations.value = getAnnotationsByPageIndex(state, pageIndex);
|
|
3588
3680
|
allSelectedIds.value = getSelectedAnnotationIds(state);
|
|
3681
|
+
lockedMode.value = state.locked;
|
|
3589
3682
|
};
|
|
3590
3683
|
syncState(provides.getState());
|
|
3591
3684
|
const off = provides.onStateChange(syncState);
|
|
@@ -3630,13 +3723,20 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
3630
3723
|
{ immediate: true }
|
|
3631
3724
|
);
|
|
3632
3725
|
const resolvedAnnotations = computed(
|
|
3633
|
-
() => annotations.value.map((annotation) =>
|
|
3634
|
-
|
|
3635
|
-
renderer
|
|
3636
|
-
|
|
3726
|
+
() => annotations.value.map((annotation) => {
|
|
3727
|
+
var _a;
|
|
3728
|
+
const renderer = resolveRenderer(annotation);
|
|
3729
|
+
if (!renderer) return null;
|
|
3730
|
+
const tool = ((_a = annotationProvides.value) == null ? void 0 : _a.findToolForAnnotation(annotation.object)) ?? null;
|
|
3731
|
+
const categories = getAnnotationCategories(tool);
|
|
3732
|
+
const locked = hasLockedFlag(annotation.object) || isCategoryLocked(categories, lockedMode.value);
|
|
3733
|
+
if (locked && renderer.hiddenWhenLocked) return null;
|
|
3734
|
+
return { annotation, renderer, tool, locked };
|
|
3735
|
+
}).filter((v) => v !== null)
|
|
3637
3736
|
);
|
|
3638
|
-
const getFinalDraggable = (annotation, renderer) => {
|
|
3737
|
+
const getFinalDraggable = (annotation, renderer, locked) => {
|
|
3639
3738
|
var _a;
|
|
3739
|
+
if (locked) return false;
|
|
3640
3740
|
const tool = (_a = annotationProvides.value) == null ? void 0 : _a.findToolForAnnotation(annotation.object);
|
|
3641
3741
|
const defaults = renderer.interactionDefaults;
|
|
3642
3742
|
const isEditing = editingId.value === annotation.object.id;
|
|
@@ -3647,8 +3747,9 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
3647
3747
|
);
|
|
3648
3748
|
return renderer.isDraggable ? renderer.isDraggable(resolvedDraggable, { isEditing }) : resolvedDraggable;
|
|
3649
3749
|
};
|
|
3650
|
-
const getResolvedResizable = (annotation, renderer) => {
|
|
3750
|
+
const getResolvedResizable = (annotation, renderer, locked) => {
|
|
3651
3751
|
var _a, _b;
|
|
3752
|
+
if (locked) return false;
|
|
3652
3753
|
const tool = (_a = annotationProvides.value) == null ? void 0 : _a.findToolForAnnotation(annotation.object);
|
|
3653
3754
|
return resolveInteractionProp(
|
|
3654
3755
|
tool == null ? void 0 : tool.interaction.isResizable,
|
|
@@ -3665,8 +3766,9 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
3665
3766
|
((_b = renderer.interactionDefaults) == null ? void 0 : _b.lockAspectRatio) ?? false
|
|
3666
3767
|
);
|
|
3667
3768
|
};
|
|
3668
|
-
const getResolvedRotatable = (annotation, renderer) => {
|
|
3769
|
+
const getResolvedRotatable = (annotation, renderer, locked) => {
|
|
3669
3770
|
var _a, _b;
|
|
3771
|
+
if (locked) return false;
|
|
3670
3772
|
const tool = (_a = annotationProvides.value) == null ? void 0 : _a.findToolForAnnotation(annotation.object);
|
|
3671
3773
|
return resolveInteractionProp(
|
|
3672
3774
|
tool == null ? void 0 : tool.interaction.isRotatable,
|
|
@@ -3674,13 +3776,18 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
3674
3776
|
((_b = renderer.interactionDefaults) == null ? void 0 : _b.isRotatable) ?? false
|
|
3675
3777
|
);
|
|
3676
3778
|
};
|
|
3677
|
-
const getSelectionMenu = (annotation, renderer) => {
|
|
3779
|
+
const getSelectionMenu = (annotation, renderer, locked) => {
|
|
3678
3780
|
var _a;
|
|
3781
|
+
if (locked) return void 0;
|
|
3679
3782
|
if ((_a = renderer.hideSelectionMenu) == null ? void 0 : _a.call(renderer, annotation.object)) return void 0;
|
|
3680
3783
|
if (isMultiSelected.value) return void 0;
|
|
3681
3784
|
return props.selectionMenu;
|
|
3682
3785
|
};
|
|
3683
|
-
const
|
|
3786
|
+
const noopSelect = (e) => {
|
|
3787
|
+
e.stopPropagation();
|
|
3788
|
+
};
|
|
3789
|
+
const getOnSelect = (annotation, renderer, locked) => {
|
|
3790
|
+
if (locked) return noopSelect;
|
|
3684
3791
|
if (renderer.selectOverride) {
|
|
3685
3792
|
const selectHelpers = {
|
|
3686
3793
|
defaultSelect: handleClick,
|
|
@@ -3803,7 +3910,8 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
3803
3910
|
const allSelected = annotationProvides.value.getSelectedAnnotations();
|
|
3804
3911
|
return allSelected.every((ta) => ta.object.pageIndex === props.pageIndex);
|
|
3805
3912
|
});
|
|
3806
|
-
const getOnDoubleClick = (renderer, annotation) => {
|
|
3913
|
+
const getOnDoubleClick = (renderer, annotation, locked) => {
|
|
3914
|
+
if (locked) return void 0;
|
|
3807
3915
|
if (!renderer.onDoubleClick) return void 0;
|
|
3808
3916
|
return (e) => {
|
|
3809
3917
|
e.stopPropagation();
|
|
@@ -3815,8 +3923,9 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
3815
3923
|
annotation.object.blendMode ?? renderer.defaultBlendMode ?? PdfBlendMode.Normal
|
|
3816
3924
|
);
|
|
3817
3925
|
};
|
|
3818
|
-
const getAppearance = (annotation, renderer) => {
|
|
3926
|
+
const getAppearance = (annotation, renderer, locked) => {
|
|
3819
3927
|
var _a, _b;
|
|
3928
|
+
if (locked && renderer.renderLocked) return void 0;
|
|
3820
3929
|
const tool = (_a = annotationProvides.value) == null ? void 0 : _a.findToolForAnnotation(annotation.object);
|
|
3821
3930
|
const useAP = ((_b = tool == null ? void 0 : tool.behavior) == null ? void 0 : _b.useAppearanceStream) ?? renderer.useAppearanceStream ?? true;
|
|
3822
3931
|
return useAP ? getAppearanceForAnnotation(annotation) : void 0;
|
|
@@ -3833,65 +3942,61 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
3833
3942
|
});
|
|
3834
3943
|
return (_ctx, _cache) => {
|
|
3835
3944
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
3836
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(resolvedAnnotations.value, ({ annotation, renderer }) => {
|
|
3945
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(resolvedAnnotations.value, ({ annotation, renderer, locked }) => {
|
|
3837
3946
|
var _a;
|
|
3838
|
-
return openBlock(),
|
|
3839
|
-
key: annotation.object.id
|
|
3947
|
+
return openBlock(), createBlock(_sfc_main$F, mergeProps({
|
|
3948
|
+
key: annotation.object.id,
|
|
3949
|
+
trackedAnnotation: annotation,
|
|
3950
|
+
isSelected: locked ? false : allSelectedIds.value.includes(annotation.object.id),
|
|
3951
|
+
isEditing: locked ? false : editingId.value === annotation.object.id,
|
|
3952
|
+
isMultiSelected: locked ? false : isMultiSelected.value,
|
|
3953
|
+
isDraggable: getFinalDraggable(annotation, renderer, locked),
|
|
3954
|
+
isResizable: getResolvedResizable(annotation, renderer, locked),
|
|
3955
|
+
lockAspectRatio: getResolvedLockAspectRatio(annotation, renderer),
|
|
3956
|
+
isRotatable: getResolvedRotatable(annotation, renderer, locked),
|
|
3957
|
+
vertexConfig: locked ? void 0 : renderer.vertexConfig,
|
|
3958
|
+
selectionMenu: getSelectionMenu(annotation, renderer, locked),
|
|
3959
|
+
onSelect: getOnSelect(annotation, renderer, locked),
|
|
3960
|
+
onDoubleClick: getOnDoubleClick(renderer, annotation, locked),
|
|
3961
|
+
zIndex: renderer.zIndex,
|
|
3962
|
+
blendMode: getBlendMode(annotation, renderer),
|
|
3963
|
+
style: (_a = renderer.containerStyle) == null ? void 0 : _a.call(renderer, annotation.object),
|
|
3964
|
+
appearance: getAppearance(annotation, renderer, locked)
|
|
3965
|
+
}, { ref_for: true }, containerProps.value), createSlots({
|
|
3966
|
+
default: withCtx(({ annotation: currentObject, appearanceActive }) => [
|
|
3967
|
+
(openBlock(), createBlock(resolveDynamicComponent(locked && renderer.renderLocked ? renderer.renderLocked : renderer.component), {
|
|
3968
|
+
annotation,
|
|
3969
|
+
currentObject,
|
|
3970
|
+
isSelected: locked ? false : allSelectedIds.value.includes(annotation.object.id),
|
|
3971
|
+
isEditing: locked ? false : editingId.value === annotation.object.id,
|
|
3972
|
+
scale: __props.scale,
|
|
3973
|
+
pageIndex: __props.pageIndex,
|
|
3974
|
+
documentId: __props.documentId,
|
|
3975
|
+
onClick: locked ? void 0 : getOnSelect(annotation, renderer, locked),
|
|
3976
|
+
appearanceActive
|
|
3977
|
+
}, null, 8, ["annotation", "currentObject", "isSelected", "isEditing", "scale", "pageIndex", "documentId", "onClick", "appearanceActive"]))
|
|
3978
|
+
]),
|
|
3979
|
+
"resize-handle": withCtx((slotProps) => [
|
|
3980
|
+
renderSlot(_ctx.$slots, "resize-handle", mergeProps({ ref_for: true }, slotProps))
|
|
3981
|
+
]),
|
|
3982
|
+
"vertex-handle": withCtx((slotProps) => [
|
|
3983
|
+
renderSlot(_ctx.$slots, "vertex-handle", mergeProps({ ref_for: true }, slotProps))
|
|
3984
|
+
]),
|
|
3985
|
+
"rotation-handle": withCtx((slotProps) => [
|
|
3986
|
+
renderSlot(_ctx.$slots, "rotation-handle", mergeProps({ ref_for: true }, slotProps))
|
|
3987
|
+
]),
|
|
3988
|
+
_: 2
|
|
3840
3989
|
}, [
|
|
3841
|
-
|
|
3842
|
-
|
|
3843
|
-
|
|
3844
|
-
|
|
3845
|
-
isEditing: editingId.value === annotation.object.id,
|
|
3846
|
-
isMultiSelected: isMultiSelected.value,
|
|
3847
|
-
isDraggable: getFinalDraggable(annotation, renderer),
|
|
3848
|
-
isResizable: getResolvedResizable(annotation, renderer),
|
|
3849
|
-
lockAspectRatio: getResolvedLockAspectRatio(annotation, renderer),
|
|
3850
|
-
isRotatable: getResolvedRotatable(annotation, renderer),
|
|
3851
|
-
vertexConfig: renderer.vertexConfig,
|
|
3852
|
-
selectionMenu: getSelectionMenu(annotation, renderer),
|
|
3853
|
-
onSelect: getOnSelect(annotation, renderer),
|
|
3854
|
-
onDoubleClick: getOnDoubleClick(renderer, annotation),
|
|
3855
|
-
zIndex: renderer.zIndex,
|
|
3856
|
-
blendMode: getBlendMode(annotation, renderer),
|
|
3857
|
-
style: (_a = renderer.containerStyle) == null ? void 0 : _a.call(renderer, annotation.object),
|
|
3858
|
-
appearance: getAppearance(annotation, renderer)
|
|
3859
|
-
}, { ref_for: true }, containerProps.value), createSlots({
|
|
3860
|
-
default: withCtx(({ annotation: currentObject, appearanceActive }) => [
|
|
3861
|
-
(openBlock(), createBlock(resolveDynamicComponent(renderer.component), {
|
|
3862
|
-
annotation,
|
|
3863
|
-
currentObject,
|
|
3864
|
-
isSelected: allSelectedIds.value.includes(annotation.object.id),
|
|
3865
|
-
isEditing: editingId.value === annotation.object.id,
|
|
3866
|
-
scale: __props.scale,
|
|
3867
|
-
pageIndex: __props.pageIndex,
|
|
3868
|
-
documentId: __props.documentId,
|
|
3869
|
-
onClick: getOnSelect(annotation, renderer),
|
|
3870
|
-
appearanceActive
|
|
3871
|
-
}, null, 8, ["annotation", "currentObject", "isSelected", "isEditing", "scale", "pageIndex", "documentId", "onClick", "appearanceActive"]))
|
|
3872
|
-
]),
|
|
3873
|
-
"resize-handle": withCtx((slotProps) => [
|
|
3874
|
-
renderSlot(_ctx.$slots, "resize-handle", mergeProps({ ref_for: true }, slotProps))
|
|
3875
|
-
]),
|
|
3876
|
-
"vertex-handle": withCtx((slotProps) => [
|
|
3877
|
-
renderSlot(_ctx.$slots, "vertex-handle", mergeProps({ ref_for: true }, slotProps))
|
|
3990
|
+
!isMultiSelected.value ? {
|
|
3991
|
+
name: "selection-menu",
|
|
3992
|
+
fn: withCtx((slotProps) => [
|
|
3993
|
+
renderSlot(_ctx.$slots, "selection-menu", mergeProps({ ref_for: true }, slotProps))
|
|
3878
3994
|
]),
|
|
3879
|
-
"
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
_: 2
|
|
3883
|
-
}, [
|
|
3884
|
-
!isMultiSelected.value ? {
|
|
3885
|
-
name: "selection-menu",
|
|
3886
|
-
fn: withCtx((slotProps) => [
|
|
3887
|
-
renderSlot(_ctx.$slots, "selection-menu", mergeProps({ ref_for: true }, slotProps))
|
|
3888
|
-
]),
|
|
3889
|
-
key: "0"
|
|
3890
|
-
} : void 0
|
|
3891
|
-
]), 1040, ["trackedAnnotation", "isSelected", "isEditing", "isMultiSelected", "isDraggable", "isResizable", "lockAspectRatio", "isRotatable", "vertexConfig", "selectionMenu", "onSelect", "onDoubleClick", "zIndex", "blendMode", "style", "appearance"])) : createCommentVNode("", true)
|
|
3892
|
-
], 64);
|
|
3995
|
+
key: "0"
|
|
3996
|
+
} : void 0
|
|
3997
|
+
]), 1040, ["trackedAnnotation", "isSelected", "isEditing", "isMultiSelected", "isDraggable", "isResizable", "lockAspectRatio", "isRotatable", "vertexConfig", "selectionMenu", "onSelect", "onDoubleClick", "zIndex", "blendMode", "style", "appearance"]);
|
|
3893
3998
|
}), 128)),
|
|
3894
|
-
allSelectedOnSamePage.value && selectedAnnotationsOnPage.value.length >= 2 ? (openBlock(), createBlock(_sfc_main$
|
|
3999
|
+
allSelectedOnSamePage.value && selectedAnnotationsOnPage.value.length >= 2 ? (openBlock(), createBlock(_sfc_main$E, {
|
|
3895
4000
|
key: 0,
|
|
3896
4001
|
documentId: __props.documentId,
|
|
3897
4002
|
pageIndex: __props.pageIndex,
|
|
@@ -3925,7 +4030,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
3925
4030
|
};
|
|
3926
4031
|
}
|
|
3927
4032
|
});
|
|
3928
|
-
const _sfc_main$
|
|
4033
|
+
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
3929
4034
|
__name: "text-markup",
|
|
3930
4035
|
props: {
|
|
3931
4036
|
documentId: {},
|
|
@@ -3974,25 +4079,25 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
3974
4079
|
inset: 0
|
|
3975
4080
|
})
|
|
3976
4081
|
}, [
|
|
3977
|
-
activeTool.value.defaults.type === unref(PdfAnnotationSubtype).HIGHLIGHT ? (openBlock(), createBlock(_sfc_main$
|
|
4082
|
+
activeTool.value.defaults.type === unref(PdfAnnotationSubtype).HIGHLIGHT ? (openBlock(), createBlock(_sfc_main$i, {
|
|
3978
4083
|
key: 0,
|
|
3979
4084
|
strokeColor: activeTool.value.defaults.strokeColor,
|
|
3980
4085
|
opacity: activeTool.value.defaults.opacity,
|
|
3981
4086
|
segmentRects: rects.value,
|
|
3982
4087
|
scale: __props.scale
|
|
3983
|
-
}, null, 8, ["strokeColor", "opacity", "segmentRects", "scale"])) : activeTool.value.defaults.type === unref(PdfAnnotationSubtype).UNDERLINE ? (openBlock(), createBlock(_sfc_main$
|
|
4088
|
+
}, null, 8, ["strokeColor", "opacity", "segmentRects", "scale"])) : activeTool.value.defaults.type === unref(PdfAnnotationSubtype).UNDERLINE ? (openBlock(), createBlock(_sfc_main$g, {
|
|
3984
4089
|
key: 1,
|
|
3985
4090
|
strokeColor: activeTool.value.defaults.strokeColor,
|
|
3986
4091
|
opacity: activeTool.value.defaults.opacity,
|
|
3987
4092
|
segmentRects: rects.value,
|
|
3988
4093
|
scale: __props.scale
|
|
3989
|
-
}, null, 8, ["strokeColor", "opacity", "segmentRects", "scale"])) : activeTool.value.defaults.type === unref(PdfAnnotationSubtype).STRIKEOUT ? (openBlock(), createBlock(_sfc_main$
|
|
4094
|
+
}, null, 8, ["strokeColor", "opacity", "segmentRects", "scale"])) : activeTool.value.defaults.type === unref(PdfAnnotationSubtype).STRIKEOUT ? (openBlock(), createBlock(_sfc_main$e, {
|
|
3990
4095
|
key: 2,
|
|
3991
4096
|
strokeColor: activeTool.value.defaults.strokeColor,
|
|
3992
4097
|
opacity: activeTool.value.defaults.opacity,
|
|
3993
4098
|
segmentRects: rects.value,
|
|
3994
4099
|
scale: __props.scale
|
|
3995
|
-
}, null, 8, ["strokeColor", "opacity", "segmentRects", "scale"])) : activeTool.value.defaults.type === unref(PdfAnnotationSubtype).SQUIGGLY ? (openBlock(), createBlock(_sfc_main$
|
|
4100
|
+
}, null, 8, ["strokeColor", "opacity", "segmentRects", "scale"])) : activeTool.value.defaults.type === unref(PdfAnnotationSubtype).SQUIGGLY ? (openBlock(), createBlock(_sfc_main$c, {
|
|
3996
4101
|
key: 3,
|
|
3997
4102
|
strokeColor: activeTool.value.defaults.strokeColor,
|
|
3998
4103
|
opacity: activeTool.value.defaults.opacity,
|
|
@@ -4003,14 +4108,19 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
4003
4108
|
};
|
|
4004
4109
|
}
|
|
4005
4110
|
});
|
|
4006
|
-
const _sfc_main$
|
|
4111
|
+
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
4007
4112
|
__name: "preview-renderer",
|
|
4008
4113
|
props: {
|
|
4114
|
+
toolId: {},
|
|
4009
4115
|
preview: {},
|
|
4010
4116
|
scale: {}
|
|
4011
4117
|
},
|
|
4012
4118
|
setup(__props) {
|
|
4013
4119
|
const props = __props;
|
|
4120
|
+
const registry = useRendererRegistry();
|
|
4121
|
+
const customMatch = computed(
|
|
4122
|
+
() => (registry == null ? void 0 : registry.getAll().find((r) => r.id === props.toolId && r.renderPreview)) ?? null
|
|
4123
|
+
);
|
|
4014
4124
|
const style = computed(() => {
|
|
4015
4125
|
const base = {
|
|
4016
4126
|
position: "absolute",
|
|
@@ -4027,30 +4137,31 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
4027
4137
|
return base;
|
|
4028
4138
|
});
|
|
4029
4139
|
return (_ctx, _cache) => {
|
|
4140
|
+
var _a;
|
|
4030
4141
|
return openBlock(), createElementBlock("div", {
|
|
4031
4142
|
style: normalizeStyle(style.value)
|
|
4032
4143
|
}, [
|
|
4033
|
-
__props.preview.type === unref(PdfAnnotationSubtype).CIRCLE ? (openBlock(), createBlock(unref(_sfc_main$
|
|
4144
|
+
__props.preview.type === unref(PdfAnnotationSubtype).CIRCLE ? (openBlock(), createBlock(unref(_sfc_main$x), mergeProps({
|
|
4034
4145
|
key: 0,
|
|
4035
4146
|
isSelected: false,
|
|
4036
4147
|
scale: __props.scale
|
|
4037
|
-
}, __props.preview.data), null, 16, ["scale"])) : __props.preview.type === unref(PdfAnnotationSubtype).SQUARE ? (openBlock(), createBlock(unref(_sfc_main$
|
|
4148
|
+
}, __props.preview.data), null, 16, ["scale"])) : __props.preview.type === unref(PdfAnnotationSubtype).SQUARE ? (openBlock(), createBlock(unref(_sfc_main$z), mergeProps({
|
|
4038
4149
|
key: 1,
|
|
4039
4150
|
isSelected: false,
|
|
4040
4151
|
scale: __props.scale
|
|
4041
|
-
}, __props.preview.data), null, 16, ["scale"])) : __props.preview.type === unref(PdfAnnotationSubtype).POLYGON ? (openBlock(), createBlock(unref(_sfc_main$
|
|
4152
|
+
}, __props.preview.data), null, 16, ["scale"])) : __props.preview.type === unref(PdfAnnotationSubtype).POLYGON ? (openBlock(), createBlock(unref(_sfc_main$r), mergeProps({
|
|
4042
4153
|
key: 2,
|
|
4043
4154
|
isSelected: false,
|
|
4044
4155
|
scale: __props.scale
|
|
4045
|
-
}, __props.preview.data), null, 16, ["scale"])) : __props.preview.type === unref(PdfAnnotationSubtype).POLYLINE ? (openBlock(), createBlock(unref(_sfc_main$
|
|
4156
|
+
}, __props.preview.data), null, 16, ["scale"])) : __props.preview.type === unref(PdfAnnotationSubtype).POLYLINE ? (openBlock(), createBlock(unref(_sfc_main$t), mergeProps({
|
|
4046
4157
|
key: 3,
|
|
4047
4158
|
isSelected: false,
|
|
4048
4159
|
scale: __props.scale
|
|
4049
|
-
}, __props.preview.data), null, 16, ["scale"])) : __props.preview.type === unref(PdfAnnotationSubtype).LINE ? (openBlock(), createBlock(unref(_sfc_main$
|
|
4160
|
+
}, __props.preview.data), null, 16, ["scale"])) : __props.preview.type === unref(PdfAnnotationSubtype).LINE ? (openBlock(), createBlock(unref(_sfc_main$v), mergeProps({
|
|
4050
4161
|
key: 4,
|
|
4051
4162
|
isSelected: false,
|
|
4052
4163
|
scale: __props.scale
|
|
4053
|
-
}, __props.preview.data), null, 16, ["scale"])) : __props.preview.type === unref(PdfAnnotationSubtype).INK ? (openBlock(), createBlock(unref(_sfc_main$
|
|
4164
|
+
}, __props.preview.data), null, 16, ["scale"])) : __props.preview.type === unref(PdfAnnotationSubtype).INK ? (openBlock(), createBlock(unref(_sfc_main$B), mergeProps({
|
|
4054
4165
|
key: 5,
|
|
4055
4166
|
isSelected: false,
|
|
4056
4167
|
scale: __props.scale
|
|
@@ -4062,12 +4173,17 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
4062
4173
|
border: `1px dashed ${__props.preview.data.fontColor || "#000000"}`,
|
|
4063
4174
|
backgroundColor: "transparent"
|
|
4064
4175
|
})
|
|
4065
|
-
}, null, 4)) :
|
|
4176
|
+
}, null, 4)) : ((_a = customMatch.value) == null ? void 0 : _a.renderPreview) ? (openBlock(), createBlock(resolveDynamicComponent(customMatch.value.renderPreview), {
|
|
4177
|
+
key: 7,
|
|
4178
|
+
data: __props.preview.data,
|
|
4179
|
+
bounds: __props.preview.bounds,
|
|
4180
|
+
scale: __props.scale
|
|
4181
|
+
}, null, 8, ["data", "bounds", "scale"])) : createCommentVNode("", true)
|
|
4066
4182
|
], 4);
|
|
4067
4183
|
};
|
|
4068
4184
|
}
|
|
4069
4185
|
});
|
|
4070
|
-
const _sfc_main$
|
|
4186
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
4071
4187
|
__name: "annotation-paint-layer",
|
|
4072
4188
|
props: {
|
|
4073
4189
|
documentId: {},
|
|
@@ -4158,17 +4274,18 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
4158
4274
|
style: { "display": "none" }
|
|
4159
4275
|
}, null, 512),
|
|
4160
4276
|
(openBlock(true), createElementBlock(Fragment, null, renderList(previews.value.entries(), ([toolId, preview]) => {
|
|
4161
|
-
return openBlock(), createBlock(_sfc_main$
|
|
4277
|
+
return openBlock(), createBlock(_sfc_main$4, {
|
|
4162
4278
|
key: toolId,
|
|
4279
|
+
toolId,
|
|
4163
4280
|
preview,
|
|
4164
4281
|
scale: __props.scale
|
|
4165
|
-
}, null, 8, ["preview", "scale"]);
|
|
4282
|
+
}, null, 8, ["toolId", "preview", "scale"]);
|
|
4166
4283
|
}), 128))
|
|
4167
4284
|
], 64);
|
|
4168
4285
|
};
|
|
4169
4286
|
}
|
|
4170
4287
|
});
|
|
4171
|
-
const _sfc_main$
|
|
4288
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
4172
4289
|
__name: "annotation-layer",
|
|
4173
4290
|
props: {
|
|
4174
4291
|
documentId: {},
|
|
@@ -4242,7 +4359,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
4242
4359
|
});
|
|
4243
4360
|
return (_ctx, _cache) => {
|
|
4244
4361
|
return openBlock(), createElementBlock("div", null, [
|
|
4245
|
-
createVNode(_sfc_main$
|
|
4362
|
+
createVNode(_sfc_main$6, {
|
|
4246
4363
|
documentId: __props.documentId,
|
|
4247
4364
|
pageIndex: __props.pageIndex,
|
|
4248
4365
|
scale: actualScale.value,
|
|
@@ -4276,12 +4393,12 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
4276
4393
|
]),
|
|
4277
4394
|
_: 3
|
|
4278
4395
|
}, 8, ["documentId", "pageIndex", "scale", "rotation", "pageWidth", "pageHeight", "resizeUi", "vertexUi", "rotationUi", "selectionOutlineColor", "selectionOutline", "groupSelectionOutline", "selectionMenu", "groupSelectionMenu", "annotationRenderers"]),
|
|
4279
|
-
createVNode(_sfc_main$
|
|
4396
|
+
createVNode(_sfc_main$5, {
|
|
4280
4397
|
documentId: __props.documentId,
|
|
4281
4398
|
pageIndex: __props.pageIndex,
|
|
4282
4399
|
scale: actualScale.value
|
|
4283
4400
|
}, null, 8, ["documentId", "pageIndex", "scale"]),
|
|
4284
|
-
createVNode(_sfc_main$
|
|
4401
|
+
createVNode(_sfc_main$3, {
|
|
4285
4402
|
documentId: __props.documentId,
|
|
4286
4403
|
pageIndex: __props.pageIndex,
|
|
4287
4404
|
scale: actualScale.value
|
|
@@ -4290,7 +4407,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
4290
4407
|
};
|
|
4291
4408
|
}
|
|
4292
4409
|
});
|
|
4293
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
4410
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
4294
4411
|
__name: "renderer-registry-provider",
|
|
4295
4412
|
setup(__props) {
|
|
4296
4413
|
provideRendererRegistry();
|
|
@@ -4299,38 +4416,61 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
4299
4416
|
};
|
|
4300
4417
|
}
|
|
4301
4418
|
});
|
|
4302
|
-
const
|
|
4419
|
+
const _hoisted_1 = { style: { "display": "none" } };
|
|
4420
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
4421
|
+
__name: "annotation-navigation-handler",
|
|
4422
|
+
setup(__props) {
|
|
4423
|
+
const { plugin } = useAnnotationPlugin();
|
|
4424
|
+
const { provides } = useAnnotationCapability();
|
|
4425
|
+
watchEffect((onCleanup) => {
|
|
4426
|
+
const p = provides.value;
|
|
4427
|
+
const pl = plugin.value;
|
|
4428
|
+
if (!p || !pl) return;
|
|
4429
|
+
const unsub = p.onNavigate((event) => {
|
|
4430
|
+
if (event.result.outcome === "uri" && pl.config.autoOpenLinks !== false) {
|
|
4431
|
+
window.open(event.result.uri, "_blank", "noopener,noreferrer");
|
|
4432
|
+
}
|
|
4433
|
+
});
|
|
4434
|
+
onCleanup(unsub);
|
|
4435
|
+
});
|
|
4436
|
+
return (_ctx, _cache) => {
|
|
4437
|
+
return openBlock(), createElementBlock("span", _hoisted_1);
|
|
4438
|
+
};
|
|
4439
|
+
}
|
|
4440
|
+
});
|
|
4441
|
+
const AnnotationPluginPackage = createPluginPackage(AnnotationPluginPackage$1).addWrapper(_sfc_main$1).addUtility(_sfc_main).build();
|
|
4303
4442
|
export {
|
|
4304
|
-
_sfc_main$
|
|
4305
|
-
_sfc_main$
|
|
4306
|
-
_sfc_main$
|
|
4443
|
+
_sfc_main$F as AnnotationContainer,
|
|
4444
|
+
_sfc_main$2 as AnnotationLayer,
|
|
4445
|
+
_sfc_main$3 as AnnotationPaintLayer,
|
|
4307
4446
|
AnnotationPluginPackage,
|
|
4308
|
-
_sfc_main$
|
|
4309
|
-
_sfc_main$
|
|
4310
|
-
_sfc_main$
|
|
4311
|
-
_sfc_main$
|
|
4312
|
-
_sfc_main$
|
|
4313
|
-
_sfc_main$
|
|
4314
|
-
_sfc_main$
|
|
4315
|
-
_sfc_main$
|
|
4316
|
-
_sfc_main$
|
|
4317
|
-
_sfc_main$
|
|
4318
|
-
_sfc_main$
|
|
4319
|
-
_sfc_main$
|
|
4320
|
-
_sfc_main as RendererRegistryProvider,
|
|
4321
|
-
_sfc_main$
|
|
4322
|
-
_sfc_main$
|
|
4323
|
-
_sfc_main$
|
|
4324
|
-
_sfc_main$
|
|
4325
|
-
_sfc_main$
|
|
4326
|
-
_sfc_main$
|
|
4327
|
-
_sfc_main$
|
|
4447
|
+
_sfc_main$6 as Annotations,
|
|
4448
|
+
_sfc_main$x as Circle,
|
|
4449
|
+
_sfc_main$p as FreeText,
|
|
4450
|
+
_sfc_main$E as GroupSelectionBox,
|
|
4451
|
+
_sfc_main$i as Highlight,
|
|
4452
|
+
_sfc_main$B as Ink,
|
|
4453
|
+
_sfc_main$v as Line,
|
|
4454
|
+
_sfc_main$k as Link,
|
|
4455
|
+
_sfc_main$r as Polygon,
|
|
4456
|
+
_sfc_main$t as Polyline,
|
|
4457
|
+
_sfc_main$4 as PreviewRenderer,
|
|
4458
|
+
_sfc_main$n as RenderAnnotation,
|
|
4459
|
+
_sfc_main$1 as RendererRegistryProvider,
|
|
4460
|
+
_sfc_main$z as Square,
|
|
4461
|
+
_sfc_main$c as Squiggly,
|
|
4462
|
+
_sfc_main$m as Stamp,
|
|
4463
|
+
_sfc_main$e as Strikeout,
|
|
4464
|
+
_sfc_main$8 as Text,
|
|
4465
|
+
_sfc_main$5 as TextMarkup,
|
|
4466
|
+
_sfc_main$g as Underline,
|
|
4328
4467
|
createRenderer,
|
|
4329
4468
|
createRendererRegistry,
|
|
4330
4469
|
provideRendererRegistry,
|
|
4331
4470
|
useAnnotation,
|
|
4332
4471
|
useAnnotationCapability,
|
|
4333
4472
|
useAnnotationPlugin,
|
|
4473
|
+
useIOSZoomPrevention,
|
|
4334
4474
|
useRegisterRenderers,
|
|
4335
4475
|
useRendererRegistry
|
|
4336
4476
|
};
|