@embedpdf/plugin-annotation 2.13.0 → 2.14.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.
Files changed (53) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.js +522 -7
  4. package/dist/index.js.map +1 -1
  5. package/dist/lib/annotation-plugin.d.ts +25 -0
  6. package/dist/lib/handlers/callout-free-text.handler.d.ts +3 -0
  7. package/dist/lib/handlers/index.d.ts +1 -0
  8. package/dist/lib/handlers/types.d.ts +7 -1
  9. package/dist/lib/helpers.d.ts +8 -0
  10. package/dist/lib/patching/patch-utils.d.ts +38 -1
  11. package/dist/lib/patching/patches/callout-freetext.patch.d.ts +3 -0
  12. package/dist/lib/patching/patches/index.d.ts +1 -0
  13. package/dist/lib/tools/default-tools.d.ts +35 -0
  14. package/dist/lib/types.d.ts +21 -2
  15. package/dist/preact/index.cjs +1 -1
  16. package/dist/preact/index.cjs.map +1 -1
  17. package/dist/preact/index.js +422 -32
  18. package/dist/preact/index.js.map +1 -1
  19. package/dist/react/index.cjs +1 -1
  20. package/dist/react/index.cjs.map +1 -1
  21. package/dist/react/index.js +422 -32
  22. package/dist/react/index.js.map +1 -1
  23. package/dist/shared/components/annotation-container.d.ts +13 -1
  24. package/dist/shared/components/annotations/callout-free-text-preview.d.ts +15 -0
  25. package/dist/shared/components/annotations/callout-free-text.d.ts +15 -0
  26. package/dist/shared/components/types.d.ts +12 -0
  27. package/dist/shared-preact/components/annotation-container.d.ts +13 -1
  28. package/dist/shared-preact/components/annotations/callout-free-text-preview.d.ts +15 -0
  29. package/dist/shared-preact/components/annotations/callout-free-text.d.ts +15 -0
  30. package/dist/shared-preact/components/types.d.ts +12 -0
  31. package/dist/shared-react/components/annotation-container.d.ts +13 -1
  32. package/dist/shared-react/components/annotations/callout-free-text-preview.d.ts +15 -0
  33. package/dist/shared-react/components/annotations/callout-free-text.d.ts +15 -0
  34. package/dist/shared-react/components/types.d.ts +12 -0
  35. package/dist/svelte/components/annotations/CalloutFreeText.svelte.d.ts +15 -0
  36. package/dist/svelte/components/annotations/CalloutFreeTextPreview.svelte.d.ts +10 -0
  37. package/dist/svelte/components/renderers/CalloutFreeTextRenderer.svelte.d.ts +5 -0
  38. package/dist/svelte/components/types.d.ts +12 -0
  39. package/dist/svelte/index.cjs +1 -1
  40. package/dist/svelte/index.cjs.map +1 -1
  41. package/dist/svelte/index.js +528 -106
  42. package/dist/svelte/index.js.map +1 -1
  43. package/dist/svelte/types.d.ts +12 -0
  44. package/dist/vue/components/annotation-container.vue.d.ts +12 -0
  45. package/dist/vue/components/annotations/callout-free-text-preview.vue.d.ts +10 -0
  46. package/dist/vue/components/annotations/callout-free-text.vue.d.ts +25 -0
  47. package/dist/vue/components/renderers/callout-free-text-renderer.vue.d.ts +6 -0
  48. package/dist/vue/index.cjs +1 -1
  49. package/dist/vue/index.cjs.map +1 -1
  50. package/dist/vue/index.js +601 -211
  51. package/dist/vue/index.js.map +1 -1
  52. package/dist/vue/types.d.ts +12 -0
  53. package/package.json +12 -12
package/dist/vue/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { createPluginPackage } from "@embedpdf/core";
2
- import { AnnotationPlugin, initialDocumentState, inferRotationCenterFromRects, generateCloudyRectanglePath, generateCloudyEllipsePath, patching, generateCloudyPolygonPath, LockModeType, getAnnotationCategories, hasLockedFlag, isCategoryLocked, resolveInteractionProp, getAnnotationsByPageIndex, getSelectedAnnotationIds, AnnotationPluginPackage as AnnotationPluginPackage$1 } from "@embedpdf/plugin-annotation";
2
+ import { AnnotationPlugin, initialDocumentState, inferRotationCenterFromRects, generateCloudyRectanglePath, generateCloudyEllipsePath, patching, generateCloudyPolygonPath, LockModeType, hasNoViewFlag, hasHiddenFlag, resolveInteractionProp, getAnnotationsByPageIndex, getSelectedAnnotationIds, AnnotationPluginPackage as AnnotationPluginPackage$1 } from "@embedpdf/plugin-annotation";
3
3
  export * from "@embedpdf/plugin-annotation";
4
4
  import { defineComponent, ref, watchEffect, openBlock, createElementBlock, normalizeStyle, createCommentVNode, toValue, watch, computed, shallowRef, toRaw, useSlots, createElementVNode, renderSlot, createBlock, Fragment, unref, normalizeProps, mergeProps, renderList, withCtx, resolveDynamicComponent, Teleport, toDisplayString, markRaw, provide, inject, onUnmounted, nextTick, createVNode, createSlots, guardReactiveProps, onMounted } from "vue";
5
5
  import { getCounterRotation } from "@embedpdf/utils";
@@ -8,8 +8,8 @@ import { usePlugin, useCapability, useDocumentPermissions, useDocumentState } fr
8
8
  import { boundingRectOrEmpty, PdfAnnotationBorderStyle, PdfVerticalAlignment, textAlignmentToCss, standardFontCssProperties, ignore, PdfErrorCode, getContrastStrokeColor, PdfBlendMode, blendModeToCss, PdfAnnotationSubtype } from "@embedpdf/models";
9
9
  import { usePointerHandlers } from "@embedpdf/plugin-interaction-manager/vue";
10
10
  import { useSelectionCapability } from "@embedpdf/plugin-selection/vue";
11
- const _hoisted_1$f = ["src"];
12
- const _sfc_main$O = /* @__PURE__ */ defineComponent({
11
+ const _hoisted_1$h = ["src"];
12
+ const _sfc_main$R = /* @__PURE__ */ defineComponent({
13
13
  __name: "appearance-image",
14
14
  props: {
15
15
  appearance: {},
@@ -52,7 +52,7 @@ const _sfc_main$O = /* @__PURE__ */ defineComponent({
52
52
  userSelect: "none",
53
53
  ...__props.style
54
54
  })
55
- }, null, 44, _hoisted_1$f)) : createCommentVNode("", true);
55
+ }, null, 44, _hoisted_1$h)) : createCommentVNode("", true);
56
56
  };
57
57
  }
58
58
  });
@@ -119,13 +119,13 @@ function useIOSZoomPrevention(computedFontPx, active) {
119
119
  return { needsComp, adjustedFontPx, scaleComp, wrapperStyle };
120
120
  });
121
121
  }
122
- const _hoisted_1$e = ["width", "height", "stroke"];
123
- const _hoisted_2$a = ["width", "height", "stroke"];
124
- const __default__$f = {
122
+ const _hoisted_1$g = ["width", "height", "stroke"];
123
+ const _hoisted_2$c = ["width", "height", "stroke"];
124
+ const __default__$g = {
125
125
  inheritAttrs: false
126
126
  };
127
- const _sfc_main$N = /* @__PURE__ */ defineComponent({
128
- ...__default__$f,
127
+ const _sfc_main$Q = /* @__PURE__ */ defineComponent({
128
+ ...__default__$g,
129
129
  __name: "annotation-container",
130
130
  props: {
131
131
  scale: {},
@@ -144,6 +144,8 @@ const _sfc_main$N = /* @__PURE__ */ defineComponent({
144
144
  lockAspectRatio: { type: Boolean, default: false },
145
145
  vertexConfig: {},
146
146
  selectionMenu: {},
147
+ structurallyLocked: { type: Boolean, default: false },
148
+ contentLocked: { type: Boolean, default: false },
147
149
  outlineOffset: { default: 1 },
148
150
  onDoubleClick: {},
149
151
  onSelect: {},
@@ -317,7 +319,9 @@ const _sfc_main$N = /* @__PURE__ */ defineComponent({
317
319
  const menuContext = computed(() => ({
318
320
  type: "annotation",
319
321
  annotation: props.trackedAnnotation,
320
- pageIndex: props.pageIndex
322
+ pageIndex: props.pageIndex,
323
+ structurallyLocked: props.structurallyLocked,
324
+ contentLocked: props.contentLocked
321
325
  }));
322
326
  const menuPlacement = computed(() => {
323
327
  const effectiveAngle = ((annotationRotation.value + effectivePageRotation.value * 90) % 360 + 360) % 360;
@@ -689,7 +693,7 @@ const _sfc_main$N = /* @__PURE__ */ defineComponent({
689
693
  annotation: childObject.value,
690
694
  appearanceActive: apActive.value
691
695
  }),
692
- ((_a = __props.appearance) == null ? void 0 : _a.normal) ? (openBlock(), createBlock(_sfc_main$O, {
696
+ ((_a = __props.appearance) == null ? void 0 : _a.normal) ? (openBlock(), createBlock(_sfc_main$R, {
693
697
  key: 0,
694
698
  appearance: __props.appearance.normal,
695
699
  style: normalizeStyle({ display: apActive.value ? "block" : "none" })
@@ -738,7 +742,7 @@ const _sfc_main$N = /* @__PURE__ */ defineComponent({
738
742
  }, [..._cache[2] || (_cache[2] = [
739
743
  createElementVNode("path", { d: "M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8" }, null, -1),
740
744
  createElementVNode("path", { d: "M21 3v5h-5" }, null, -1)
741
- ])], 8, _hoisted_1$e))
745
+ ])], 8, _hoisted_1$g))
742
746
  ], 16)
743
747
  ]) : (openBlock(), createElementBlock("div", mergeProps({ key: 2 }, rotationHandleBindings.value, { style: rotationHandleStyle.value }), [
744
748
  (openBlock(), createElementBlock("svg", {
@@ -753,7 +757,7 @@ const _sfc_main$N = /* @__PURE__ */ defineComponent({
753
757
  }, [..._cache[3] || (_cache[3] = [
754
758
  createElementVNode("path", { d: "M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8" }, null, -1),
755
759
  createElementVNode("path", { d: "M21 3v5h-5" }, null, -1)
756
- ])], 8, _hoisted_2$a))
760
+ ])], 8, _hoisted_2$c))
757
761
  ], 16))
758
762
  ], 32)) : createCommentVNode("", true),
759
763
  createElementVNode("div", mergeProps({ ...effectiveIsDraggable.value && __props.isSelected ? unref(dragProps) : {}, ...unref(doubleProps) }, { style: innerRotatedStyle.value }), [
@@ -873,14 +877,14 @@ function getAnnotationScreenBounds(annotation, scale, rotation) {
873
877
  bottom: top + maxY
874
878
  };
875
879
  }
876
- const _hoisted_1$d = {
880
+ const _hoisted_1$f = {
877
881
  key: 0,
878
882
  "data-group-selection-box": "",
879
883
  "data-no-interaction": ""
880
884
  };
881
- const _hoisted_2$9 = ["width", "height", "stroke"];
882
- const _hoisted_3$9 = ["width", "height", "stroke"];
883
- const _sfc_main$M = /* @__PURE__ */ defineComponent({
885
+ const _hoisted_2$b = ["width", "height", "stroke"];
886
+ const _hoisted_3$b = ["width", "height", "stroke"];
887
+ const _sfc_main$P = /* @__PURE__ */ defineComponent({
884
888
  __name: "group-selection-box",
885
889
  props: {
886
890
  documentId: {},
@@ -1340,7 +1344,7 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
1340
1344
  currentRotation: computed(() => liveRotation.value ?? 0)
1341
1345
  });
1342
1346
  return (_ctx, _cache) => {
1343
- return __props.selectedAnnotations.length >= 2 ? (openBlock(), createElementBlock("div", _hoisted_1$d, [
1347
+ return __props.selectedAnnotations.length >= 2 ? (openBlock(), createElementBlock("div", _hoisted_1$f, [
1344
1348
  createElementVNode("div", {
1345
1349
  style: normalizeStyle(outerStyle.value)
1346
1350
  }, [
@@ -1383,7 +1387,7 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
1383
1387
  }, [..._cache[2] || (_cache[2] = [
1384
1388
  createElementVNode("path", { d: "M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8" }, null, -1),
1385
1389
  createElementVNode("path", { d: "M21 3v5h-5" }, null, -1)
1386
- ])], 8, _hoisted_2$9))
1390
+ ])], 8, _hoisted_2$b))
1387
1391
  ], 16)
1388
1392
  ]) : (openBlock(), createElementBlock("div", mergeProps({ key: 2 }, rotationHandleBindings.value, { style: rotationHandleStyle.value }), [
1389
1393
  (openBlock(), createElementBlock("svg", {
@@ -1398,7 +1402,7 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
1398
1402
  }, [..._cache[3] || (_cache[3] = [
1399
1403
  createElementVNode("path", { d: "M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8" }, null, -1),
1400
1404
  createElementVNode("path", { d: "M21 3v5h-5" }, null, -1)
1401
- ])], 8, _hoisted_3$9))
1405
+ ])], 8, _hoisted_3$b))
1402
1406
  ], 16))
