@embedpdf/plugin-annotation 2.9.0 → 2.10.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 +3082 -2656
- package/dist/index.js.map +1 -1
- package/dist/lib/actions.d.ts +25 -6
- package/dist/lib/annotation-plugin.d.ts +15 -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 +149 -299
- package/dist/lib/tools/tools-utils.d.ts +448 -22
- package/dist/lib/tools/types.d.ts +37 -2
- package/dist/lib/types.d.ts +108 -24
- package/dist/preact/index.cjs +1 -1
- package/dist/preact/index.cjs.map +1 -1
- package/dist/preact/index.js +213 -92
- 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 +213 -92
- 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 +422 -234
- 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 +433 -277
- package/dist/vue/index.js.map +1 -1
- package/package.json +12 -10
package/dist/svelte/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createPluginPackage } from "@embedpdf/core";
|
|
2
|
-
import { AnnotationPlugin, initialDocumentState, generateCloudyRectanglePath, generateCloudyEllipsePath, patching, generateCloudyPolygonPath, getAnnotationsByPageIndex, getSelectedAnnotationIds, resolveInteractionProp, AnnotationPluginPackage as AnnotationPluginPackage$1 } from "@embedpdf/plugin-annotation";
|
|
2
|
+
import { AnnotationPlugin, initialDocumentState, generateCloudyRectanglePath, generateCloudyEllipsePath, patching, generateCloudyPolygonPath, LockModeType, getAnnotationsByPageIndex, getSelectedAnnotationIds, resolveInteractionProp, getAnnotationCategories, hasLockedFlag, isCategoryLocked, AnnotationPluginPackage as AnnotationPluginPackage$1 } from "@embedpdf/plugin-annotation";
|
|
3
3
|
export * from "@embedpdf/plugin-annotation";
|
|
4
4
|
import "svelte/internal/disclose-version";
|
|
5
5
|
import * as $ from "svelte/internal/client";
|
|
6
6
|
import { setContext, getContext, untrack } from "svelte";
|
|
7
|
-
import {
|
|
7
|
+
import { usePlugin, useCapability, useDocumentPermissions, useDocumentState } from "@embedpdf/core/svelte";
|
|
8
8
|
import { getCounterRotation } from "@embedpdf/utils";
|
|
9
9
|
import { useInteractionHandles, deepToRaw, doublePress, CounterRotate } from "@embedpdf/utils/svelte";
|
|
10
10
|
import { inferRotationCenterFromRects, boundingRectOrEmpty, PdfAnnotationBorderStyle, PdfVerticalAlignment, standardFontCssProperties, textAlignmentToCss, ignore, PdfErrorCode, getContrastStrokeColor, PdfBlendMode, PdfAnnotationSubtype, blendModeToCss } from "@embedpdf/models";
|
|
@@ -55,7 +55,10 @@ function createRenderer(entry) {
|
|
|
55
55
|
isDraggable: entry.isDraggable,
|
|
56
56
|
onDoubleClick: entry.onDoubleClick,
|
|
57
57
|
selectOverride: entry.selectOverride,
|
|
58
|
-
hideSelectionMenu: entry.hideSelectionMenu
|
|
58
|
+
hideSelectionMenu: entry.hideSelectionMenu,
|
|
59
|
+
renderPreview: entry.renderPreview,
|
|
60
|
+
hiddenWhenLocked: entry.hiddenWhenLocked,
|
|
61
|
+
renderLocked: entry.renderLocked
|
|
59
62
|
};
|
|
60
63
|
}
|
|
61
64
|
function RendererRegistryProvider($$anchor, $$props) {
|
|
@@ -96,6 +99,66 @@ const useAnnotation = (getDocumentId) => {
|
|
|
96
99
|
}
|
|
97
100
|
};
|
|
98
101
|
};
|
|
102
|
+
const MIN_IOS_FOCUS_FONT_PX = 16;
|
|
103
|
+
function detectIOS() {
|
|
104
|
+
try {
|
|
105
|
+
const nav = navigator;
|
|
106
|
+
return /iPad|iPhone|iPod/.test(navigator.userAgent) || navigator.platform === "MacIntel" && (nav == null ? void 0 : nav.maxTouchPoints) > 1;
|
|
107
|
+
} catch {
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
let _isIOS;
|
|
112
|
+
function getIsIOS() {
|
|
113
|
+
if (_isIOS === void 0) {
|
|
114
|
+
_isIOS = detectIOS();
|
|
115
|
+
}
|
|
116
|
+
return _isIOS;
|
|
117
|
+
}
|
|
118
|
+
function useIOSZoomPrevention(getComputedFontPx, getActive) {
|
|
119
|
+
const isIOS = getIsIOS();
|
|
120
|
+
const needsComp = $.derived(() => {
|
|
121
|
+
const px = getComputedFontPx();
|
|
122
|
+
return isIOS && getActive() && px > 0 && px < MIN_IOS_FOCUS_FONT_PX;
|
|
123
|
+
});
|
|
124
|
+
const adjustedFontPx = $.derived(() => $.get(needsComp) ? MIN_IOS_FOCUS_FONT_PX : getComputedFontPx());
|
|
125
|
+
const scaleComp = $.derived(() => $.get(needsComp) ? getComputedFontPx() / MIN_IOS_FOCUS_FONT_PX : 1);
|
|
126
|
+
const wrapperStyle = $.derived(() => {
|
|
127
|
+
if (!$.get(needsComp)) return "";
|
|
128
|
+
const s = $.get(scaleComp);
|
|
129
|
+
return `width: ${100 / s}%; height: ${100 / s}%; transform: scale(${s}); transform-origin: top left;`;
|
|
130
|
+
});
|
|
131
|
+
return {
|
|
132
|
+
get needsComp() {
|
|
133
|
+
return $.get(needsComp);
|
|
134
|
+
},
|
|
135
|
+
get adjustedFontPx() {
|
|
136
|
+
return $.get(adjustedFontPx);
|
|
137
|
+
},
|
|
138
|
+
get scaleComp() {
|
|
139
|
+
return $.get(scaleComp);
|
|
140
|
+
},
|
|
141
|
+
get wrapperStyle() {
|
|
142
|
+
return $.get(wrapperStyle);
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
function AnnotationNavigationHandler($$anchor, $$props) {
|
|
147
|
+
$.push($$props, true);
|
|
148
|
+
const { plugin } = useAnnotationPlugin();
|
|
149
|
+
const { provides } = useAnnotationCapability();
|
|
150
|
+
$.user_effect(() => {
|
|
151
|
+
const p = provides;
|
|
152
|
+
const pl = plugin;
|
|
153
|
+
if (!p || !pl) return;
|
|
154
|
+
return p.onNavigate((event) => {
|
|
155
|
+
if (event.result.outcome === "uri" && pl.config.autoOpenLinks !== false) {
|
|
156
|
+
window.open(event.result.uri, "_blank", "noopener,noreferrer");
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
});
|
|
160
|
+
$.pop();
|
|
161
|
+
}
|
|
99
162
|
var root_1$f = $.from_html(`<img alt="" draggable="false"/>`);
|
|
100
163
|
function AppearanceImage($$anchor, $$props) {
|
|
101
164
|
$.push($$props, true);
|
|
@@ -145,7 +208,7 @@ var root_7$1 = $.from_html(`<div style="display: contents;"><!> <div><svg viewBo
|
|
|
145
208
|
var root_12 = $.from_html(`<div></div>`);
|
|
146
209
|
var root_16 = $.from_html(`<div></div>`);
|
|
147
210
|
var root_23 = $.from_html(`<div><div> </div></div>`);
|
|
148
|
-
var root$
|
|
211
|
+
var root$g = $.from_html(`<div data-no-interaction=""><div><div><!> <!></div></div> <div><!> <!> <div><!> <!></div></div> <!> <!></div>`);
|
|
149
212
|
function AnnotationContainer($$anchor, $$props) {
|
|
150
213
|
$.push($$props, true);
|
|
151
214
|
let isEditing = $.prop($$props, "isEditing", 3, false), isMultiSelected = $.prop($$props, "isMultiSelected", 3, false), isRotatable = $.prop($$props, "isRotatable", 3, true), lockAspectRatio = $.prop($$props, "lockAspectRatio", 3, false), propsClass = $.prop($$props, "class", 3, ""), outlineOffset = $.prop($$props, "outlineOffset", 3, 1), zIndex = $.prop($$props, "zIndex", 3, 1), restProps = $.rest_props($$props, [
|
|
@@ -504,7 +567,7 @@ function AnnotationContainer($$anchor, $$props) {
|
|
|
504
567
|
}
|
|
505
568
|
};
|
|
506
569
|
}
|
|
507
|
-
var div = root$
|
|
570
|
+
var div = root$g();
|
|
508
571
|
var div_1 = $.child(div);
|
|
509
572
|
let styles;
|
|
510
573
|
var div_2 = $.child(div_1);
|
|
@@ -734,7 +797,7 @@ function AnnotationContainer($$anchor, $$props) {
|
|
|
734
797
|
"transform-origin": $.get(innerTransformOrigin),
|
|
735
798
|
outline: $.get(showOutline) ? `${$.get(outlineWidth)}px ${$.get(outlineStyleVal)} ${$.get(outlineColor)}` : "none",
|
|
736
799
|
"outline-offset": $.get(showOutline) ? `${$.get(outlineOff)}px` : "0px",
|
|
737
|
-
"pointer-events": $$props.isSelected && !isMultiSelected() ? "auto" : "none",
|
|
800
|
+
"pointer-events": $$props.isSelected && !isMultiSelected() && !isEditing() ? "auto" : "none",
|
|
738
801
|
"touch-action": "none",
|
|
739
802
|
cursor: $$props.isSelected && $.get(effectiveIsDraggable) ? "move" : "default"
|
|
740
803
|
}
|
|
@@ -978,7 +1041,7 @@ function AnnotationContainer($$anchor, $$props) {
|
|
|
978
1041
|
height: `${$.get(innerHeight) ?? ""}px`,
|
|
979
1042
|
transform: $.get(annotationRotation) !== 0 ? `rotate(${$.get(annotationRotation)}deg)` : void 0,
|
|
980
1043
|
"transform-origin": $.get(innerTransformOrigin),
|
|
981
|
-
"pointer-events": "none"
|
|
1044
|
+
"pointer-events": isEditing() ? "auto" : "none"
|
|
982
1045
|
});
|
|
983
1046
|
});
|
|
984
1047
|
$.append($$anchor, div);
|
|
@@ -1670,6 +1733,48 @@ function GroupSelectionBox($$anchor, $$props) {
|
|
|
1670
1733
|
$.pop();
|
|
1671
1734
|
}
|
|
1672
1735
|
$.delegate(["pointermove"]);
|
|
1736
|
+
var root$f = $.from_html(`<div role="link" tabindex="-1"></div>`);
|
|
1737
|
+
function LinkLockedMode($$anchor, $$props) {
|
|
1738
|
+
$.push($$props, true);
|
|
1739
|
+
const { provides } = useAnnotationCapability();
|
|
1740
|
+
function handleClick() {
|
|
1741
|
+
const target = $$props.annotation.object.target;
|
|
1742
|
+
if (!target || !provides) return;
|
|
1743
|
+
provides.forDocument($$props.documentId).navigateTarget(target);
|
|
1744
|
+
}
|
|
1745
|
+
var div = root$f();
|
|
1746
|
+
div.__click = handleClick;
|
|
1747
|
+
div.__keydown = (e) => {
|
|
1748
|
+
if (e.key === "Enter") handleClick();
|
|
1749
|
+
};
|
|
1750
|
+
$.set_style(div, "", {}, {
|
|
1751
|
+
width: "100%",
|
|
1752
|
+
height: "100%",
|
|
1753
|
+
cursor: "pointer",
|
|
1754
|
+
"pointer-events": "auto"
|
|
1755
|
+
});
|
|
1756
|
+
$.append($$anchor, div);
|
|
1757
|
+
$.pop();
|
|
1758
|
+
}
|
|
1759
|
+
$.delegate(["click", "keydown"]);
|
|
1760
|
+
var root$e = $.from_html(`<div></div>`);
|
|
1761
|
+
function LinkPreview($$anchor, $$props) {
|
|
1762
|
+
$.push($$props, true);
|
|
1763
|
+
var div = root$e();
|
|
1764
|
+
let styles;
|
|
1765
|
+
$.template_effect(() => styles = $.set_style(div, "", styles, {
|
|
1766
|
+
position: "absolute",
|
|
1767
|
+
left: "0",
|
|
1768
|
+
top: "0",
|
|
1769
|
+
width: `${$$props.bounds.size.width * $$props.scale}px`,
|
|
1770
|
+
height: `${$$props.bounds.size.height * $$props.scale}px`,
|
|
1771
|
+
"border-bottom": `${$$props.data.strokeWidth * $$props.scale}px solid ${$$props.data.strokeColor ?? ""}`,
|
|
1772
|
+
"background-color": "rgba(0, 0, 255, 0.05)",
|
|
1773
|
+
"box-sizing": "border-box"
|
|
1774
|
+
}));
|
|
1775
|
+
$.append($$anchor, div);
|
|
1776
|
+
$.pop();
|
|
1777
|
+
}
|
|
1673
1778
|
var root_1$d = $.from_svg(`<path fill="none" stroke="transparent"></path>`);
|
|
1674
1779
|
var root_3$4 = $.from_svg(`<path fill="none"></path>`);
|
|
1675
1780
|
var root$d = $.from_svg(`<svg><!><!></svg>`);
|
|
@@ -1705,8 +1810,8 @@ function Ink($$anchor, $$props) {
|
|
|
1705
1810
|
$.set_attribute(path, "d", $.get(d));
|
|
1706
1811
|
$.set_attribute(path, "stroke-width", $.get(hitStrokeWidth));
|
|
1707
1812
|
styles_1 = $.set_style(path, "", styles_1, {
|
|
1708
|
-
cursor: $$props.isSelected ? "move" : "pointer",
|
|
1709
|
-
"pointer-events": $$props.isSelected ? "none" : "visibleStroke",
|
|
1813
|
+
cursor: $$props.isSelected ? "move" : $$props.onClick ? "pointer" : "default",
|
|
1814
|
+
"pointer-events": !$$props.onClick ? "none" : $$props.isSelected ? "none" : "visibleStroke",
|
|
1710
1815
|
"stroke-linecap": "round",
|
|
1711
1816
|
"stroke-linejoin": "round"
|
|
1712
1817
|
});
|
|
@@ -1825,8 +1930,8 @@ function Square($$anchor, $$props) {
|
|
|
1825
1930
|
$.set_attribute(path, "d", $.get(cloudyPath).path);
|
|
1826
1931
|
$.set_attribute(path, "stroke-width", $.get(hitStrokeWidth));
|
|
1827
1932
|
styles_1 = $.set_style(path, "", styles_1, {
|
|
1828
|
-
cursor: $$props.isSelected ? "move" : "pointer",
|
|
1829
|
-
"pointer-events": $$props.isSelected ? "none" : color() === "transparent" ? "visibleStroke" : "visible"
|
|
1933
|
+
cursor: $$props.isSelected ? "move" : $$props.onClick ? "pointer" : "default",
|
|
1934
|
+
"pointer-events": !$$props.onClick ? "none" : $$props.isSelected ? "none" : color() === "transparent" ? "visibleStroke" : "visible"
|
|
1830
1935
|
});
|
|
1831
1936
|
});
|
|
1832
1937
|
$.append($$anchor2, path);
|
|
@@ -1845,8 +1950,8 @@ function Square($$anchor, $$props) {
|
|
|
1845
1950
|
$.set_attribute(rect_1, "height", $.get(height));
|
|
1846
1951
|
$.set_attribute(rect_1, "stroke-width", $.get(hitStrokeWidth));
|
|
1847
1952
|
styles_2 = $.set_style(rect_1, "", styles_2, {
|
|
1848
|
-
cursor: $$props.isSelected ? "move" : "pointer",
|
|
1849
|
-
"pointer-events": $$props.isSelected ? "none" : color() === "transparent" ? "visibleStroke" : "visible"
|
|
1953
|
+
cursor: $$props.isSelected ? "move" : $$props.onClick ? "pointer" : "default",
|
|
1954
|
+
"pointer-events": !$$props.onClick ? "none" : $$props.isSelected ? "none" : color() === "transparent" ? "visibleStroke" : "visible"
|
|
1850
1955
|
});
|
|
1851
1956
|
});
|
|
1852
1957
|
$.append($$anchor2, rect_1);
|
|
@@ -1978,7 +2083,7 @@ function Circle($$anchor, $$props) {
|
|
|
1978
2083
|
let svgWidth = $.derived(() => $.get(width) * $$props.scale);
|
|
1979
2084
|
let svgHeight = $.derived(() => $.get(height) * $$props.scale);
|
|
1980
2085
|
let hitStrokeWidth = $.derived(() => Math.max($$props.strokeWidth, MIN_HIT_AREA_SCREEN_PX / $$props.scale));
|
|
1981
|
-
let peValue = $.derived(() => $$props.isSelected ? "none" : color() === "transparent" ? "visibleStroke" : "visible");
|
|
2086
|
+
let peValue = $.derived(() => !$$props.onClick ? "none" : $$props.isSelected ? "none" : color() === "transparent" ? "visibleStroke" : "visible");
|
|
1982
2087
|
var svg = root$b();
|
|
1983
2088
|
let styles;
|
|
1984
2089
|
var node = $.child(svg);
|
|
@@ -1994,7 +2099,9 @@ function Circle($$anchor, $$props) {
|
|
|
1994
2099
|
$.set_attribute(path, "d", $.get(cloudyPath).path);
|
|
1995
2100
|
$.set_attribute(path, "stroke-width", $.get(hitStrokeWidth));
|
|
1996
2101
|
$.set_attribute(path, "pointer-events", $.get(peValue));
|
|
1997
|
-
styles_1 = $.set_style(path, "", styles_1, {
|
|
2102
|
+
styles_1 = $.set_style(path, "", styles_1, {
|
|
2103
|
+
cursor: $$props.isSelected ? "move" : $$props.onClick ? "pointer" : "default"
|
|
2104
|
+
});
|
|
1998
2105
|
});
|
|
1999
2106
|
$.append($$anchor2, path);
|
|
2000
2107
|
};
|
|
@@ -2012,7 +2119,9 @@ function Circle($$anchor, $$props) {
|
|
|
2012
2119
|
$.set_attribute(ellipse, "ry", $.get(ry));
|
|
2013
2120
|
$.set_attribute(ellipse, "stroke-width", $.get(hitStrokeWidth));
|
|
2014
2121
|
$.set_attribute(ellipse, "pointer-events", $.get(peValue));
|
|
2015
|
-
styles_2 = $.set_style(ellipse, "", styles_2, {
|
|
2122
|
+
styles_2 = $.set_style(ellipse, "", styles_2, {
|
|
2123
|
+
cursor: $$props.isSelected ? "move" : $$props.onClick ? "pointer" : "default"
|
|
2124
|
+
});
|
|
2016
2125
|
});
|
|
2017
2126
|
$.append($$anchor2, ellipse);
|
|
2018
2127
|
};
|
|
@@ -2158,8 +2267,8 @@ function Line($$anchor, $$props) {
|
|
|
2158
2267
|
$.set_attribute(path, "transform", $.get(endings).start.transform);
|
|
2159
2268
|
$.set_attribute(path, "stroke-width", $.get(hitStrokeWidth));
|
|
2160
2269
|
styles_2 = $.set_style(path, "", styles_2, {
|
|
2161
|
-
cursor: $$props.isSelected ? "move" : "pointer",
|
|
2162
|
-
"pointer-events": $$props.isSelected ? "none" : $.get(endings).start.filled ? "visible" : "visibleStroke",
|
|
2270
|
+
cursor: $$props.isSelected ? "move" : $$props.onClick ? "pointer" : "default",
|
|
2271
|
+
"pointer-events": !$$props.onClick ? "none" : $$props.isSelected ? "none" : $.get(endings).start.filled ? "visible" : "visibleStroke",
|
|
2163
2272
|
"stroke-linecap": "butt"
|
|
2164
2273
|
});
|
|
2165
2274
|
});
|
|
@@ -2183,8 +2292,8 @@ function Line($$anchor, $$props) {
|
|
|
2183
2292
|
$.set_attribute(path_1, "transform", $.get(endings).end.transform);
|
|
2184
2293
|
$.set_attribute(path_1, "stroke-width", $.get(hitStrokeWidth));
|
|
2185
2294
|
styles_3 = $.set_style(path_1, "", styles_3, {
|
|
2186
|
-
cursor: $$props.isSelected ? "move" : "pointer",
|
|
2187
|
-
"pointer-events": $$props.isSelected ? "none" : $.get(endings).end.filled ? "visible" : "visibleStroke",
|
|
2295
|
+
cursor: $$props.isSelected ? "move" : $$props.onClick ? "pointer" : "default",
|
|
2296
|
+
"pointer-events": !$$props.onClick ? "none" : $$props.isSelected ? "none" : $.get(endings).end.filled ? "visible" : "visibleStroke",
|
|
2188
2297
|
"stroke-linecap": "butt"
|
|
2189
2298
|
});
|
|
2190
2299
|
});
|
|
@@ -2278,8 +2387,8 @@ function Line($$anchor, $$props) {
|
|
|
2278
2387
|
$.set_attribute(line, "y2", $.get(y2));
|
|
2279
2388
|
$.set_attribute(line, "stroke-width", $.get(hitStrokeWidth));
|
|
2280
2389
|
styles_1 = $.set_style(line, "", styles_1, {
|
|
2281
|
-
cursor: $$props.isSelected ? "move" : "pointer",
|
|
2282
|
-
"pointer-events": $$props.isSelected ? "none" : "visibleStroke",
|
|
2390
|
+
cursor: $$props.isSelected ? "move" : $$props.onClick ? "pointer" : "default",
|
|
2391
|
+
"pointer-events": !$$props.onClick ? "none" : $$props.isSelected ? "none" : "visibleStroke",
|
|
2283
2392
|
"stroke-linecap": "butt"
|
|
2284
2393
|
});
|
|
2285
2394
|
});
|
|
@@ -2358,8 +2467,8 @@ function Polyline($$anchor, $$props) {
|
|
|
2358
2467
|
$.set_attribute(path_1, "transform", $.get(endings).start.transform);
|
|
2359
2468
|
$.set_attribute(path_1, "stroke-width", $.get(hitStrokeWidth));
|
|
2360
2469
|
styles_2 = $.set_style(path_1, "", styles_2, {
|
|
2361
|
-
cursor: $$props.isSelected ? "move" : "pointer",
|
|
2362
|
-
"pointer-events": $$props.isSelected ? "none" : $.get(endings).start.filled ? "visible" : "visibleStroke",
|
|
2470
|
+
cursor: $$props.isSelected ? "move" : $$props.onClick ? "pointer" : "default",
|
|
2471
|
+
"pointer-events": !$$props.onClick ? "none" : $$props.isSelected ? "none" : $.get(endings).start.filled ? "visible" : "visibleStroke",
|
|
2363
2472
|
"stroke-linecap": "butt"
|
|
2364
2473
|
});
|
|
2365
2474
|
});
|
|
@@ -2383,8 +2492,8 @@ function Polyline($$anchor, $$props) {
|
|
|
2383
2492
|
$.set_attribute(path_2, "transform", $.get(endings).end.transform);
|
|
2384
2493
|
$.set_attribute(path_2, "stroke-width", $.get(hitStrokeWidth));
|
|
2385
2494
|
styles_3 = $.set_style(path_2, "", styles_3, {
|
|
2386
|
-
cursor: $$props.isSelected ? "move" : "pointer",
|
|
2387
|
-
"pointer-events": $$props.isSelected ? "none" : $.get(endings).end.filled ? "visible" : "visibleStroke",
|
|
2495
|
+
cursor: $$props.isSelected ? "move" : $$props.onClick ? "pointer" : "default",
|
|
2496
|
+
"pointer-events": !$$props.onClick ? "none" : $$props.isSelected ? "none" : $.get(endings).end.filled ? "visible" : "visibleStroke",
|
|
2388
2497
|
"stroke-linecap": "butt"
|
|
2389
2498
|
});
|
|
2390
2499
|
});
|
|
@@ -2474,8 +2583,8 @@ function Polyline($$anchor, $$props) {
|
|
|
2474
2583
|
$.set_attribute(path, "d", $.get(pathData));
|
|
2475
2584
|
$.set_attribute(path, "stroke-width", $.get(hitStrokeWidth));
|
|
2476
2585
|
styles_1 = $.set_style(path, "", styles_1, {
|
|
2477
|
-
cursor: $$props.isSelected ? "move" : "pointer",
|
|
2478
|
-
"pointer-events": $$props.isSelected ? "none" : "visibleStroke",
|
|
2586
|
+
cursor: $$props.isSelected ? "move" : $$props.onClick ? "pointer" : "default",
|
|
2587
|
+
"pointer-events": !$$props.onClick ? "none" : $$props.isSelected ? "none" : "visibleStroke",
|
|
2479
2588
|
"stroke-linecap": "butt",
|
|
2480
2589
|
"stroke-linejoin": "miter"
|
|
2481
2590
|
});
|
|
@@ -2641,8 +2750,8 @@ function Polygon($$anchor, $$props) {
|
|
|
2641
2750
|
$.set_attribute(path, "d", $.get(isCloudy) && $.get(cloudyPath) ? $.get(cloudyPath).path : $.get(pathData));
|
|
2642
2751
|
$.set_attribute(path, "stroke-width", $.get(hitStrokeWidth));
|
|
2643
2752
|
styles_1 = $.set_style(path, "", styles_1, {
|
|
2644
|
-
cursor: $$props.isSelected ? "move" : "pointer",
|
|
2645
|
-
"pointer-events": $$props.isSelected ? "none" : color() === "transparent" ? "visibleStroke" : "visible",
|
|
2753
|
+
cursor: $$props.isSelected ? "move" : $$props.onClick ? "pointer" : "default",
|
|
2754
|
+
"pointer-events": !$$props.onClick ? "none" : $$props.isSelected ? "none" : color() === "transparent" ? "visibleStroke" : "visible",
|
|
2646
2755
|
"stroke-linecap": "butt",
|
|
2647
2756
|
"stroke-linejoin": "miter"
|
|
2648
2757
|
});
|
|
@@ -2674,42 +2783,32 @@ function FreeText($$anchor, $$props) {
|
|
|
2674
2783
|
const annotationCapability = useAnnotationCapability();
|
|
2675
2784
|
const annotationProvides = $.derived(() => annotationCapability.provides ? annotationCapability.provides.forDocument($$props.documentId) : null);
|
|
2676
2785
|
let editorRef = null;
|
|
2677
|
-
let isIOS = $.state(false);
|
|
2678
2786
|
let editingRef = false;
|
|
2679
2787
|
$.user_effect(() => {
|
|
2680
|
-
var _a;
|
|
2788
|
+
var _a, _b, _c;
|
|
2681
2789
|
if (!$$props.isEditing || !editorRef) return;
|
|
2682
2790
|
editingRef = true;
|
|
2683
2791
|
editorRef.focus();
|
|
2684
|
-
const
|
|
2792
|
+
const tool = (_a = $.get(annotationProvides)) == null ? void 0 : _a.findToolForAnnotation($$props.annotation.object);
|
|
2793
|
+
const isDefaultContent = ((_b = tool == null ? void 0 : tool.defaults) == null ? void 0 : _b.contents) != null && $$props.annotation.object.contents === tool.defaults.contents;
|
|
2794
|
+
const selection = (_c = window.getSelection) == null ? void 0 : _c.call(window);
|
|
2685
2795
|
if (!selection) return;
|
|
2686
2796
|
const range = document.createRange();
|
|
2687
2797
|
range.selectNodeContents(editorRef);
|
|
2688
|
-
|
|
2798
|
+
if (!isDefaultContent) {
|
|
2799
|
+
range.collapse(false);
|
|
2800
|
+
}
|
|
2689
2801
|
selection.removeAllRanges();
|
|
2690
2802
|
selection.addRange(range);
|
|
2691
2803
|
});
|
|
2692
|
-
$.user_pre_effect(() => {
|
|
2693
|
-
try {
|
|
2694
|
-
const nav = navigator;
|
|
2695
|
-
const ios = /iPad|iPhone|iPod/.test(navigator.userAgent) || navigator.platform === "MacIntel" && (nav == null ? void 0 : nav.maxTouchPoints) > 1;
|
|
2696
|
-
$.set(isIOS, ios, true);
|
|
2697
|
-
} catch {
|
|
2698
|
-
$.set(isIOS, false);
|
|
2699
|
-
}
|
|
2700
|
-
});
|
|
2701
2804
|
function handleBlur() {
|
|
2702
2805
|
if (!editingRef) return;
|
|
2703
2806
|
editingRef = false;
|
|
2704
2807
|
if (!$.get(annotationProvides) || !editorRef) return;
|
|
2705
|
-
$.get(annotationProvides).updateAnnotation($$props.pageIndex, $$props.annotation.object.id, { contents: editorRef.innerText });
|
|
2808
|
+
$.get(annotationProvides).updateAnnotation($$props.pageIndex, $$props.annotation.object.id, { contents: editorRef.innerText.replace(/\u00A0/g, " ") });
|
|
2706
2809
|
}
|
|
2707
|
-
const
|
|
2708
|
-
const
|
|
2709
|
-
const needsComp = $.derived(() => $.get(isIOS) && $$props.isEditing && $.get(computedFontPx) > 0 && $.get(computedFontPx) < MIN_IOS_FOCUS_FONT_PX);
|
|
2710
|
-
const adjustedFontPx = $.derived(() => $.get(needsComp) ? MIN_IOS_FOCUS_FONT_PX : $.get(computedFontPx));
|
|
2711
|
-
const scaleComp = $.derived(() => $.get(needsComp) ? $.get(computedFontPx) / MIN_IOS_FOCUS_FONT_PX : 1);
|
|
2712
|
-
const invScalePercent = $.derived(() => $.get(needsComp) ? 100 / $.get(scaleComp) : 100);
|
|
2810
|
+
const ios = useIOSZoomPrevention(() => $$props.annotation.object.fontSize * $$props.scale, () => $$props.isEditing);
|
|
2811
|
+
const invScalePercent = $.derived(() => ios.needsComp ? 100 / ios.scaleComp : 100);
|
|
2713
2812
|
const outerW = $.derived(() => $$props.annotation.object.rect.size.width * $$props.scale);
|
|
2714
2813
|
const outerH = $.derived(() => $$props.annotation.object.rect.size.height * $$props.scale);
|
|
2715
2814
|
const justify = $.derived(() => $$props.annotation.object.verticalAlign === PdfVerticalAlignment.Top ? "flex-start" : $$props.annotation.object.verticalAlign === PdfVerticalAlignment.Middle ? "center" : "flex-end");
|
|
@@ -2735,7 +2834,7 @@ function FreeText($$anchor, $$props) {
|
|
|
2735
2834
|
height: `${$.get(outerH)}px`,
|
|
2736
2835
|
"z-index": 2,
|
|
2737
2836
|
cursor: $$props.isSelected && !$$props.isEditing ? "move" : "default",
|
|
2738
|
-
"pointer-events": $$props.isSelected && !$$props.isEditing ? "none" : "auto",
|
|
2837
|
+
"pointer-events": !$$props.onClick ? "none" : $$props.isSelected && !$$props.isEditing ? "none" : "auto",
|
|
2739
2838
|
opacity: appearanceActive() ? 0 : 1
|
|
2740
2839
|
});
|
|
2741
2840
|
$.set_attribute(span, "contenteditable", $$props.isEditing);
|
|
@@ -2748,20 +2847,20 @@ function FreeText($$anchor, $$props) {
|
|
|
2748
2847
|
"flex-direction": "column",
|
|
2749
2848
|
"justify-content": $.get(justify),
|
|
2750
2849
|
color: $$props.annotation.object.fontColor,
|
|
2751
|
-
"font-size": `${
|
|
2850
|
+
"font-size": `${ios.adjustedFontPx}px`,
|
|
2752
2851
|
"font-family": $.get(fontCss).fontFamily,
|
|
2753
2852
|
"font-weight": $.get(fontCss).fontWeight,
|
|
2754
2853
|
"font-style": $.get(fontCss).fontStyle,
|
|
2755
2854
|
"text-align": textAlignmentToCss($$props.annotation.object.textAlign),
|
|
2756
2855
|
"background-color": $$props.annotation.object.color ?? $$props.annotation.object.backgroundColor,
|
|
2757
2856
|
opacity: $$props.annotation.object.opacity,
|
|
2758
|
-
width:
|
|
2759
|
-
height:
|
|
2857
|
+
width: ios.needsComp ? `${$.get(invScalePercent)}%` : "100%",
|
|
2858
|
+
height: ios.needsComp ? `${$.get(invScalePercent)}%` : "100%",
|
|
2760
2859
|
"line-height": "1.18",
|
|
2761
2860
|
overflow: "hidden",
|
|
2762
|
-
cursor: $$props.isEditing ? "text" : "pointer",
|
|
2861
|
+
cursor: $$props.isEditing ? "text" : $$props.onClick ? "pointer" : "default",
|
|
2763
2862
|
outline: "none",
|
|
2764
|
-
transform:
|
|
2863
|
+
transform: ios.needsComp ? `scale(${ios.scaleComp})` : void 0,
|
|
2765
2864
|
"transform-origin": "top left"
|
|
2766
2865
|
})
|
|
2767
2866
|
]
|
|
@@ -2919,8 +3018,8 @@ function Stamp($$anchor, $$props) {
|
|
|
2919
3018
|
});
|
|
2920
3019
|
$.reset(div);
|
|
2921
3020
|
$.template_effect(() => styles = $.set_style(div, "position: absolute; width: 100%; height: 100%; z-index: 2;", styles, {
|
|
2922
|
-
"pointer-events": $$props.isSelected ? "none" : "auto",
|
|
2923
|
-
cursor: "pointer"
|
|
3021
|
+
"pointer-events": !$$props.onClick ? "none" : $$props.isSelected ? "none" : "auto",
|
|
3022
|
+
cursor: $$props.isSelected ? "move" : $$props.onClick ? "pointer" : "default"
|
|
2924
3023
|
}));
|
|
2925
3024
|
$.append($$anchor, div);
|
|
2926
3025
|
$.pop();
|
|
@@ -2966,8 +3065,8 @@ function Link($$anchor, $$props) {
|
|
|
2966
3065
|
return void 0;
|
|
2967
3066
|
});
|
|
2968
3067
|
const isUnderline = $.derived(() => strokeStyle() === PdfAnnotationBorderStyle.UNDERLINE);
|
|
2969
|
-
const hitAreaCursor = $.derived(() => hasIRT() ? "default" : $$props.isSelected ? "move" : "pointer");
|
|
2970
|
-
const hitAreaPointerEvents = $.derived(() => hasIRT() ? "none" : $$props.isSelected ? "none" : "visible");
|
|
3068
|
+
const hitAreaCursor = $.derived(() => hasIRT() || !$$props.onClick ? "default" : $$props.isSelected ? "move" : "pointer");
|
|
3069
|
+
const hitAreaPointerEvents = $.derived(() => hasIRT() || !$$props.onClick ? "none" : $$props.isSelected ? "none" : "visible");
|
|
2971
3070
|
var svg = root$5();
|
|
2972
3071
|
let styles;
|
|
2973
3072
|
var rect_1 = $.child(svg);
|
|
@@ -3401,8 +3500,10 @@ function Caret($$anchor, $$props) {
|
|
|
3401
3500
|
"z-index": "2"
|
|
3402
3501
|
});
|
|
3403
3502
|
$.set_attribute(path_1, "d", $.get(path));
|
|
3404
|
-
$.set_attribute(path_1, "pointer-events", $$props.isSelected ? "none" : "visible");
|
|
3405
|
-
styles_1 = $.set_style(path_1, "", styles_1, {
|
|
3503
|
+
$.set_attribute(path_1, "pointer-events", !$$props.onClick ? "none" : $$props.isSelected ? "none" : "visible");
|
|
3504
|
+
styles_1 = $.set_style(path_1, "", styles_1, {
|
|
3505
|
+
cursor: $$props.isSelected ? "move" : $$props.onClick ? "pointer" : "default"
|
|
3506
|
+
});
|
|
3406
3507
|
});
|
|
3407
3508
|
$.append($$anchor, svg);
|
|
3408
3509
|
$.pop();
|
|
@@ -3465,8 +3566,8 @@ function Text($$anchor, $$props) {
|
|
|
3465
3566
|
position: "absolute",
|
|
3466
3567
|
inset: "0",
|
|
3467
3568
|
"z-index": "2",
|
|
3468
|
-
"pointer-events": $$props.isSelected ? "none" : "auto",
|
|
3469
|
-
cursor: $$props.isSelected ? "move" : "pointer"
|
|
3569
|
+
"pointer-events": !$$props.onClick ? "none" : $$props.isSelected ? "none" : "auto",
|
|
3570
|
+
cursor: $$props.isSelected ? "move" : $$props.onClick ? "pointer" : "default"
|
|
3470
3571
|
}));
|
|
3471
3572
|
$.append($$anchor, div);
|
|
3472
3573
|
$.pop();
|
|
@@ -3608,7 +3709,8 @@ const builtInRenderers = [
|
|
|
3608
3709
|
id: "link",
|
|
3609
3710
|
matches: (a) => a.type === PdfAnnotationSubtype.LINK,
|
|
3610
3711
|
component: LinkRenderer,
|
|
3611
|
-
|
|
3712
|
+
renderPreview: LinkPreview,
|
|
3713
|
+
interactionDefaults: { isDraggable: true, isResizable: true, isRotatable: false },
|
|
3612
3714
|
useAppearanceStream: false,
|
|
3613
3715
|
selectOverride: (e, annotation, helpers) => {
|
|
3614
3716
|
e.stopPropagation();
|
|
@@ -3624,7 +3726,8 @@ const builtInRenderers = [
|
|
|
3624
3726
|
}
|
|
3625
3727
|
helpers.selectAnnotation(helpers.pageIndex, annotation.object.id);
|
|
3626
3728
|
},
|
|
3627
|
-
hideSelectionMenu: (a) => !!a.inReplyToId
|
|
3729
|
+
hideSelectionMenu: (a) => !!a.inReplyToId,
|
|
3730
|
+
renderLocked: LinkLockedMode
|
|
3628
3731
|
})
|
|
3629
3732
|
];
|
|
3630
3733
|
var root$2 = $.from_html(`<!> <!>`, 1);
|
|
@@ -3638,6 +3741,7 @@ function Annotations($$anchor, $$props) {
|
|
|
3638
3741
|
let allSelectedIds = $.state($.proxy([]));
|
|
3639
3742
|
let editingId = $.state(null);
|
|
3640
3743
|
let appearanceMap = $.state($.proxy({}));
|
|
3744
|
+
let lockedMode = $.state($.proxy({ type: LockModeType.None }));
|
|
3641
3745
|
let prevScale = $$props.scale;
|
|
3642
3746
|
const annotationProvides = $.derived(() => annotationCapability.provides ? annotationCapability.provides.forDocument($$props.documentId) : null);
|
|
3643
3747
|
const isMultiSelected = $.derived(() => $.get(allSelectedIds).length > 1);
|
|
@@ -3664,12 +3768,22 @@ function Annotations($$anchor, $$props) {
|
|
|
3664
3768
|
const currentState = $.get(annotationProvides).getState();
|
|
3665
3769
|
$.set(annotations, getAnnotationsByPageIndex(currentState, $$props.pageIndex), true);
|
|
3666
3770
|
$.set(allSelectedIds, getSelectedAnnotationIds(currentState), true);
|
|
3771
|
+
$.set(lockedMode, currentState.locked, true);
|
|
3667
3772
|
const off = $.get(annotationProvides).onStateChange((state) => {
|
|
3668
3773
|
$.set(annotations, getAnnotationsByPageIndex(state, $$props.pageIndex), true);
|
|
3669
3774
|
$.set(allSelectedIds, getSelectedAnnotationIds(state), true);
|
|
3775
|
+
$.set(lockedMode, state.locked, true);
|
|
3670
3776
|
});
|
|
3671
3777
|
return () => off == null ? void 0 : off();
|
|
3672
3778
|
});
|
|
3779
|
+
$.user_effect(() => {
|
|
3780
|
+
if (!$.get(annotationProvides)) return;
|
|
3781
|
+
return $.get(annotationProvides).onAnnotationEvent((event) => {
|
|
3782
|
+
if (event.type === "create" && event.editAfterCreate) {
|
|
3783
|
+
$.set(editingId, event.annotation.id, true);
|
|
3784
|
+
}
|
|
3785
|
+
});
|
|
3786
|
+
});
|
|
3673
3787
|
$.user_effect(() => {
|
|
3674
3788
|
if (!$.get(annotationProvides)) return;
|
|
3675
3789
|
if (prevScale !== $$props.scale) {
|
|
@@ -3685,6 +3799,9 @@ function Annotations($$anchor, $$props) {
|
|
|
3685
3799
|
const handlers = {
|
|
3686
3800
|
onPointerDown: (_, pe) => {
|
|
3687
3801
|
if (pe.target === pe.currentTarget && $.get(annotationProvides)) {
|
|
3802
|
+
if ($.get(editingId) && $.get(annotations).some((a) => a.object.id === $.get(editingId))) {
|
|
3803
|
+
pe.stopImmediatePropagation();
|
|
3804
|
+
}
|
|
3688
3805
|
$.get(annotationProvides).deselectAnnotation();
|
|
3689
3806
|
$.set(editingId, null);
|
|
3690
3807
|
}
|
|
@@ -3765,174 +3882,195 @@ function Annotations($$anchor, $$props) {
|
|
|
3765
3882
|
var fragment_1 = $.comment();
|
|
3766
3883
|
var node_1 = $.first_child(fragment_1);
|
|
3767
3884
|
{
|
|
3768
|
-
var
|
|
3769
|
-
const isSelected = $.derived(() => $.get(allSelectedIds).includes($.get(annotation).object.id));
|
|
3770
|
-
const isEditing = $.derived(() => $.get(editingId) === $.get(annotation).object.id);
|
|
3885
|
+
var consequent_1 = ($$anchor3) => {
|
|
3771
3886
|
const tool = $.derived(() => {
|
|
3772
3887
|
var _a;
|
|
3773
|
-
return (_a = $.get(annotationProvides)) == null ? void 0 : _a.findToolForAnnotation($.get(annotation).object);
|
|
3774
|
-
});
|
|
3775
|
-
const defaults = $.derived(() => $.get(renderer).interactionDefaults);
|
|
3776
|
-
const resolvedDraggable = $.derived(() => {
|
|
3777
|
-
var _a, _b;
|
|
3778
|
-
return resolveInteractionProp((_a = $.get(tool)) == null ? void 0 : _a.interaction.isDraggable, $.get(annotation).object, ((_b = $.get(defaults)) == null ? void 0 : _b.isDraggable) ?? true);
|
|
3888
|
+
return ((_a = $.get(annotationProvides)) == null ? void 0 : _a.findToolForAnnotation($.get(annotation).object)) ?? null;
|
|
3779
3889
|
});
|
|
3780
|
-
const
|
|
3781
|
-
const
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
});
|
|
3785
|
-
const selectHelpers = $.derived(() => ({
|
|
3786
|
-
defaultSelect: handleClick,
|
|
3787
|
-
selectAnnotation: (pi, id) => {
|
|
3788
|
-
var _a;
|
|
3789
|
-
return (_a = $.get(annotationProvides)) == null ? void 0 : _a.selectAnnotation(pi, id);
|
|
3790
|
-
},
|
|
3791
|
-
clearSelection: () => {
|
|
3792
|
-
var _a;
|
|
3793
|
-
return (_a = selectionCapability.provides) == null ? void 0 : _a.clear();
|
|
3794
|
-
},
|
|
3795
|
-
allAnnotations: $.get(annotations),
|
|
3796
|
-
pageIndex: $$props.pageIndex
|
|
3797
|
-
}));
|
|
3798
|
-
const onSelect = $.derived(() => $.get(renderer).selectOverride ? (e) => $.get(renderer).selectOverride(e, $.get(annotation), $.get(selectHelpers)) : (e) => handleClick(e, $.get(annotation)));
|
|
3799
|
-
const RendererComponent = $.derived(() => $.get(renderer).component);
|
|
3890
|
+
const categories = $.derived(() => getAnnotationCategories($.get(tool)));
|
|
3891
|
+
const locked = $.derived(() => hasLockedFlag($.get(annotation).object) || isCategoryLocked($.get(categories), $.get(lockedMode)));
|
|
3892
|
+
var fragment_2 = $.comment();
|
|
3893
|
+
var node_2 = $.first_child(fragment_2);
|
|
3800
3894
|
{
|
|
3801
|
-
|
|
3802
|
-
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
$.
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
|
|
3812
|
-
|
|
3813
|
-
|
|
3814
|
-
|
|
3815
|
-
|
|
3816
|
-
|
|
3817
|
-
|
|
3818
|
-
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
|
|
3830
|
-
|
|
3831
|
-
|
|
3832
|
-
|
|
3895
|
+
var consequent = ($$anchor4) => {
|
|
3896
|
+
const hasRenderLocked = $.derived(() => $.get(locked) && !!$.get(renderer).renderLocked);
|
|
3897
|
+
const isSelected = $.derived(() => $.get(locked) ? false : $.get(allSelectedIds).includes($.get(annotation).object.id));
|
|
3898
|
+
const isEditing = $.derived(() => $.get(locked) ? false : $.get(editingId) === $.get(annotation).object.id);
|
|
3899
|
+
const defaults = $.derived(() => $.get(renderer).interactionDefaults);
|
|
3900
|
+
const resolvedDraggable = $.derived(() => {
|
|
3901
|
+
var _a, _b;
|
|
3902
|
+
return resolveInteractionProp((_a = $.get(tool)) == null ? void 0 : _a.interaction.isDraggable, $.get(annotation).object, ((_b = $.get(defaults)) == null ? void 0 : _b.isDraggable) ?? true);
|
|
3903
|
+
});
|
|
3904
|
+
const finalDraggable = $.derived(() => $.get(locked) ? false : $.get(renderer).isDraggable ? $.get(renderer).isDraggable($.get(resolvedDraggable), { isEditing: $.get(isEditing) }) : $.get(resolvedDraggable));
|
|
3905
|
+
const useAP = $.derived(() => {
|
|
3906
|
+
var _a, _b;
|
|
3907
|
+
return ((_b = (_a = $.get(tool)) == null ? void 0 : _a.behavior) == null ? void 0 : _b.useAppearanceStream) ?? $.get(renderer).useAppearanceStream ?? true;
|
|
3908
|
+
});
|
|
3909
|
+
const appearance = $.derived(() => $.get(hasRenderLocked) ? void 0 : $.get(useAP) ? getAppearanceForAnnotation($.get(annotation)) : void 0);
|
|
3910
|
+
const selectHelpers = $.derived(() => ({
|
|
3911
|
+
defaultSelect: handleClick,
|
|
3912
|
+
selectAnnotation: (pi, id) => {
|
|
3913
|
+
var _a;
|
|
3914
|
+
return (_a = $.get(annotationProvides)) == null ? void 0 : _a.selectAnnotation(pi, id);
|
|
3915
|
+
},
|
|
3916
|
+
clearSelection: () => {
|
|
3917
|
+
var _a;
|
|
3918
|
+
return (_a = selectionCapability.provides) == null ? void 0 : _a.clear();
|
|
3919
|
+
},
|
|
3920
|
+
allAnnotations: $.get(annotations),
|
|
3921
|
+
pageIndex: $$props.pageIndex
|
|
3922
|
+
}));
|
|
3923
|
+
const noopSelect = $.derived(() => (e) => {
|
|
3924
|
+
e.stopPropagation();
|
|
3925
|
+
});
|
|
3926
|
+
const onSelect = $.derived(() => $.get(locked) ? $.get(noopSelect) : $.get(renderer).selectOverride ? (e) => $.get(renderer).selectOverride(e, $.get(annotation), $.get(selectHelpers)) : (e) => handleClick(e, $.get(annotation)));
|
|
3927
|
+
const RendererComponent = $.derived(() => $.get(hasRenderLocked) ? $.get(renderer).renderLocked : $.get(renderer).component);
|
|
3928
|
+
{
|
|
3929
|
+
const children = ($$anchor5, currentObject = $.noop, $$arg1) => {
|
|
3930
|
+
let appearanceActive = () => $$arg1 == null ? void 0 : $$arg1().appearanceActive;
|
|
3931
|
+
var fragment_4 = $.comment();
|
|
3932
|
+
var node_3 = $.first_child(fragment_4);
|
|
3933
|
+
{
|
|
3934
|
+
let $02 = $.derived(() => $.get(locked) ? void 0 : $.get(onSelect));
|
|
3935
|
+
$.component(node_3, () => $.get(RendererComponent), ($$anchor6, RendererComponent_1) => {
|
|
3936
|
+
RendererComponent_1($$anchor6, {
|
|
3937
|
+
get annotation() {
|
|
3938
|
+
return $.get(annotation);
|
|
3939
|
+
},
|
|
3940
|
+
get currentObject() {
|
|
3941
|
+
return currentObject();
|
|
3942
|
+
},
|
|
3943
|
+
get isSelected() {
|
|
3944
|
+
return $.get(isSelected);
|
|
3945
|
+
},
|
|
3946
|
+
get isEditing() {
|
|
3947
|
+
return $.get(isEditing);
|
|
3948
|
+
},
|
|
3949
|
+
get scale() {
|
|
3950
|
+
return $$props.scale;
|
|
3951
|
+
},
|
|
3952
|
+
get pageIndex() {
|
|
3953
|
+
return $$props.pageIndex;
|
|
3954
|
+
},
|
|
3955
|
+
get documentId() {
|
|
3956
|
+
return $$props.documentId;
|
|
3957
|
+
},
|
|
3958
|
+
get onClick() {
|
|
3959
|
+
return $.get($02);
|
|
3960
|
+
},
|
|
3961
|
+
get appearanceActive() {
|
|
3962
|
+
return appearanceActive();
|
|
3963
|
+
}
|
|
3964
|
+
});
|
|
3965
|
+
});
|
|
3833
3966
|
}
|
|
3967
|
+
$.append($$anchor5, fragment_4);
|
|
3968
|
+
};
|
|
3969
|
+
let $0 = $.derived(() => $.get(locked) ? false : $.get(isMultiSelected));
|
|
3970
|
+
let $1 = $.derived(() => {
|
|
3971
|
+
var _a, _b;
|
|
3972
|
+
return $.get(locked) ? false : resolveInteractionProp((_a = $.get(tool)) == null ? void 0 : _a.interaction.isResizable, $.get(annotation).object, ((_b = $.get(defaults)) == null ? void 0 : _b.isResizable) ?? false);
|
|
3834
3973
|
});
|
|
3835
|
-
|
|
3836
|
-
|
|
3974
|
+
let $2 = $.derived(() => {
|
|
3975
|
+
var _a, _b;
|
|
3976
|
+
return resolveInteractionProp((_a = $.get(tool)) == null ? void 0 : _a.interaction.lockAspectRatio, $.get(annotation).object, ((_b = $.get(defaults)) == null ? void 0 : _b.lockAspectRatio) ?? false);
|
|
3977
|
+
});
|
|
3978
|
+
let $3 = $.derived(() => {
|
|
3979
|
+
var _a, _b;
|
|
3980
|
+
return $.get(locked) ? false : resolveInteractionProp((_a = $.get(tool)) == null ? void 0 : _a.interaction.isRotatable, $.get(annotation).object, ((_b = $.get(defaults)) == null ? void 0 : _b.isRotatable) ?? false);
|
|
3981
|
+
});
|
|
3982
|
+
let $4 = $.derived(() => $.get(locked) ? void 0 : $.get(renderer).vertexConfig);
|
|
3983
|
+
let $5 = $.derived(() => {
|
|
3984
|
+
var _a, _b;
|
|
3985
|
+
return $.get(locked) ? void 0 : ((_b = (_a = $.get(renderer)).hideSelectionMenu) == null ? void 0 : _b.call(_a, $.get(annotation).object)) ? void 0 : $.get(isMultiSelected) ? void 0 : $$props.selectionMenu;
|
|
3986
|
+
});
|
|
3987
|
+
let $6 = $.derived(() => {
|
|
3988
|
+
var _a, _b;
|
|
3989
|
+
return $.get(locked) ? void 0 : ((_b = (_a = $.get(renderer)).hideSelectionMenu) == null ? void 0 : _b.call(_a, $.get(annotation).object)) ? void 0 : $.get(isMultiSelected) ? void 0 : $$props.selectionMenuSnippet;
|
|
3990
|
+
});
|
|
3991
|
+
let $7 = $.derived(() => $.get(locked) ? void 0 : $.get(renderer).onDoubleClick ? (e) => {
|
|
3992
|
+
e.stopPropagation();
|
|
3993
|
+
$.get(renderer).onDoubleClick($.get(annotation).object.id, setEditingId);
|
|
3994
|
+
} : void 0);
|
|
3995
|
+
let $8 = $.derived(() => blendModeToCss($.get(annotation).object.blendMode ?? $.get(renderer).defaultBlendMode ?? PdfBlendMode.Normal));
|
|
3996
|
+
let $9 = $.derived(() => {
|
|
3997
|
+
var _a, _b;
|
|
3998
|
+
return (_b = (_a = $.get(renderer)).containerStyle) == null ? void 0 : _b.call(_a, $.get(annotation).object);
|
|
3999
|
+
});
|
|
4000
|
+
AnnotationContainer($$anchor4, $.spread_props(
|
|
4001
|
+
{
|
|
4002
|
+
get trackedAnnotation() {
|
|
4003
|
+
return $.get(annotation);
|
|
4004
|
+
},
|
|
4005
|
+
get isSelected() {
|
|
4006
|
+
return $.get(isSelected);
|
|
4007
|
+
},
|
|
4008
|
+
get isEditing() {
|
|
4009
|
+
return $.get(isEditing);
|
|
4010
|
+
},
|
|
4011
|
+
get isMultiSelected() {
|
|
4012
|
+
return $.get($0);
|
|
4013
|
+
},
|
|
4014
|
+
get isDraggable() {
|
|
4015
|
+
return $.get(finalDraggable);
|
|
4016
|
+
},
|
|
4017
|
+
get isResizable() {
|
|
4018
|
+
return $.get($1);
|
|
4019
|
+
},
|
|
4020
|
+
get lockAspectRatio() {
|
|
4021
|
+
return $.get($2);
|
|
4022
|
+
},
|
|
4023
|
+
get isRotatable() {
|
|
4024
|
+
return $.get($3);
|
|
4025
|
+
},
|
|
4026
|
+
get vertexConfig() {
|
|
4027
|
+
return $.get($4);
|
|
4028
|
+
},
|
|
4029
|
+
get selectionMenu() {
|
|
4030
|
+
return $.get($5);
|
|
4031
|
+
},
|
|
4032
|
+
get selectionMenuSnippet() {
|
|
4033
|
+
return $.get($6);
|
|
4034
|
+
},
|
|
4035
|
+
get onSelect() {
|
|
4036
|
+
return $.get(onSelect);
|
|
4037
|
+
},
|
|
4038
|
+
get onDoubleClick() {
|
|
4039
|
+
return $.get($7);
|
|
4040
|
+
},
|
|
4041
|
+
get zIndex() {
|
|
4042
|
+
return $.get(renderer).zIndex;
|
|
4043
|
+
},
|
|
4044
|
+
get blendMode() {
|
|
4045
|
+
return $.get($8);
|
|
4046
|
+
},
|
|
4047
|
+
get style() {
|
|
4048
|
+
return $.get($9);
|
|
4049
|
+
},
|
|
4050
|
+
get appearance() {
|
|
4051
|
+
return $.get(appearance);
|
|
4052
|
+
}
|
|
4053
|
+
},
|
|
4054
|
+
() => annotationsProps,
|
|
4055
|
+
{ children, $$slots: { default: true } }
|
|
4056
|
+
));
|
|
4057
|
+
}
|
|
3837
4058
|
};
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
return resolveInteractionProp((_a = $.get(tool)) == null ? void 0 : _a.interaction.isResizable, $.get(annotation).object, ((_b = $.get(defaults)) == null ? void 0 : _b.isResizable) ?? false);
|
|
3841
|
-
});
|
|
3842
|
-
let $1 = $.derived(() => {
|
|
3843
|
-
var _a, _b;
|
|
3844
|
-
return resolveInteractionProp((_a = $.get(tool)) == null ? void 0 : _a.interaction.lockAspectRatio, $.get(annotation).object, ((_b = $.get(defaults)) == null ? void 0 : _b.lockAspectRatio) ?? false);
|
|
3845
|
-
});
|
|
3846
|
-
let $2 = $.derived(() => {
|
|
3847
|
-
var _a, _b;
|
|
3848
|
-
return resolveInteractionProp((_a = $.get(tool)) == null ? void 0 : _a.interaction.isRotatable, $.get(annotation).object, ((_b = $.get(defaults)) == null ? void 0 : _b.isRotatable) ?? false);
|
|
3849
|
-
});
|
|
3850
|
-
let $3 = $.derived(() => {
|
|
3851
|
-
var _a, _b;
|
|
3852
|
-
return ((_b = (_a = $.get(renderer)).hideSelectionMenu) == null ? void 0 : _b.call(_a, $.get(annotation).object)) ? void 0 : $.get(isMultiSelected) ? void 0 : $$props.selectionMenu;
|
|
4059
|
+
$.if(node_2, ($$render) => {
|
|
4060
|
+
if (!($.get(locked) && $.get(renderer).hiddenWhenLocked)) $$render(consequent);
|
|
3853
4061
|
});
|
|
3854
|
-
let $4 = $.derived(() => {
|
|
3855
|
-
var _a, _b;
|
|
3856
|
-
return ((_b = (_a = $.get(renderer)).hideSelectionMenu) == null ? void 0 : _b.call(_a, $.get(annotation).object)) ? void 0 : $.get(isMultiSelected) ? void 0 : $$props.selectionMenuSnippet;
|
|
3857
|
-
});
|
|
3858
|
-
let $5 = $.derived(() => $.get(renderer).onDoubleClick ? (e) => {
|
|
3859
|
-
e.stopPropagation();
|
|
3860
|
-
$.get(renderer).onDoubleClick($.get(annotation).object.id, setEditingId);
|
|
3861
|
-
} : void 0);
|
|
3862
|
-
let $6 = $.derived(() => blendModeToCss($.get(annotation).object.blendMode ?? $.get(renderer).defaultBlendMode ?? PdfBlendMode.Normal));
|
|
3863
|
-
let $7 = $.derived(() => {
|
|
3864
|
-
var _a, _b;
|
|
3865
|
-
return (_b = (_a = $.get(renderer)).containerStyle) == null ? void 0 : _b.call(_a, $.get(annotation).object);
|
|
3866
|
-
});
|
|
3867
|
-
let $8 = $.derived(() => $.get(useAP) ? getAppearanceForAnnotation($.get(annotation)) : void 0);
|
|
3868
|
-
AnnotationContainer($$anchor3, $.spread_props(
|
|
3869
|
-
{
|
|
3870
|
-
get trackedAnnotation() {
|
|
3871
|
-
return $.get(annotation);
|
|
3872
|
-
},
|
|
3873
|
-
get isSelected() {
|
|
3874
|
-
return $.get(isSelected);
|
|
3875
|
-
},
|
|
3876
|
-
get isEditing() {
|
|
3877
|
-
return $.get(isEditing);
|
|
3878
|
-
},
|
|
3879
|
-
get isMultiSelected() {
|
|
3880
|
-
return $.get(isMultiSelected);
|
|
3881
|
-
},
|
|
3882
|
-
get isDraggable() {
|
|
3883
|
-
return $.get(finalDraggable);
|
|
3884
|
-
},
|
|
3885
|
-
get isResizable() {
|
|
3886
|
-
return $.get($0);
|
|
3887
|
-
},
|
|
3888
|
-
get lockAspectRatio() {
|
|
3889
|
-
return $.get($1);
|
|
3890
|
-
},
|
|
3891
|
-
get isRotatable() {
|
|
3892
|
-
return $.get($2);
|
|
3893
|
-
},
|
|
3894
|
-
get vertexConfig() {
|
|
3895
|
-
return $.get(renderer).vertexConfig;
|
|
3896
|
-
},
|
|
3897
|
-
get selectionMenu() {
|
|
3898
|
-
return $.get($3);
|
|
3899
|
-
},
|
|
3900
|
-
get selectionMenuSnippet() {
|
|
3901
|
-
return $.get($4);
|
|
3902
|
-
},
|
|
3903
|
-
get onSelect() {
|
|
3904
|
-
return $.get(onSelect);
|
|
3905
|
-
},
|
|
3906
|
-
get onDoubleClick() {
|
|
3907
|
-
return $.get($5);
|
|
3908
|
-
},
|
|
3909
|
-
get zIndex() {
|
|
3910
|
-
return $.get(renderer).zIndex;
|
|
3911
|
-
},
|
|
3912
|
-
get blendMode() {
|
|
3913
|
-
return $.get($6);
|
|
3914
|
-
},
|
|
3915
|
-
get style() {
|
|
3916
|
-
return $.get($7);
|
|
3917
|
-
},
|
|
3918
|
-
get appearance() {
|
|
3919
|
-
return $.get($8);
|
|
3920
|
-
}
|
|
3921
|
-
},
|
|
3922
|
-
() => annotationsProps,
|
|
3923
|
-
{ children, $$slots: { default: true } }
|
|
3924
|
-
));
|
|
3925
4062
|
}
|
|
4063
|
+
$.append($$anchor3, fragment_2);
|
|
3926
4064
|
};
|
|
3927
4065
|
$.if(node_1, ($$render) => {
|
|
3928
|
-
if ($.get(renderer)) $$render(
|
|
4066
|
+
if ($.get(renderer)) $$render(consequent_1);
|
|
3929
4067
|
});
|
|
3930
4068
|
}
|
|
3931
4069
|
$.append($$anchor2, fragment_1);
|
|
3932
4070
|
});
|
|
3933
|
-
var
|
|
4071
|
+
var node_4 = $.sibling(node, 2);
|
|
3934
4072
|
{
|
|
3935
|
-
var
|
|
4073
|
+
var consequent_2 = ($$anchor2) => {
|
|
3936
4074
|
{
|
|
3937
4075
|
let $0 = $.derived(() => $$props.groupSelectionOutline ?? $$props.selectionOutline);
|
|
3938
4076
|
GroupSelectionBox($$anchor2, {
|
|
@@ -3990,8 +4128,8 @@ function Annotations($$anchor, $$props) {
|
|
|
3990
4128
|
});
|
|
3991
4129
|
}
|
|
3992
4130
|
};
|
|
3993
|
-
$.if(
|
|
3994
|
-
if ($.get(allSelectedOnSamePage) && $.get(selectedAnnotationsOnPage).length >= 2) $$render(
|
|
4131
|
+
$.if(node_4, ($$render) => {
|
|
4132
|
+
if ($.get(allSelectedOnSamePage) && $.get(selectedAnnotationsOnPage).length >= 2) $$render(consequent_2);
|
|
3995
4133
|
});
|
|
3996
4134
|
}
|
|
3997
4135
|
$.append($$anchor, fragment);
|
|
@@ -4250,8 +4388,10 @@ var root_7 = $.from_html(`<div><!></div>`);
|
|
|
4250
4388
|
var root_9 = $.from_html(`<div><!></div>`);
|
|
4251
4389
|
var root_11 = $.from_html(`<div><!></div>`);
|
|
4252
4390
|
var root_13 = $.from_html(`<div><div></div></div>`);
|
|
4391
|
+
var root_15 = $.from_html(`<div><!></div>`);
|
|
4253
4392
|
function PreviewRenderer($$anchor, $$props) {
|
|
4254
4393
|
$.push($$props, true);
|
|
4394
|
+
const registry = getRendererRegistry();
|
|
4255
4395
|
const bounds = $.derived(() => $$props.preview.bounds);
|
|
4256
4396
|
const style = $.derived(() => ({
|
|
4257
4397
|
left: $.get(bounds).origin.x * $$props.scale,
|
|
@@ -4287,7 +4427,7 @@ function PreviewRenderer($$anchor, $$props) {
|
|
|
4287
4427
|
}));
|
|
4288
4428
|
$.append($$anchor2, div);
|
|
4289
4429
|
};
|
|
4290
|
-
var
|
|
4430
|
+
var alternate_6 = ($$anchor2) => {
|
|
4291
4431
|
var fragment_1 = $.comment();
|
|
4292
4432
|
var node_2 = $.first_child(fragment_1);
|
|
4293
4433
|
{
|
|
@@ -4316,7 +4456,7 @@ function PreviewRenderer($$anchor, $$props) {
|
|
|
4316
4456
|
}));
|
|
4317
4457
|
$.append($$anchor3, div_1);
|
|
4318
4458
|
};
|
|
4319
|
-
var
|
|
4459
|
+
var alternate_5 = ($$anchor3) => {
|
|
4320
4460
|
var fragment_2 = $.comment();
|
|
4321
4461
|
var node_4 = $.first_child(fragment_2);
|
|
4322
4462
|
{
|
|
@@ -4345,7 +4485,7 @@ function PreviewRenderer($$anchor, $$props) {
|
|
|
4345
4485
|
}));
|
|
4346
4486
|
$.append($$anchor4, div_2);
|
|
4347
4487
|
};
|
|
4348
|
-
var
|
|
4488
|
+
var alternate_4 = ($$anchor4) => {
|
|
4349
4489
|
var fragment_3 = $.comment();
|
|
4350
4490
|
var node_6 = $.first_child(fragment_3);
|
|
4351
4491
|
{
|
|
@@ -4374,7 +4514,7 @@ function PreviewRenderer($$anchor, $$props) {
|
|
|
4374
4514
|
}));
|
|
4375
4515
|
$.append($$anchor5, div_3);
|
|
4376
4516
|
};
|
|
4377
|
-
var
|
|
4517
|
+
var alternate_3 = ($$anchor5) => {
|
|
4378
4518
|
var fragment_4 = $.comment();
|
|
4379
4519
|
var node_8 = $.first_child(fragment_4);
|
|
4380
4520
|
{
|
|
@@ -4403,7 +4543,7 @@ function PreviewRenderer($$anchor, $$props) {
|
|
|
4403
4543
|
}));
|
|
4404
4544
|
$.append($$anchor6, div_4);
|
|
4405
4545
|
};
|
|
4406
|
-
var
|
|
4546
|
+
var alternate_2 = ($$anchor6) => {
|
|
4407
4547
|
var fragment_5 = $.comment();
|
|
4408
4548
|
var node_10 = $.first_child(fragment_5);
|
|
4409
4549
|
{
|
|
@@ -4435,7 +4575,7 @@ function PreviewRenderer($$anchor, $$props) {
|
|
|
4435
4575
|
]);
|
|
4436
4576
|
$.append($$anchor7, div_5);
|
|
4437
4577
|
};
|
|
4438
|
-
var
|
|
4578
|
+
var alternate_1 = ($$anchor7) => {
|
|
4439
4579
|
var fragment_6 = $.comment();
|
|
4440
4580
|
var node_12 = $.first_child(fragment_6);
|
|
4441
4581
|
{
|
|
@@ -4464,10 +4604,53 @@ function PreviewRenderer($$anchor, $$props) {
|
|
|
4464
4604
|
});
|
|
4465
4605
|
$.append($$anchor8, div_6);
|
|
4466
4606
|
};
|
|
4607
|
+
var alternate = ($$anchor8) => {
|
|
4608
|
+
const match = $.derived(() => registry == null ? void 0 : registry.getAll().find((r) => r.id === $$props.toolId && r.renderPreview));
|
|
4609
|
+
var fragment_7 = $.comment();
|
|
4610
|
+
var node_13 = $.first_child(fragment_7);
|
|
4611
|
+
{
|
|
4612
|
+
var consequent_7 = ($$anchor9) => {
|
|
4613
|
+
const PreviewComponent = $.derived(() => $.get(match).renderPreview);
|
|
4614
|
+
var div_8 = root_15();
|
|
4615
|
+
let styles_8;
|
|
4616
|
+
var node_14 = $.child(div_8);
|
|
4617
|
+
$.component(node_14, () => $.get(PreviewComponent), ($$anchor10, PreviewComponent_1) => {
|
|
4618
|
+
PreviewComponent_1($$anchor10, {
|
|
4619
|
+
get data() {
|
|
4620
|
+
return $$props.preview.data;
|
|
4621
|
+
},
|
|
4622
|
+
get bounds() {
|
|
4623
|
+
return $$props.preview.bounds;
|
|
4624
|
+
},
|
|
4625
|
+
get scale() {
|
|
4626
|
+
return $$props.scale;
|
|
4627
|
+
}
|
|
4628
|
+
});
|
|
4629
|
+
});
|
|
4630
|
+
$.reset(div_8);
|
|
4631
|
+
$.template_effect(() => styles_8 = $.set_style(div_8, "", styles_8, {
|
|
4632
|
+
position: "absolute",
|
|
4633
|
+
left: `${$.get(style).left ?? ""}px`,
|
|
4634
|
+
top: `${$.get(style).top ?? ""}px`,
|
|
4635
|
+
width: `${$.get(style).width ?? ""}px`,
|
|
4636
|
+
height: `${$.get(style).height ?? ""}px`,
|
|
4637
|
+
"pointer-events": "none",
|
|
4638
|
+
"z-index": "10"
|
|
4639
|
+
}));
|
|
4640
|
+
$.append($$anchor9, div_8);
|
|
4641
|
+
};
|
|
4642
|
+
$.if(node_13, ($$render) => {
|
|
4643
|
+
var _a;
|
|
4644
|
+
if ((_a = $.get(match)) == null ? void 0 : _a.renderPreview) $$render(consequent_7);
|
|
4645
|
+
});
|
|
4646
|
+
}
|
|
4647
|
+
$.append($$anchor8, fragment_7);
|
|
4648
|
+
};
|
|
4467
4649
|
$.if(
|
|
4468
4650
|
node_12,
|
|
4469
4651
|
($$render) => {
|
|
4470
4652
|
if ($$props.preview.type === PdfAnnotationSubtype.FREETEXT) $$render(consequent_6);
|
|
4653
|
+
else $$render(alternate, false);
|
|
4471
4654
|
},
|
|
4472
4655
|
true
|
|
4473
4656
|
);
|
|
@@ -4478,7 +4661,7 @@ function PreviewRenderer($$anchor, $$props) {
|
|
|
4478
4661
|
node_10,
|
|
4479
4662
|
($$render) => {
|
|
4480
4663
|
if ($$props.preview.type === PdfAnnotationSubtype.INK) $$render(consequent_5);
|
|
4481
|
-
else $$render(
|
|
4664
|
+
else $$render(alternate_1, false);
|
|
4482
4665
|
},
|
|
4483
4666
|
true
|
|
4484
4667
|
);
|
|
@@ -4489,7 +4672,7 @@ function PreviewRenderer($$anchor, $$props) {
|
|
|
4489
4672
|
node_8,
|
|
4490
4673
|
($$render) => {
|
|
4491
4674
|
if ($$props.preview.type === PdfAnnotationSubtype.LINE) $$render(consequent_4);
|
|
4492
|
-
else $$render(
|
|
4675
|
+
else $$render(alternate_2, false);
|
|
4493
4676
|
},
|
|
4494
4677
|
true
|
|
4495
4678
|
);
|
|
@@ -4500,7 +4683,7 @@ function PreviewRenderer($$anchor, $$props) {
|
|
|
4500
4683
|
node_6,
|
|
4501
4684
|
($$render) => {
|
|
4502
4685
|
if ($$props.preview.type === PdfAnnotationSubtype.POLYLINE) $$render(consequent_3);
|
|
4503
|
-
else $$render(
|
|
4686
|
+
else $$render(alternate_3, false);
|
|
4504
4687
|
},
|
|
4505
4688
|
true
|
|
4506
4689
|
);
|
|
@@ -4511,7 +4694,7 @@ function PreviewRenderer($$anchor, $$props) {
|
|
|
4511
4694
|
node_4,
|
|
4512
4695
|
($$render) => {
|
|
4513
4696
|
if ($$props.preview.type === PdfAnnotationSubtype.POLYGON) $$render(consequent_2);
|
|
4514
|
-
else $$render(
|
|
4697
|
+
else $$render(alternate_4, false);
|
|
4515
4698
|
},
|
|
4516
4699
|
true
|
|
4517
4700
|
);
|
|
@@ -4522,7 +4705,7 @@ function PreviewRenderer($$anchor, $$props) {
|
|
|
4522
4705
|
node_2,
|
|
4523
4706
|
($$render) => {
|
|
4524
4707
|
if ($$props.preview.type === PdfAnnotationSubtype.SQUARE) $$render(consequent_1);
|
|
4525
|
-
else $$render(
|
|
4708
|
+
else $$render(alternate_5, false);
|
|
4526
4709
|
},
|
|
4527
4710
|
true
|
|
4528
4711
|
);
|
|
@@ -4531,7 +4714,7 @@ function PreviewRenderer($$anchor, $$props) {
|
|
|
4531
4714
|
};
|
|
4532
4715
|
$.if(node, ($$render) => {
|
|
4533
4716
|
if ($$props.preview.type === PdfAnnotationSubtype.CIRCLE) $$render(consequent);
|
|
4534
|
-
else $$render(
|
|
4717
|
+
else $$render(alternate_6, false);
|
|
4535
4718
|
});
|
|
4536
4719
|
}
|
|
4537
4720
|
$.append($$anchor, fragment);
|
|
@@ -4607,8 +4790,12 @@ function AnnotationPaintLayer($$anchor, $$props) {
|
|
|
4607
4790
|
var node = $.sibling(canvas_1, 2);
|
|
4608
4791
|
$.each(node, 17, () => Array.from($.get(previews).entries()), ([toolId, preview]) => toolId, ($$anchor2, $$item) => {
|
|
4609
4792
|
var $$array = $.derived(() => $.to_array($.get($$item), 2));
|
|
4793
|
+
let toolId = () => $.get($$array)[0];
|
|
4610
4794
|
let preview = () => $.get($$array)[1];
|
|
4611
4795
|
PreviewRenderer($$anchor2, {
|
|
4796
|
+
get toolId() {
|
|
4797
|
+
return toolId();
|
|
4798
|
+
},
|
|
4612
4799
|
get preview() {
|
|
4613
4800
|
return preview();
|
|
4614
4801
|
},
|
|
@@ -4770,7 +4957,7 @@ function AnnotationLayer($$anchor, $$props) {
|
|
|
4770
4957
|
$.append($$anchor, div);
|
|
4771
4958
|
$.pop();
|
|
4772
4959
|
}
|
|
4773
|
-
const AnnotationPluginPackage = createPluginPackage(AnnotationPluginPackage$1).addWrapper(RendererRegistryProvider).build();
|
|
4960
|
+
const AnnotationPluginPackage = createPluginPackage(AnnotationPluginPackage$1).addWrapper(RendererRegistryProvider).addUtility(AnnotationNavigationHandler).build();
|
|
4774
4961
|
export {
|
|
4775
4962
|
AnnotationContainer,
|
|
4776
4963
|
AnnotationLayer,
|
|
@@ -4802,6 +4989,7 @@ export {
|
|
|
4802
4989
|
provideRendererRegistry,
|
|
4803
4990
|
useAnnotation,
|
|
4804
4991
|
useAnnotationCapability,
|
|
4805
|
-
useAnnotationPlugin
|
|
4992
|
+
useAnnotationPlugin,
|
|
4993
|
+
useIOSZoomPrevention
|
|
4806
4994
|
};
|
|
4807
4995
|
//# sourceMappingURL=index.js.map
|