@embedpdf/plugin-annotation 2.8.0 → 2.9.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 +829 -148
- package/dist/index.js.map +1 -1
- package/dist/lib/geometry/cloudy-border.d.ts +90 -0
- package/dist/lib/geometry/index.d.ts +1 -0
- package/dist/lib/handlers/types.d.ts +2 -1
- package/dist/lib/tools/default-tools.d.ts +43 -88
- package/dist/lib/tools/types.d.ts +34 -1
- package/dist/lib/types.d.ts +3 -0
- package/dist/preact/index.cjs +1 -1
- package/dist/preact/index.cjs.map +1 -1
- package/dist/preact/index.js +371 -242
- 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 +371 -242
- package/dist/react/index.js.map +1 -1
- package/dist/shared/components/annotation-container.d.ts +4 -2
- package/dist/shared/components/annotations/circle.d.ts +6 -2
- package/dist/shared/components/annotations/polygon.d.ts +3 -1
- package/dist/shared/components/annotations/square.d.ts +6 -2
- package/dist/shared/components/types.d.ts +6 -2
- package/dist/shared-preact/components/annotation-container.d.ts +4 -2
- package/dist/shared-preact/components/annotations/circle.d.ts +6 -2
- package/dist/shared-preact/components/annotations/polygon.d.ts +3 -1
- package/dist/shared-preact/components/annotations/square.d.ts +6 -2
- package/dist/shared-preact/components/types.d.ts +6 -2
- package/dist/shared-react/components/annotation-container.d.ts +4 -2
- package/dist/shared-react/components/annotations/circle.d.ts +6 -2
- package/dist/shared-react/components/annotations/polygon.d.ts +3 -1
- package/dist/shared-react/components/annotations/square.d.ts +6 -2
- package/dist/shared-react/components/types.d.ts +6 -2
- package/dist/svelte/components/annotations/Circle.svelte.d.ts +3 -1
- package/dist/svelte/components/annotations/Polygon.svelte.d.ts +1 -0
- package/dist/svelte/components/annotations/Square.svelte.d.ts +3 -1
- package/dist/svelte/components/types.d.ts +2 -1
- package/dist/svelte/context/types.d.ts +6 -2
- package/dist/svelte/index.cjs +1 -1
- package/dist/svelte/index.cjs.map +1 -1
- package/dist/svelte/index.js +525 -298
- package/dist/svelte/index.js.map +1 -1
- package/dist/vue/components/annotation-container.vue.d.ts +7 -6
- package/dist/vue/components/annotations/circle.vue.d.ts +5 -1
- package/dist/vue/components/annotations/polygon.vue.d.ts +2 -0
- package/dist/vue/components/annotations/square.vue.d.ts +5 -1
- package/dist/vue/components/annotations.vue.d.ts +8 -9
- package/dist/vue/context/types.d.ts +6 -2
- package/dist/vue/index.cjs +1 -1
- package/dist/vue/index.cjs.map +1 -1
- package/dist/vue/index.js +289 -135
- package/dist/vue/index.js.map +1 -1
- package/package.json +10 -10
package/dist/svelte/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createPluginPackage } from "@embedpdf/core";
|
|
2
|
-
import { AnnotationPlugin, initialDocumentState, patching, getAnnotationsByPageIndex, getSelectedAnnotationIds, resolveInteractionProp, AnnotationPluginPackage as AnnotationPluginPackage$1 } from "@embedpdf/plugin-annotation";
|
|
2
|
+
import { AnnotationPlugin, initialDocumentState, generateCloudyRectanglePath, generateCloudyEllipsePath, patching, generateCloudyPolygonPath, getAnnotationsByPageIndex, getSelectedAnnotationIds, resolveInteractionProp, 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";
|
|
@@ -7,7 +7,7 @@ import { setContext, getContext, untrack } from "svelte";
|
|
|
7
7
|
import { useCapability, usePlugin, 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
|
-
import { inferRotationCenterFromRects, boundingRectOrEmpty, PdfAnnotationBorderStyle, PdfVerticalAlignment, standardFontCssProperties, textAlignmentToCss, ignore, PdfErrorCode, getContrastStrokeColor, PdfAnnotationSubtype, blendModeToCss
|
|
10
|
+
import { inferRotationCenterFromRects, boundingRectOrEmpty, PdfAnnotationBorderStyle, PdfVerticalAlignment, standardFontCssProperties, textAlignmentToCss, ignore, PdfErrorCode, getContrastStrokeColor, PdfBlendMode, PdfAnnotationSubtype, blendModeToCss } from "@embedpdf/models";
|
|
11
11
|
import { usePointerHandlers } from "@embedpdf/plugin-interaction-manager/svelte";
|
|
12
12
|
import { useSelectionCapability } from "@embedpdf/plugin-selection/svelte";
|
|
13
13
|
const REGISTRY_KEY = Symbol("AnnotationRendererRegistry");
|
|
@@ -48,6 +48,7 @@ function createRenderer(entry) {
|
|
|
48
48
|
component: entry.component,
|
|
49
49
|
vertexConfig: entry.vertexConfig,
|
|
50
50
|
zIndex: entry.zIndex,
|
|
51
|
+
defaultBlendMode: entry.defaultBlendMode,
|
|
51
52
|
containerStyle: entry.containerStyle,
|
|
52
53
|
interactionDefaults: entry.interactionDefaults,
|
|
53
54
|
useAppearanceStream: entry.useAppearanceStream,
|
|
@@ -95,7 +96,7 @@ const useAnnotation = (getDocumentId) => {
|
|
|
95
96
|
}
|
|
96
97
|
};
|
|
97
98
|
};
|
|
98
|
-
var root_1$
|
|
99
|
+
var root_1$f = $.from_html(`<img alt="" draggable="false"/>`);
|
|
99
100
|
function AppearanceImage($$anchor, $$props) {
|
|
100
101
|
$.push($$props, true);
|
|
101
102
|
let imageUrl = $.state(null);
|
|
@@ -121,7 +122,7 @@ function AppearanceImage($$anchor, $$props) {
|
|
|
121
122
|
var node = $.first_child(fragment);
|
|
122
123
|
{
|
|
123
124
|
var consequent = ($$anchor2) => {
|
|
124
|
-
var img = root_1$
|
|
125
|
+
var img = root_1$f();
|
|
125
126
|
$.template_effect(() => {
|
|
126
127
|
$.set_attribute(img, "src", $.get(imageUrl));
|
|
127
128
|
$.set_style(img, `position: absolute; width: 100%; height: 100%; display: block; pointer-events: none; user-select: none; ${$$props.style ?? "" ?? ""}`);
|
|
@@ -137,14 +138,14 @@ function AppearanceImage($$anchor, $$props) {
|
|
|
137
138
|
$.append($$anchor, fragment);
|
|
138
139
|
$.pop();
|
|
139
140
|
}
|
|
140
|
-
var
|
|
141
|
-
var
|
|
142
|
-
var
|
|
143
|
-
var
|
|
141
|
+
var root_4$7 = $.from_html(`<div></div> <div></div> <div></div>`, 1);
|
|
142
|
+
var root_6$2 = $.from_html(`<div style="display: contents;"><!></div>`);
|
|
143
|
+
var root_8$1 = $.from_html(`<div></div>`);
|
|
144
|
+
var root_7$1 = $.from_html(`<div style="display: contents;"><!> <div><svg viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"></path><path d="M21 3v5h-5"></path></svg></div></div>`);
|
|
144
145
|
var root_12 = $.from_html(`<div></div>`);
|
|
145
146
|
var root_16 = $.from_html(`<div></div>`);
|
|
146
147
|
var root_23 = $.from_html(`<div><div> </div></div>`);
|
|
147
|
-
var root$e = $.from_html(`<div data-no-interaction=""><div><!>
|
|
148
|
+
var root$e = $.from_html(`<div data-no-interaction=""><div><div><!> <!></div></div> <div><!> <!> <div><!> <!></div></div> <!> <!></div>`);
|
|
148
149
|
function AnnotationContainer($$anchor, $$props) {
|
|
149
150
|
$.push($$props, true);
|
|
150
151
|
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, [
|
|
@@ -166,6 +167,7 @@ function AnnotationContainer($$anchor, $$props) {
|
|
|
166
167
|
"isResizable",
|
|
167
168
|
"isRotatable",
|
|
168
169
|
"lockAspectRatio",
|
|
170
|
+
"blendMode",
|
|
169
171
|
"style",
|
|
170
172
|
"class",
|
|
171
173
|
"vertexConfig",
|
|
@@ -504,8 +506,62 @@ function AnnotationContainer($$anchor, $$props) {
|
|
|
504
506
|
}
|
|
505
507
|
var div = root$e();
|
|
506
508
|
var div_1 = $.child(div);
|
|
507
|
-
|
|
508
|
-
|
|
509
|
+
let styles;
|
|
510
|
+
var div_2 = $.child(div_1);
|
|
511
|
+
let styles_1;
|
|
512
|
+
var node_1 = $.child(div_2);
|
|
513
|
+
{
|
|
514
|
+
var consequent = ($$anchor2) => {
|
|
515
|
+
var fragment = $.comment();
|
|
516
|
+
var node_2 = $.first_child(fragment);
|
|
517
|
+
$.snippet(node_2, () => $$props.customAnnotationRenderer ?? $.noop, () => ({
|
|
518
|
+
annotation: $.get(childObject),
|
|
519
|
+
children: $$props.children,
|
|
520
|
+
isSelected: $$props.isSelected,
|
|
521
|
+
scale: $$props.scale,
|
|
522
|
+
rotation: $$props.rotation,
|
|
523
|
+
pageWidth: $$props.pageWidth,
|
|
524
|
+
pageHeight: $$props.pageHeight,
|
|
525
|
+
pageIndex: $$props.pageIndex,
|
|
526
|
+
onSelect: $$props.onSelect
|
|
527
|
+
}));
|
|
528
|
+
$.append($$anchor2, fragment);
|
|
529
|
+
};
|
|
530
|
+
var alternate = ($$anchor2) => {
|
|
531
|
+
var fragment_1 = $.comment();
|
|
532
|
+
var node_3 = $.first_child(fragment_1);
|
|
533
|
+
$.snippet(node_3, () => $$props.children, () => $.get(childObject), () => ({ appearanceActive: $.get(apActive) }));
|
|
534
|
+
$.append($$anchor2, fragment_1);
|
|
535
|
+
};
|
|
536
|
+
$.if(node_1, ($$render) => {
|
|
537
|
+
if ($$props.customAnnotationRenderer) $$render(consequent);
|
|
538
|
+
else $$render(alternate, false);
|
|
539
|
+
});
|
|
540
|
+
}
|
|
541
|
+
var node_4 = $.sibling(node_1, 2);
|
|
542
|
+
{
|
|
543
|
+
var consequent_1 = ($$anchor2) => {
|
|
544
|
+
{
|
|
545
|
+
let $0 = $.derived(() => $.get(apActive) ? "block" : "none");
|
|
546
|
+
AppearanceImage($$anchor2, {
|
|
547
|
+
get appearance() {
|
|
548
|
+
return $$props.appearance.normal;
|
|
549
|
+
},
|
|
550
|
+
get style() {
|
|
551
|
+
return `display: ${$.get($0) ?? ""};`;
|
|
552
|
+
}
|
|
553
|
+
});
|
|
554
|
+
}
|
|
555
|
+
};
|
|
556
|
+
$.if(node_4, ($$render) => {
|
|
557
|
+
var _a;
|
|
558
|
+
if ((_a = $$props.appearance) == null ? void 0 : _a.normal) $$render(consequent_1);
|
|
559
|
+
});
|
|
560
|
+
}
|
|
561
|
+
$.reset(div_2);
|
|
562
|
+
$.reset(div_1);
|
|
563
|
+
var div_3 = $.sibling(div_1, 2);
|
|
564
|
+
$.attribute_effect(div_3, () => ({
|
|
509
565
|
class: propsClass(),
|
|
510
566
|
...restProps,
|
|
511
567
|
[$.STYLE]: {
|
|
@@ -520,18 +576,18 @@ function AnnotationContainer($$anchor, $$props) {
|
|
|
520
576
|
"transform-origin": $.get(counterRot) ? "0 0" : void 0
|
|
521
577
|
}
|
|
522
578
|
}));
|
|
523
|
-
var
|
|
579
|
+
var node_5 = $.child(div_3);
|
|
524
580
|
{
|
|
525
|
-
var
|
|
526
|
-
var
|
|
527
|
-
var
|
|
528
|
-
let styles;
|
|
529
|
-
var div_3 = $.sibling(div_2, 2);
|
|
530
|
-
let styles_1;
|
|
531
|
-
var div_4 = $.sibling(div_3, 2);
|
|
581
|
+
var consequent_2 = ($$anchor2) => {
|
|
582
|
+
var fragment_3 = root_4$7();
|
|
583
|
+
var div_4 = $.first_child(fragment_3);
|
|
532
584
|
let styles_2;
|
|
585
|
+
var div_5 = $.sibling(div_4, 2);
|
|
586
|
+
let styles_3;
|
|
587
|
+
var div_6 = $.sibling(div_5, 2);
|
|
588
|
+
let styles_4;
|
|
533
589
|
$.template_effect(() => {
|
|
534
|
-
|
|
590
|
+
styles_2 = $.set_style(div_4, "", styles_2, {
|
|
535
591
|
position: "absolute",
|
|
536
592
|
left: `${$.get(centerX) - $.get(guideLength) / 2}px`,
|
|
537
593
|
top: `${$.get(centerY) ?? ""}px`,
|
|
@@ -541,7 +597,7 @@ function AnnotationContainer($$anchor, $$props) {
|
|
|
541
597
|
opacity: "0.35",
|
|
542
598
|
"pointer-events": "none"
|
|
543
599
|
});
|
|
544
|
-
|
|
600
|
+
styles_3 = $.set_style(div_5, "", styles_3, {
|
|
545
601
|
position: "absolute",
|
|
546
602
|
left: `${$.get(centerX) ?? ""}px`,
|
|
547
603
|
top: `${$.get(centerY) - $.get(guideLength) / 2}px`,
|
|
@@ -551,7 +607,7 @@ function AnnotationContainer($$anchor, $$props) {
|
|
|
551
607
|
opacity: "0.35",
|
|
552
608
|
"pointer-events": "none"
|
|
553
609
|
});
|
|
554
|
-
|
|
610
|
+
styles_4 = $.set_style(div_6, "", styles_4, {
|
|
555
611
|
position: "absolute",
|
|
556
612
|
left: `${$.get(centerX) - $.get(guideLength) / 2}px`,
|
|
557
613
|
top: `${$.get(centerY) ?? ""}px`,
|
|
@@ -564,24 +620,24 @@ function AnnotationContainer($$anchor, $$props) {
|
|
|
564
620
|
"pointer-events": "none"
|
|
565
621
|
});
|
|
566
622
|
});
|
|
567
|
-
$.append($$anchor2,
|
|
623
|
+
$.append($$anchor2, fragment_3);
|
|
568
624
|
};
|
|
569
|
-
$.if(
|
|
570
|
-
if ($.get(rotationActive)) $$render(
|
|
625
|
+
$.if(node_5, ($$render) => {
|
|
626
|
+
if ($.get(rotationActive)) $$render(consequent_2);
|
|
571
627
|
});
|
|
572
628
|
}
|
|
573
|
-
var
|
|
629
|
+
var node_6 = $.sibling(node_5, 2);
|
|
574
630
|
{
|
|
575
|
-
var
|
|
576
|
-
var
|
|
577
|
-
var
|
|
631
|
+
var consequent_5 = ($$anchor2) => {
|
|
632
|
+
var fragment_4 = $.comment();
|
|
633
|
+
var node_7 = $.first_child(fragment_4);
|
|
578
634
|
{
|
|
579
|
-
var
|
|
580
|
-
var
|
|
581
|
-
|
|
635
|
+
var consequent_3 = ($$anchor3) => {
|
|
636
|
+
var div_7 = root_6$2();
|
|
637
|
+
div_7.__pointermove = (e) => {
|
|
582
638
|
if (!$.get(rotationActive)) $.set(cursorScreen, { x: e.clientX, y: e.clientY }, true);
|
|
583
639
|
};
|
|
584
|
-
var
|
|
640
|
+
var node_8 = $.child(div_7);
|
|
585
641
|
{
|
|
586
642
|
let $0 = $.derived(() => ({
|
|
587
643
|
...$.get(rotationHandle).handle,
|
|
@@ -596,34 +652,34 @@ function AnnotationContainer($$anchor, $$props) {
|
|
|
596
652
|
style: $.get(ROTATION_BORDER_STYLE)
|
|
597
653
|
}
|
|
598
654
|
}));
|
|
599
|
-
$.snippet(
|
|
655
|
+
$.snippet(node_8, () => $$props.rotationUI.component, () => $.get($0));
|
|
600
656
|
}
|
|
601
|
-
$.reset(
|
|
602
|
-
$.event("pointerenter",
|
|
603
|
-
$.event("pointerleave",
|
|
657
|
+
$.reset(div_7);
|
|
658
|
+
$.event("pointerenter", div_7, () => $.set(isHandleHovered, true));
|
|
659
|
+
$.event("pointerleave", div_7, () => {
|
|
604
660
|
$.set(isHandleHovered, false);
|
|
605
661
|
$.set(cursorScreen, null);
|
|
606
662
|
});
|
|
607
|
-
$.append($$anchor3,
|
|
663
|
+
$.append($$anchor3, div_7);
|
|
608
664
|
};
|
|
609
|
-
var
|
|
610
|
-
var
|
|
611
|
-
|
|
665
|
+
var alternate_1 = ($$anchor3) => {
|
|
666
|
+
var div_8 = root_7$1();
|
|
667
|
+
div_8.__pointermove = (e) => {
|
|
612
668
|
if (!$.get(rotationActive)) $.set(cursorScreen, { x: e.clientX, y: e.clientY }, true);
|
|
613
669
|
};
|
|
614
|
-
var
|
|
670
|
+
var node_9 = $.child(div_8);
|
|
615
671
|
{
|
|
616
|
-
var
|
|
617
|
-
var
|
|
618
|
-
$.template_effect(() => $.set_style(
|
|
619
|
-
$.append($$anchor4,
|
|
672
|
+
var consequent_4 = ($$anchor4) => {
|
|
673
|
+
var div_9 = root_8$1();
|
|
674
|
+
$.template_effect(() => $.set_style(div_9, `${$.get(rotationHandle).connector.style ?? ""}; background-color: ${$.get(ROTATION_CONNECTOR_COLOR) ?? ""}; opacity: ${$.get(rotationActive) ? 0 : 1};`));
|
|
675
|
+
$.append($$anchor4, div_9);
|
|
620
676
|
};
|
|
621
|
-
$.if(
|
|
622
|
-
if ($.get(SHOW_CONNECTOR)) $$render(
|
|
677
|
+
$.if(node_9, ($$render) => {
|
|
678
|
+
if ($.get(SHOW_CONNECTOR)) $$render(consequent_4);
|
|
623
679
|
});
|
|
624
680
|
}
|
|
625
|
-
var
|
|
626
|
-
$.attribute_effect(
|
|
681
|
+
var div_10 = $.sibling(node_9, 2);
|
|
682
|
+
$.attribute_effect(div_10, () => ({
|
|
627
683
|
...{
|
|
628
684
|
onpointerdown: $.get(rotationHandle).handle.onpointerdown,
|
|
629
685
|
onpointermove: $.get(rotationHandle).handle.onpointermove,
|
|
@@ -632,9 +688,9 @@ function AnnotationContainer($$anchor, $$props) {
|
|
|
632
688
|
},
|
|
633
689
|
style: `${$.get(rotationHandle).handle.style ?? ""}; background-color: ${$.get(ROTATION_COLOR) ?? ""}; border: ${$.get(ROTATION_BORDER_WIDTH) ?? ""}px ${$.get(ROTATION_BORDER_STYLE) ?? ""} ${$.get(ROTATION_BORDER_COLOR) ?? ""}; box-sizing: border-box; display: flex; align-items: center; justify-content: center; pointer-events: auto; opacity: ${$.get(rotationActive) ? 0 : 1};`
|
|
634
690
|
}));
|
|
635
|
-
var svg = $.child(
|
|
691
|
+
var svg = $.child(div_10);
|
|
692
|
+
$.reset(div_10);
|
|
636
693
|
$.reset(div_8);
|
|
637
|
-
$.reset(div_6);
|
|
638
694
|
$.template_effect(
|
|
639
695
|
($0, $1) => {
|
|
640
696
|
$.set_attribute(svg, "width", $0);
|
|
@@ -646,27 +702,27 @@ function AnnotationContainer($$anchor, $$props) {
|
|
|
646
702
|
() => Math.round($.get(ROTATION_SIZE) * 0.6)
|
|
647
703
|
]
|
|
648
704
|
);
|
|
649
|
-
$.event("pointerenter",
|
|
650
|
-
$.event("pointerleave",
|
|
705
|
+
$.event("pointerenter", div_8, () => $.set(isHandleHovered, true));
|
|
706
|
+
$.event("pointerleave", div_8, () => {
|
|
651
707
|
$.set(isHandleHovered, false);
|
|
652
708
|
$.set(cursorScreen, null);
|
|
653
709
|
});
|
|
654
|
-
$.append($$anchor3,
|
|
710
|
+
$.append($$anchor3, div_8);
|
|
655
711
|
};
|
|
656
|
-
$.if(
|
|
712
|
+
$.if(node_7, ($$render) => {
|
|
657
713
|
var _a;
|
|
658
|
-
if ((_a = $$props.rotationUI) == null ? void 0 : _a.component) $$render(
|
|
659
|
-
else $$render(
|
|
714
|
+
if ((_a = $$props.rotationUI) == null ? void 0 : _a.component) $$render(consequent_3);
|
|
715
|
+
else $$render(alternate_1, false);
|
|
660
716
|
});
|
|
661
717
|
}
|
|
662
|
-
$.append($$anchor2,
|
|
718
|
+
$.append($$anchor2, fragment_4);
|
|
663
719
|
};
|
|
664
|
-
$.if(
|
|
665
|
-
if ($$props.isSelected && $.get(effectiveIsRotatable) && $.get(rotationHandle)) $$render(
|
|
720
|
+
$.if(node_6, ($$render) => {
|
|
721
|
+
if ($$props.isSelected && $.get(effectiveIsRotatable) && $.get(rotationHandle)) $$render(consequent_5);
|
|
666
722
|
});
|
|
667
723
|
}
|
|
668
|
-
var
|
|
669
|
-
$.attribute_effect(
|
|
724
|
+
var div_11 = $.sibling(node_6, 2);
|
|
725
|
+
$.attribute_effect(div_11, () => ({
|
|
670
726
|
...$.get(effectiveIsDraggable) && $$props.isSelected ? interactionHandles.dragProps : {},
|
|
671
727
|
[$.STYLE]: {
|
|
672
728
|
position: "absolute",
|
|
@@ -678,61 +734,12 @@ function AnnotationContainer($$anchor, $$props) {
|
|
|
678
734
|
"transform-origin": $.get(innerTransformOrigin),
|
|
679
735
|
outline: $.get(showOutline) ? `${$.get(outlineWidth)}px ${$.get(outlineStyleVal)} ${$.get(outlineColor)}` : "none",
|
|
680
736
|
"outline-offset": $.get(showOutline) ? `${$.get(outlineOff)}px` : "0px",
|
|
681
|
-
"pointer-events": $$props.isSelected && !isMultiSelected() ? "auto" : "none",
|
|
737
|
+
"pointer-events": $$props.isSelected && !isMultiSelected() && !isEditing() ? "auto" : "none",
|
|
682
738
|
"touch-action": "none",
|
|
683
739
|
cursor: $$props.isSelected && $.get(effectiveIsDraggable) ? "move" : "default"
|
|
684
740
|
}
|
|
685
741
|
}));
|
|
686
|
-
var
|
|
687
|
-
{
|
|
688
|
-
var consequent_4 = ($$anchor2) => {
|
|
689
|
-
var fragment_2 = $.comment();
|
|
690
|
-
var node_7 = $.first_child(fragment_2);
|
|
691
|
-
$.snippet(node_7, () => $$props.customAnnotationRenderer ?? $.noop, () => ({
|
|
692
|
-
annotation: $.get(childObject),
|
|
693
|
-
children: $$props.children,
|
|
694
|
-
isSelected: $$props.isSelected,
|
|
695
|
-
scale: $$props.scale,
|
|
696
|
-
rotation: $$props.rotation,
|
|
697
|
-
pageWidth: $$props.pageWidth,
|
|
698
|
-
pageHeight: $$props.pageHeight,
|
|
699
|
-
pageIndex: $$props.pageIndex,
|
|
700
|
-
onSelect: $$props.onSelect
|
|
701
|
-
}));
|
|
702
|
-
$.append($$anchor2, fragment_2);
|
|
703
|
-
};
|
|
704
|
-
var alternate_1 = ($$anchor2) => {
|
|
705
|
-
var fragment_3 = $.comment();
|
|
706
|
-
var node_8 = $.first_child(fragment_3);
|
|
707
|
-
$.snippet(node_8, () => $$props.children, () => $.get(childObject), () => ({ appearanceActive: $.get(apActive) }));
|
|
708
|
-
$.append($$anchor2, fragment_3);
|
|
709
|
-
};
|
|
710
|
-
$.if(node_6, ($$render) => {
|
|
711
|
-
if ($$props.customAnnotationRenderer) $$render(consequent_4);
|
|
712
|
-
else $$render(alternate_1, false);
|
|
713
|
-
});
|
|
714
|
-
}
|
|
715
|
-
var node_9 = $.sibling(node_6, 2);
|
|
716
|
-
{
|
|
717
|
-
var consequent_5 = ($$anchor2) => {
|
|
718
|
-
{
|
|
719
|
-
let $0 = $.derived(() => $.get(apActive) ? "block" : "none");
|
|
720
|
-
AppearanceImage($$anchor2, {
|
|
721
|
-
get appearance() {
|
|
722
|
-
return $$props.appearance.normal;
|
|
723
|
-
},
|
|
724
|
-
get style() {
|
|
725
|
-
return `display: ${$.get($0) ?? ""};`;
|
|
726
|
-
}
|
|
727
|
-
});
|
|
728
|
-
}
|
|
729
|
-
};
|
|
730
|
-
$.if(node_9, ($$render) => {
|
|
731
|
-
var _a;
|
|
732
|
-
if ((_a = $$props.appearance) == null ? void 0 : _a.normal) $$render(consequent_5);
|
|
733
|
-
});
|
|
734
|
-
}
|
|
735
|
-
var node_10 = $.sibling(node_9, 2);
|
|
742
|
+
var node_10 = $.child(div_11);
|
|
736
743
|
{
|
|
737
744
|
var consequent_7 = ($$anchor2) => {
|
|
738
745
|
var fragment_5 = $.comment();
|
|
@@ -757,12 +764,12 @@ function AnnotationContainer($$anchor, $$props) {
|
|
|
757
764
|
$.append($$anchor4, fragment_7);
|
|
758
765
|
};
|
|
759
766
|
var alternate_2 = ($$anchor4) => {
|
|
760
|
-
var
|
|
761
|
-
$.attribute_effect(
|
|
767
|
+
var div_12 = root_12();
|
|
768
|
+
$.attribute_effect(div_12, () => ({
|
|
762
769
|
...hProps(),
|
|
763
770
|
style: `${handleStyle() ?? ""}; background-color: ${$.get(HANDLE_COLOR) ?? ""};`
|
|
764
771
|
}));
|
|
765
|
-
$.append($$anchor4,
|
|
772
|
+
$.append($$anchor4, div_12);
|
|
766
773
|
};
|
|
767
774
|
$.if(node_12, ($$render) => {
|
|
768
775
|
var _a;
|
|
@@ -803,12 +810,12 @@ function AnnotationContainer($$anchor, $$props) {
|
|
|
803
810
|
$.append($$anchor4, fragment_10);
|
|
804
811
|
};
|
|
805
812
|
var alternate_3 = ($$anchor4) => {
|
|
806
|
-
var
|
|
807
|
-
$.attribute_effect(
|
|
813
|
+
var div_13 = root_16();
|
|
814
|
+
$.attribute_effect(div_13, () => ({
|
|
808
815
|
...vProps(),
|
|
809
816
|
style: `${vertexStyle() ?? ""}; background-color: ${$.get(VERTEX_COLOR) ?? ""};`
|
|
810
817
|
}));
|
|
811
|
-
$.append($$anchor4,
|
|
818
|
+
$.append($$anchor4, div_13);
|
|
812
819
|
};
|
|
813
820
|
$.if(node_16, ($$render) => {
|
|
814
821
|
var _a;
|
|
@@ -824,13 +831,13 @@ function AnnotationContainer($$anchor, $$props) {
|
|
|
824
831
|
if ($$props.isSelected && permissions.canModifyAnnotations && !isMultiSelected() && !$.get(rotationActive)) $$render(consequent_9);
|
|
825
832
|
});
|
|
826
833
|
}
|
|
827
|
-
$.reset(
|
|
828
|
-
$.action(
|
|
834
|
+
$.reset(div_11);
|
|
835
|
+
$.action(div_11, ($$node, $$action_arg) => {
|
|
829
836
|
var _a;
|
|
830
837
|
return (_a = doublePress) == null ? void 0 : _a($$node, $$action_arg);
|
|
831
838
|
}, () => ({ onDouble: $.get(guardedOnDoubleClick) }));
|
|
832
|
-
$.reset(
|
|
833
|
-
var node_18 = $.sibling(
|
|
839
|
+
$.reset(div_3);
|
|
840
|
+
var node_18 = $.sibling(div_3, 2);
|
|
834
841
|
{
|
|
835
842
|
var consequent_13 = ($$anchor2) => {
|
|
836
843
|
{
|
|
@@ -916,16 +923,16 @@ function AnnotationContainer($$anchor, $$props) {
|
|
|
916
923
|
var node_24 = $.sibling(node_18, 2);
|
|
917
924
|
{
|
|
918
925
|
var consequent_14 = ($$anchor2) => {
|
|
919
|
-
var
|
|
920
|
-
var
|
|
921
|
-
let
|
|
922
|
-
var text = $.child(
|
|
923
|
-
$.reset(
|
|
924
|
-
$.reset(
|
|
925
|
-
$.action(
|
|
926
|
+
var div_14 = root_23();
|
|
927
|
+
var div_15 = $.child(div_14);
|
|
928
|
+
let styles_5;
|
|
929
|
+
var text = $.child(div_15);
|
|
930
|
+
$.reset(div_15);
|
|
931
|
+
$.reset(div_14);
|
|
932
|
+
$.action(div_14, ($$node) => portalToBody == null ? void 0 : portalToBody($$node));
|
|
926
933
|
$.template_effect(
|
|
927
934
|
($0) => {
|
|
928
|
-
|
|
935
|
+
styles_5 = $.set_style(div_15, "", styles_5, {
|
|
929
936
|
position: "fixed",
|
|
930
937
|
left: `${$.get(cursorScreen).x + 16}px`,
|
|
931
938
|
top: `${$.get(cursorScreen).y - 16}px`,
|
|
@@ -943,13 +950,37 @@ function AnnotationContainer($$anchor, $$props) {
|
|
|
943
950
|
},
|
|
944
951
|
[() => $.get(normalizedRotationDisplay).toFixed(0)]
|
|
945
952
|
);
|
|
946
|
-
$.append($$anchor2,
|
|
953
|
+
$.append($$anchor2, div_14);
|
|
947
954
|
};
|
|
948
955
|
$.if(node_24, ($$render) => {
|
|
949
956
|
if (($.get(rotationActive) || $.get(isHandleHovered)) && $.get(cursorScreen)) $$render(consequent_14);
|
|
950
957
|
});
|
|
951
958
|
}
|
|
952
959
|
$.reset(div);
|
|
960
|
+
$.template_effect(() => {
|
|
961
|
+
styles = $.set_style(div_1, $$props.style, styles, {
|
|
962
|
+
position: "absolute",
|
|
963
|
+
left: `${$.get(currentObject).rect.origin.x * $$props.scale}px`,
|
|
964
|
+
top: `${$.get(currentObject).rect.origin.y * $$props.scale}px`,
|
|
965
|
+
width: `${($.get(counterRot) ? $.get(counterRot).width : $.get(aabbWidth)) ?? ""}px`,
|
|
966
|
+
height: `${($.get(counterRot) ? $.get(counterRot).height : $.get(aabbHeight)) ?? ""}px`,
|
|
967
|
+
"pointer-events": "none",
|
|
968
|
+
"z-index": zIndex(),
|
|
969
|
+
transform: $.get(counterRot) ? $.get(counterRot).matrix : void 0,
|
|
970
|
+
"transform-origin": $.get(counterRot) ? "0 0" : void 0,
|
|
971
|
+
"mix-blend-mode": $$props.blendMode
|
|
972
|
+
});
|
|
973
|
+
styles_1 = $.set_style(div_2, "", styles_1, {
|
|
974
|
+
position: "absolute",
|
|
975
|
+
left: `${$.get(innerLeft) ?? ""}px`,
|
|
976
|
+
top: `${$.get(innerTop) ?? ""}px`,
|
|
977
|
+
width: `${$.get(innerWidth) ?? ""}px`,
|
|
978
|
+
height: `${$.get(innerHeight) ?? ""}px`,
|
|
979
|
+
transform: $.get(annotationRotation) !== 0 ? `rotate(${$.get(annotationRotation)}deg)` : void 0,
|
|
980
|
+
"transform-origin": $.get(innerTransformOrigin),
|
|
981
|
+
"pointer-events": isEditing() ? "auto" : "none"
|
|
982
|
+
});
|
|
983
|
+
});
|
|
953
984
|
$.append($$anchor, div);
|
|
954
985
|
$.pop();
|
|
955
986
|
}
|
|
@@ -1005,13 +1036,13 @@ function getAnnotationScreenBounds(annotation, scale, rotation) {
|
|
|
1005
1036
|
bottom: top + maxY
|
|
1006
1037
|
};
|
|
1007
1038
|
}
|
|
1008
|
-
var root_2$
|
|
1009
|
-
var root_4$
|
|
1039
|
+
var root_2$a = $.from_html(`<div></div> <div></div> <div></div>`, 1);
|
|
1040
|
+
var root_4$6 = $.from_html(`<div style="display: contents;"><!></div>`);
|
|
1010
1041
|
var root_6$1 = $.from_html(`<div></div>`);
|
|
1011
|
-
var root_5$
|
|
1042
|
+
var root_5$6 = $.from_html(`<div style="display: contents;"><!> <div><svg viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"></path><path d="M21 3v5h-5"></path></svg></div></div>`);
|
|
1012
1043
|
var root_10 = $.from_html(`<div></div>`);
|
|
1013
1044
|
var root_11$1 = $.from_html(`<div><div> </div></div>`);
|
|
1014
|
-
var root_1$
|
|
1045
|
+
var root_1$e = $.from_html(`<div data-group-selection-box="" data-no-interaction=""><div><!> <!> <div><!></div></div> <!> <!></div>`);
|
|
1015
1046
|
function GroupSelectionBox($$anchor, $$props) {
|
|
1016
1047
|
$.push($$props, true);
|
|
1017
1048
|
let isRotatable = $.prop($$props, "isRotatable", 3, true), lockAspectRatio = $.prop($$props, "lockAspectRatio", 3, false), zIndex = $.prop($$props, "zIndex", 3, 2);
|
|
@@ -1294,13 +1325,13 @@ function GroupSelectionBox($$anchor, $$props) {
|
|
|
1294
1325
|
var node_1 = $.first_child(fragment);
|
|
1295
1326
|
{
|
|
1296
1327
|
var consequent_11 = ($$anchor2) => {
|
|
1297
|
-
var div = root_1$
|
|
1328
|
+
var div = root_1$e();
|
|
1298
1329
|
var div_1 = $.child(div);
|
|
1299
1330
|
let styles;
|
|
1300
1331
|
var node_2 = $.child(div_1);
|
|
1301
1332
|
{
|
|
1302
1333
|
var consequent = ($$anchor3) => {
|
|
1303
|
-
var fragment_1 = root_2$
|
|
1334
|
+
var fragment_1 = root_2$a();
|
|
1304
1335
|
var div_2 = $.first_child(fragment_1);
|
|
1305
1336
|
let styles_1;
|
|
1306
1337
|
var div_3 = $.sibling(div_2, 2);
|
|
@@ -1354,7 +1385,7 @@ function GroupSelectionBox($$anchor, $$props) {
|
|
|
1354
1385
|
var node_4 = $.first_child(fragment_2);
|
|
1355
1386
|
{
|
|
1356
1387
|
var consequent_1 = ($$anchor4) => {
|
|
1357
|
-
var div_5 = root_4$
|
|
1388
|
+
var div_5 = root_4$6();
|
|
1358
1389
|
div_5.__pointermove = (e) => {
|
|
1359
1390
|
if (!$.get(rotationActive)) $.set(cursorScreen, { x: e.clientX, y: e.clientY }, true);
|
|
1360
1391
|
};
|
|
@@ -1384,7 +1415,7 @@ function GroupSelectionBox($$anchor, $$props) {
|
|
|
1384
1415
|
$.append($$anchor4, div_5);
|
|
1385
1416
|
};
|
|
1386
1417
|
var alternate = ($$anchor4) => {
|
|
1387
|
-
var div_6 = root_5$
|
|
1418
|
+
var div_6 = root_5$6();
|
|
1388
1419
|
div_6.__pointermove = (e) => {
|
|
1389
1420
|
if (!$.get(rotationActive)) $.set(cursorScreen, { x: e.clientX, y: e.clientY }, true);
|
|
1390
1421
|
};
|
|
@@ -1616,7 +1647,7 @@ function GroupSelectionBox($$anchor, $$props) {
|
|
|
1616
1647
|
}
|
|
1617
1648
|
};
|
|
1618
1649
|
$.if(node_12, ($$render) => {
|
|
1619
|
-
if ($.get(shouldShowMenu)) $$render(consequent_10);
|
|
1650
|
+
if ($.get(shouldShowMenu) && !$.get(rotationActive)) $$render(consequent_10);
|
|
1620
1651
|
});
|
|
1621
1652
|
}
|
|
1622
1653
|
$.reset(div);
|
|
@@ -1639,7 +1670,7 @@ function GroupSelectionBox($$anchor, $$props) {
|
|
|
1639
1670
|
$.pop();
|
|
1640
1671
|
}
|
|
1641
1672
|
$.delegate(["pointermove"]);
|
|
1642
|
-
var root_1$
|
|
1673
|
+
var root_1$d = $.from_svg(`<path fill="none" stroke="transparent"></path>`);
|
|
1643
1674
|
var root_3$4 = $.from_svg(`<path fill="none"></path>`);
|
|
1644
1675
|
var root$d = $.from_svg(`<svg><!><!></svg>`);
|
|
1645
1676
|
function Ink($$anchor, $$props) {
|
|
@@ -1664,7 +1695,7 @@ function Ink($$anchor, $$props) {
|
|
|
1664
1695
|
let styles;
|
|
1665
1696
|
var node = $.child(svg);
|
|
1666
1697
|
$.each(node, 19, () => $.get(paths), (d, i) => `hit-${i}`, ($$anchor2, d) => {
|
|
1667
|
-
var path = root_1$
|
|
1698
|
+
var path = root_1$d();
|
|
1668
1699
|
path.__pointerdown = function(...$$args) {
|
|
1669
1700
|
var _a;
|
|
1670
1701
|
(_a = $$props.onClick) == null ? void 0 : _a.apply(this, $$args);
|
|
@@ -1736,12 +1767,16 @@ function InkRenderer($$anchor, $$props) {
|
|
|
1736
1767
|
}
|
|
1737
1768
|
}));
|
|
1738
1769
|
}
|
|
1739
|
-
var root_1$
|
|
1740
|
-
var
|
|
1770
|
+
var root_1$c = $.from_svg(`<path fill="transparent" stroke="transparent"></path>`);
|
|
1771
|
+
var root_2$9 = $.from_svg(`<rect fill="transparent" stroke="transparent"></rect>`);
|
|
1772
|
+
var root_4$5 = $.from_svg(`<path stroke-linejoin="round"></path>`);
|
|
1773
|
+
var root_5$5 = $.from_svg(`<rect></rect>`);
|
|
1774
|
+
var root$c = $.from_svg(`<svg overflow="visible"><!><!></svg>`);
|
|
1741
1775
|
function Square($$anchor, $$props) {
|
|
1742
1776
|
$.push($$props, true);
|
|
1743
1777
|
const MIN_HIT_AREA_SCREEN_PX = 20;
|
|
1744
1778
|
let color = $.prop($$props, "color", 3, "#000000"), opacity = $.prop($$props, "opacity", 3, 1), strokeStyle = $.prop($$props, "strokeStyle", 19, () => PdfAnnotationBorderStyle.SOLID), appearanceActive = $.prop($$props, "appearanceActive", 3, false);
|
|
1779
|
+
const isCloudy = $.derived(() => ($$props.cloudyBorderIntensity ?? 0) > 0);
|
|
1745
1780
|
const $$d = $.derived(() => {
|
|
1746
1781
|
const outerW = $$props.rect.size.width;
|
|
1747
1782
|
const outerH = $$props.rect.size.height;
|
|
@@ -1754,6 +1789,20 @@ function Square($$anchor, $$props) {
|
|
|
1754
1789
|
y: $$props.strokeWidth / 2
|
|
1755
1790
|
};
|
|
1756
1791
|
}), width = $.derived(() => $.get($$d).width), height = $.derived(() => $.get($$d).height), x = $.derived(() => $.get($$d).x), y = $.derived(() => $.get($$d).y);
|
|
1792
|
+
const cloudyPath = $.derived(() => {
|
|
1793
|
+
if (!$.get(isCloudy)) return null;
|
|
1794
|
+
return generateCloudyRectanglePath(
|
|
1795
|
+
{
|
|
1796
|
+
x: 0,
|
|
1797
|
+
y: 0,
|
|
1798
|
+
width: $$props.rect.size.width,
|
|
1799
|
+
height: $$props.rect.size.height
|
|
1800
|
+
},
|
|
1801
|
+
$$props.rectangleDifferences,
|
|
1802
|
+
$$props.cloudyBorderIntensity,
|
|
1803
|
+
$$props.strokeWidth
|
|
1804
|
+
);
|
|
1805
|
+
});
|
|
1757
1806
|
const svgWidth = $.derived(() => ($.get(width) + $$props.strokeWidth) * $$props.scale);
|
|
1758
1807
|
const svgHeight = $.derived(() => ($.get(height) + $$props.strokeWidth) * $$props.scale);
|
|
1759
1808
|
const hitStrokeWidth = $.derived(() => Math.max($$props.strokeWidth, MIN_HIT_AREA_SCREEN_PX / $$props.scale));
|
|
@@ -1763,35 +1812,99 @@ function Square($$anchor, $$props) {
|
|
|
1763
1812
|
});
|
|
1764
1813
|
var svg = root$c();
|
|
1765
1814
|
let styles;
|
|
1766
|
-
var
|
|
1767
|
-
rect_1.__pointerdown = function(...$$args) {
|
|
1768
|
-
var _a;
|
|
1769
|
-
(_a = $$props.onClick) == null ? void 0 : _a.apply(this, $$args);
|
|
1770
|
-
};
|
|
1771
|
-
let styles_1;
|
|
1772
|
-
var node = $.sibling(rect_1);
|
|
1815
|
+
var node = $.child(svg);
|
|
1773
1816
|
{
|
|
1774
1817
|
var consequent = ($$anchor2) => {
|
|
1775
|
-
var
|
|
1818
|
+
var path = root_1$c();
|
|
1819
|
+
path.__pointerdown = function(...$$args) {
|
|
1820
|
+
var _a;
|
|
1821
|
+
(_a = $$props.onClick) == null ? void 0 : _a.apply(this, $$args);
|
|
1822
|
+
};
|
|
1823
|
+
let styles_1;
|
|
1824
|
+
$.template_effect(() => {
|
|
1825
|
+
$.set_attribute(path, "d", $.get(cloudyPath).path);
|
|
1826
|
+
$.set_attribute(path, "stroke-width", $.get(hitStrokeWidth));
|
|
1827
|
+
styles_1 = $.set_style(path, "", styles_1, {
|
|
1828
|
+
cursor: $$props.isSelected ? "move" : "pointer",
|
|
1829
|
+
"pointer-events": $$props.isSelected ? "none" : color() === "transparent" ? "visibleStroke" : "visible"
|
|
1830
|
+
});
|
|
1831
|
+
});
|
|
1832
|
+
$.append($$anchor2, path);
|
|
1833
|
+
};
|
|
1834
|
+
var alternate = ($$anchor2) => {
|
|
1835
|
+
var rect_1 = root_2$9();
|
|
1836
|
+
rect_1.__pointerdown = function(...$$args) {
|
|
1837
|
+
var _a;
|
|
1838
|
+
(_a = $$props.onClick) == null ? void 0 : _a.apply(this, $$args);
|
|
1839
|
+
};
|
|
1776
1840
|
let styles_2;
|
|
1777
1841
|
$.template_effect(() => {
|
|
1778
|
-
$.set_attribute(
|
|
1779
|
-
$.set_attribute(
|
|
1780
|
-
$.set_attribute(
|
|
1781
|
-
$.set_attribute(
|
|
1782
|
-
$.set_attribute(
|
|
1783
|
-
$.
|
|
1784
|
-
|
|
1785
|
-
"pointer-events": "none"
|
|
1786
|
-
stroke: $$props.strokeColor ?? color(),
|
|
1787
|
-
"stroke-width": $$props.strokeWidth,
|
|
1788
|
-
"stroke-dasharray": $.get(dash)
|
|
1842
|
+
$.set_attribute(rect_1, "x", $.get(x));
|
|
1843
|
+
$.set_attribute(rect_1, "y", $.get(y));
|
|
1844
|
+
$.set_attribute(rect_1, "width", $.get(width));
|
|
1845
|
+
$.set_attribute(rect_1, "height", $.get(height));
|
|
1846
|
+
$.set_attribute(rect_1, "stroke-width", $.get(hitStrokeWidth));
|
|
1847
|
+
styles_2 = $.set_style(rect_1, "", styles_2, {
|
|
1848
|
+
cursor: $$props.isSelected ? "move" : "pointer",
|
|
1849
|
+
"pointer-events": $$props.isSelected ? "none" : color() === "transparent" ? "visibleStroke" : "visible"
|
|
1789
1850
|
});
|
|
1790
1851
|
});
|
|
1791
|
-
$.append($$anchor2,
|
|
1852
|
+
$.append($$anchor2, rect_1);
|
|
1792
1853
|
};
|
|
1793
1854
|
$.if(node, ($$render) => {
|
|
1794
|
-
if (
|
|
1855
|
+
if ($.get(isCloudy) && $.get(cloudyPath)) $$render(consequent);
|
|
1856
|
+
else $$render(alternate, false);
|
|
1857
|
+
});
|
|
1858
|
+
}
|
|
1859
|
+
var node_1 = $.sibling(node);
|
|
1860
|
+
{
|
|
1861
|
+
var consequent_2 = ($$anchor2) => {
|
|
1862
|
+
var fragment = $.comment();
|
|
1863
|
+
var node_2 = $.first_child(fragment);
|
|
1864
|
+
{
|
|
1865
|
+
var consequent_1 = ($$anchor3) => {
|
|
1866
|
+
var path_1 = root_4$5();
|
|
1867
|
+
let styles_3;
|
|
1868
|
+
$.template_effect(() => {
|
|
1869
|
+
$.set_attribute(path_1, "d", $.get(cloudyPath).path);
|
|
1870
|
+
$.set_attribute(path_1, "fill", color());
|
|
1871
|
+
$.set_attribute(path_1, "opacity", opacity());
|
|
1872
|
+
styles_3 = $.set_style(path_1, "", styles_3, {
|
|
1873
|
+
"pointer-events": "none",
|
|
1874
|
+
stroke: $$props.strokeColor ?? color(),
|
|
1875
|
+
"stroke-width": $$props.strokeWidth
|
|
1876
|
+
});
|
|
1877
|
+
});
|
|
1878
|
+
$.append($$anchor3, path_1);
|
|
1879
|
+
};
|
|
1880
|
+
var alternate_1 = ($$anchor3) => {
|
|
1881
|
+
var rect_2 = root_5$5();
|
|
1882
|
+
let styles_4;
|
|
1883
|
+
$.template_effect(() => {
|
|
1884
|
+
$.set_attribute(rect_2, "x", $.get(x));
|
|
1885
|
+
$.set_attribute(rect_2, "y", $.get(y));
|
|
1886
|
+
$.set_attribute(rect_2, "width", $.get(width));
|
|
1887
|
+
$.set_attribute(rect_2, "height", $.get(height));
|
|
1888
|
+
$.set_attribute(rect_2, "fill", color());
|
|
1889
|
+
$.set_attribute(rect_2, "opacity", opacity());
|
|
1890
|
+
styles_4 = $.set_style(rect_2, "", styles_4, {
|
|
1891
|
+
"pointer-events": "none",
|
|
1892
|
+
stroke: $$props.strokeColor ?? color(),
|
|
1893
|
+
"stroke-width": $$props.strokeWidth,
|
|
1894
|
+
"stroke-dasharray": $.get(dash)
|
|
1895
|
+
});
|
|
1896
|
+
});
|
|
1897
|
+
$.append($$anchor3, rect_2);
|
|
1898
|
+
};
|
|
1899
|
+
$.if(node_2, ($$render) => {
|
|
1900
|
+
if ($.get(isCloudy) && $.get(cloudyPath)) $$render(consequent_1);
|
|
1901
|
+
else $$render(alternate_1, false);
|
|
1902
|
+
});
|
|
1903
|
+
}
|
|
1904
|
+
$.append($$anchor2, fragment);
|
|
1905
|
+
};
|
|
1906
|
+
$.if(node_1, ($$render) => {
|
|
1907
|
+
if (!appearanceActive()) $$render(consequent_2);
|
|
1795
1908
|
});
|
|
1796
1909
|
}
|
|
1797
1910
|
$.reset(svg);
|
|
@@ -1803,15 +1916,6 @@ function Square($$anchor, $$props) {
|
|
|
1803
1916
|
$.set_attribute(svg, "width", $.get(svgWidth));
|
|
1804
1917
|
$.set_attribute(svg, "height", $.get(svgHeight));
|
|
1805
1918
|
$.set_attribute(svg, "viewBox", `0 0 ${$.get(width) + $$props.strokeWidth} ${$.get(height) + $$props.strokeWidth}`);
|
|
1806
|
-
$.set_attribute(rect_1, "x", $.get(x));
|
|
1807
|
-
$.set_attribute(rect_1, "y", $.get(y));
|
|
1808
|
-
$.set_attribute(rect_1, "width", $.get(width));
|
|
1809
|
-
$.set_attribute(rect_1, "height", $.get(height));
|
|
1810
|
-
$.set_attribute(rect_1, "stroke-width", $.get(hitStrokeWidth));
|
|
1811
|
-
styles_1 = $.set_style(rect_1, "", styles_1, {
|
|
1812
|
-
cursor: $$props.isSelected ? "move" : "pointer",
|
|
1813
|
-
"pointer-events": $$props.isSelected ? "none" : color() === "transparent" ? "visibleStroke" : "visible"
|
|
1814
|
-
});
|
|
1815
1919
|
});
|
|
1816
1920
|
$.append($$anchor, svg);
|
|
1817
1921
|
$.pop();
|
|
@@ -1833,12 +1937,16 @@ function SquareRenderer($$anchor, $$props) {
|
|
|
1833
1937
|
}
|
|
1834
1938
|
}));
|
|
1835
1939
|
}
|
|
1836
|
-
var root_1$
|
|
1837
|
-
var
|
|
1940
|
+
var root_1$b = $.from_svg(`<path fill="transparent" stroke="transparent"></path>`);
|
|
1941
|
+
var root_2$8 = $.from_svg(`<ellipse fill="transparent" stroke="transparent"></ellipse>`);
|
|
1942
|
+
var root_4$4 = $.from_svg(`<path stroke-linejoin="round"></path>`);
|
|
1943
|
+
var root_5$4 = $.from_svg(`<ellipse></ellipse>`);
|
|
1944
|
+
var root$b = $.from_svg(`<svg overflow="visible"><!><!></svg>`);
|
|
1838
1945
|
function Circle($$anchor, $$props) {
|
|
1839
1946
|
$.push($$props, true);
|
|
1840
1947
|
const MIN_HIT_AREA_SCREEN_PX = 20;
|
|
1841
1948
|
let color = $.prop($$props, "color", 3, "#000000"), opacity = $.prop($$props, "opacity", 3, 1), strokeStyle = $.prop($$props, "strokeStyle", 19, () => PdfAnnotationBorderStyle.SOLID), appearanceActive = $.prop($$props, "appearanceActive", 3, false);
|
|
1949
|
+
const isCloudy = $.derived(() => ($$props.cloudyBorderIntensity ?? 0) > 0);
|
|
1842
1950
|
const $$d = $.derived(() => {
|
|
1843
1951
|
const outerW = $$props.rect.size.width;
|
|
1844
1952
|
const outerH = $$props.rect.size.height;
|
|
@@ -1853,46 +1961,117 @@ function Circle($$anchor, $$props) {
|
|
|
1853
1961
|
ry: innerH / 2
|
|
1854
1962
|
};
|
|
1855
1963
|
}), width = $.derived(() => $.get($$d).width), height = $.derived(() => $.get($$d).height), cx = $.derived(() => $.get($$d).cx), cy = $.derived(() => $.get($$d).cy), rx = $.derived(() => $.get($$d).rx), ry = $.derived(() => $.get($$d).ry);
|
|
1964
|
+
const cloudyPath = $.derived(() => {
|
|
1965
|
+
if (!$.get(isCloudy)) return null;
|
|
1966
|
+
return generateCloudyEllipsePath(
|
|
1967
|
+
{
|
|
1968
|
+
x: 0,
|
|
1969
|
+
y: 0,
|
|
1970
|
+
width: $$props.rect.size.width,
|
|
1971
|
+
height: $$props.rect.size.height
|
|
1972
|
+
},
|
|
1973
|
+
$$props.rectangleDifferences,
|
|
1974
|
+
$$props.cloudyBorderIntensity,
|
|
1975
|
+
$$props.strokeWidth
|
|
1976
|
+
);
|
|
1977
|
+
});
|
|
1856
1978
|
let svgWidth = $.derived(() => $.get(width) * $$props.scale);
|
|
1857
1979
|
let svgHeight = $.derived(() => $.get(height) * $$props.scale);
|
|
1858
1980
|
let hitStrokeWidth = $.derived(() => Math.max($$props.strokeWidth, MIN_HIT_AREA_SCREEN_PX / $$props.scale));
|
|
1859
1981
|
let peValue = $.derived(() => $$props.isSelected ? "none" : color() === "transparent" ? "visibleStroke" : "visible");
|
|
1860
1982
|
var svg = root$b();
|
|
1861
1983
|
let styles;
|
|
1862
|
-
var
|
|
1863
|
-
ellipse.__pointerdown = (e) => {
|
|
1864
|
-
var _a;
|
|
1865
|
-
return (_a = $$props.onClick) == null ? void 0 : _a.call($$props, e);
|
|
1866
|
-
};
|
|
1867
|
-
let styles_1;
|
|
1868
|
-
var node = $.sibling(ellipse);
|
|
1984
|
+
var node = $.child(svg);
|
|
1869
1985
|
{
|
|
1870
1986
|
var consequent = ($$anchor2) => {
|
|
1871
|
-
var
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
(
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
$.
|
|
1987
|
+
var path = root_1$b();
|
|
1988
|
+
path.__pointerdown = (e) => {
|
|
1989
|
+
var _a;
|
|
1990
|
+
return (_a = $$props.onClick) == null ? void 0 : _a.call($$props, e);
|
|
1991
|
+
};
|
|
1992
|
+
let styles_1;
|
|
1993
|
+
$.template_effect(() => {
|
|
1994
|
+
$.set_attribute(path, "d", $.get(cloudyPath).path);
|
|
1995
|
+
$.set_attribute(path, "stroke-width", $.get(hitStrokeWidth));
|
|
1996
|
+
$.set_attribute(path, "pointer-events", $.get(peValue));
|
|
1997
|
+
styles_1 = $.set_style(path, "", styles_1, { cursor: $$props.isSelected ? "move" : "pointer" });
|
|
1998
|
+
});
|
|
1999
|
+
$.append($$anchor2, path);
|
|
2000
|
+
};
|
|
2001
|
+
var alternate = ($$anchor2) => {
|
|
2002
|
+
var ellipse = root_2$8();
|
|
2003
|
+
ellipse.__pointerdown = (e) => {
|
|
2004
|
+
var _a;
|
|
2005
|
+
return (_a = $$props.onClick) == null ? void 0 : _a.call($$props, e);
|
|
2006
|
+
};
|
|
2007
|
+
let styles_2;
|
|
2008
|
+
$.template_effect(() => {
|
|
2009
|
+
$.set_attribute(ellipse, "cx", $.get(cx));
|
|
2010
|
+
$.set_attribute(ellipse, "cy", $.get(cy));
|
|
2011
|
+
$.set_attribute(ellipse, "rx", $.get(rx));
|
|
2012
|
+
$.set_attribute(ellipse, "ry", $.get(ry));
|
|
2013
|
+
$.set_attribute(ellipse, "stroke-width", $.get(hitStrokeWidth));
|
|
2014
|
+
$.set_attribute(ellipse, "pointer-events", $.get(peValue));
|
|
2015
|
+
styles_2 = $.set_style(ellipse, "", styles_2, { cursor: $$props.isSelected ? "move" : "pointer" });
|
|
2016
|
+
});
|
|
2017
|
+
$.append($$anchor2, ellipse);
|
|
1893
2018
|
};
|
|
1894
2019
|
$.if(node, ($$render) => {
|
|
1895
|
-
if (
|
|
2020
|
+
if ($.get(isCloudy) && $.get(cloudyPath)) $$render(consequent);
|
|
2021
|
+
else $$render(alternate, false);
|
|
2022
|
+
});
|
|
2023
|
+
}
|
|
2024
|
+
var node_1 = $.sibling(node);
|
|
2025
|
+
{
|
|
2026
|
+
var consequent_2 = ($$anchor2) => {
|
|
2027
|
+
var fragment = $.comment();
|
|
2028
|
+
var node_2 = $.first_child(fragment);
|
|
2029
|
+
{
|
|
2030
|
+
var consequent_1 = ($$anchor3) => {
|
|
2031
|
+
var path_1 = root_4$4();
|
|
2032
|
+
$.set_style(path_1, "", {}, { "pointer-events": "none" });
|
|
2033
|
+
$.template_effect(() => {
|
|
2034
|
+
$.set_attribute(path_1, "d", $.get(cloudyPath).path);
|
|
2035
|
+
$.set_attribute(path_1, "fill", color());
|
|
2036
|
+
$.set_attribute(path_1, "opacity", opacity());
|
|
2037
|
+
$.set_attribute(path_1, "stroke", $$props.strokeColor ?? color());
|
|
2038
|
+
$.set_attribute(path_1, "stroke-width", $$props.strokeWidth);
|
|
2039
|
+
});
|
|
2040
|
+
$.append($$anchor3, path_1);
|
|
2041
|
+
};
|
|
2042
|
+
var alternate_1 = ($$anchor3) => {
|
|
2043
|
+
var ellipse_1 = root_5$4();
|
|
2044
|
+
$.set_style(ellipse_1, "", {}, { "pointer-events": "none" });
|
|
2045
|
+
$.template_effect(
|
|
2046
|
+
($0) => {
|
|
2047
|
+
$.set_attribute(ellipse_1, "cx", $.get(cx));
|
|
2048
|
+
$.set_attribute(ellipse_1, "cy", $.get(cy));
|
|
2049
|
+
$.set_attribute(ellipse_1, "rx", $.get(rx));
|
|
2050
|
+
$.set_attribute(ellipse_1, "ry", $.get(ry));
|
|
2051
|
+
$.set_attribute(ellipse_1, "fill", color());
|
|
2052
|
+
$.set_attribute(ellipse_1, "opacity", opacity());
|
|
2053
|
+
$.set_attribute(ellipse_1, "stroke", $$props.strokeColor ?? color());
|
|
2054
|
+
$.set_attribute(ellipse_1, "stroke-width", $$props.strokeWidth);
|
|
2055
|
+
$.set_attribute(ellipse_1, "stroke-dasharray", $0);
|
|
2056
|
+
},
|
|
2057
|
+
[
|
|
2058
|
+
() => {
|
|
2059
|
+
var _a;
|
|
2060
|
+
return strokeStyle() === PdfAnnotationBorderStyle.DASHED ? (_a = $$props.strokeDashArray) == null ? void 0 : _a.join(",") : void 0;
|
|
2061
|
+
}
|
|
2062
|
+
]
|
|
2063
|
+
);
|
|
2064
|
+
$.append($$anchor3, ellipse_1);
|
|
2065
|
+
};
|
|
2066
|
+
$.if(node_2, ($$render) => {
|
|
2067
|
+
if ($.get(isCloudy) && $.get(cloudyPath)) $$render(consequent_1);
|
|
2068
|
+
else $$render(alternate_1, false);
|
|
2069
|
+
});
|
|
2070
|
+
}
|
|
2071
|
+
$.append($$anchor2, fragment);
|
|
2072
|
+
};
|
|
2073
|
+
$.if(node_1, ($$render) => {
|
|
2074
|
+
if (!appearanceActive()) $$render(consequent_2);
|
|
1896
2075
|
});
|
|
1897
2076
|
}
|
|
1898
2077
|
$.reset(svg);
|
|
@@ -1907,13 +2086,6 @@ function Circle($$anchor, $$props) {
|
|
|
1907
2086
|
"pointer-events": "none",
|
|
1908
2087
|
"z-index": "2"
|
|
1909
2088
|
});
|
|
1910
|
-
$.set_attribute(ellipse, "cx", $.get(cx));
|
|
1911
|
-
$.set_attribute(ellipse, "cy", $.get(cy));
|
|
1912
|
-
$.set_attribute(ellipse, "rx", $.get(rx));
|
|
1913
|
-
$.set_attribute(ellipse, "ry", $.get(ry));
|
|
1914
|
-
$.set_attribute(ellipse, "stroke-width", $.get(hitStrokeWidth));
|
|
1915
|
-
$.set_attribute(ellipse, "pointer-events", $.get(peValue));
|
|
1916
|
-
styles_1 = $.set_style(ellipse, "", styles_1, { cursor: $$props.isSelected ? "move" : "pointer" });
|
|
1917
2089
|
});
|
|
1918
2090
|
$.append($$anchor, svg);
|
|
1919
2091
|
$.pop();
|
|
@@ -1935,10 +2107,10 @@ function CircleRenderer($$anchor, $$props) {
|
|
|
1935
2107
|
}
|
|
1936
2108
|
}));
|
|
1937
2109
|
}
|
|
1938
|
-
var root_1$
|
|
2110
|
+
var root_1$a = $.from_svg(`<path fill="transparent" stroke="transparent"></path>`);
|
|
1939
2111
|
var root_2$7 = $.from_svg(`<path fill="transparent" stroke="transparent"></path>`);
|
|
1940
|
-
var root_4$
|
|
1941
|
-
var root_5$
|
|
2112
|
+
var root_4$3 = $.from_svg(`<path></path>`);
|
|
2113
|
+
var root_5$3 = $.from_svg(`<path></path>`);
|
|
1942
2114
|
var root_3$3 = $.from_svg(`<line></line><!><!>`, 1);
|
|
1943
2115
|
var root$a = $.from_svg(`<svg><line stroke="transparent"></line><!><!><!></svg>`);
|
|
1944
2116
|
function Line($$anchor, $$props) {
|
|
@@ -1975,7 +2147,7 @@ function Line($$anchor, $$props) {
|
|
|
1975
2147
|
var node = $.sibling(line);
|
|
1976
2148
|
{
|
|
1977
2149
|
var consequent = ($$anchor2) => {
|
|
1978
|
-
var path = root_1$
|
|
2150
|
+
var path = root_1$a();
|
|
1979
2151
|
path.__pointerdown = function(...$$args) {
|
|
1980
2152
|
var _a;
|
|
1981
2153
|
(_a = $$props.onClick) == null ? void 0 : _a.apply(this, $$args);
|
|
@@ -2031,7 +2203,7 @@ function Line($$anchor, $$props) {
|
|
|
2031
2203
|
var node_3 = $.sibling(line_1);
|
|
2032
2204
|
{
|
|
2033
2205
|
var consequent_2 = ($$anchor3) => {
|
|
2034
|
-
var path_2 = root_4$
|
|
2206
|
+
var path_2 = root_4$3();
|
|
2035
2207
|
let styles_5;
|
|
2036
2208
|
$.template_effect(() => {
|
|
2037
2209
|
$.set_attribute(path_2, "d", $.get(endings).start.d);
|
|
@@ -2054,7 +2226,7 @@ function Line($$anchor, $$props) {
|
|
|
2054
2226
|
var node_4 = $.sibling(node_3);
|
|
2055
2227
|
{
|
|
2056
2228
|
var consequent_3 = ($$anchor3) => {
|
|
2057
|
-
var path_3 = root_5$
|
|
2229
|
+
var path_3 = root_5$3();
|
|
2058
2230
|
let styles_6;
|
|
2059
2231
|
$.template_effect(() => {
|
|
2060
2232
|
$.set_attribute(path_3, "d", $.get(endings).end.d);
|
|
@@ -2131,10 +2303,10 @@ function LineRenderer($$anchor, $$props) {
|
|
|
2131
2303
|
}
|
|
2132
2304
|
}));
|
|
2133
2305
|
}
|
|
2134
|
-
var root_1$
|
|
2306
|
+
var root_1$9 = $.from_svg(`<path fill="transparent" stroke="transparent"></path>`);
|
|
2135
2307
|
var root_2$6 = $.from_svg(`<path fill="transparent" stroke="transparent"></path>`);
|
|
2136
|
-
var root_4$
|
|
2137
|
-
var root_5$
|
|
2308
|
+
var root_4$2 = $.from_svg(`<path></path>`);
|
|
2309
|
+
var root_5$2 = $.from_svg(`<path></path>`);
|
|
2138
2310
|
var root_3$2 = $.from_svg(`<path></path><!><!>`, 1);
|
|
2139
2311
|
var root$9 = $.from_svg(`<svg><path fill="none" stroke="transparent"></path><!><!><!></svg>`);
|
|
2140
2312
|
function Polyline($$anchor, $$props) {
|
|
@@ -2175,7 +2347,7 @@ function Polyline($$anchor, $$props) {
|
|
|
2175
2347
|
var node = $.sibling(path);
|
|
2176
2348
|
{
|
|
2177
2349
|
var consequent = ($$anchor2) => {
|
|
2178
|
-
var path_1 = root_1$
|
|
2350
|
+
var path_1 = root_1$9();
|
|
2179
2351
|
path_1.__pointerdown = function(...$$args) {
|
|
2180
2352
|
var _a;
|
|
2181
2353
|
(_a = $$props.onClick) == null ? void 0 : _a.apply(this, $$args);
|
|
@@ -2231,7 +2403,7 @@ function Polyline($$anchor, $$props) {
|
|
|
2231
2403
|
var node_3 = $.sibling(path_3);
|
|
2232
2404
|
{
|
|
2233
2405
|
var consequent_2 = ($$anchor3) => {
|
|
2234
|
-
var path_4 = root_4$
|
|
2406
|
+
var path_4 = root_4$2();
|
|
2235
2407
|
let styles_5;
|
|
2236
2408
|
$.template_effect(() => {
|
|
2237
2409
|
$.set_attribute(path_4, "d", $.get(endings).start.d);
|
|
@@ -2254,7 +2426,7 @@ function Polyline($$anchor, $$props) {
|
|
|
2254
2426
|
var node_4 = $.sibling(node_3);
|
|
2255
2427
|
{
|
|
2256
2428
|
var consequent_3 = ($$anchor3) => {
|
|
2257
|
-
var path_5 = root_5$
|
|
2429
|
+
var path_5 = root_5$2();
|
|
2258
2430
|
let styles_6;
|
|
2259
2431
|
$.template_effect(() => {
|
|
2260
2432
|
$.set_attribute(path_5, "d", $.get(endings).end.d);
|
|
@@ -2328,14 +2500,16 @@ function PolylineRenderer($$anchor, $$props) {
|
|
|
2328
2500
|
}
|
|
2329
2501
|
}));
|
|
2330
2502
|
}
|
|
2331
|
-
var root_2$5 = $.from_svg(`<path
|
|
2332
|
-
var
|
|
2333
|
-
var
|
|
2503
|
+
var root_2$5 = $.from_svg(`<path></path>`);
|
|
2504
|
+
var root_4$1 = $.from_svg(`<path fill="none"></path>`);
|
|
2505
|
+
var root_5$1 = $.from_svg(`<rect></rect>`);
|
|
2506
|
+
var root_3$1 = $.from_svg(`<path></path><!><!>`, 1);
|
|
2334
2507
|
var root$8 = $.from_svg(`<svg><path fill="transparent" stroke="transparent"></path><!></svg>`);
|
|
2335
2508
|
function Polygon($$anchor, $$props) {
|
|
2336
2509
|
$.push($$props, true);
|
|
2337
2510
|
const MIN_HIT_AREA_SCREEN_PX = 20;
|
|
2338
2511
|
let color = $.prop($$props, "color", 3, "transparent"), strokeColor = $.prop($$props, "strokeColor", 3, "#000000"), opacity = $.prop($$props, "opacity", 3, 1), strokeStyle = $.prop($$props, "strokeStyle", 19, () => PdfAnnotationBorderStyle.SOLID), handleSize = $.prop($$props, "handleSize", 3, 14), appearanceActive = $.prop($$props, "appearanceActive", 3, false);
|
|
2512
|
+
const isCloudy = $.derived(() => ($$props.cloudyBorderIntensity ?? 0) > 0);
|
|
2339
2513
|
const allPoints = $.derived(() => $$props.currentVertex ? [...$$props.vertices, $$props.currentVertex] : $$props.vertices);
|
|
2340
2514
|
const localPts = $.derived(() => $.get(allPoints).map(({ x, y }) => ({ x: x - $$props.rect.origin.x, y: y - $$props.rect.origin.y })));
|
|
2341
2515
|
const pathData = $.derived(() => {
|
|
@@ -2344,6 +2518,10 @@ function Polygon($$anchor, $$props) {
|
|
|
2344
2518
|
const isPreview = !!$$props.currentVertex;
|
|
2345
2519
|
return (`M ${first.x} ${first.y} ` + rest.map((p) => `L ${p.x} ${p.y}`).join(" ") + (isPreview ? "" : " Z")).trim();
|
|
2346
2520
|
});
|
|
2521
|
+
const cloudyPath = $.derived(() => {
|
|
2522
|
+
if (!$.get(isCloudy) || $.get(allPoints).length < 3) return null;
|
|
2523
|
+
return generateCloudyPolygonPath($.get(allPoints), $$props.rect.origin, $$props.cloudyBorderIntensity, $$props.strokeWidth);
|
|
2524
|
+
});
|
|
2347
2525
|
const isPreviewing = $.derived(() => !!$$props.currentVertex && $$props.vertices.length > 0);
|
|
2348
2526
|
const width = $.derived(() => $$props.rect.size.width * $$props.scale);
|
|
2349
2527
|
const height = $.derived(() => $$props.rect.size.height * $$props.scale);
|
|
@@ -2362,69 +2540,96 @@ function Polygon($$anchor, $$props) {
|
|
|
2362
2540
|
let styles_1;
|
|
2363
2541
|
var node = $.sibling(path);
|
|
2364
2542
|
{
|
|
2365
|
-
var
|
|
2366
|
-
var fragment =
|
|
2367
|
-
var
|
|
2368
|
-
let styles_2;
|
|
2369
|
-
var node_1 = $.sibling(path_1);
|
|
2543
|
+
var consequent_3 = ($$anchor2) => {
|
|
2544
|
+
var fragment = $.comment();
|
|
2545
|
+
var node_1 = $.first_child(fragment);
|
|
2370
2546
|
{
|
|
2371
2547
|
var consequent = ($$anchor3) => {
|
|
2372
|
-
var
|
|
2373
|
-
let
|
|
2548
|
+
var path_1 = root_2$5();
|
|
2549
|
+
let styles_2;
|
|
2374
2550
|
$.template_effect(() => {
|
|
2375
|
-
$.set_attribute(
|
|
2376
|
-
|
|
2377
|
-
|
|
2551
|
+
$.set_attribute(path_1, "d", $.get(cloudyPath).path);
|
|
2552
|
+
$.set_attribute(path_1, "opacity", opacity());
|
|
2553
|
+
styles_2 = $.set_style(path_1, "", styles_2, {
|
|
2554
|
+
fill: color(),
|
|
2555
|
+
stroke: strokeColor() ?? color(),
|
|
2378
2556
|
"stroke-width": $$props.strokeWidth,
|
|
2379
|
-
"
|
|
2380
|
-
|
|
2381
|
-
"pointer-events": "none"
|
|
2557
|
+
"pointer-events": "none",
|
|
2558
|
+
"stroke-linejoin": "round"
|
|
2382
2559
|
});
|
|
2383
2560
|
});
|
|
2384
|
-
$.append($$anchor3,
|
|
2561
|
+
$.append($$anchor3, path_1);
|
|
2385
2562
|
};
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2563
|
+
var alternate = ($$anchor3) => {
|
|
2564
|
+
var fragment_1 = root_3$1();
|
|
2565
|
+
var path_2 = $.first_child(fragment_1);
|
|
2566
|
+
let styles_3;
|
|
2567
|
+
var node_2 = $.sibling(path_2);
|
|
2568
|
+
{
|
|
2569
|
+
var consequent_1 = ($$anchor4) => {
|
|
2570
|
+
var path_3 = root_4$1();
|
|
2571
|
+
let styles_4;
|
|
2572
|
+
$.template_effect(() => {
|
|
2573
|
+
$.set_attribute(path_3, "d", `M ${$.get(localPts)[$.get(localPts).length - 1].x} ${$.get(localPts)[$.get(localPts).length - 1].y} L ${$.get(localPts)[0].x} ${$.get(localPts)[0].y}`);
|
|
2574
|
+
styles_4 = $.set_style(path_3, "", styles_4, {
|
|
2575
|
+
stroke: strokeColor(),
|
|
2576
|
+
"stroke-width": $$props.strokeWidth,
|
|
2577
|
+
"stroke-dasharray": "4,4",
|
|
2578
|
+
opacity: 0.7,
|
|
2579
|
+
"pointer-events": "none"
|
|
2580
|
+
});
|
|
2581
|
+
});
|
|
2582
|
+
$.append($$anchor4, path_3);
|
|
2583
|
+
};
|
|
2584
|
+
$.if(node_2, ($$render) => {
|
|
2585
|
+
if ($.get(isPreviewing) && $$props.vertices.length > 1) $$render(consequent_1);
|
|
2586
|
+
});
|
|
2587
|
+
}
|
|
2588
|
+
var node_3 = $.sibling(node_2);
|
|
2589
|
+
{
|
|
2590
|
+
var consequent_2 = ($$anchor4) => {
|
|
2591
|
+
var rect_1 = root_5$1();
|
|
2592
|
+
$.set_attribute(rect_1, "opacity", 0.4);
|
|
2593
|
+
$.set_style(rect_1, "", {}, { "pointer-events": "none" });
|
|
2594
|
+
$.template_effect(() => {
|
|
2595
|
+
$.set_attribute(rect_1, "x", $.get(localPts)[0].x - handleSize() / $$props.scale / 2);
|
|
2596
|
+
$.set_attribute(rect_1, "y", $.get(localPts)[0].y - handleSize() / $$props.scale / 2);
|
|
2597
|
+
$.set_attribute(rect_1, "width", handleSize() / $$props.scale);
|
|
2598
|
+
$.set_attribute(rect_1, "height", handleSize() / $$props.scale);
|
|
2599
|
+
$.set_attribute(rect_1, "fill", strokeColor());
|
|
2600
|
+
$.set_attribute(rect_1, "stroke", strokeColor());
|
|
2601
|
+
$.set_attribute(rect_1, "stroke-width", $$props.strokeWidth / 2);
|
|
2602
|
+
});
|
|
2603
|
+
$.append($$anchor4, rect_1);
|
|
2604
|
+
};
|
|
2605
|
+
$.if(node_3, ($$render) => {
|
|
2606
|
+
if ($.get(isPreviewing) && $$props.vertices.length >= 2) $$render(consequent_2);
|
|
2607
|
+
});
|
|
2608
|
+
}
|
|
2396
2609
|
$.template_effect(() => {
|
|
2397
|
-
$.set_attribute(
|
|
2398
|
-
$.set_attribute(
|
|
2399
|
-
$.
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2610
|
+
$.set_attribute(path_2, "d", $.get(pathData));
|
|
2611
|
+
$.set_attribute(path_2, "opacity", opacity());
|
|
2612
|
+
styles_3 = $.set_style(path_2, "", styles_3, {
|
|
2613
|
+
fill: $$props.currentVertex ? "none" : color(),
|
|
2614
|
+
stroke: strokeColor() ?? color(),
|
|
2615
|
+
"stroke-width": $$props.strokeWidth,
|
|
2616
|
+
"pointer-events": "none",
|
|
2617
|
+
"stroke-linecap": "butt",
|
|
2618
|
+
"stroke-linejoin": "miter",
|
|
2619
|
+
"stroke-dasharray": $.get(dash)
|
|
2620
|
+
});
|
|
2404
2621
|
});
|
|
2405
|
-
$.append($$anchor3,
|
|
2622
|
+
$.append($$anchor3, fragment_1);
|
|
2406
2623
|
};
|
|
2407
|
-
$.if(
|
|
2408
|
-
if ($.get(
|
|
2624
|
+
$.if(node_1, ($$render) => {
|
|
2625
|
+
if ($.get(isCloudy) && $.get(cloudyPath)) $$render(consequent);
|
|
2626
|
+
else $$render(alternate, false);
|
|
2409
2627
|
});
|
|
2410
2628
|
}
|
|
2411
|
-
$.template_effect(() => {
|
|
2412
|
-
$.set_attribute(path_1, "d", $.get(pathData));
|
|
2413
|
-
$.set_attribute(path_1, "opacity", opacity());
|
|
2414
|
-
styles_2 = $.set_style(path_1, "", styles_2, {
|
|
2415
|
-
fill: $$props.currentVertex ? "none" : color(),
|
|
2416
|
-
stroke: strokeColor() ?? color(),
|
|
2417
|
-
"stroke-width": $$props.strokeWidth,
|
|
2418
|
-
"pointer-events": "none",
|
|
2419
|
-
"stroke-linecap": "butt",
|
|
2420
|
-
"stroke-linejoin": "miter",
|
|
2421
|
-
"stroke-dasharray": $.get(dash)
|
|
2422
|
-
});
|
|
2423
|
-
});
|
|
2424
2629
|
$.append($$anchor2, fragment);
|
|
2425
2630
|
};
|
|
2426
2631
|
$.if(node, ($$render) => {
|
|
2427
|
-
if (!appearanceActive()) $$render(
|
|
2632
|
+
if (!appearanceActive()) $$render(consequent_3);
|
|
2428
2633
|
});
|
|
2429
2634
|
}
|
|
2430
2635
|
$.reset(svg);
|
|
@@ -2433,7 +2638,7 @@ function Polygon($$anchor, $$props) {
|
|
|
2433
2638
|
$.set_attribute(svg, "width", $.get(width));
|
|
2434
2639
|
$.set_attribute(svg, "height", $.get(height));
|
|
2435
2640
|
$.set_attribute(svg, "viewBox", `0 0 ${$$props.rect.size.width} ${$$props.rect.size.height}`);
|
|
2436
|
-
$.set_attribute(path, "d", $.get(pathData));
|
|
2641
|
+
$.set_attribute(path, "d", $.get(isCloudy) && $.get(cloudyPath) ? $.get(cloudyPath).path : $.get(pathData));
|
|
2437
2642
|
$.set_attribute(path, "stroke-width", $.get(hitStrokeWidth));
|
|
2438
2643
|
styles_1 = $.set_style(path, "", styles_1, {
|
|
2439
2644
|
cursor: $$props.isSelected ? "move" : "pointer",
|
|
@@ -2472,15 +2677,19 @@ function FreeText($$anchor, $$props) {
|
|
|
2472
2677
|
let isIOS = $.state(false);
|
|
2473
2678
|
let editingRef = false;
|
|
2474
2679
|
$.user_effect(() => {
|
|
2475
|
-
var _a;
|
|
2680
|
+
var _a, _b, _c;
|
|
2476
2681
|
if (!$$props.isEditing || !editorRef) return;
|
|
2477
2682
|
editingRef = true;
|
|
2478
2683
|
editorRef.focus();
|
|
2479
|
-
const
|
|
2684
|
+
const tool = (_a = $.get(annotationProvides)) == null ? void 0 : _a.findToolForAnnotation($$props.annotation.object);
|
|
2685
|
+
const isDefaultContent = ((_b = tool == null ? void 0 : tool.defaults) == null ? void 0 : _b.contents) != null && $$props.annotation.object.contents === tool.defaults.contents;
|
|
2686
|
+
const selection = (_c = window.getSelection) == null ? void 0 : _c.call(window);
|
|
2480
2687
|
if (!selection) return;
|
|
2481
2688
|
const range = document.createRange();
|
|
2482
2689
|
range.selectNodeContents(editorRef);
|
|
2483
|
-
|
|
2690
|
+
if (!isDefaultContent) {
|
|
2691
|
+
range.collapse(false);
|
|
2692
|
+
}
|
|
2484
2693
|
selection.removeAllRanges();
|
|
2485
2694
|
selection.addRange(range);
|
|
2486
2695
|
});
|
|
@@ -2497,7 +2706,7 @@ function FreeText($$anchor, $$props) {
|
|
|
2497
2706
|
if (!editingRef) return;
|
|
2498
2707
|
editingRef = false;
|
|
2499
2708
|
if (!$.get(annotationProvides) || !editorRef) return;
|
|
2500
|
-
$.get(annotationProvides).updateAnnotation($$props.pageIndex, $$props.annotation.object.id, { contents: editorRef.innerText });
|
|
2709
|
+
$.get(annotationProvides).updateAnnotation($$props.pageIndex, $$props.annotation.object.id, { contents: editorRef.innerText.replace(/\u00A0/g, " ") });
|
|
2501
2710
|
}
|
|
2502
2711
|
const computedFontPx = $.derived(() => $$props.annotation.object.fontSize * $$props.scale);
|
|
2503
2712
|
const MIN_IOS_FOCUS_FONT_PX = 16;
|
|
@@ -3349,7 +3558,7 @@ const builtInRenderers = [
|
|
|
3349
3558
|
component: HighlightRenderer,
|
|
3350
3559
|
zIndex: 0,
|
|
3351
3560
|
interactionDefaults: { isDraggable: false, isResizable: false, isRotatable: false },
|
|
3352
|
-
|
|
3561
|
+
defaultBlendMode: PdfBlendMode.Multiply
|
|
3353
3562
|
}),
|
|
3354
3563
|
createRenderer({
|
|
3355
3564
|
id: "underline",
|
|
@@ -3465,6 +3674,14 @@ function Annotations($$anchor, $$props) {
|
|
|
3465
3674
|
});
|
|
3466
3675
|
return () => off == null ? void 0 : off();
|
|
3467
3676
|
});
|
|
3677
|
+
$.user_effect(() => {
|
|
3678
|
+
if (!$.get(annotationProvides)) return;
|
|
3679
|
+
return $.get(annotationProvides).onAnnotationEvent((event) => {
|
|
3680
|
+
if (event.type === "create" && event.editAfterCreate) {
|
|
3681
|
+
$.set(editingId, event.annotation.id, true);
|
|
3682
|
+
}
|
|
3683
|
+
});
|
|
3684
|
+
});
|
|
3468
3685
|
$.user_effect(() => {
|
|
3469
3686
|
if (!$.get(annotationProvides)) return;
|
|
3470
3687
|
if (prevScale !== $$props.scale) {
|
|
@@ -3480,6 +3697,9 @@ function Annotations($$anchor, $$props) {
|
|
|
3480
3697
|
const handlers = {
|
|
3481
3698
|
onPointerDown: (_, pe) => {
|
|
3482
3699
|
if (pe.target === pe.currentTarget && $.get(annotationProvides)) {
|
|
3700
|
+
if ($.get(editingId) && $.get(annotations).some((a) => a.object.id === $.get(editingId))) {
|
|
3701
|
+
pe.stopImmediatePropagation();
|
|
3702
|
+
}
|
|
3483
3703
|
$.get(annotationProvides).deselectAnnotation();
|
|
3484
3704
|
$.set(editingId, null);
|
|
3485
3705
|
}
|
|
@@ -3654,11 +3874,12 @@ function Annotations($$anchor, $$props) {
|
|
|
3654
3874
|
e.stopPropagation();
|
|
3655
3875
|
$.get(renderer).onDoubleClick($.get(annotation).object.id, setEditingId);
|
|
3656
3876
|
} : void 0);
|
|
3657
|
-
let $6 = $.derived(() =>
|
|
3877
|
+
let $6 = $.derived(() => blendModeToCss($.get(annotation).object.blendMode ?? $.get(renderer).defaultBlendMode ?? PdfBlendMode.Normal));
|
|
3878
|
+
let $7 = $.derived(() => {
|
|
3658
3879
|
var _a, _b;
|
|
3659
|
-
return (
|
|
3880
|
+
return (_b = (_a = $.get(renderer)).containerStyle) == null ? void 0 : _b.call(_a, $.get(annotation).object);
|
|
3660
3881
|
});
|
|
3661
|
-
let $
|
|
3882
|
+
let $8 = $.derived(() => $.get(useAP) ? getAppearanceForAnnotation($.get(annotation)) : void 0);
|
|
3662
3883
|
AnnotationContainer($$anchor3, $.spread_props(
|
|
3663
3884
|
{
|
|
3664
3885
|
get trackedAnnotation() {
|
|
@@ -3703,11 +3924,14 @@ function Annotations($$anchor, $$props) {
|
|
|
3703
3924
|
get zIndex() {
|
|
3704
3925
|
return $.get(renderer).zIndex;
|
|
3705
3926
|
},
|
|
3706
|
-
get
|
|
3927
|
+
get blendMode() {
|
|
3707
3928
|
return $.get($6);
|
|
3708
3929
|
},
|
|
3709
|
-
get
|
|
3930
|
+
get style() {
|
|
3710
3931
|
return $.get($7);
|
|
3932
|
+
},
|
|
3933
|
+
get appearance() {
|
|
3934
|
+
return $.get($8);
|
|
3711
3935
|
}
|
|
3712
3936
|
},
|
|
3713
3937
|
() => annotationsProps,
|
|
@@ -4212,15 +4436,18 @@ function PreviewRenderer($$anchor, $$props) {
|
|
|
4212
4436
|
() => $$props.preview.data
|
|
4213
4437
|
));
|
|
4214
4438
|
$.reset(div_5);
|
|
4215
|
-
$.template_effect(() => styles_5 = $.set_style(div_5, "", styles_5,
|
|
4216
|
-
|
|
4217
|
-
|
|
4218
|
-
|
|
4219
|
-
|
|
4220
|
-
|
|
4221
|
-
|
|
4222
|
-
|
|
4223
|
-
|
|
4439
|
+
$.template_effect(($0) => styles_5 = $.set_style(div_5, "", styles_5, $0), [
|
|
4440
|
+
() => ({
|
|
4441
|
+
position: "absolute",
|
|
4442
|
+
left: `${$.get(style).left ?? ""}px`,
|
|
4443
|
+
top: `${$.get(style).top ?? ""}px`,
|
|
4444
|
+
width: `${$.get(style).width ?? ""}px`,
|
|
4445
|
+
height: `${$.get(style).height ?? ""}px`,
|
|
4446
|
+
"pointer-events": "none",
|
|
4447
|
+
"z-index": "10",
|
|
4448
|
+
"mix-blend-mode": blendModeToCss($$props.preview.data.blendMode ?? PdfBlendMode.Normal)
|
|
4449
|
+
})
|
|
4450
|
+
]);
|
|
4224
4451
|
$.append($$anchor7, div_5);
|
|
4225
4452
|
};
|
|
4226
4453
|
var alternate = ($$anchor7) => {
|