1403
1407
  ], 32)) : createCommentVNode("", true),
1404
1408
  createElementVNode("div", mergeProps(
@@ -1507,9 +1511,9 @@ function createRenderer(entry) {
1507
1511
  renderLocked: entry.renderLocked ? markRaw(entry.renderLocked) : void 0
1508
1512
  };
1509
1513
  }
1510
- const __default__$e = { inheritAttrs: false };
1511
- const _sfc_main$L = /* @__PURE__ */ defineComponent({
1512
- ...__default__$e,
1514
+ const __default__$f = { inheritAttrs: false };
1515
+ const _sfc_main$O = /* @__PURE__ */ defineComponent({
1516
+ ...__default__$f,
1513
1517
  __name: "link-locked",
1514
1518
  props: {
1515
1519
  annotation: {},
@@ -1543,7 +1547,7 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
1543
1547
  };
1544
1548
  }
1545
1549
  });
1546
- const _sfc_main$K = /* @__PURE__ */ defineComponent({
1550
+ const _sfc_main$N = /* @__PURE__ */ defineComponent({
1547
1551
  __name: "link-preview",
1548
1552
  props: {
1549
1553
  data: {},
@@ -1569,12 +1573,12 @@ const _sfc_main$K = /* @__PURE__ */ defineComponent({
1569
1573
  };
1570
1574
  }
1571
1575
  });
1572
- const _hoisted_1$c = ["width", "height", "viewBox"];
1573
- const _hoisted_2$8 = ["d", "stroke-width"];
1574
- const _hoisted_3$8 = ["d", "opacity"];
1575
- const __default__$d = { inheritAttrs: false };
1576
- const _sfc_main$J = /* @__PURE__ */ defineComponent({
1577
- ...__default__$d,
1576
+ const _hoisted_1$e = ["width", "height", "viewBox"];
1577
+ const _hoisted_2$a = ["d", "stroke-width"];
1578
+ const _hoisted_3$a = ["d", "opacity"];
1579
+ const __default__$e = { inheritAttrs: false };
1580
+ const _sfc_main$M = /* @__PURE__ */ defineComponent({
1581
+ ...__default__$e,
1578
1582
  __name: "ink",
1579
1583
  props: {
1580
1584
  isSelected: { type: Boolean },
@@ -1636,7 +1640,7 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
1636
1640
  strokeLinecap: "round",
1637
1641
  strokeLinejoin: "round"
1638
1642
  })
1639
- }, null, 44, _hoisted_2$8);
1643
+ }, null, 44, _hoisted_2$a);
1640
1644
  }), 128)),
1641
1645
  !__props.appearanceActive ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(paths.value, (d, i) => {
1642
1646
  return openBlock(), createElementBlock("path", {
@@ -1651,13 +1655,13 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
1651
1655
  strokeLinecap: "round",
1652
1656
  strokeLinejoin: "round"
1653
1657
  })
1654
- }, null, 12, _hoisted_3$8);
1658
+ }, null, 12, _hoisted_3$a);
1655
1659
  }), 128)) : createCommentVNode("", true)
1656
- ], 12, _hoisted_1$c);
1660
+ ], 12, _hoisted_1$e);
1657
1661
  };
1658
1662
  }
1659
1663
  });
1660
- const _sfc_main$I = /* @__PURE__ */ defineComponent({
1664
+ const _sfc_main$L = /* @__PURE__ */ defineComponent({
1661
1665
  __name: "ink-preview",
1662
1666
  props: {
1663
1667
  data: {},
@@ -1666,21 +1670,21 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
1666
1670
  },
1667
1671
  setup(__props) {
1668
1672
  return (_ctx, _cache) => {
1669
- return openBlock(), createBlock(_sfc_main$J, mergeProps({
1673
+ return openBlock(), createBlock(_sfc_main$M, mergeProps({
1670
1674
  isSelected: false,
1671
1675
  scale: __props.scale
1672
1676
  }, __props.data), null, 16, ["scale"]);
1673
1677
  };
1674
1678
  }
1675
1679
  });
1676
- const _hoisted_1$b = ["width", "height", "viewBox"];
1677
- const _hoisted_2$7 = ["d", "stroke-width"];
1678
- const _hoisted_3$7 = ["x", "y", "width", "height", "stroke-width"];
1679
- const _hoisted_4$6 = ["d", "fill", "opacity"];
1680
- const _hoisted_5$5 = ["x", "y", "width", "height", "fill", "opacity"];
1681
- const __default__$c = { inheritAttrs: false };
1682
- const _sfc_main$H = /* @__PURE__ */ defineComponent({
1683
- ...__default__$c,
1680
+ const _hoisted_1$d = ["width", "height", "viewBox"];
1681
+ const _hoisted_2$9 = ["d", "stroke-width"];
1682
+ const _hoisted_3$9 = ["x", "y", "width", "height", "stroke-width"];
1683
+ const _hoisted_4$8 = ["d", "fill", "opacity"];
1684
+ const _hoisted_5$6 = ["x", "y", "width", "height", "fill", "opacity"];
1685
+ const __default__$d = { inheritAttrs: false };
1686
+ const _sfc_main$K = /* @__PURE__ */ defineComponent({
1687
+ ...__default__$d,
1684
1688
  __name: "square",
1685
1689
  props: {
1686
1690
  isSelected: { type: Boolean },
@@ -1754,7 +1758,7 @@ const _sfc_main$H = /* @__PURE__ */ defineComponent({
1754
1758
  cursor: __props.isSelected ? "move" : __props.onClick ? "pointer" : "default",
1755
1759
  pointerEvents: !__props.onClick ? "none" : __props.isSelected ? "none" : __props.color === "transparent" ? "visibleStroke" : "visible"
1756
1760
  })
1757
- }, null, 44, _hoisted_2$7)) : (openBlock(), createElementBlock("rect", {
1761
+ }, null, 44, _hoisted_2$9)) : (openBlock(), createElementBlock("rect", {
1758
1762
  key: 1,
1759
1763
  x: geometry.value.x,
1760
1764
  y: geometry.value.y,
@@ -1769,7 +1773,7 @@ const _sfc_main$H = /* @__PURE__ */ defineComponent({
1769
1773
  cursor: __props.isSelected ? "move" : __props.onClick ? "pointer" : "default",
1770
1774
  pointerEvents: !__props.onClick ? "none" : __props.isSelected ? "none" : __props.color === "transparent" ? "visibleStroke" : "visible"
1771
1775
  })
1772
- }, null, 44, _hoisted_3$7)),
1776
+ }, null, 44, _hoisted_3$9)),
1773
1777
  !__props.appearanceActive ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
1774
1778
  isCloudy.value && cloudyPath.value ? (openBlock(), createElementBlock("path", {
1775
1779
  key: 0,
@@ -1782,7 +1786,7 @@ const _sfc_main$H = /* @__PURE__ */ defineComponent({
1782
1786
  strokeWidth: __props.strokeWidth,
1783
1787
  strokeLinejoin: "round"
1784
1788
  })
1785
- }, null, 12, _hoisted_4$6)) : (openBlock(), createElementBlock("rect", {
1789
+ }, null, 12, _hoisted_4$8)) : (openBlock(), createElementBlock("rect", {
1786
1790
  key: 1,
1787
1791
  x: geometry.value.x,
1788
1792
  y: geometry.value.y,
@@ -1798,13 +1802,13 @@ const _sfc_main$H = /* @__PURE__ */ defineComponent({
1798
1802
  strokeDasharray: (_a = __props.strokeDashArray) == null ? void 0 : _a.join(",")
1799
1803
  }
1800
1804
  })
1801
- }, null, 12, _hoisted_5$5))
1805
+ }, null, 12, _hoisted_5$6))
1802
1806
  ], 64)) : createCommentVNode("", true)
1803
- ], 12, _hoisted_1$b);
1807
+ ], 12, _hoisted_1$d);
1804
1808
  };
1805
1809
  }
1806
1810
  });
