@embedpdf/plugin-annotation 2.8.0 → 2.9.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.
Files changed (52) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.js +814 -139
  4. package/dist/index.js.map +1 -1
  5. package/dist/lib/geometry/cloudy-border.d.ts +90 -0
  6. package/dist/lib/geometry/index.d.ts +1 -0
  7. package/dist/lib/handlers/types.d.ts +2 -1
  8. package/dist/lib/tools/default-tools.d.ts +38 -87
  9. package/dist/lib/tools/types.d.ts +32 -1
  10. package/dist/preact/index.cjs +1 -1
  11. package/dist/preact/index.cjs.map +1 -1
  12. package/dist/preact/index.js +352 -239
  13. package/dist/preact/index.js.map +1 -1
  14. package/dist/react/index.cjs +1 -1
  15. package/dist/react/index.cjs.map +1 -1
  16. package/dist/react/index.js +352 -239
  17. package/dist/react/index.js.map +1 -1
  18. package/dist/shared/components/annotation-container.d.ts +4 -2
  19. package/dist/shared/components/annotations/circle.d.ts +6 -2
  20. package/dist/shared/components/annotations/polygon.d.ts +3 -1
  21. package/dist/shared/components/annotations/square.d.ts +6 -2
  22. package/dist/shared/components/types.d.ts +6 -2
  23. package/dist/shared-preact/components/annotation-container.d.ts +4 -2
  24. package/dist/shared-preact/components/annotations/circle.d.ts +6 -2
  25. package/dist/shared-preact/components/annotations/polygon.d.ts +3 -1
  26. package/dist/shared-preact/components/annotations/square.d.ts +6 -2
  27. package/dist/shared-preact/components/types.d.ts +6 -2
  28. package/dist/shared-react/components/annotation-container.d.ts +4 -2
  29. package/dist/shared-react/components/annotations/circle.d.ts +6 -2
  30. package/dist/shared-react/components/annotations/polygon.d.ts +3 -1
  31. package/dist/shared-react/components/annotations/square.d.ts +6 -2
  32. package/dist/shared-react/components/types.d.ts +6 -2
  33. package/dist/svelte/components/annotations/Circle.svelte.d.ts +3 -1
  34. package/dist/svelte/components/annotations/Polygon.svelte.d.ts +1 -0
  35. package/dist/svelte/components/annotations/Square.svelte.d.ts +3 -1
  36. package/dist/svelte/components/types.d.ts +2 -1
  37. package/dist/svelte/context/types.d.ts +6 -2
  38. package/dist/svelte/index.cjs +1 -1
  39. package/dist/svelte/index.cjs.map +1 -1
  40. package/dist/svelte/index.js +505 -293
  41. package/dist/svelte/index.js.map +1 -1
  42. package/dist/vue/components/annotation-container.vue.d.ts +7 -6
  43. package/dist/vue/components/annotations/circle.vue.d.ts +5 -1
  44. package/dist/vue/components/annotations/polygon.vue.d.ts +2 -0
  45. package/dist/vue/components/annotations/square.vue.d.ts +5 -1
  46. package/dist/vue/components/annotations.vue.d.ts +8 -9
  47. package/dist/vue/context/types.d.ts +6 -2
  48. package/dist/vue/index.cjs +1 -1
  49. package/dist/vue/index.cjs.map +1 -1
  50. package/dist/vue/index.js +259 -121
  51. package/dist/vue/index.js.map +1 -1
  52. package/package.json +10 -10
package/dist/vue/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import { createPluginPackage } from "@embedpdf/core";
2
- import { AnnotationPlugin, initialDocumentState, inferRotationCenterFromRects, patching, resolveInteractionProp, getAnnotationsByPageIndex, getSelectedAnnotationIds, AnnotationPluginPackage as AnnotationPluginPackage$1 } from "@embedpdf/plugin-annotation";
2
+ import { AnnotationPlugin, initialDocumentState, inferRotationCenterFromRects, generateCloudyRectanglePath, generateCloudyEllipsePath, patching, generateCloudyPolygonPath, resolveInteractionProp, getAnnotationsByPageIndex, getSelectedAnnotationIds, AnnotationPluginPackage as AnnotationPluginPackage$1 } from "@embedpdf/plugin-annotation";
3
3
  export * from "@embedpdf/plugin-annotation";
4
- import { defineComponent, ref, watchEffect, openBlock, createElementBlock, normalizeStyle, createCommentVNode, toValue, watch, computed, shallowRef, toRaw, useSlots, createElementVNode, Fragment, unref, renderSlot, normalizeProps, mergeProps, createBlock, renderList, withCtx, resolveDynamicComponent, Teleport, toDisplayString, markRaw, provide, inject, onUnmounted, onMounted, createVNode, createSlots, guardReactiveProps } from "vue";
4
+ import { defineComponent, ref, watchEffect, openBlock, createElementBlock, normalizeStyle, createCommentVNode, toValue, watch, computed, shallowRef, toRaw, useSlots, createElementVNode, renderSlot, createBlock, Fragment, unref, normalizeProps, mergeProps, renderList, withCtx, resolveDynamicComponent, Teleport, toDisplayString, markRaw, provide, inject, onUnmounted, onMounted, createVNode, createSlots, guardReactiveProps } from "vue";
5
5
  import { getCounterRotation } from "@embedpdf/utils";
6
6
  import { useInteractionHandles, useDoublePressProps, CounterRotate, deepToRaw } from "@embedpdf/utils/vue";