1807
- const _sfc_main$G = /* @__PURE__ */ defineComponent({
1811
+ const _sfc_main$J = /* @__PURE__ */ defineComponent({
1808
1812
  __name: "square-preview",
1809
1813
  props: {
1810
1814
  data: {},
@@ -1813,21 +1817,21 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
1813
1817
  },
1814
1818
  setup(__props) {
1815
1819
  return (_ctx, _cache) => {
1816
- return openBlock(), createBlock(_sfc_main$H, mergeProps({
1820
+ return openBlock(), createBlock(_sfc_main$K, mergeProps({
1817
1821
  isSelected: false,
1818
1822
  scale: __props.scale
1819
1823
  }, __props.data), null, 16, ["scale"]);
1820
1824
  };
1821
1825
  }
1822
1826
  });
1823
- const _hoisted_1$a = ["width", "height", "viewBox"];
1824
- const _hoisted_2$6 = ["d", "stroke-width"];
1825
- const _hoisted_3$6 = ["cx", "cy", "rx", "ry", "stroke-width"];
1826
- const _hoisted_4$5 = ["d", "fill", "opacity"];
1827
- const _hoisted_5$4 = ["cx", "cy", "rx", "ry", "fill", "opacity"];
1828
- const __default__$b = { inheritAttrs: false };
1829
- const _sfc_main$F = /* @__PURE__ */ defineComponent({
1830
- ...__default__$b,
1827
+ const _hoisted_1$c = ["width", "height", "viewBox"];
1828
+ const _hoisted_2$8 = ["d", "stroke-width"];
1829
+ const _hoisted_3$8 = ["cx", "cy", "rx", "ry", "stroke-width"];
1830
+ const _hoisted_4$7 = ["d", "fill", "opacity"];
1831
+ const _hoisted_5$5 = ["cx", "cy", "rx", "ry", "fill", "opacity"];
1832
+ const __default__$c = { inheritAttrs: false };
1833
+ const _sfc_main$I = /* @__PURE__ */ defineComponent({
1834
+ ...__default__$c,
1831
1835
  __name: "circle",
1832
1836
  props: {
1833
1837
  isSelected: { type: Boolean },
@@ -1903,7 +1907,7 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
1903
1907
  cursor: __props.isSelected ? "move" : __props.onClick ? "pointer" : "default",
1904
1908
  pointerEvents: !__props.onClick ? "none" : __props.isSelected ? "none" : __props.color === "transparent" ? "visibleStroke" : "visible"
1905
1909
  })
1906
- }, null, 44, _hoisted_2$6)) : (openBlock(), createElementBlock("ellipse", {
1910
+ }, null, 44, _hoisted_2$8)) : (openBlock(), createElementBlock("ellipse", {
1907
1911
  key: 1,
1908
1912
  cx: geometry.value.cx,
1909
1913
  cy: geometry.value.cy,
@@ -1918,7 +1922,7 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
1918
1922
  cursor: __props.isSelected ? "move" : __props.onClick ? "pointer" : "default",
1919
1923
  pointerEvents: !__props.onClick ? "none" : __props.isSelected ? "none" : __props.color === "transparent" ? "visibleStroke" : "visible"
1920
1924
  })
1921
- }, null, 44, _hoisted_3$6)),
1925
+ }, null, 44, _hoisted_3$8)),
1922
1926
  !__props.appearanceActive ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
1923
1927
  isCloudy.value && cloudyPath.value ? (openBlock(), createElementBlock("path", {
1924
1928
  key: 0,
@@ -1931,7 +1935,7 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
1931
1935
  strokeWidth: __props.strokeWidth,
1932
1936
  strokeLinejoin: "round"
1933
1937
  })
1934
- }, null, 12, _hoisted_4$5)) : (openBlock(), createElementBlock("ellipse", {
1938
+ }, null, 12, _hoisted_4$7)) : (openBlock(), createElementBlock("ellipse", {
1935
1939
  key: 1,
1936
1940
  cx: geometry.value.cx,
1937
1941
  cy: geometry.value.cy,
@@ -1947,13 +1951,13 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
1947
1951
  strokeDasharray: (_a = __props.strokeDashArray) == null ? void 0 : _a.join(",")
1948
1952
  }
1949
1953
  })
1950
- }, null, 12, _hoisted_5$4))
1954
+ }, null, 12, _hoisted_5$5))
1951
1955
  ], 64)) : createCommentVNode("", true)
1952
- ], 12, _hoisted_1$a);
1956
+ ], 12, _hoisted_1$c);
1953
1957
  };
1954
1958
  }
1955
1959
  });
1956
- const _sfc_main$E = /* @__PURE__ */ defineComponent({
1960
+ const _sfc_main$H = /* @__PURE__ */ defineComponent({
1957
1961
  __name: "circle-preview",
1958
1962
  props: {
1959
1963
  data: {},
@@ -1962,23 +1966,23 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
1962
1966
  },
1963
1967
  setup(__props) {
1964
1968
  return (_ctx, _cache) => {
1965
- return openBlock(), createBlock(_sfc_main$F, mergeProps({
1969
+ return openBlock(), createBlock(_sfc_main$I, mergeProps({
1966
1970
  isSelected: false,
1967
1971
  scale: __props.scale
1968
1972
  }, __props.data), null, 16, ["scale"]);
1969
1973
  };
1970
1974
  }
1971
1975
  });
1972
- const _hoisted_1$9 = ["width", "height", "viewBox"];
1973
- const _hoisted_2$5 = ["x1", "y1", "x2", "y2", "stroke-width"];
1974
- const _hoisted_3$5 = ["d", "transform", "stroke-width"];
1975
- const _hoisted_4$4 = ["d", "transform", "stroke-width"];
1976
- const _hoisted_5$3 = ["x1", "y1", "x2", "y2", "opacity"];
1977
- const _hoisted_6$2 = ["d", "transform", "stroke", "fill"];
1978
- const _hoisted_7$1 = ["d", "transform", "stroke", "fill"];
1979
- const __default__$a = { inheritAttrs: false };
1980
- const _sfc_main$D = /* @__PURE__ */ defineComponent({
1981
- ...__default__$a,
1976
+ const _hoisted_1$b = ["width", "height", "viewBox"];
1977
+ const _hoisted_2$7 = ["x1", "y1", "x2", "y2", "stroke-width"];
1978
+ const _hoisted_3$7 = ["d", "transform", "stroke-width"];
1979
+ const _hoisted_4$6 = ["d", "transform", "stroke-width"];
1980
+ const _hoisted_5$4 = ["x1", "y1", "x2", "y2", "opacity"];
1981
+ const _hoisted_6$3 = ["d", "transform", "stroke", "fill"];
1982
+ const _hoisted_7$2 = ["d", "transform", "stroke", "fill"];
1983
+ const __default__$b = { inheritAttrs: false };
1984
+ const _sfc_main$G = /* @__PURE__ */ defineComponent({
1985
+ ...__default__$b,
1982
1986
  __name: "line",
1983
1987
  props: {
1984
1988
  color: { default: "transparent" },
@@ -2053,7 +2057,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
2053
2057
  pointerEvents: !__props.onClick ? "none" : __props.isSelected ? "none" : "visibleStroke",
2054
2058
  strokeLinecap: "butt"
2055
2059
  })
2056
- }, null, 44, _hoisted_2$5),
2060
+ }, null, 44, _hoisted_2$7),
2057
2061
  endings.value.start ? (openBlock(), createElementBlock("path", {
2058
2062
  key: 0,
2059
2063
  d: endings.value.start.d,
@@ -2068,7 +2072,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
2068
2072
  pointerEvents: !__props.onClick ? "none" : __props.isSelected ? "none" : endings.value.start.filled ? "visible" : "visibleStroke",
2069
2073
  strokeLinecap: "butt"
2070
2074
  })
2071
- }, null, 44, _hoisted_3$5)) : createCommentVNode("", true),
2075
+ }, null, 44, _hoisted_3$7)) : createCommentVNode("", true),
2072
2076
  endings.value.end ? (openBlock(), createElementBlock("path", {
2073
2077
  key: 1,
2074
2078
  d: endings.value.end.d,
@@ -2083,7 +2087,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
2083
2087
  pointerEvents: !__props.onClick ? "none" : __props.isSelected ? "none" : endings.value.end.filled ? "visible" : "visibleStroke",
2084
2088
  strokeLinecap: "butt"
2085
2089
  })
2086
- }, null, 44, _hoisted_4$4)) : createCommentVNode("", true),
2090
+ }, null, 44, _hoisted_4$6)) : createCommentVNode("", true),
2087
2091
  !__props.appearanceActive ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
2088
2092
  createElementVNode("line", {
2089
2093
  x1: localLine.value.x1,
@@ -2100,7 +2104,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
2100
2104
  strokeDasharray: (_a = __props.strokeDashArray) == null ? void 0 : _a.join(",")
2101
2105
  }
2102
2106
  })
2103
- }, null, 12, _hoisted_5$3),
2107
+ }, null, 12, _hoisted_5$4),
2104
2108
  endings.value.start ? (openBlock(), createElementBlock("path", {
2105
2109
  key: 0,
2106
2110
  d: endings.value.start.d,
@@ -2115,7 +2119,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
2115
2119
  strokeDasharray: (_b = __props.strokeDashArray) == null ? void 0 : _b.join(",")
2116
2120
  }
2117
2121
  })
2118
- }, null, 12, _hoisted_6$2)) : createCommentVNode("", true),
2122
+ }, null, 12, _hoisted_6$3)) : createCommentVNode("", true),
2119
2123
  endings.value.end ? (openBlock(), createElementBlock("path", {
2120
2124
  key: 1,
2121
2125
  d: endings.value.end.d,
@@ -2130,13 +2134,13 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
2130
2134
  strokeDasharray: (_c = __props.strokeDashArray) == null ? void 0 : _c.join(",")
2131
2135
  }
2132
2136
  })
2133
- }, null, 12, _hoisted_7$1)) : createCommentVNode("", true)
2137
+ }, null, 12, _hoisted_7$2)) : createCommentVNode("", true)
2134
2138
  ], 64)) : createCommentVNode("", true)
2135
- ], 12, _hoisted_1$9);
2139
+ ], 12, _hoisted_1$b);
2136
2140
  };
2137
2141
  }
2138
2142
  });
2139
- const _sfc_main$C = /* @__PURE__ */ defineComponent({
2143
+ const _sfc_main$F = /* @__PURE__ */ defineComponent({
2140
2144
  __name: "line-preview",
2141
2145
  props: {
2142
2146
  data: {},
@@ -2145,23 +2149,23 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
2145
2149
  },
2146
2150
  setup(__props) {
2147
2151
  return (_ctx, _cache) => {
2148
- return openBlock(), createBlock(_sfc_main$D, mergeProps({
2152
+ return openBlock(), createBlock(_sfc_main$G, mergeProps({
2149
2153
  isSelected: false,
2150
2154
  scale: __props.scale
2151
2155
  }, __props.data), null, 16, ["scale"]);
2152
2156
  };
2153
2157
  }
2154
2158
  });
2155
- const _hoisted_1$8 = ["width", "height", "viewBox"];
2156
- const _hoisted_2$4 = ["d", "stroke-width"];
2157
- const _hoisted_3$4 = ["d", "transform", "stroke-width"];
2158
- const _hoisted_4$3 = ["d", "transform", "stroke-width"];
2159
- const _hoisted_5$2 = ["d", "opacity"];
2160
- const _hoisted_6$1 = ["d", "transform", "stroke", "fill"];
2161
- const _hoisted_7 = ["d", "transform", "stroke", "fill"];
2162
- const __default__$9 = { inheritAttrs: false };
2163
- const _sfc_main$B = /* @__PURE__ */ defineComponent({
2164
- ...__default__$9,
2159
+ const _hoisted_1$a = ["width", "height", "viewBox"];
2160
+ const _hoisted_2$6 = ["d", "stroke-width"];
2161
+ const _hoisted_3$6 = ["d", "transform", "stroke-width"];
2162
+ const _hoisted_4$5 = ["d", "transform", "stroke-width"];
2163
+ const _hoisted_5$3 = ["d", "opacity"];
2164
+ const _hoisted_6$2 = ["d", "transform", "stroke", "fill"];
2165
+ const _hoisted_7$1 = ["d", "transform", "stroke", "fill"];
2166
+ const __default__$a = { inheritAttrs: false };
2167
+ const _sfc_main$E = /* @__PURE__ */ defineComponent({
2168
+ ...__default__$a,
2165
2169
  __name: "polyline",
2166
2170
  props: {
2167
2171
  rect: {},
@@ -2251,7 +2255,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
2251
2255
  strokeLinecap: "butt",
2252
2256
  strokeLinejoin: "miter"
2253
2257
  })
2254
- }, null, 44, _hoisted_2$4),
2258
+ }, null, 44, _hoisted_2$6),
2255
2259
  endings.value.start ? (openBlock(), createElementBlock("path", {
2256
2260
  key: 0,
2257
2261
  d: endings.value.start.d,
@@ -2266,7 +2270,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
2266
2270
  pointerEvents: !__props.onClick ? "none" : __props.isSelected ? "none" : endings.value.start.filled ? "visible" : "visibleStroke",
2267
2271
  strokeLinecap: "butt"
2268
2272
  })
2269
- }, null, 44, _hoisted_3$4)) : createCommentVNode("", true),
2273
+ }, null, 44, _hoisted_3$6)) : createCommentVNode("", true),
2270
2274
  endings.value.end ? (openBlock(), createElementBlock("path", {
2271
2275
  key: 1,
2272
2276
  d: endings.value.end.d,
@@ -2281,7 +2285,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
2281
2285
  pointerEvents: !__props.onClick ? "none" : __props.isSelected ? "none" : endings.value.end.filled ? "visible" : "visibleStroke",
2282
2286
  strokeLinecap: "butt"
2283
2287
  })
2284
- }, null, 44, _hoisted_4$3)) : createCommentVNode("", true),
2288
+ }, null, 44, _hoisted_4$5)) : createCommentVNode("", true),
2285
2289
  !__props.appearanceActive ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
2286
2290
  createElementVNode("path", {
2287
2291
  d: pathData.value,
@@ -2297,7 +2301,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
2297
2301
  strokeDasharray: (_a = __props.strokeDashArray) == null ? void 0 : _a.join(",")
2298
2302
  }
2299
2303
  })
2300
- }, null, 12, _hoisted_5$2),
2304
+ }, null, 12, _hoisted_5$3),
2301
2305
  endings.value.start ? (openBlock(), createElementBlock("path", {
2302
2306
  key: 0,
2303
2307
  d: endings.value.start.d,
@@ -2312,7 +2316,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
2312
2316
  strokeDasharray: (_b = __props.strokeDashArray) == null ? void 0 : _b.join(",")
2313
2317
  }
2314
2318
  })
2315
- }, null, 12, _hoisted_6$1)) : createCommentVNode("", true),
2319
+ }, null, 12, _hoisted_6$2)) : createCommentVNode("", true),
2316
2320
  endings.value.end ? (openBlock(), createElementBlock("path", {
2317
2321
  key: 1,
2318
2322
  d: endings.value.end.d,
@@ -2327,13 +2331,13 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
2327
2331
  strokeDasharray: (_c = __props.strokeDashArray) == null ? void 0 : _c.join(",")
2328
2332
  }
2329
2333
  })
2330
- }, null, 12, _hoisted_7)) : createCommentVNode("", true)
2334
+ }, null, 12, _hoisted_7$1)) : createCommentVNode("", true)
2331
2335
  ], 64)) : createCommentVNode("", true)
2332
- ], 12, _hoisted_1$8);
2336
+ ], 12, _hoisted_1$a);
2333
2337
  };
2334
2338
  }
2335
2339
  });
2336
- const _sfc_main$A = /* @__PURE__ */ defineComponent({
2340
+ const _sfc_main$D = /* @__PURE__ */ defineComponent({
2337
2341
  __name: "polyline-preview",
2338
2342
  props: {
2339
2343
  data: {},
@@ -2342,22 +2346,22 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
2342
2346
  },
2343
2347
  setup(__props) {
2344
2348
  return (_ctx, _cache) => {
2345
- return openBlock(), createBlock(_sfc_main$B, mergeProps({
2349
+ return openBlock(), createBlock(_sfc_main$E, mergeProps({
2346
2350
  isSelected: false,
2347
2351
  scale: __props.scale
2348
2352
  }, __props.data), null, 16, ["scale"]);
2349
2353
  };
2350
2354
  }
2351
2355
  });
2352
- const _hoisted_1$7 = ["width", "height", "viewBox"];
2353
- const _hoisted_2$3 = ["d", "stroke-width"];
2354
- const _hoisted_3$3 = ["d", "opacity"];
2355
- const _hoisted_4$2 = ["d", "opacity"];
2356
- const _hoisted_5$1 = ["d"];
2357
- const _hoisted_6 = ["x", "y", "width", "height", "fill", "stroke", "stroke-width"];
2358
- const __default__$8 = { inheritAttrs: false };
2359
- const _sfc_main$z = /* @__PURE__ */ defineComponent({
2360
- ...__default__$8,
2356
+ const _hoisted_1$9 = ["width", "height", "viewBox"];
2357
+ const _hoisted_2$5 = ["d", "stroke-width"];
2358
+ const _hoisted_3$5 = ["d", "opacity"];
2359
+ const _hoisted_4$4 = ["d", "opacity"];
2360
+ const _hoisted_5$2 = ["d"];
2361
+ const _hoisted_6$1 = ["x", "y", "width", "height", "fill", "stroke", "stroke-width"];
2362
+ const __default__$9 = { inheritAttrs: false };
2363
+ const _sfc_main$C = /* @__PURE__ */ defineComponent({
2364
+ ...__default__$9,
2361
2365
  __name: "polygon",
2362
2366
  props: {
2363
2367
  rect: {},
@@ -2438,7 +2442,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
2438
2442
  strokeLinecap: "butt",
2439
2443
  strokeLinejoin: "miter"
2440
2444
  })
2441
- }, null, 44, _hoisted_2$3),
2445
+ }, null, 44, _hoisted_2$5),
2442
2446
  !__props.appearanceActive ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
2443
2447
  isCloudy.value && cloudyPath.value ? (openBlock(), createElementBlock("path", {
2444
2448
  key: 0,
@@ -2451,7 +2455,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
2451
2455
  pointerEvents: "none",
2452
2456
  strokeLinejoin: "round"
2453
2457
  })
2454
- }, null, 12, _hoisted_3$3)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
2458
+ }, null, 12, _hoisted_3$5)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
2455
2459
  createElementVNode("path", {
2456
2460
  d: pathData.value,
2457
2461
  opacity: __props.opacity,
@@ -2466,7 +2470,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
2466
2470
  strokeDasharray: (_a = __props.strokeDashArray) == null ? void 0 : _a.join(",")
2467
2471
  }
2468
2472
  })