7
7
  import { useCapability, usePlugin, useDocumentPermissions, useDocumentState } from "@embedpdf/core/vue";
8
- import { boundingRectOrEmpty, PdfAnnotationBorderStyle, PdfVerticalAlignment, textAlignmentToCss, standardFontCssProperties, ignore, PdfErrorCode, getContrastStrokeColor, PdfAnnotationSubtype, blendModeToCss, PdfBlendMode } from "@embedpdf/models";
8
+ import { boundingRectOrEmpty, PdfAnnotationBorderStyle, PdfVerticalAlignment, textAlignmentToCss, standardFontCssProperties, ignore, PdfErrorCode, getContrastStrokeColor, PdfBlendMode, PdfAnnotationSubtype, blendModeToCss } from "@embedpdf/models";
9
9
  import { usePointerHandlers } from "@embedpdf/plugin-interaction-manager/vue";
10
10
  import { useSelectionCapability } from "@embedpdf/plugin-selection/vue";
11
11
  const _hoisted_1$d = ["src"];
@@ -121,6 +121,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
121
121
  resizeUi: {},
122
122
  vertexUi: {},
123
123
  rotationUi: {},
124
+ blendMode: {},
124
125
  style: {}
125
126
  },
126
127
  setup(__props) {
@@ -509,7 +510,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
509
510
  }
510
511
  );
511
512
  const contentsStyle = { display: "contents" };