2469
- }, null, 12, _hoisted_4$2),
2473
+ }, null, 12, _hoisted_4$4),
2470
2474
  isPreviewing.value && localPts.value.length > 1 ? (openBlock(), createElementBlock("path", {
2471
2475
  key: 0,
2472
2476
  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}`,
@@ -2478,7 +2482,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
2478
2482
  opacity: 0.7,
2479
2483
  pointerEvents: "none"
2480
2484
  })
2481
- }, null, 12, _hoisted_5$1)) : createCommentVNode("", true),
2485
+ }, null, 12, _hoisted_5$2)) : createCommentVNode("", true),
2482
2486
  isPreviewing.value && localPts.value.length >= 2 ? (openBlock(), createElementBlock("rect", {
2483
2487
  key: 1,
2484
2488
  x: localPts.value[0].x - __props.handleSize / __props.scale / 2,
@@ -2490,14 +2494,14 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
2490
2494
  stroke: __props.strokeColor,
2491
2495
  "stroke-width": __props.strokeWidth / 2,
2492
2496
  style: { "pointer-events": "none" }
2493
- }, null, 8, _hoisted_6)) : createCommentVNode("", true)
2497
+ }, null, 8, _hoisted_6$1)) : createCommentVNode("", true)
2494
2498
  ], 64))
2495
2499
  ], 64)) : createCommentVNode("", true)
2496
- ], 12, _hoisted_1$7);
2500
+ ], 12, _hoisted_1$9);
2497
2501
  };
2498
2502
  }
2499
2503
  });
2500
- const _sfc_main$y = /* @__PURE__ */ defineComponent({
2504
+ const _sfc_main$B = /* @__PURE__ */ defineComponent({
2501
2505
  __name: "polygon-preview",
2502
2506
  props: {
2503
2507
  data: {},
@@ -2506,14 +2510,14 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
2506
2510
  },
2507
2511
  setup(__props) {
2508
2512
  return (_ctx, _cache) => {
2509
- return openBlock(), createBlock(_sfc_main$z, mergeProps({
2513
+ return openBlock(), createBlock(_sfc_main$C, mergeProps({
2510
2514
  isSelected: false,
2511
2515
  scale: __props.scale
2512
2516
  }, __props.data), null, 16, ["scale"]);
2513
2517
  };
2514
2518
  }
2515
2519
  });
2516
- const _sfc_main$x = /* @__PURE__ */ defineComponent({
2520
+ const _sfc_main$A = /* @__PURE__ */ defineComponent({
2517
2521
  __name: "free-text-preview",
2518
2522
  props: {
2519
2523
  data: {},
@@ -2535,8 +2539,87 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
2535
2539
  };
2536
2540
  }
2537
2541
  });
2538
- const _hoisted_1$6 = ["src"];
2539
- const _sfc_main$w = /* @__PURE__ */ defineComponent({
2542
+ const _hoisted_1$8 = ["width", "height", "viewBox"];
2543
+ const _hoisted_2$4 = ["points", "stroke", "stroke-width", "opacity"];
2544
+ const _hoisted_3$4 = ["d", "transform", "stroke", "fill", "stroke-width", "opacity"];
2545
+ const _hoisted_4$3 = ["x", "y", "width", "height", "fill", "stroke", "stroke-width", "opacity"];
2546
+ const _sfc_main$z = /* @__PURE__ */ defineComponent({
2547
+ __name: "callout-free-text-preview",
2548
+ props: {
2549
+ data: {},
2550
+ bounds: {},
2551
+ scale: {}
2552
+ },
2553
+ setup(__props) {
2554
+ const props = __props;
2555
+ const cl = computed(() => props.data.calloutLine);
2556
+ const sw = computed(() => props.data.strokeWidth ?? 1);
2557
+ const sc = computed(() => props.data.strokeColor ?? "#000000");
2558
+ const op = computed(() => props.data.opacity ?? 1);
2559
+ const w = computed(() => props.bounds.size.width);
2560
+ const h = computed(() => props.bounds.size.height);
2561
+ const ox = computed(() => props.bounds.origin.x);
2562
+ const oy = computed(() => props.bounds.origin.y);
2563
+ const lineCoords = computed(() => {
2564
+ const line = cl.value;
2565
+ if (!line || line.length < 2) return null;
2566
+ return line.map((p) => ({ x: p.x - ox.value, y: p.y - oy.value }));
2567
+ });
2568
+ const ending = computed(() => {
2569
+ const lc = lineCoords.value;
2570
+ if (!lc || lc.length < 2) return null;
2571
+ const angle = Math.atan2(lc[1].y - lc[0].y, lc[1].x - lc[0].x);
2572
+ return patching.createEnding(props.data.lineEnding, sw.value, angle + Math.PI, lc[0].x, lc[0].y);
2573
+ });
2574
+ const halfSw = computed(() => sw.value / 2);
2575
+ const tb = computed(() => props.data.textBox);
2576
+ return (_ctx, _cache) => {
2577
+ return lineCoords.value ? (openBlock(), createElementBlock("svg", {
2578
+ key: 0,
2579
+ style: normalizeStyle({
2580
+ position: "absolute",
2581
+ width: `${w.value * __props.scale}px`,
2582
+ height: `${h.value * __props.scale}px`,
2583
+ pointerEvents: "none",
2584
+ overflow: "visible"
2585
+ }),
2586
+ width: w.value * __props.scale,
2587
+ height: h.value * __props.scale,
2588
+ viewBox: `0 0 ${w.value} ${h.value}`
2589
+ }, [
2590
+ createElementVNode("polyline", {
2591
+ points: lineCoords.value.map((p) => `${p.x},${p.y}`).join(" "),
2592
+ fill: "none",
2593
+ stroke: sc.value,
2594
+ "stroke-width": sw.value,
2595
+ opacity: op.value
2596
+ }, null, 8, _hoisted_2$4),
2597
+ ending.value ? (openBlock(), createElementBlock("path", {
2598
+ key: 0,
2599
+ d: ending.value.d,
2600
+ transform: ending.value.transform,
2601
+ stroke: sc.value,
2602
+ fill: ending.value.filled ? __props.data.color ?? "transparent" : "none",
2603
+ "stroke-width": sw.value,
2604
+ opacity: op.value
2605
+ }, null, 8, _hoisted_3$4)) : createCommentVNode("", true),
2606
+ tb.value ? (openBlock(), createElementBlock("rect", {
2607
+ key: 1,
2608
+ x: tb.value.origin.x - ox.value + halfSw.value,
2609
+ y: tb.value.origin.y - oy.value + halfSw.value,
2610
+ width: tb.value.size.width - sw.value,
2611
+ height: tb.value.size.height - sw.value,
2612
+ fill: __props.data.color ?? __props.data.backgroundColor ?? "transparent",
2613
+ stroke: sc.value,
2614
+ "stroke-width": sw.value,
2615
+ opacity: op.value
2616
+ }, null, 8, _hoisted_4$3)) : createCommentVNode("", true)
2617
+ ], 12, _hoisted_1$8)) : createCommentVNode("", true);
2618
+ };
2619
+ }
2620
+ });
2621
+ const _hoisted_1$7 = ["src"];
2622
+ const _sfc_main$y = /* @__PURE__ */ defineComponent({
2540
2623
  __name: "stamp-preview",
2541
2624
  props: {
2542
2625
  data: {},
@@ -2559,11 +2642,11 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
2559
2642
  src: __props.data.ghostUrl,
2560
2643
  style: normalizeStyle(style.value),
2561
2644
  alt: ""
2562
- }, null, 12, _hoisted_1$6);
2645
+ }, null, 12, _hoisted_1$7);
2563
2646
  };
2564
2647
  }
2565
2648
  });
2566
- const _sfc_main$v = /* @__PURE__ */ defineComponent({
2649
+ const _sfc_main$x = /* @__PURE__ */ defineComponent({
2567
2650
  __name: "ink-renderer",
2568
2651
  props: {
2569
2652
  annotation: {},
@@ -2578,7 +2661,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
2578
2661
  },
2579
2662
  setup(__props) {
2580
2663
  return (_ctx, _cache) => {
2581
- return openBlock(), createBlock(_sfc_main$J, mergeProps(__props.currentObject, {
2664
+ return openBlock(), createBlock(_sfc_main$M, mergeProps(__props.currentObject, {
2582
2665
  isSelected: __props.isSelected,
2583
2666
  scale: __props.scale,
2584
2667
  onClick: __props.onClick,
@@ -2587,7 +2670,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
2587
2670
  };
2588
2671
  }
2589
2672
  });
2590
- const _sfc_main$u = /* @__PURE__ */ defineComponent({
2673
+ const _sfc_main$w = /* @__PURE__ */ defineComponent({
2591
2674
  __name: "square-renderer",
2592
2675
  props: {
2593
2676
  annotation: {},
@@ -2602,7 +2685,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
2602
2685
  },
2603
2686
  setup(__props) {
2604
2687
  return (_ctx, _cache) => {
2605
- return openBlock(), createBlock(_sfc_main$H, mergeProps(__props.currentObject, {
2688
+ return openBlock(), createBlock(_sfc_main$K, mergeProps(__props.currentObject, {
2606
2689
  isSelected: __props.isSelected,
2607
2690
  scale: __props.scale,
2608
2691
  onClick: __props.onClick,
@@ -2611,7 +2694,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
2611
2694
  };
2612
2695
  }
2613
2696
  });
2614
- const _sfc_main$t = /* @__PURE__ */ defineComponent({
2697
+ const _sfc_main$v = /* @__PURE__ */ defineComponent({
2615
2698
  __name: "circle-renderer",
2616
2699
  props: {
2617
2700
  annotation: {},
@@ -2626,7 +2709,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
2626
2709
  },
2627
2710
  setup(__props) {
2628
2711
  return (_ctx, _cache) => {
2629
- return openBlock(), createBlock(_sfc_main$F, mergeProps(__props.currentObject, {
2712
+ return openBlock(), createBlock(_sfc_main$I, mergeProps(__props.currentObject, {
2630
2713
  isSelected: __props.isSelected,
2631
2714
  scale: __props.scale,
2632
2715
  onClick: __props.onClick,
@@ -2635,7 +2718,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
2635
2718
  };
2636
2719
  }
2637
2720
  });
2638
- const _sfc_main$s = /* @__PURE__ */ defineComponent({
2721
+ const _sfc_main$u = /* @__PURE__ */ defineComponent({
2639
2722
  __name: "line-renderer",
2640
2723
  props: {
2641
2724
  annotation: {},
@@ -2650,7 +2733,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
2650
2733
  },
2651
2734
  setup(__props) {
2652
2735
  return (_ctx, _cache) => {
2653
- return openBlock(), createBlock(_sfc_main$D, mergeProps(__props.currentObject, {
2736
+ return openBlock(), createBlock(_sfc_main$G, mergeProps(__props.currentObject, {
2654
2737
  isSelected: __props.isSelected,
2655
2738
  scale: __props.scale,
2656
2739
  onClick: __props.onClick,
@@ -2659,7 +2742,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
2659
2742
  };
2660
2743
  }
2661
2744
  });
2662
- const _sfc_main$r = /* @__PURE__ */ defineComponent({
2745
+ const _sfc_main$t = /* @__PURE__ */ defineComponent({
2663
2746
  __name: "polyline-renderer",
2664
2747
  props: {
2665
2748
  annotation: {},
@@ -2674,7 +2757,7 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
2674
2757
  },
2675
2758
  setup(__props) {
2676
2759
  return (_ctx, _cache) => {
2677
- return openBlock(), createBlock(_sfc_main$B, mergeProps(__props.currentObject, {
2760
+ return openBlock(), createBlock(_sfc_main$E, mergeProps(__props.currentObject, {
2678
2761
  isSelected: __props.isSelected,
2679
2762
  scale: __props.scale,
2680
2763
  onClick: __props.onClick,
@@ -2683,7 +2766,7 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
2683
2766
  };
2684
2767
  }
2685
2768
  });
2686
- const _sfc_main$q = /* @__PURE__ */ defineComponent({
2769
+ const _sfc_main$s = /* @__PURE__ */ defineComponent({
2687
2770
  __name: "polygon-renderer",
2688
2771
  props: {
2689
2772
  annotation: {},
@@ -2698,7 +2781,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
2698
2781
  },
2699
2782
  setup(__props) {
2700
2783
  return (_ctx, _cache) => {
2701
- return openBlock(), createBlock(_sfc_main$z, mergeProps(__props.currentObject, {
2784
+ return openBlock(), createBlock(_sfc_main$C, mergeProps(__props.currentObject, {
2702
2785
  isSelected: __props.isSelected,
2703
2786
  scale: __props.scale,
2704
2787
  onClick: __props.onClick,
@@ -2707,10 +2790,10 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
2707
2790
  };
2708
2791
  }
2709
2792
  });
2710
- const _hoisted_1$5 = ["contenteditable"];
2711
- const __default__$7 = { inheritAttrs: false };
2712
- const _sfc_main$p = /* @__PURE__ */ defineComponent({
2713
- ...__default__$7,
2793
+ const _hoisted_1$6 = ["contenteditable"];
2794
+ const __default__$8 = { inheritAttrs: false };
2795
+ const _sfc_main$r = /* @__PURE__ */ defineComponent({
2796
+ ...__default__$8,
2714
2797
  __name: "free-text",
2715
2798
  props: {
2716
2799
  documentId: {},
@@ -2815,12 +2898,12 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
2815
2898
  tabindex: "0",
2816
2899
  style: normalizeStyle(editorStyle.value),
2817
2900
  contenteditable: __props.isEditing
2818
- }, toDisplayString(__props.annotation.object.contents), 45, _hoisted_1$5)
2901
+ }, toDisplayString(__props.annotation.object.contents), 45, _hoisted_1$6)
2819
2902
  ], 36);
2820
2903
  };
2821
2904
  }
2822
2905
  });
2823
- const _sfc_main$o = /* @__PURE__ */ defineComponent({
2906
+ const _sfc_main$q = /* @__PURE__ */ defineComponent({
2824
2907
  __name: "free-text-renderer",
2825
2908
  props: {
2826
2909
  annotation: {},
@@ -2833,6 +2916,290 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
2833
2916
  onClick: { type: Function },
2834
2917
  appearanceActive: { type: Boolean }
2835
2918
  },
2919
+ setup(__props) {
2920
+ return (_ctx, _cache) => {
2921
+ return openBlock(), createBlock(_sfc_main$r, {
2922
+ documentId: __props.documentId,
2923
+ isSelected: __props.isSelected,
2924
+ isEditing: __props.isEditing,
2925
+ annotation: { ...__props.annotation, object: __props.currentObject },
2926
+ pageIndex: __props.pageIndex,
2927
+ scale: __props.scale,
2928
+ onClick: __props.onClick,
2929
+ appearanceActive: __props.appearanceActive
2930
+ }, null, 8, ["documentId", "isSelected", "isEditing", "annotation", "pageIndex", "scale", "onClick", "appearanceActive"]);
2931
+ };
2932
+ }
2933
+ });
2934
+ const _hoisted_1$5 = ["width", "height", "viewBox"];
2935
+ const _hoisted_2$3 = ["points", "stroke-width"];
2936
+ const _hoisted_3$3 = ["d", "transform", "stroke-width"];
2937
+ const _hoisted_4$2 = ["points", "stroke", "stroke-width", "opacity"];
2938
+ const _hoisted_5$1 = ["d", "transform", "stroke", "fill", "stroke-width", "opacity"];
2939
+ const _hoisted_6 = ["x", "y", "width", "height", "fill", "stroke", "stroke-width", "opacity"];
2940
+ const _hoisted_7 = ["contenteditable"];
2941
+ const __default__$7 = { inheritAttrs: false };
2942
+ const _sfc_main$p = /* @__PURE__ */ defineComponent({
2943
+ ...__default__$7,
2944
+ __name: "callout-free-text",
2945
+ props: {
2946
+ documentId: {},
2947
+ isSelected: { type: Boolean },
2948
+ isEditing: { type: Boolean },
2949
+ annotation: {},
2950
+ pageIndex: {},
2951
+ scale: {},
2952
+ onClick: {},
2953
+ appearanceActive: { type: Boolean, default: false }
2954
+ },
2955
+ setup(__props) {
2956
+ const props = __props;
2957
+ const obj = computed(() => props.annotation.object);
2958
+ const strokeWidth = computed(() => obj.value.strokeWidth ?? 1);
2959
+ const strokeColor = computed(() => obj.value.strokeColor ?? "#000000");
2960
+ const editorRef = ref(null);
2961
+ const editingRef = ref(false);
2962
+ const { provides: annotationCapability } = useAnnotationCapability();
2963
+ const annotationProvides = computed(
2964
+ () => {
2965
+ var _a;
2966
+ return ((_a = annotationCapability.value) == null ? void 0 : _a.forDocument(props.documentId)) ?? null;
2967
+ }
2968
+ );
2969
+ const textBox = computed(
2970
+ () => patching.computeTextBoxFromRD(obj.value.rect, obj.value.rectangleDifferences)
2971
+ );
2972
+ const textBoxRelative = computed(() => ({
2973
+ left: (textBox.value.origin.x - obj.value.rect.origin.x + strokeWidth.value / 2) * props.scale,
2974
+ top: (textBox.value.origin.y - obj.value.rect.origin.y + strokeWidth.value / 2) * props.scale,
2975
+ width: (textBox.value.size.width - strokeWidth.value) * props.scale,
2976
+ height: (textBox.value.size.height - strokeWidth.value) * props.scale
2977
+ }));
2978
+ const lineCoords = computed(() => {
2979
+ const cl = obj.value.calloutLine;
2980
+ if (!cl || cl.length < 3) return null;
2981
+ return cl.map((p) => ({
2982
+ x: p.x - obj.value.rect.origin.x,
2983
+ y: p.y - obj.value.rect.origin.y
2984
+ }));
2985
+ });
2986
+ const ending = computed(() => {
2987
+ const lc = lineCoords.value;
2988
+ if (!lc || lc.length < 2) return null;
2989
+ const angle = Math.atan2(lc[1].y - lc[0].y, lc[1].x - lc[0].x);
2990
+ return patching.createEnding(
2991
+ obj.value.lineEnding,
2992
+ strokeWidth.value,
2993
+ angle + Math.PI,
2994
+ lc[0].x,
2995
+ lc[0].y
2996
+ );
2997
+ });
2998
+ const visualLineCoords = computed(() => {
2999
+ const lc = lineCoords.value;
3000
+ if (!lc || lc.length < 2) return lc;
3001
+ const pts = lc.map((p) => ({ ...p }));
3002
+ const last = pts.length - 1;
3003
+ const prev = last - 1;
3004
+ const dx = pts[last].x - pts[prev].x;
3005
+ const dy = pts[last].y - pts[prev].y;
3006
+ const len = Math.sqrt(dx * dx + dy * dy);
3007
+ if (len > 0) {
3008
+ const halfBw = strokeWidth.value / 2;
3009
+ pts[last].x += dx / len * halfBw;
3010
+ pts[last].y += dy / len * halfBw;
3011
+ }
3012
+ return pts;
3013
+ });
3014
+ const ios = useIOSZoomPrevention(
3015
+ () => obj.value.fontSize * props.scale,
3016
+ () => props.isEditing
3017
+ );
3018
+ const width = computed(() => obj.value.rect.size.width * props.scale);
3019
+ const height = computed(() => obj.value.rect.size.height * props.scale);
3020
+ const hitStrokeWidth = computed(() => Math.max(strokeWidth.value, 20 / props.scale));
3021
+ watch(
3022
+ () => props.isEditing,
3023
+ async (editing) => {
3024
+ var _a, _b;
3025
+ if (!editing) return;
3026
+ await nextTick();
3027
+ if (!editorRef.value) return;
3028
+ editingRef.value = true;
3029
+ const editor = editorRef.value;
3030
+ editor.focus();
3031
+ const tool = (_a = annotationProvides.value) == null ? void 0 : _a.findToolForAnnotation(obj.value);
3032
+ const isDefaultContent = ((_b = tool == null ? void 0 : tool.defaults) == null ? void 0 : _b.contents) != null && obj.value.contents === tool.defaults.contents;
3033
+ const selection = window.getSelection();
3034
+ if (selection) {
3035
+ const range = document.createRange();
3036
+ range.selectNodeContents(editor);
3037
+ if (!isDefaultContent) {
3038
+ range.collapse(false);
3039
+ }
3040
+ selection.removeAllRanges();
3041
+ selection.addRange(range);
3042
+ }
3043
+ },
3044
+ { immediate: true }
3045
+ );
3046
+ const handleBlur = () => {
3047
+ if (!editingRef.value) return;
3048
+ editingRef.value = false;
3049
+ if (!annotationProvides.value || !editorRef.value) return;
3050
+ annotationProvides.value.updateAnnotation(props.pageIndex, obj.value.id, {
3051
+ contents: editorRef.value.innerText.replace(/\u00A0/g, " ")
3052
+ });
3053
+ };
3054
+ const editorStyle = computed(() => {
3055
+ const { adjustedFontPx } = ios.value;
3056
+ const tbr = textBoxRelative.value;
3057
+ return {
3058
+ position: "absolute",
3059
+ left: `${tbr.left}px`,
3060
+ top: `${tbr.top}px`,
3061
+ width: `${tbr.width}px`,
3062
+ height: `${tbr.height}px`,
3063
+ color: obj.value.fontColor,
3064
+ fontSize: `${adjustedFontPx}px`,
3065
+ ...standardFontCssProperties(obj.value.fontFamily),
3066
+ textAlign: textAlignmentToCss(obj.value.textAlign),
3067
+ flexDirection: "column",
3068
+ justifyContent: obj.value.verticalAlign === PdfVerticalAlignment.Top ? "flex-start" : obj.value.verticalAlign === PdfVerticalAlignment.Middle ? "center" : "flex-end",
3069
+ display: "flex",
3070
+ padding: `${strokeWidth.value * props.scale / 2 + 2 * props.scale}px`,
3071
+ opacity: obj.value.opacity,
3072
+ lineHeight: "1.18",
3073
+ overflow: "hidden",
3074
+ cursor: props.isEditing ? "text" : "default",
3075
+ outline: "none",
3076
+ pointerEvents: props.isEditing ? "auto" : "none"
3077
+ };
3078
+ });
3079
+ return (_ctx, _cache) => {
3080
+ return openBlock(), createElementBlock("div", {
3081
+ style: normalizeStyle({
3082
+ position: "absolute",
3083
+ width: `${width.value}px`,
3084
+ height: `${height.value}px`,
3085
+ cursor: __props.isSelected && !__props.isEditing ? "move" : "default",
3086
+ pointerEvents: "none",
3087
+ zIndex: 2,
3088
+ opacity: __props.appearanceActive ? 0 : 1
3089
+ })
3090
+ }, [
3091
+ (openBlock(), createElementBlock("svg", {
3092
+ style: normalizeStyle({
3093
+ position: "absolute",
3094
+ width: `${width.value}px`,
3095
+ height: `${height.value}px`,
3096
+ pointerEvents: "none",
3097
+ overflow: "visible"
3098
+ }),
3099
+ width: width.value,
3100
+ height: height.value,
3101
+ viewBox: `0 0 ${obj.value.rect.size.width} ${obj.value.rect.size.height}`
3102
+ }, [
3103
+ lineCoords.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
3104
+ createElementVNode("polyline", {
3105
+ points: lineCoords.value.map((p) => `${p.x},${p.y}`).join(" "),
3106
+ fill: "none",
3107
+ stroke: "transparent",
3108
+ "stroke-width": hitStrokeWidth.value,
3109
+ onPointerdown: _cache[0] || (_cache[0] = //@ts-ignore
3110
+ (...args) => __props.onClick && __props.onClick(...args)),
3111
+ style: normalizeStyle({
3112
+ cursor: __props.isSelected ? "move" : __props.onClick ? "pointer" : "default",
3113
+ pointerEvents: !__props.onClick ? "none" : __props.isSelected ? "none" : "visibleStroke"
3114
+ })
3115
+ }, null, 44, _hoisted_2$3),
3116
+ ending.value ? (openBlock(), createElementBlock("path", {
3117
+ key: 0,
3118
+ d: ending.value.d,
3119
+ transform: ending.value.transform,
3120
+ fill: "transparent",
3121
+ stroke: "transparent",
3122
+ "stroke-width": hitStrokeWidth.value,
3123
+ onPointerdown: _cache[1] || (_cache[1] = //@ts-ignore
3124
+ (...args) => __props.onClick && __props.onClick(...args)),
3125
+ style: normalizeStyle({
3126
+ cursor: __props.isSelected ? "move" : __props.onClick ? "pointer" : "default",
3127
+ pointerEvents: !__props.onClick ? "none" : __props.isSelected ? "none" : ending.value.filled ? "visible" : "visibleStroke"
3128
+ })
3129
+ }, null, 44, _hoisted_3$3)) : createCommentVNode("", true)
3130
+ ], 64)) : createCommentVNode("", true),
3131
+ !__props.appearanceActive ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
3132
+ visualLineCoords.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
3133
+ createElementVNode("polyline", {
3134
+ points: visualLineCoords.value.map((p) => `${p.x},${p.y}`).join(" "),
3135
+ fill: "none",
3136
+ stroke: strokeColor.value,
3137
+ "stroke-width": strokeWidth.value,
3138
+ opacity: obj.value.opacity,
3139
+ style: { "pointer-events": "none" }
3140
+ }, null, 8, _hoisted_4$2),
3141
+ ending.value ? (openBlock(), createElementBlock("path", {
3142
+ key: 0,
3143
+ d: ending.value.d,
3144
+ transform: ending.value.transform,
3145
+ stroke: strokeColor.value,
3146
+ fill: ending.value.filled ? obj.value.color ?? "transparent" : "none",
3147
+ "stroke-width": strokeWidth.value,
3148
+ opacity: obj.value.opacity,
3149
+ style: { "pointer-events": "none" }
3150
+ }, null, 8, _hoisted_5$1)) : createCommentVNode("", true)
3151
+ ], 64)) : createCommentVNode("", true),
3152
+ createElementVNode("rect", {
3153
+ x: textBox.value.origin.x - obj.value.rect.origin.x + strokeWidth.value / 2,
3154
+ y: textBox.value.origin.y - obj.value.rect.origin.y + strokeWidth.value / 2,
3155
+ width: textBox.value.size.width - strokeWidth.value,
3156
+ height: textBox.value.size.height - strokeWidth.value,
3157
+ fill: obj.value.color ?? obj.value.backgroundColor ?? "transparent",
3158
+ stroke: strokeColor.value,
3159
+ "stroke-width": strokeWidth.value,
3160
+ opacity: obj.value.opacity,
3161
+ style: { "pointer-events": "none" }
3162
+ }, null, 8, _hoisted_6)
3163
+ ], 64)) : createCommentVNode("", true)
3164
+ ], 12, _hoisted_1$5)),
3165
+ createElementVNode("div", {
3166
+ onPointerdown: _cache[2] || (_cache[2] = //@ts-ignore
3167
+ (...args) => __props.onClick && __props.onClick(...args)),
3168
+ style: normalizeStyle({
3169
+ position: "absolute",
3170
+ left: `${(textBox.value.origin.x - obj.value.rect.origin.x) * __props.scale}px`,
3171
+ top: `${(textBox.value.origin.y - obj.value.rect.origin.y) * __props.scale}px`,
3172
+ width: `${textBox.value.size.width * __props.scale}px`,
3173
+ height: `${textBox.value.size.height * __props.scale}px`,
3174
+ cursor: __props.isSelected && !__props.isEditing ? "move" : __props.onClick ? "pointer" : "default",
3175
+ pointerEvents: !__props.onClick ? "none" : __props.isSelected && !__props.isEditing ? "none" : "auto"
3176
+ })
3177
+ }, null, 36),
3178
+ createElementVNode("span", {
3179
+ ref_key: "editorRef",
3180
+ ref: editorRef,
3181
+ onBlur: handleBlur,
3182
+ tabindex: "0",
3183
+ style: normalizeStyle(editorStyle.value),
3184
+ contenteditable: __props.isEditing
3185
+ }, toDisplayString(obj.value.contents), 45, _hoisted_7)
3186
+ ], 4);
3187
+ };
3188
+ }
3189
+ });
3190
+ const _sfc_main$o = /* @__PURE__ */ defineComponent({
3191
+ __name: "callout-free-text-renderer",
3192
+ props: {
3193
+ annotation: {},
3194
+ currentObject: {},
3195
+ isSelected: { type: Boolean },
3196
+ isEditing: { type: Boolean },
3197
+ scale: {},
3198
+ pageIndex: {},
3199
+ documentId: {},
3200
+ onClick: { type: Function },
3201
+ appearanceActive: { type: Boolean }
3202
+ },
2836
3203
  setup(__props) {
2837
3204
  return (_ctx, _cache) => {
2838
3205
  return openBlock(), createBlock(_sfc_main$p, {
@@ -3635,8 +4002,8 @@ const builtInRenderers = [
3635
4002
  id: "ink",
3636
4003
  matches: (a) => a.type === PdfAnnotationSubtype.INK,
3637
4004
  matchesPreview: (p) => p.type === PdfAnnotationSubtype.INK,
3638
- component: _sfc_main$v,
3639
- renderPreview: _sfc_main$I,
4005
+ component: _sfc_main$x,
4006
+ renderPreview: _sfc_main$L,
3640
4007
  previewContainerStyle: ({ data }) => ({
3641
4008
  mixBlendMode: blendModeToCss(data.blendMode ?? PdfBlendMode.Normal)
3642
4009
  }),
@@ -3646,24 +4013,24 @@ const builtInRenderers = [
3646
4013
  id: "square",
3647
4014
  matches: (a) => a.type === PdfAnnotationSubtype.SQUARE,
3648
4015
  matchesPreview: (p) => p.type === PdfAnnotationSubtype.SQUARE,
3649
- component: _sfc_main$u,
3650
- renderPreview: _sfc_main$G,
4016
+ component: _sfc_main$w,
4017
+ renderPreview: _sfc_main$J,
3651
4018
  interactionDefaults: { isDraggable: true, isResizable: true, isRotatable: true }
3652
4019
  }),
3653
4020
  createRenderer({
3654
4021
  id: "circle",
3655
4022
  matches: (a) => a.type === PdfAnnotationSubtype.CIRCLE,
3656
4023
  matchesPreview: (p) => p.type === PdfAnnotationSubtype.CIRCLE,
3657
- component: _sfc_main$t,
3658
- renderPreview: _sfc_main$E,
4024
+ component: _sfc_main$v,
4025
+ renderPreview: _sfc_main$H,
3659
4026
  interactionDefaults: { isDraggable: true, isResizable: true, isRotatable: true }
3660
4027
  }),
3661
4028
  createRenderer({
3662
4029
  id: "line",
3663
4030
  matches: (a) => a.type === PdfAnnotationSubtype.LINE,
3664
4031
  matchesPreview: (p) => p.type === PdfAnnotationSubtype.LINE,
3665
- component: _sfc_main$s,
3666
- renderPreview: _sfc_main$C,
4032
+ component: _sfc_main$u,
4033
+ renderPreview: _sfc_main$F,
3667
4034
  vertexConfig: {
3668
4035
  extractVertices: (a) => [a.linePoints.start, a.linePoints.end],
3669
4036
  transformAnnotation: (a, v) => ({
@@ -3677,8 +4044,8 @@ const builtInRenderers = [
3677
4044
  id: "polyline",
3678
4045
  matches: (a) => a.type === PdfAnnotationSubtype.POLYLINE,
3679
4046
  matchesPreview: (p) => p.type === PdfAnnotationSubtype.POLYLINE,
3680
- component: _sfc_main$r,
3681
- renderPreview: _sfc_main$A,
4047
+ component: _sfc_main$t,
4048
+ renderPreview: _sfc_main$D,
3682
4049
  vertexConfig: {
3683
4050
  extractVertices: (a) => a.vertices,
3684
4051
  transformAnnotation: (a, vertices) => ({ ...a, vertices })
@@ -3689,8 +4056,8 @@ const builtInRenderers = [
3689
4056
  id: "polygon",
3690
4057
  matches: (a) => a.type === PdfAnnotationSubtype.POLYGON,
3691
4058
  matchesPreview: (p) => p.type === PdfAnnotationSubtype.POLYGON,
3692
- component: _sfc_main$q,
3693
- renderPreview: _sfc_main$y,
4059
+ component: _sfc_main$s,
4060
+ renderPreview: _sfc_main$B,
3694
4061
  vertexConfig: {
3695
4062
  extractVertices: (a) => a.vertices,
3696
4063
  transformAnnotation: (a, vertices) => ({ ...a, vertices })
@@ -3739,11 +4106,22 @@ const builtInRenderers = [
3739
4106
  interactionDefaults: { isDraggable: false, isResizable: false, isRotatable: false }
3740
4107
  }),
3741
4108
  createRenderer({
3742
- id: "freeText",
3743
- matches: (a) => a.type === PdfAnnotationSubtype.FREETEXT,
3744
- matchesPreview: (p) => p.type === PdfAnnotationSubtype.FREETEXT,
4109
+ id: "freeTextCallout",
4110
+ matches: (a) => a.type === PdfAnnotationSubtype.FREETEXT && a.intent === "FreeTextCallout",
4111
+ matchesPreview: (p) => p.type === PdfAnnotationSubtype.FREETEXT && !!p.data.calloutLine,
3745
4112
  component: _sfc_main$o,
3746
- renderPreview: _sfc_main$x,
4113
+ renderPreview: _sfc_main$z,
4114
+ vertexConfig: patching.calloutVertexConfig,
4115
+ interactionDefaults: { isDraggable: true, isResizable: false, isRotatable: false },
4116
+ isDraggable: (toolDraggable, { isEditing }) => toolDraggable && !isEditing,
4117
+ onDoubleClick: (id, setEditingId) => setEditingId(id)
4118
+ }),
4119
+ createRenderer({
4120
+ id: "freeText",
4121
+ matches: (a) => a.type === PdfAnnotationSubtype.FREETEXT && a.intent !== "FreeTextCallout",
4122
+ matchesPreview: (p) => p.type === PdfAnnotationSubtype.FREETEXT && !p.data.calloutLine,
4123
+ component: _sfc_main$q,
4124
+ renderPreview: _sfc_main$A,
3747
4125
  interactionDefaults: { isDraggable: true, isResizable: true, isRotatable: true },
3748
4126
  isDraggable: (toolDraggable, { isEditing }) => toolDraggable && !isEditing,
3749
4127
  onDoubleClick: (id, setEditingId) => setEditingId(id)
@@ -3753,7 +4131,7 @@ const builtInRenderers = [
3753
4131
  matches: (a) => a.type === PdfAnnotationSubtype.STAMP,
3754
4132
  matchesPreview: (p) => p.type === PdfAnnotationSubtype.STAMP,
3755
4133
  component: _sfc_main$l,
3756
- renderPreview: _sfc_main$w,
4134
+ renderPreview: _sfc_main$y,
3757
4135
  useAppearanceStream: false,
3758
4136
  interactionDefaults: { isDraggable: true, isResizable: true, isRotatable: true }
3759
4137
  }),
@@ -3762,7 +4140,7 @@ const builtInRenderers = [
3762
4140
  matches: (a) => a.type === PdfAnnotationSubtype.LINK,
3763
4141
  matchesPreview: (p) => p.type === PdfAnnotationSubtype.LINK,
3764
4142
  component: _sfc_main$j,
3765
- renderPreview: _sfc_main$K,
4143
+ renderPreview: _sfc_main$N,
3766
4144
  interactionDefaults: { isDraggable: true, isResizable: true, isRotatable: false },
3767
4145
  useAppearanceStream: false,
3768
4146
  selectOverride: (e, annotation, helpers) => {
@@ -3780,7 +4158,7 @@ const builtInRenderers = [
3780
4158
  helpers.selectAnnotation(helpers.pageIndex, annotation.object.id);
3781
4159
  },
3782
4160
  hideSelectionMenu: (a) => !!a.inReplyToId,
3783
- renderLocked: _sfc_main$L
4161
+ renderLocked: _sfc_main$O
3784
4162
  })
3785
4163
  ];
3786
4164
  const _sfc_main$6 = /* @__PURE__ */ defineComponent({
@@ -3890,21 +4268,25 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
3890
4268
  },
3891
4269
  { immediate: true }
3892
4270
  );
3893
- const resolvedAnnotations = computed(
3894
- () => annotations.value.map((annotation) => {
4271
+ const resolvedAnnotations = computed(() => {
4272
+ void lockedMode.value;
4273
+ return annotations.value.map((annotation) => {
3895
4274
  var _a;
3896
4275
  const renderer = resolveRenderer(annotation);
3897
4276
  if (!renderer) return null;
4277
+ if (hasNoViewFlag(annotation.object)) return null;
4278
+ if (hasHiddenFlag(annotation.object)) return null;
3898
4279
  const tool = ((_a = annotationProvides.value) == null ? void 0 : _a.findToolForAnnotation(annotation.object)) ?? null;
3899
- const categories = getAnnotationCategories(tool);
3900
- const locked = hasLockedFlag(annotation.object) || isCategoryLocked(categories, lockedMode.value);
3901
- if (locked && renderer.hiddenWhenLocked) return null;
3902
- return { annotation, renderer, tool, locked };
3903
- }).filter((v) => v !== null)
3904
- );
3905
- const getFinalDraggable = (annotation, renderer, locked) => {
4280
+ const nonInteractive = annotationProvides.value ? !annotationProvides.value.isAnnotationInteractive(annotation.object) : false;
4281
+ const structurallyLocked = annotationProvides.value ? annotationProvides.value.isAnnotationStructurallyLocked(annotation.object) : false;
4282
+ const contentLocked = annotationProvides.value ? annotationProvides.value.isAnnotationContentLocked(annotation.object) : false;
4283
+ if (nonInteractive && renderer.hiddenWhenLocked) return null;
4284
+ return { annotation, renderer, tool, nonInteractive, structurallyLocked, contentLocked };
4285
+ }).filter((v) => v !== null);
4286
+ });
4287
+ const getFinalDraggable = (annotation, renderer, structurallyLocked) => {
3906
4288
  var _a;
3907
- if (locked) return false;
4289
+ if (structurallyLocked) return false;
3908
4290
  const tool = (_a = annotationProvides.value) == null ? void 0 : _a.findToolForAnnotation(annotation.object);
3909
4291
  const defaults = renderer.interactionDefaults;
3910
4292
  const isEditing = editingId.value === annotation.object.id;
@@ -3915,9 +4297,9 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
3915
4297
  );
3916
4298
  return renderer.isDraggable ? renderer.isDraggable(resolvedDraggable, { isEditing }) : resolvedDraggable;
3917
4299
  };
3918
- const getResolvedResizable = (annotation, renderer, locked) => {
4300
+ const getResolvedResizable = (annotation, renderer, structurallyLocked) => {
3919
4301
  var _a, _b;
3920
- if (locked) return false;
4302
+ if (structurallyLocked) return false;
3921
4303
  const tool = (_a = annotationProvides.value) == null ? void 0 : _a.findToolForAnnotation(annotation.object);
3922
4304
  return resolveInteractionProp(
3923
4305
  tool == null ? void 0 : tool.interaction.isResizable,
@@ -3934,9 +4316,9 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
3934
4316
  ((_b = renderer.interactionDefaults) == null ? void 0 : _b.lockAspectRatio) ?? false
3935
4317
  );
3936
4318
  };
3937
- const getResolvedRotatable = (annotation, renderer, locked) => {
4319
+ const getResolvedRotatable = (annotation, renderer, structurallyLocked) => {
3938
4320
  var _a, _b;
3939
- if (locked) return false;
4321
+ if (structurallyLocked) return false;
3940
4322
  const tool = (_a = annotationProvides.value) == null ? void 0 : _a.findToolForAnnotation(annotation.object);
3941
4323
  return resolveInteractionProp(
3942
4324
  tool == null ? void 0 : tool.interaction.isRotatable,
@@ -3944,9 +4326,9 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
3944
4326
  ((_b = renderer.interactionDefaults) == null ? void 0 : _b.isRotatable) ?? false
3945
4327
  );
3946
4328
  };
3947
- const getSelectionMenu = (annotation, renderer, locked) => {
4329
+ const getSelectionMenu = (annotation, renderer, nonInteractive) => {
3948
4330
  var _a;
3949
- if (locked) return void 0;
4331
+ if (nonInteractive) return void 0;
3950
4332
  if ((_a = renderer.hideSelectionMenu) == null ? void 0 : _a.call(renderer, annotation.object)) return void 0;
3951
4333
  if (isMultiSelected.value) return void 0;
3952
4334
  return props.selectionMenu;
@@ -3954,8 +4336,8 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
3954
4336
  const noopSelect = (e) => {
3955
4337
  e.stopPropagation();
3956
4338
  };
3957
- const getOnSelect = (annotation, renderer, locked) => {
3958
- if (locked) return noopSelect;
4339
+ const getOnSelect = (annotation, renderer, nonInteractive) => {
4340
+ if (nonInteractive) return noopSelect;
3959
4341
  if (renderer.selectOverride) {
3960
4342
  const selectHelpers = {
3961
4343
  defaultSelect: handleClick,
@@ -4078,8 +4460,8 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
4078
4460
  const allSelected = annotationProvides.value.getSelectedAnnotations();
4079
4461
  return allSelected.every((ta) => ta.object.pageIndex === props.pageIndex);
4080
4462
  });
4081
- const getOnDoubleClick = (renderer, annotation, locked) => {
4082
- if (locked) return void 0;
4463
+ const getOnDoubleClick = (renderer, annotation, nonInteractive, contentLocked) => {
4464
+ if (nonInteractive || contentLocked) return void 0;
4083
4465
  if (!renderer.onDoubleClick) return void 0;
4084
4466
  return (e) => {
4085
4467
  e.stopPropagation();
@@ -4091,9 +4473,9 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
4091
4473
  annotation.object.blendMode ?? renderer.defaultBlendMode ?? PdfBlendMode.Normal
4092
4474
  );
4093
4475
  };
4094
- const getAppearance = (annotation, renderer, locked) => {
4476
+ const getAppearance = (annotation, renderer, nonInteractive) => {
4095
4477
  var _a, _b;
4096
- if (locked && renderer.renderLocked) return void 0;
4478
+ if (nonInteractive && renderer.renderLocked) return void 0;
4097
4479
  const tool = (_a = annotationProvides.value) == null ? void 0 : _a.findToolForAnnotation(annotation.object);
4098
4480
  const useAP = ((_b = tool == null ? void 0 : tool.behavior) == null ? void 0 : _b.useAppearanceStream) ?? renderer.useAppearanceStream ?? true;
4099
4481
  return useAP ? getAppearanceForAnnotation(annotation) : void 0;
@@ -4110,37 +4492,45 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
4110
4492
  });
4111
4493
  return (_ctx, _cache) => {
4112
4494
  return openBlock(), createElementBlock(Fragment, null, [
4113
- (openBlock(true), createElementBlock(Fragment, null, renderList(resolvedAnnotations.value, ({ annotation, renderer, locked }) => {
4495
+ (openBlock(true), createElementBlock(Fragment, null, renderList(resolvedAnnotations.value, ({
4496
+ annotation,
4497
+ renderer,
4498
+ nonInteractive,
4499
+ structurallyLocked,
4500
+ contentLocked
4501
+ }) => {
4114
4502
  var _a;
4115
- return openBlock(), createBlock(_sfc_main$N, mergeProps({
4503
+ return openBlock(), createBlock(_sfc_main$Q, mergeProps({
4116
4504
  key: annotation.object.id,
4117
4505
  trackedAnnotation: annotation,
4118
- isSelected: locked ? false : allSelectedIds.value.includes(annotation.object.id),
4119
- isEditing: locked ? false : editingId.value === annotation.object.id,
4120
- isMultiSelected: locked ? false : isMultiSelected.value,
4121
- isDraggable: getFinalDraggable(annotation, renderer, locked),
4122
- isResizable: getResolvedResizable(annotation, renderer, locked),
4506
+ isSelected: nonInteractive ? false : allSelectedIds.value.includes(annotation.object.id),
4507
+ isEditing: nonInteractive ? false : editingId.value === annotation.object.id,
4508
+ isMultiSelected: nonInteractive ? false : isMultiSelected.value,
4509
+ isDraggable: getFinalDraggable(annotation, renderer, structurallyLocked),
4510
+ isResizable: getResolvedResizable(annotation, renderer, structurallyLocked),
4123
4511
  lockAspectRatio: getResolvedLockAspectRatio(annotation, renderer),
4124
- isRotatable: getResolvedRotatable(annotation, renderer, locked),
4125
- vertexConfig: locked ? void 0 : renderer.vertexConfig,
4126
- selectionMenu: getSelectionMenu(annotation, renderer, locked),
4127
- onSelect: getOnSelect(annotation, renderer, locked),
4128
- onDoubleClick: getOnDoubleClick(renderer, annotation, locked),
4512
+ isRotatable: getResolvedRotatable(annotation, renderer, structurallyLocked),
4513
+ vertexConfig: structurallyLocked ? void 0 : renderer.vertexConfig,
4514
+ selectionMenu: getSelectionMenu(annotation, renderer, nonInteractive),
4515
+ structurallyLocked,
4516
+ contentLocked,
4517
+ onSelect: getOnSelect(annotation, renderer, nonInteractive),
4518
+ onDoubleClick: getOnDoubleClick(renderer, annotation, nonInteractive, contentLocked),
4129
4519
  zIndex: renderer.zIndex,
4130
4520
  blendMode: getBlendMode(annotation, renderer),
4131
4521
  style: (_a = renderer.containerStyle) == null ? void 0 : _a.call(renderer, annotation.object),
4132
- appearance: getAppearance(annotation, renderer, locked)
4522
+ appearance: getAppearance(annotation, renderer, nonInteractive)
4133
4523
  }, { ref_for: true }, containerProps.value), createSlots({
4134
4524
  default: withCtx(({ annotation: currentObject, appearanceActive }) => [
4135
- (openBlock(), createBlock(resolveDynamicComponent(locked && renderer.renderLocked ? renderer.renderLocked : renderer.component), {
4525
+ (openBlock(), createBlock(resolveDynamicComponent(nonInteractive && renderer.renderLocked ? renderer.renderLocked : renderer.component), {
4136
4526
  annotation,
4137
4527
  currentObject,
4138
- isSelected: locked ? false : allSelectedIds.value.includes(annotation.object.id),
4139
- isEditing: locked ? false : editingId.value === annotation.object.id,
4528
+ isSelected: nonInteractive ? false : allSelectedIds.value.includes(annotation.object.id),
4529
+ isEditing: nonInteractive ? false : editingId.value === annotation.object.id,
4140
4530
  scale: __props.scale,
4141
4531
  pageIndex: __props.pageIndex,
4142
4532
  documentId: __props.documentId,
4143
- onClick: locked ? void 0 : getOnSelect(annotation, renderer, locked),
4533
+ onClick: nonInteractive ? void 0 : getOnSelect(annotation, renderer, nonInteractive),
4144
4534
  appearanceActive
4145
4535
  }, null, 8, ["annotation", "currentObject", "isSelected", "isEditing", "scale", "pageIndex", "documentId", "onClick", "appearanceActive"]))
4146
4536
  ]),
@@ -4162,9 +4552,9 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
4162
4552
  ]),
4163
4553
  key: "0"
4164
4554
  } : void 0
4165
- ]), 1040, ["trackedAnnotation", "isSelected", "isEditing", "isMultiSelected", "isDraggable", "isResizable", "lockAspectRatio", "isRotatable", "vertexConfig", "selectionMenu", "onSelect", "onDoubleClick", "zIndex", "blendMode", "style", "appearance"]);
4555
+ ]), 1040, ["trackedAnnotation", "isSelected", "isEditing", "isMultiSelected", "isDraggable", "isResizable", "lockAspectRatio", "isRotatable", "vertexConfig", "selectionMenu", "structurallyLocked", "contentLocked", "onSelect", "onDoubleClick", "zIndex", "blendMode", "style", "appearance"]);
4166
4556
  }), 128)),
4167
- allSelectedOnSamePage.value && selectedAnnotationsOnPage.value.length >= 2 ? (openBlock(), createBlock(_sfc_main$M, {
4557
+ allSelectedOnSamePage.value && selectedAnnotationsOnPage.value.length >= 2 ? (openBlock(), createBlock(_sfc_main$P, {
4168
4558
  key: 0,
4169
4559
  documentId: __props.documentId,
4170
4560
  pageIndex: __props.pageIndex,
@@ -4557,24 +4947,24 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
4557
4947
  });
4558
4948
  const AnnotationPluginPackage = createPluginPackage(AnnotationPluginPackage$1).addWrapper(_sfc_main$1).addUtility(_sfc_main).build();
4559
4949
  export {
4560
- _sfc_main$N as AnnotationContainer,
4950
+ _sfc_main$Q as AnnotationContainer,
4561
4951
  _sfc_main$2 as AnnotationLayer,
4562
4952
  _sfc_main$3 as AnnotationPaintLayer,
4563
4953
  AnnotationPluginPackage,
4564
4954
  _sfc_main$6 as Annotations,
4565
- _sfc_main$F as Circle,
4566
- _sfc_main$p as FreeText,
4567
- _sfc_main$M as GroupSelectionBox,
4955
+ _sfc_main$I as Circle,
4956
+ _sfc_main$r as FreeText,
4957
+ _sfc_main$P as GroupSelectionBox,
4568
4958
  _sfc_main$i as Highlight,
4569
- _sfc_main$J as Ink,
4570
- _sfc_main$D as Line,
4959
+ _sfc_main$M as Ink,
4960
+ _sfc_main$G as Line,
4571
4961
  _sfc_main$k as Link,
4572
- _sfc_main$z as Polygon,
4573
- _sfc_main$B as Polyline,
4962
+ _sfc_main$C as Polygon,
4963
+ _sfc_main$E as Polyline,
4574
4964
  _sfc_main$4 as PreviewRenderer,
4575
4965
  _sfc_main$n as RenderAnnotation,
4576
4966
  _sfc_main$1 as RendererRegistryProvider,
4577
- _sfc_main$H as Square,
4967
+ _sfc_main$K as Square,
4578
4968
  _sfc_main$c as Squiggly,
4579
4969
  _sfc_main$m as Stamp,
4580
4970
  _sfc_main$e as Strikeout,