512
- const outerAABBStyle = computed(() => ({
513
+ const layerBaseStyle = computed(() => ({
513
514
  position: "absolute",
514
515
  left: `${currentObject.value.rect.origin.x * props.scale}px`,
515
516
  top: `${currentObject.value.rect.origin.y * props.scale}px`,
@@ -517,8 +518,23 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
517
518
  height: `${counterRot.value ? counterRot.value.height : aabbHeight.value}px`,
518
519
  pointerEvents: "none",
519
520
  zIndex: props.zIndex,
520
- ...counterRot.value ? { transform: counterRot.value.matrix, transformOrigin: "0 0" } : {},
521
- ...props.style ?? {}
521
+ ...counterRot.value ? { transform: counterRot.value.matrix, transformOrigin: "0 0" } : {}
522
+ }));
523
+ const visualLayerStyle = computed(() => ({
524
+ ...layerBaseStyle.value,
525
+ ...props.blendMode ? { mixBlendMode: props.blendMode } : {},
526
+ ...props.style
527
+ }));
528
+ const outerAABBStyle = computed(() => layerBaseStyle.value);
529
+ const visualInnerStyle = computed(() => ({
530
+ position: "absolute",
531
+ left: `${innerLeft.value}px`,
532
+ top: `${innerTop.value}px`,
533
+ width: `${innerWidth.value}px`,
534
+ height: `${innerHeight.value}px`,
535
+ transform: annotationRotation.value !== 0 ? `rotate(${annotationRotation.value}deg)` : void 0,
536
+ transformOrigin: innerTransformOrigin.value,
537
+ pointerEvents: "none"
522
538
  }));
523
539
  const innerRotatedStyle = computed(() => ({
524
540
  position: "absolute",
@@ -630,6 +646,23 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
630
646
  "data-no-interaction": "",
631
647
  style: contentsStyle
632
648
  }, [
649
+ createElementVNode("div", {
650
+ style: normalizeStyle(visualLayerStyle.value)
651
+ }, [
652
+ createElementVNode("div", {
653
+ style: normalizeStyle(visualInnerStyle.value)
654
+ }, [
655
+ renderSlot(_ctx.$slots, "default", {
656
+ annotation: childObject.value,
657
+ appearanceActive: apActive.value
658
+ }),
659
+ ((_a = __props.appearance) == null ? void 0 : _a.normal) ? (openBlock(), createBlock(_sfc_main$D, {
660
+ key: 0,
661
+ appearance: __props.appearance.normal,
662
+ style: normalizeStyle({ display: apActive.value ? "block" : "none" })
663
+ }, null, 8, ["appearance", "style"])) : createCommentVNode("", true)
664
+ ], 4)
665
+ ], 4),
633
666
  createElementVNode("div", {
634
667
  style: normalizeStyle(outerAABBStyle.value)
635
668
  }, [
@@ -691,16 +724,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
691
724
  ], 16))
692
725
  ], 32)) : createCommentVNode("", true),
693
726
  createElementVNode("div", mergeProps({ ...effectiveIsDraggable.value && __props.isSelected ? unref(dragProps) : {}, ...unref(doubleProps) }, { style: innerRotatedStyle.value }), [
694
- renderSlot(_ctx.$slots, "default", {
695
- annotation: childObject.value,
696
- appearanceActive: apActive.value
697
- }),
698
- ((_a = __props.appearance) == null ? void 0 : _a.normal) ? (openBlock(), createBlock(_sfc_main$D, {
699
- key: 0,
700
- appearance: __props.appearance.normal,
701
- style: normalizeStyle({ display: apActive.value ? "block" : "none" })
702
- }, null, 8, ["appearance", "style"])) : createCommentVNode("", true),
703
- __props.isSelected && effectiveIsResizable.value && !rotationActive.value ? (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(unref(resize), ({ key, style, ...handle }) => {
727
+ __props.isSelected && effectiveIsResizable.value && !rotationActive.value ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(unref(resize), ({ key, style, ...handle }) => {
704
728
  return openBlock(), createElementBlock(Fragment, { key }, [
705
729
  unref(slots)["resize-handle"] ? renderSlot(_ctx.$slots, "resize-handle", mergeProps({
706
730
  key: 0,
@@ -717,7 +741,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
717
741
  }), null, 16))
718
742
  ], 64);
719
743
  }), 128)) : createCommentVNode("", true),
720
- __props.isSelected && unref(permissions).canModifyAnnotations && !__props.isMultiSelected && !rotationActive.value && unref(vertices).length > 0 ? (openBlock(true), createElementBlock(Fragment, { key: 2 }, renderList(unref(vertices), ({ key, style, ...vertex }) => {
744
+ __props.isSelected && unref(permissions).canModifyAnnotations && !__props.isMultiSelected && !rotationActive.value && unref(vertices).length > 0 ? (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(unref(vertices), ({ key, style, ...vertex }) => {
721
745
  return openBlock(), createElementBlock(Fragment, { key }, [
722
746
  unref(slots)["vertex-handle"] ? renderSlot(_ctx.$slots, "vertex-handle", mergeProps({
723
747
  key: 0,
@@ -1367,7 +1391,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
1367
1391
  }), 128)) : createCommentVNode("", true)
1368
1392
  ], 16)
1369
1393
  ], 4),
1370
- shouldShowMenu.value ? (openBlock(), createBlock(unref(CounterRotate), {
1394
+ shouldShowMenu.value && !rotationActive.value ? (openBlock(), createBlock(unref(CounterRotate), {
1371
1395
  key: 0,
1372
1396
  rect: menuRect.value,
1373
1397
  rotation: __props.rotation
@@ -1435,6 +1459,7 @@ function createRenderer(entry) {
1435
1459
  component: markRaw(entry.component),
1436
1460
  vertexConfig: entry.vertexConfig,
1437
1461
  zIndex: entry.zIndex,
1462
+ defaultBlendMode: entry.defaultBlendMode,
1438
1463
  containerStyle: entry.containerStyle,
1439
1464
  interactionDefaults: entry.interactionDefaults,
1440
1465
  useAppearanceStream: entry.useAppearanceStream,
@@ -1557,8 +1582,10 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
1557
1582
  }
1558
1583
  });
1559
1584
  const _hoisted_1$9 = ["width", "height", "viewBox"];
1560
- const _hoisted_2$7 = ["x", "y", "width", "height", "stroke-width"];
1561
- const _hoisted_3$7 = ["x", "y", "width", "height", "fill", "opacity"];
1585
+ const _hoisted_2$7 = ["d", "stroke-width"];
1586
+ const _hoisted_3$7 = ["x", "y", "width", "height", "stroke-width"];
1587
+ const _hoisted_4$6 = ["d", "fill", "opacity"];
1588
+ const _hoisted_5$5 = ["x", "y", "width", "height", "fill", "opacity"];
1562
1589
  const __default__$c = { inheritAttrs: false };
1563
1590
  const _sfc_main$y = /* @__PURE__ */ defineComponent({
1564
1591
  ...__default__$c,
@@ -1574,11 +1601,14 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
1574
1601
  rect: {},
1575
1602
  scale: {},
1576
1603
  onClick: {},
1577
- appearanceActive: { type: Boolean, default: false }
1604
+ appearanceActive: { type: Boolean, default: false },
1605
+ cloudyBorderIntensity: {},
1606
+ rectangleDifferences: {}
1578
1607
  },
1579
1608
  setup(__props) {
1580
1609
  const MIN_HIT_AREA_SCREEN_PX = 20;
1581
1610
  const props = __props;
1611
+ const isCloudy = computed(() => (props.cloudyBorderIntensity ?? 0) > 0);
1582
1612
  const geometry = computed(() => {
1583
1613
  const outerW = props.rect.size.width;
1584
1614
  const outerH = props.rect.size.height;
@@ -1591,8 +1621,17 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
1591
1621
  y: props.strokeWidth / 2
1592
1622
  };
1593
1623
  });
1594
- const svgWidth = computed(() => (geometry.value.width + props.strokeWidth) * props.scale);
1595
- const svgHeight = computed(() => (geometry.value.height + props.strokeWidth) * props.scale);
1624
+ const cloudyPath = computed(() => {
1625
+ if (!isCloudy.value) return null;
1626
+ return generateCloudyRectanglePath(
1627
+ { x: 0, y: 0, width: props.rect.size.width, height: props.rect.size.height },
1628
+ props.rectangleDifferences,
1629
+ props.cloudyBorderIntensity,
1630
+ props.strokeWidth
1631
+ );
1632
+ });
1633
+ const svgWidth = computed(() => props.rect.size.width * props.scale);
1634
+ const svgHeight = computed(() => props.rect.size.height * props.scale);
1596
1635
  const hitStrokeWidth = computed(
1597
1636
  () => Math.max(props.strokeWidth, MIN_HIT_AREA_SCREEN_PX / props.scale)
1598
1637
  );
@@ -1608,14 +1647,12 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
1608
1647
  }),
1609
1648
  width: svgWidth.value,
1610
1649
  height: svgHeight.value,
1611
- viewBox: `0 0 ${geometry.value.width + __props.strokeWidth} ${geometry.value.height + __props.strokeWidth}`,
1650
+ viewBox: `0 0 ${__props.rect.size.width} ${__props.rect.size.height}`,
1612
1651
  overflow: "visible"
1613
1652
  }, [
1614
- createElementVNode("rect", {
1615
- x: geometry.value.x,
1616
- y: geometry.value.y,
1617
- width: geometry.value.width,
1618
- height: geometry.value.height,
1653
+ isCloudy.value && cloudyPath.value ? (openBlock(), createElementBlock("path", {
1654
+ key: 0,
1655
+ d: cloudyPath.value.path,
1619
1656
  fill: "transparent",
1620
1657
  stroke: "transparent",
1621
1658
  "stroke-width": hitStrokeWidth.value,
@@ -1625,24 +1662,52 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
1625
1662
  cursor: __props.isSelected ? "move" : "pointer",
1626
1663
  pointerEvents: __props.isSelected ? "none" : __props.color === "transparent" ? "visibleStroke" : "visible"
1627
1664
  })
1628
- }, null, 44, _hoisted_2$7),
1629
- !__props.appearanceActive ? (openBlock(), createElementBlock("rect", {
1630
- key: 0,
1665
+ }, null, 44, _hoisted_2$7)) : (openBlock(), createElementBlock("rect", {
1666
+ key: 1,
1631
1667
  x: geometry.value.x,
1632
1668
  y: geometry.value.y,
1633
1669
  width: geometry.value.width,
1634
1670
  height: geometry.value.height,
1635
- fill: __props.color,
1636
- opacity: __props.opacity,
1671
+ fill: "transparent",
1672
+ stroke: "transparent",
1673
+ "stroke-width": hitStrokeWidth.value,
1674
+ onPointerdown: _cache[1] || (_cache[1] = //@ts-ignore
1675
+ (...args) => __props.onClick && __props.onClick(...args)),
1637
1676
  style: normalizeStyle({
1638
- pointerEvents: "none",
1639
- stroke: __props.strokeColor ?? __props.color,
1640
- strokeWidth: __props.strokeWidth,
1641
- ...__props.strokeStyle === unref(PdfAnnotationBorderStyle).DASHED && {
1642
- strokeDasharray: (_a = __props.strokeDashArray) == null ? void 0 : _a.join(",")
1643
- }
1677
+ cursor: __props.isSelected ? "move" : "pointer",
1678
+ pointerEvents: __props.isSelected ? "none" : __props.color === "transparent" ? "visibleStroke" : "visible"
1644
1679
  })
1645
- }, null, 12, _hoisted_3$7)) : createCommentVNode("", true)
1680
+ }, null, 44, _hoisted_3$7)),
1681
+ !__props.appearanceActive ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
1682
+ isCloudy.value && cloudyPath.value ? (openBlock(), createElementBlock("path", {
1683
+ key: 0,
1684
+ d: cloudyPath.value.path,
1685
+ fill: __props.color,
1686
+ opacity: __props.opacity,
1687
+ style: normalizeStyle({
1688
+ pointerEvents: "none",
1689
+ stroke: __props.strokeColor ?? __props.color,
1690
+ strokeWidth: __props.strokeWidth,
1691
+ strokeLinejoin: "round"
1692
+ })
1693
+ }, null, 12, _hoisted_4$6)) : (openBlock(), createElementBlock("rect", {
1694
+ key: 1,
1695
+ x: geometry.value.x,
1696
+ y: geometry.value.y,
1697
+ width: geometry.value.width,
1698
+ height: geometry.value.height,
1699
+ fill: __props.color,
1700
+ opacity: __props.opacity,
1701
+ style: normalizeStyle({
1702
+ pointerEvents: "none",
1703
+ stroke: __props.strokeColor ?? __props.color,
1704
+ strokeWidth: __props.strokeWidth,
1705
+ ...__props.strokeStyle === unref(PdfAnnotationBorderStyle).DASHED && {
1706
+ strokeDasharray: (_a = __props.strokeDashArray) == null ? void 0 : _a.join(",")
1707
+ }
1708
+ })
1709
+ }, null, 12, _hoisted_5$5))
1710
+ ], 64)) : createCommentVNode("", true)
1646
1711
  ], 12, _hoisted_1$9);
1647
1712
  };
1648
1713
  }
@@ -1672,8 +1737,10 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
1672
1737
  }
1673
1738
  });
1674
1739
  const _hoisted_1$8 = ["width", "height", "viewBox"];
1675
- const _hoisted_2$6 = ["cx", "cy", "rx", "ry", "stroke-width"];
1676
- const _hoisted_3$6 = ["cx", "cy", "rx", "ry", "fill", "opacity"];
1740
+ const _hoisted_2$6 = ["d", "stroke-width"];
1741
+ const _hoisted_3$6 = ["cx", "cy", "rx", "ry", "stroke-width"];
1742
+ const _hoisted_4$5 = ["d", "fill", "opacity"];
1743
+ const _hoisted_5$4 = ["cx", "cy", "rx", "ry", "fill", "opacity"];
1677
1744
  const __default__$b = { inheritAttrs: false };
1678
1745
  const _sfc_main$w = /* @__PURE__ */ defineComponent({
1679
1746
  ...__default__$b,
@@ -1689,11 +1756,14 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
1689
1756
  rect: {},
1690
1757
  scale: {},
1691
1758
  onClick: {},
1692
- appearanceActive: { type: Boolean, default: false }
1759
+ appearanceActive: { type: Boolean, default: false },
1760
+ cloudyBorderIntensity: {},
1761
+ rectangleDifferences: {}
1693
1762
  },
1694
1763
  setup(__props) {
1695
1764
  const MIN_HIT_AREA_SCREEN_PX = 20;
1696
1765
  const props = __props;
1766
+ const isCloudy = computed(() => (props.cloudyBorderIntensity ?? 0) > 0);
1697
1767
  const geometry = computed(() => {
1698
1768
  const outerW = props.rect.size.width;
1699
1769
  const outerH = props.rect.size.height;
@@ -1708,6 +1778,15 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
1708
1778
  ry: innerH / 2
1709
1779
  };
1710
1780
  });
1781
+ const cloudyPath = computed(() => {
1782
+ if (!isCloudy.value) return null;
1783
+ return generateCloudyEllipsePath(
1784
+ { x: 0, y: 0, width: props.rect.size.width, height: props.rect.size.height },
1785
+ props.rectangleDifferences,
1786
+ props.cloudyBorderIntensity,
1787
+ props.strokeWidth
1788
+ );
1789
+ });
1711
1790
  const svgWidth = computed(() => geometry.value.width * props.scale);
1712
1791
  const svgHeight = computed(() => geometry.value.height * props.scale);
1713
1792
  const hitStrokeWidth = computed(
@@ -1728,11 +1807,9 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
1728
1807
  viewBox: `0 0 ${geometry.value.width} ${geometry.value.height}`,
1729
1808
  overflow: "visible"
1730
1809
  }, [
1731
- createElementVNode("ellipse", {
1732
- cx: geometry.value.cx,
1733
- cy: geometry.value.cy,
1734
- rx: geometry.value.rx,
1735
- ry: geometry.value.ry,
1810
+ isCloudy.value && cloudyPath.value ? (openBlock(), createElementBlock("path", {
1811
+ key: 0,
1812
+ d: cloudyPath.value.path,
1736
1813
  fill: "transparent",
1737
1814
  stroke: "transparent",
1738
1815
  "stroke-width": hitStrokeWidth.value,
@@ -1742,24 +1819,52 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
1742
1819
  cursor: __props.isSelected ? "move" : "pointer",
1743
1820
  pointerEvents: __props.isSelected ? "none" : __props.color === "transparent" ? "visibleStroke" : "visible"
1744
1821
  })
1745
- }, null, 44, _hoisted_2$6),
1746
- !__props.appearanceActive ? (openBlock(), createElementBlock("ellipse", {
1747
- key: 0,
1822
+ }, null, 44, _hoisted_2$6)) : (openBlock(), createElementBlock("ellipse", {
1823
+ key: 1,
1748
1824
  cx: geometry.value.cx,
1749
1825
  cy: geometry.value.cy,
1750
1826
  rx: geometry.value.rx,
1751
1827
  ry: geometry.value.ry,
1752
- fill: __props.color,
1753
- opacity: __props.opacity,
1828
+ fill: "transparent",
1829
+ stroke: "transparent",
1830
+ "stroke-width": hitStrokeWidth.value,
1831
+ onPointerdown: _cache[1] || (_cache[1] = //@ts-ignore
1832
+ (...args) => __props.onClick && __props.onClick(...args)),
1754
1833
  style: normalizeStyle({
1755
- pointerEvents: "none",
1756
- stroke: __props.strokeColor ?? __props.color,
1757
- strokeWidth: __props.strokeWidth,
1758
- ...__props.strokeStyle === unref(PdfAnnotationBorderStyle).DASHED && {
1759
- strokeDasharray: (_a = __props.strokeDashArray) == null ? void 0 : _a.join(",")
1760
- }
1834
+ cursor: __props.isSelected ? "move" : "pointer",
1835
+ pointerEvents: __props.isSelected ? "none" : __props.color === "transparent" ? "visibleStroke" : "visible"
1761
1836
  })
1762
- }, null, 12, _hoisted_3$6)) : createCommentVNode("", true)
1837
+ }, null, 44, _hoisted_3$6)),
1838
+ !__props.appearanceActive ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
1839
+ isCloudy.value && cloudyPath.value ? (openBlock(), createElementBlock("path", {
1840
+ key: 0,
1841
+ d: cloudyPath.value.path,
1842
+ fill: __props.color,
1843
+ opacity: __props.opacity,
1844
+ style: normalizeStyle({
1845
+ pointerEvents: "none",
1846
+ stroke: __props.strokeColor ?? __props.color,
1847
+ strokeWidth: __props.strokeWidth,
1848
+ strokeLinejoin: "round"
1849
+ })
1850
+ }, null, 12, _hoisted_4$5)) : (openBlock(), createElementBlock("ellipse", {
1851
+ key: 1,
1852
+ cx: geometry.value.cx,
1853
+ cy: geometry.value.cy,
1854
+ rx: geometry.value.rx,
1855
+ ry: geometry.value.ry,
1856
+ fill: __props.color,
1857
+ opacity: __props.opacity,
1858
+ style: normalizeStyle({
1859
+ pointerEvents: "none",
1860
+ stroke: __props.strokeColor ?? __props.color,
1861
+ strokeWidth: __props.strokeWidth,
1862
+ ...__props.strokeStyle === unref(PdfAnnotationBorderStyle).DASHED && {
1863
+ strokeDasharray: (_a = __props.strokeDashArray) == null ? void 0 : _a.join(",")
1864
+ }
1865
+ })
1866
+ }, null, 12, _hoisted_5$4))
1867
+ ], 64)) : createCommentVNode("", true)
1763
1868
  ], 12, _hoisted_1$8);
1764
1869
  };
1765
1870
  }
@@ -1793,7 +1898,7 @@ const _hoisted_2$5 = ["x1", "y1", "x2", "y2", "stroke-width"];
1793
1898
  const _hoisted_3$5 = ["d", "transform", "stroke-width"];
1794
1899
  const _hoisted_4$4 = ["d", "transform", "stroke-width"];
1795
1900
  const _hoisted_5$3 = ["x1", "y1", "x2", "y2", "opacity"];
1796
- const _hoisted_6$1 = ["d", "transform", "stroke", "fill"];
1901
+ const _hoisted_6$2 = ["d", "transform", "stroke", "fill"];
1797
1902
  const _hoisted_7$1 = ["d", "transform", "stroke", "fill"];
1798
1903
  const __default__$a = { inheritAttrs: false };
1799
1904
  const _sfc_main$u = /* @__PURE__ */ defineComponent({
@@ -1934,7 +2039,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
1934
2039
  strokeDasharray: (_b = __props.strokeDashArray) == null ? void 0 : _b.join(",")
1935
2040
  }
1936
2041
  })
1937
- }, null, 12, _hoisted_6$1)) : createCommentVNode("", true),
2042
+ }, null, 12, _hoisted_6$2)) : createCommentVNode("", true),
1938
2043
  endings.value.end ? (openBlock(), createElementBlock("path", {
1939
2044
  key: 1,
1940
2045
  d: endings.value.end.d,
@@ -1984,7 +2089,7 @@ const _hoisted_2$4 = ["d", "stroke-width"];
1984
2089
  const _hoisted_3$4 = ["d", "transform", "stroke-width"];
1985
2090
  const _hoisted_4$3 = ["d", "transform", "stroke-width"];
1986
2091
  const _hoisted_5$2 = ["d", "opacity"];
1987
- const _hoisted_6 = ["d", "transform", "stroke", "fill"];
2092
+ const _hoisted_6$1 = ["d", "transform", "stroke", "fill"];
1988
2093
  const _hoisted_7 = ["d", "transform", "stroke", "fill"];
1989
2094
  const __default__$9 = { inheritAttrs: false };
1990
2095
  const _sfc_main$s = /* @__PURE__ */ defineComponent({
@@ -2139,7 +2244,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
2139
2244
  strokeDasharray: (_b = __props.strokeDashArray) == null ? void 0 : _b.join(",")
2140
2245
  }
2141
2246
  })
2142
- }, null, 12, _hoisted_6)) : createCommentVNode("", true),
2247
+ }, null, 12, _hoisted_6$1)) : createCommentVNode("", true),
2143
2248
  endings.value.end ? (openBlock(), createElementBlock("path", {
2144
2249
  key: 1,
2145
2250
  d: endings.value.end.d,
@@ -2187,8 +2292,9 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
2187
2292
  const _hoisted_1$5 = ["width", "height", "viewBox"];
2188
2293
  const _hoisted_2$3 = ["d", "stroke-width"];
2189
2294
  const _hoisted_3$3 = ["d", "opacity"];
2190
- const _hoisted_4$2 = ["d"];
2191
- const _hoisted_5$1 = ["x", "y", "width", "height", "fill", "stroke", "stroke-width"];
2295
+ const _hoisted_4$2 = ["d", "opacity"];
2296
+ const _hoisted_5$1 = ["d"];
2297
+ const _hoisted_6 = ["x", "y", "width", "height", "fill", "stroke", "stroke-width"];
2192
2298
  const __default__$8 = { inheritAttrs: false };
2193
2299
  const _sfc_main$q = /* @__PURE__ */ defineComponent({
2194
2300
  ...__default__$8,
@@ -2207,11 +2313,13 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
2207
2313
  onClick: {},
2208
2314
  currentVertex: {},
2209
2315
  handleSize: { default: 14 },
2210
- appearanceActive: { type: Boolean, default: false }
2316
+ appearanceActive: { type: Boolean, default: false },
2317
+ cloudyBorderIntensity: {}
2211
2318
  },
2212
2319
  setup(__props) {
2213
2320
  const MIN_HIT_AREA_SCREEN_PX = 20;
2214
2321
  const props = __props;
2322
+ const isCloudy = computed(() => (props.cloudyBorderIntensity ?? 0) > 0);
2215
2323
  const allPoints = computed(
2216
2324
  () => props.currentVertex ? [...props.vertices, props.currentVertex] : props.vertices
2217
2325
  );
@@ -2227,6 +2335,15 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
2227
2335
  const isPreview = !!props.currentVertex;
2228
2336
  return (`M ${first.x} ${first.y} ` + rest.map((p) => `L ${p.x} ${p.y}`).join(" ") + (isPreview ? "" : " Z")).trim();
2229
2337
  });
2338
+ const cloudyPath = computed(() => {
2339
+ if (!isCloudy.value || allPoints.value.length < 3) return null;
2340
+ return generateCloudyPolygonPath(
2341
+ allPoints.value,
2342
+ props.rect.origin,
2343
+ props.cloudyBorderIntensity,
2344
+ props.strokeWidth
2345
+ );
2346
+ });
2230
2347
  const isPreviewing = computed(() => props.currentVertex && props.vertices.length > 0);
2231
2348
  const width = computed(() => props.rect.size.width * props.scale);
2232
2349
  const height = computed(() => props.rect.size.height * props.scale);
@@ -2249,7 +2366,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
2249
2366
  viewBox: `0 0 ${__props.rect.size.width} ${__props.rect.size.height}`
2250
2367
  }, [
2251
2368
  createElementVNode("path", {
2252
- d: pathData.value,
2369
+ d: isCloudy.value && cloudyPath.value ? cloudyPath.value.path : pathData.value,
2253
2370
  fill: "transparent",
2254
2371
  stroke: "transparent",
2255
2372
  "stroke-width": hitStrokeWidth.value,
@@ -2263,45 +2380,58 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
2263
2380
  })
2264
2381
  }, null, 44, _hoisted_2$3),
2265
2382
  !__props.appearanceActive ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
2266
- createElementVNode("path", {
2267
- d: pathData.value,
2383
+ isCloudy.value && cloudyPath.value ? (openBlock(), createElementBlock("path", {
2384
+ key: 0,
2385
+ d: cloudyPath.value.path,
2268
2386
  opacity: __props.opacity,
2269
2387
  style: normalizeStyle({
2270
- fill: __props.currentVertex ? "none" : __props.color,
2388
+ fill: __props.color,
2271
2389
  stroke: __props.strokeColor ?? __props.color,
2272
2390
  strokeWidth: __props.strokeWidth,
2273
2391
  pointerEvents: "none",
2274
- strokeLinecap: "butt",
2275
- strokeLinejoin: "miter",
2276
- ...__props.strokeStyle === unref(PdfAnnotationBorderStyle).DASHED && {
2277
- strokeDasharray: (_a = __props.strokeDashArray) == null ? void 0 : _a.join(",")
2278
- }
2392
+ strokeLinejoin: "round"
2279
2393
  })
2280
- }, null, 12, _hoisted_3$3),
2281
- isPreviewing.value && localPts.value.length > 1 ? (openBlock(), createElementBlock("path", {
2282
- key: 0,
2283
- d: `M ${localPts.value[localPts.value.length - 1].x} ${localPts.value[localPts.value.length - 1].y} L ${localPts.value[0].x} ${localPts.value[0].y}`,
2284
- fill: "none",
2285
- style: normalizeStyle({
2394
+ }, null, 12, _hoisted_3$3)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
2395
+ createElementVNode("path", {
2396
+ d: pathData.value,
2397
+ opacity: __props.opacity,
2398
+ style: normalizeStyle({
2399
+ fill: __props.currentVertex ? "none" : __props.color,
2400
+ stroke: __props.strokeColor ?? __props.color,
2401
+ strokeWidth: __props.strokeWidth,
2402
+ pointerEvents: "none",
2403
+ strokeLinecap: "butt",
2404
+ strokeLinejoin: "miter",
2405
+ ...__props.strokeStyle === unref(PdfAnnotationBorderStyle).DASHED && {
2406
+ strokeDasharray: (_a = __props.strokeDashArray) == null ? void 0 : _a.join(",")
2407
+ }
2408
+ })
2409
+ }, null, 12, _hoisted_4$2),
2410
+ isPreviewing.value && localPts.value.length > 1 ? (openBlock(), createElementBlock("path", {
2411
+ key: 0,
2412
+ d: `M ${localPts.value[localPts.value.length - 1].x} ${localPts.value[localPts.value.length - 1].y} L ${localPts.value[0].x} ${localPts.value[0].y}`,
2413
+ fill: "none",
2414
+ style: normalizeStyle({
2415
+ stroke: __props.strokeColor,
2416
+ strokeWidth: __props.strokeWidth,
2417
+ strokeDasharray: "4,4",
2418
+ opacity: 0.7,
2419
+ pointerEvents: "none"
2420
+ })
2421
+ }, null, 12, _hoisted_5$1)) : createCommentVNode("", true),
2422
+ isPreviewing.value && localPts.value.length >= 2 ? (openBlock(), createElementBlock("rect", {
2423
+ key: 1,
2424
+ x: localPts.value[0].x - __props.handleSize / __props.scale / 2,
2425
+ y: localPts.value[0].y - __props.handleSize / __props.scale / 2,
2426
+ width: __props.handleSize / __props.scale,
2427
+ height: __props.handleSize / __props.scale,
2428
+ fill: __props.strokeColor,
2429
+ opacity: 0.4,
2286
2430
  stroke: __props.strokeColor,
2287
- strokeWidth: __props.strokeWidth,
2288
- strokeDasharray: "4,4",
2289
- opacity: 0.7,
2290
- pointerEvents: "none"
2291
- })
2292
- }, null, 12, _hoisted_4$2)) : createCommentVNode("", true),
2293
- isPreviewing.value && localPts.value.length >= 2 ? (openBlock(), createElementBlock("rect", {
2294
- key: 1,
2295
- x: localPts.value[0].x - __props.handleSize / __props.scale / 2,
2296
- y: localPts.value[0].y - __props.handleSize / __props.scale / 2,
2297
- width: __props.handleSize / __props.scale,
2298
- height: __props.handleSize / __props.scale,
2299
- fill: __props.strokeColor,
2300
- opacity: 0.4,
2301
- stroke: __props.strokeColor,
2302
- "stroke-width": __props.strokeWidth / 2,
2303
- style: { "pointer-events": "none" }
2304
- }, null, 8, _hoisted_5$1)) : createCommentVNode("", true)
2431
+ "stroke-width": __props.strokeWidth / 2,
2432
+ style: { "pointer-events": "none" }
2433
+ }, null, 8, _hoisted_6)) : createCommentVNode("", true)
2434
+ ], 64))
2305
2435
  ], 64)) : createCommentVNode("", true)
2306
2436
  ], 12, _hoisted_1$5);
2307
2437
  };
@@ -2699,7 +2829,10 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
2699
2829
  width: width.value,
2700
2830
  height: height.value,
2701
2831
  fill: "transparent",
2702
- onPointerdown: _cache[0] || (_cache[0] = ($event) => __props.hasIRT ? void 0 : __props.onClick),
2832
+ onPointerdown: _cache[0] || (_cache[0] = ($event) => {
2833
+ var _a;
2834
+ return __props.hasIRT ? void 0 : (_a = __props.onClick) == null ? void 0 : _a.call(__props, $event);
2835
+ }),
2703
2836
  style: normalizeStyle({
2704
2837
  cursor: hitAreaCursor.value,
2705
2838
  pointerEvents: hitAreaPointerEvents.value
@@ -3311,9 +3444,7 @@ const builtInRenderers = [
3311
3444
  component: _sfc_main$g,
3312
3445
  zIndex: 0,
3313
3446
  interactionDefaults: { isDraggable: false, isResizable: false, isRotatable: false },
3314
- containerStyle: (a) => ({
3315
- mixBlendMode: blendModeToCss(a.blendMode ?? PdfBlendMode.Multiply)
3316
- })
3447
+ defaultBlendMode: PdfBlendMode.Multiply
3317
3448
  }),
3318
3449
  createRenderer({
3319
3450
  id: "underline",
@@ -3663,11 +3794,10 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
3663
3794
  renderer.onDoubleClick(annotation.object.id, setEditingId);
3664
3795
  };
3665
3796
  };
3666
- const getContainerStyle = (annotation, renderer) => {
3667
- var _a;
3668
- return ((_a = renderer.containerStyle) == null ? void 0 : _a.call(renderer, annotation.object)) ?? {
3669
- mixBlendMode: blendModeToCss(annotation.object.blendMode ?? PdfBlendMode.Normal)
3670
- };
3797
+ const getBlendMode = (annotation, renderer) => {
3798
+ return blendModeToCss(
3799
+ annotation.object.blendMode ?? renderer.defaultBlendMode ?? PdfBlendMode.Normal
3800
+ );
3671
3801
  };
3672
3802
  const getAppearance = (annotation, renderer) => {
3673
3803
  var _a, _b;
@@ -3688,6 +3818,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
3688
3818
  return (_ctx, _cache) => {
3689
3819
  return openBlock(), createElementBlock(Fragment, null, [
3690
3820
  (openBlock(true), createElementBlock(Fragment, null, renderList(resolvedAnnotations.value, ({ annotation, renderer }) => {
3821
+ var _a;
3691
3822
  return openBlock(), createElementBlock(Fragment, {
3692
3823
  key: annotation.object.id
3693
3824
  }, [
@@ -3706,7 +3837,8 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
3706
3837
  onSelect: getOnSelect(annotation, renderer),
3707
3838
  onDoubleClick: getOnDoubleClick(renderer, annotation),
3708
3839
  zIndex: renderer.zIndex,
3709
- style: getContainerStyle(annotation, renderer),
3840
+ blendMode: getBlendMode(annotation, renderer),
3841
+ style: (_a = renderer.containerStyle) == null ? void 0 : _a.call(renderer, annotation.object),
3710
3842
  appearance: getAppearance(annotation, renderer)
3711
3843
  }, { ref_for: true }, containerProps.value), createSlots({
3712
3844
  default: withCtx(({ annotation: currentObject, appearanceActive }) => [
@@ -3740,7 +3872,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
3740
3872
  ]),
3741
3873
  key: "0"
3742
3874
  } : void 0
3743
- ]), 1040, ["trackedAnnotation", "isSelected", "isEditing", "isMultiSelected", "isDraggable", "isResizable", "lockAspectRatio", "isRotatable", "vertexConfig", "selectionMenu", "onSelect", "onDoubleClick", "zIndex", "style", "appearance"])) : createCommentVNode("", true)
3875
+ ]), 1040, ["trackedAnnotation", "isSelected", "isEditing", "isMultiSelected", "isDraggable", "isResizable", "lockAspectRatio", "isRotatable", "vertexConfig", "selectionMenu", "onSelect", "onDoubleClick", "zIndex", "blendMode", "style", "appearance"])) : createCommentVNode("", true)
3744
3876
  ], 64);
3745
3877
  }), 128)),
3746
3878
  allSelectedOnSamePage.value && selectedAnnotationsOnPage.value.length >= 2 ? (openBlock(), createBlock(_sfc_main$B, {
@@ -3863,15 +3995,21 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
3863
3995
  },
3864
3996
  setup(__props) {
3865
3997
  const props = __props;
3866
- const style = computed(() => ({
3867
- position: "absolute",
3868
- left: `${props.preview.bounds.origin.x * props.scale}px`,
3869
- top: `${props.preview.bounds.origin.y * props.scale}px`,
3870
- width: `${props.preview.bounds.size.width * props.scale}px`,
3871
- height: `${props.preview.bounds.size.height * props.scale}px`,
3872
- pointerEvents: "none",
3873
- zIndex: 10
3874
- }));
3998
+ const style = computed(() => {
3999
+ const base = {
4000
+ position: "absolute",
4001
+ left: `${props.preview.bounds.origin.x * props.scale}px`,
4002
+ top: `${props.preview.bounds.origin.y * props.scale}px`,
4003
+ width: `${props.preview.bounds.size.width * props.scale}px`,
4004
+ height: `${props.preview.bounds.size.height * props.scale}px`,
4005
+ pointerEvents: "none",
4006
+ zIndex: 10
4007
+ };
4008
+ if (props.preview.type === PdfAnnotationSubtype.INK) {
4009
+ base.mixBlendMode = blendModeToCss(props.preview.data.blendMode ?? PdfBlendMode.Normal);
4010
+ }
4011
+ return base;
4012
+ });
3875
4013
  return (_ctx, _cache) => {
3876
4014
  return openBlock(), createElementBlock("div", {
3877
4015
  style: normalizeStyle(style.value)