@embedpdf/plugin-annotation 1.3.13 → 1.3.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/vue/index.js CHANGED
@@ -3,9 +3,9 @@ import { usePlugin, useCapability } from "@embedpdf/core/vue";
3
3
  import { AnnotationPlugin, initialState, patching, getAnnotationsByPageIndex, getSelectedAnnotationByPageIndex, isInk, isSquare, isCircle, isLine, isPolyline, isPolygon, isFreeText, isStamp, isUnderline, isStrikeout, isSquiggly, isHighlight } from "@embedpdf/plugin-annotation";
4
4
  export * from "@embedpdf/plugin-annotation";
5
5
  import { useInteractionHandles, useDoublePressProps, CounterRotate, deepToRaw } from "@embedpdf/utils/vue";
6
+ import { PdfAnnotationBorderStyle, textAlignmentToCss, standardFontCss, PdfVerticalAlignment, ignore, PdfErrorCode, blendModeToCss, PdfBlendMode, PdfAnnotationSubtype } from "@embedpdf/models";
6
7
  import { usePointerHandlers } from "@embedpdf/plugin-interaction-manager/vue";
7
8
  import { useSelectionCapability } from "@embedpdf/plugin-selection/vue";
8
- import { PdfAnnotationBorderStyle, textAlignmentToCss, standardFontCss, PdfVerticalAlignment, ignore, PdfErrorCode, blendModeToCss, PdfBlendMode, PdfAnnotationSubtype } from "@embedpdf/models";
9
9
  const useAnnotationPlugin = () => usePlugin(AnnotationPlugin.id);
10
10
  const useAnnotationCapability = () => useCapability(AnnotationPlugin.id);
11
11
  const useAnnotation = () => {
@@ -1306,7 +1306,8 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
1306
1306
  isResizable: isResizable(annotation),
1307
1307
  lockAspectRatio: lockAspectRatio(annotation),
1308
1308
  onSelect: (e) => handleClick(e, annotation),
1309
- vertexConfig: getVertexConfig(annotation)
1309
+ vertexConfig: getVertexConfig(annotation),
1310
+ style: { mixBlendMode: unref(blendModeToCss)(annotation.object.blendMode ?? unref(PdfBlendMode).Normal) }
1310
1311
  }, { ref_for: true }, props), {
1311
1312
  default: withCtx(({ annotation: currentObject }) => {
1312
1313
  var _a2;
@@ -1328,7 +1329,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
1328
1329
  renderSlot(_ctx.$slots, "vertex-handle", mergeProps({ ref_for: true }, slotProps))
1329
1330
  ]),
1330
1331
  _: 2
1331
- }, 1040, ["trackedAnnotation", "isSelected", "isDraggable", "isResizable", "lockAspectRatio", "onSelect", "vertexConfig"])) : unref(isSquare)(annotation) ? (openBlock(), createBlock(_sfc_main$i, mergeProps({
1332
+ }, 1040, ["trackedAnnotation", "isSelected", "isDraggable", "isResizable", "lockAspectRatio", "onSelect", "vertexConfig", "style"])) : unref(isSquare)(annotation) ? (openBlock(), createBlock(_sfc_main$i, mergeProps({
1332
1333
  key: 1,
1333
1334
  trackedAnnotation: annotation,
1334
1335
  isSelected: ((_b = selectionState.value) == null ? void 0 : _b.object.id) === annotation.object.id,
@@ -1336,7 +1337,8 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
1336
1337
  isResizable: isResizable(annotation),
1337
1338
  lockAspectRatio: lockAspectRatio(annotation),
1338
1339
  onSelect: (e) => handleClick(e, annotation),
1339
- vertexConfig: getVertexConfig(annotation)
1340
+ vertexConfig: getVertexConfig(annotation),
1341
+ style: { mixBlendMode: unref(blendModeToCss)(annotation.object.blendMode ?? unref(PdfBlendMode).Normal) }
1340
1342
  }, { ref_for: true }, props), {
1341
1343
  default: withCtx(({ annotation: currentObject }) => {
1342
1344
  var _a2;
@@ -1358,7 +1360,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
1358
1360
  renderSlot(_ctx.$slots, "vertex-handle", mergeProps({ ref_for: true }, slotProps))
1359
1361
  ]),
1360
1362
  _: 2
1361
- }, 1040, ["trackedAnnotation", "isSelected", "isDraggable", "isResizable", "lockAspectRatio", "onSelect", "vertexConfig"])) : unref(isCircle)(annotation) ? (openBlock(), createBlock(_sfc_main$i, mergeProps({
1363
+ }, 1040, ["trackedAnnotation", "isSelected", "isDraggable", "isResizable", "lockAspectRatio", "onSelect", "vertexConfig", "style"])) : unref(isCircle)(annotation) ? (openBlock(), createBlock(_sfc_main$i, mergeProps({
1362
1364
  key: 2,
1363
1365
  trackedAnnotation: annotation,
1364
1366
  isSelected: ((_c = selectionState.value) == null ? void 0 : _c.object.id) === annotation.object.id,
@@ -1366,7 +1368,8 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
1366
1368
  isResizable: isResizable(annotation),
1367
1369
  lockAspectRatio: lockAspectRatio(annotation),
1368
1370
  onSelect: (e) => handleClick(e, annotation),
1369
- vertexConfig: getVertexConfig(annotation)
1371
+ vertexConfig: getVertexConfig(annotation),
1372
+ style: { mixBlendMode: unref(blendModeToCss)(annotation.object.blendMode ?? unref(PdfBlendMode).Normal) }
1370
1373
  }, { ref_for: true }, props), {
1371
1374
  default: withCtx(({ annotation: currentObject }) => {
1372
1375
  var _a2;
@@ -1388,7 +1391,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
1388
1391
  renderSlot(_ctx.$slots, "vertex-handle", mergeProps({ ref_for: true }, slotProps))
1389
1392
  ]),
1390
1393
  _: 2
1391
- }, 1040, ["trackedAnnotation", "isSelected", "isDraggable", "isResizable", "lockAspectRatio", "onSelect", "vertexConfig"])) : unref(isLine)(annotation) ? (openBlock(), createBlock(_sfc_main$i, mergeProps({
1394
+ }, 1040, ["trackedAnnotation", "isSelected", "isDraggable", "isResizable", "lockAspectRatio", "onSelect", "vertexConfig", "style"])) : unref(isLine)(annotation) ? (openBlock(), createBlock(_sfc_main$i, mergeProps({
1392
1395
  key: 3,
1393
1396
  trackedAnnotation: annotation,
1394
1397
  isSelected: ((_d = selectionState.value) == null ? void 0 : _d.object.id) === annotation.object.id,
@@ -1396,7 +1399,8 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
1396
1399
  isResizable: isResizable(annotation),
1397
1400
  lockAspectRatio: lockAspectRatio(annotation),
1398
1401
  onSelect: (e) => handleClick(e, annotation),
1399
- vertexConfig: getVertexConfig(annotation)
1402
+ vertexConfig: getVertexConfig(annotation),
1403
+ style: { mixBlendMode: unref(blendModeToCss)(annotation.object.blendMode ?? unref(PdfBlendMode).Normal) }
1400
1404
  }, { ref_for: true }, props), {
1401
1405
  default: withCtx(({ annotation: currentObject }) => {
1402
1406
  var _a2;
@@ -1418,7 +1422,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
1418
1422
  renderSlot(_ctx.$slots, "vertex-handle", mergeProps({ ref_for: true }, slotProps))
1419
1423
  ]),
1420
1424
  _: 2
1421
- }, 1040, ["trackedAnnotation", "isSelected", "isDraggable", "isResizable", "lockAspectRatio", "onSelect", "vertexConfig"])) : unref(isPolyline)(annotation) ? (openBlock(), createBlock(_sfc_main$i, mergeProps({
1425
+ }, 1040, ["trackedAnnotation", "isSelected", "isDraggable", "isResizable", "lockAspectRatio", "onSelect", "vertexConfig", "style"])) : unref(isPolyline)(annotation) ? (openBlock(), createBlock(_sfc_main$i, mergeProps({
1422
1426
  key: 4,
1423
1427
  trackedAnnotation: annotation,
1424
1428
  isSelected: ((_e = selectionState.value) == null ? void 0 : _e.object.id) === annotation.object.id,
@@ -1426,7 +1430,8 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
1426
1430
  isResizable: isResizable(annotation),
1427
1431
  lockAspectRatio: lockAspectRatio(annotation),
1428
1432
  onSelect: (e) => handleClick(e, annotation),
1429
- vertexConfig: getVertexConfig(annotation)
1433
+ vertexConfig: getVertexConfig(annotation),
1434
+ style: { mixBlendMode: unref(blendModeToCss)(annotation.object.blendMode ?? unref(PdfBlendMode).Normal) }
1430
1435
  }, { ref_for: true }, props), {
1431
1436
  default: withCtx(({ annotation: currentObject }) => {
1432
1437
  var _a2;
@@ -1448,7 +1453,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
1448
1453
  renderSlot(_ctx.$slots, "vertex-handle", mergeProps({ ref_for: true }, slotProps))
1449
1454
  ]),
1450
1455
  _: 2
1451
- }, 1040, ["trackedAnnotation", "isSelected", "isDraggable", "isResizable", "lockAspectRatio", "onSelect", "vertexConfig"])) : unref(isPolygon)(annotation) ? (openBlock(), createBlock(_sfc_main$i, mergeProps({
1456
+ }, 1040, ["trackedAnnotation", "isSelected", "isDraggable", "isResizable", "lockAspectRatio", "onSelect", "vertexConfig", "style"])) : unref(isPolygon)(annotation) ? (openBlock(), createBlock(_sfc_main$i, mergeProps({
1452
1457
  key: 5,
1453
1458
  trackedAnnotation: annotation,
1454
1459
  isSelected: ((_f = selectionState.value) == null ? void 0 : _f.object.id) === annotation.object.id,
@@ -1456,7 +1461,8 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
1456
1461
  isResizable: isResizable(annotation),
1457
1462
  lockAspectRatio: lockAspectRatio(annotation),
1458
1463
  onSelect: (e) => handleClick(e, annotation),
1459
- vertexConfig: getVertexConfig(annotation)
1464
+ vertexConfig: getVertexConfig(annotation),
1465
+ style: { mixBlendMode: unref(blendModeToCss)(annotation.object.blendMode ?? unref(PdfBlendMode).Normal) }
1460
1466
  }, { ref_for: true }, props), {
1461
1467
  default: withCtx(({ annotation: currentObject }) => {
1462
1468
  var _a2;
@@ -1478,7 +1484,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
1478
1484
  renderSlot(_ctx.$slots, "vertex-handle", mergeProps({ ref_for: true }, slotProps))
1479
1485
  ]),
1480
1486
  _: 2
1481
- }, 1040, ["trackedAnnotation", "isSelected", "isDraggable", "isResizable", "lockAspectRatio", "onSelect", "vertexConfig"])) : unref(isFreeText)(annotation) ? (openBlock(), createBlock(_sfc_main$i, mergeProps({
1487
+ }, 1040, ["trackedAnnotation", "isSelected", "isDraggable", "isResizable", "lockAspectRatio", "onSelect", "vertexConfig", "style"])) : unref(isFreeText)(annotation) ? (openBlock(), createBlock(_sfc_main$i, mergeProps({
1482
1488
  key: 6,
1483
1489
  trackedAnnotation: annotation,
1484
1490
  isSelected: ((_g = selectionState.value) == null ? void 0 : _g.object.id) === annotation.object.id,
@@ -1487,7 +1493,8 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
1487
1493
  lockAspectRatio: lockAspectRatio(annotation),
1488
1494
  onSelect: (e) => handleClick(e, annotation),
1489
1495
  onDoubleClick: (e) => handleDoubleClick(e, annotation.object.id),
1490
- vertexConfig: getVertexConfig(annotation)
1496
+ vertexConfig: getVertexConfig(annotation),
1497
+ style: { mixBlendMode: unref(blendModeToCss)(annotation.object.blendMode ?? unref(PdfBlendMode).Normal) }
1491
1498
  }, { ref_for: true }, props), {
1492
1499
  default: withCtx(({ annotation: currentObject }) => {
1493
1500
  var _a2;
@@ -1512,7 +1519,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
1512
1519
  renderSlot(_ctx.$slots, "vertex-handle", mergeProps({ ref_for: true }, slotProps))
1513
1520
  ]),
1514
1521
  _: 2
1515
- }, 1040, ["trackedAnnotation", "isSelected", "isDraggable", "isResizable", "lockAspectRatio", "onSelect", "onDoubleClick", "vertexConfig"])) : unref(isStamp)(annotation) ? (openBlock(), createBlock(_sfc_main$i, mergeProps({
1522
+ }, 1040, ["trackedAnnotation", "isSelected", "isDraggable", "isResizable", "lockAspectRatio", "onSelect", "onDoubleClick", "vertexConfig", "style"])) : unref(isStamp)(annotation) ? (openBlock(), createBlock(_sfc_main$i, mergeProps({
1516
1523
  key: 7,
1517
1524
  trackedAnnotation: annotation,
1518
1525
  isSelected: ((_h = selectionState.value) == null ? void 0 : _h.object.id) === annotation.object.id,
@@ -1520,7 +1527,8 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
1520
1527
  isResizable: isResizable(annotation),
1521
1528
  lockAspectRatio: lockAspectRatio(annotation),
1522
1529
  onSelect: (e) => handleClick(e, annotation),
1523
- vertexConfig: getVertexConfig(annotation)
1530
+ vertexConfig: getVertexConfig(annotation),
1531
+ style: { mixBlendMode: unref(blendModeToCss)(annotation.object.blendMode ?? unref(PdfBlendMode).Normal) }
1524
1532
  }, { ref_for: true }, props), {
1525
1533
  default: withCtx(() => {
1526
1534
  var _a2;
@@ -1544,7 +1552,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
1544
1552
  renderSlot(_ctx.$slots, "vertex-handle", mergeProps({ ref_for: true }, slotProps))
1545
1553
  ]),
1546
1554
  _: 2
1547
- }, 1040, ["trackedAnnotation", "isSelected", "isDraggable", "isResizable", "lockAspectRatio", "onSelect", "vertexConfig"])) : unref(isUnderline)(annotation) ? (openBlock(), createBlock(_sfc_main$i, mergeProps({
1555
+ }, 1040, ["trackedAnnotation", "isSelected", "isDraggable", "isResizable", "lockAspectRatio", "onSelect", "vertexConfig", "style"])) : unref(isUnderline)(annotation) ? (openBlock(), createBlock(_sfc_main$i, mergeProps({
1548
1556
  key: 8,
1549
1557
  trackedAnnotation: annotation,
1550
1558
  isSelected: ((_i = selectionState.value) == null ? void 0 : _i.object.id) === annotation.object.id,
@@ -1553,7 +1561,8 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
1553
1561
  lockAspectRatio: lockAspectRatio(annotation),
1554
1562
  onSelect: (e) => handleClick(e, annotation),
1555
1563
  vertexConfig: getVertexConfig(annotation),
1556
- zIndex: 0
1564
+ zIndex: 0,
1565
+ style: { mixBlendMode: unref(blendModeToCss)(annotation.object.blendMode ?? unref(PdfBlendMode).Normal) }
1557
1566
  }, { ref_for: true }, props), {
1558
1567
  default: withCtx(({ annotation: currentObject }) => [
1559
1568
  createVNode(_sfc_main$5, mergeProps({ ref_for: true }, currentObject, {
@@ -1565,7 +1574,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
1565
1574
  renderSlot(_ctx.$slots, "selection-menu", mergeProps({ ref_for: true }, slotProps))
1566
1575
  ]),
1567
1576
  _: 2
1568
- }, 1040, ["trackedAnnotation", "isSelected", "isDraggable", "isResizable", "lockAspectRatio", "onSelect", "vertexConfig"])) : unref(isStrikeout)(annotation) ? (openBlock(), createBlock(_sfc_main$i, mergeProps({
1577
+ }, 1040, ["trackedAnnotation", "isSelected", "isDraggable", "isResizable", "lockAspectRatio", "onSelect", "vertexConfig", "style"])) : unref(isStrikeout)(annotation) ? (openBlock(), createBlock(_sfc_main$i, mergeProps({
1569
1578
  key: 9,
1570
1579
  trackedAnnotation: annotation,
1571
1580
  isSelected: ((_j = selectionState.value) == null ? void 0 : _j.object.id) === annotation.object.id,
@@ -1574,7 +1583,8 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
1574
1583
  lockAspectRatio: lockAspectRatio(annotation),
1575
1584
  onSelect: (e) => handleClick(e, annotation),
1576
1585
  vertexConfig: getVertexConfig(annotation),
1577
- zIndex: 0
1586
+ zIndex: 0,
1587
+ style: { mixBlendMode: unref(blendModeToCss)(annotation.object.blendMode ?? unref(PdfBlendMode).Normal) }
1578
1588
  }, { ref_for: true }, props), {
1579
1589
  default: withCtx(({ annotation: currentObject }) => [
1580
1590
  createVNode(_sfc_main$6, mergeProps({ ref_for: true }, currentObject, {
@@ -1586,7 +1596,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
1586
1596
  renderSlot(_ctx.$slots, "selection-menu", mergeProps({ ref_for: true }, slotProps))
1587
1597
  ]),
1588
1598
  _: 2
1589
- }, 1040, ["trackedAnnotation", "isSelected", "isDraggable", "isResizable", "lockAspectRatio", "onSelect", "vertexConfig"])) : unref(isSquiggly)(annotation) ? (openBlock(), createBlock(_sfc_main$i, mergeProps({
1599
+ }, 1040, ["trackedAnnotation", "isSelected", "isDraggable", "isResizable", "lockAspectRatio", "onSelect", "vertexConfig", "style"])) : unref(isSquiggly)(annotation) ? (openBlock(), createBlock(_sfc_main$i, mergeProps({
1590
1600
  key: 10,
1591
1601
  trackedAnnotation: annotation,
1592
1602
  isSelected: ((_k = selectionState.value) == null ? void 0 : _k.object.id) === annotation.object.id,
@@ -1595,7 +1605,8 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
1595
1605
  lockAspectRatio: lockAspectRatio(annotation),
1596
1606
  onSelect: (e) => handleClick(e, annotation),
1597
1607
  vertexConfig: getVertexConfig(annotation),
1598
- zIndex: 0
1608
+ zIndex: 0,
1609
+ style: { mixBlendMode: unref(blendModeToCss)(annotation.object.blendMode ?? unref(PdfBlendMode).Normal) }
1599
1610
  }, { ref_for: true }, props), {
1600
1611
  default: withCtx(({ annotation: currentObject }) => [
1601
1612
  createVNode(_sfc_main$7, mergeProps({ ref_for: true }, currentObject, {
@@ -1607,7 +1618,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
1607
1618
  renderSlot(_ctx.$slots, "selection-menu", mergeProps({ ref_for: true }, slotProps))
1608
1619
  ]),
1609
1620
  _: 2
1610
- }, 1040, ["trackedAnnotation", "isSelected", "isDraggable", "isResizable", "lockAspectRatio", "onSelect", "vertexConfig"])) : unref(isHighlight)(annotation) ? (openBlock(), createBlock(_sfc_main$i, mergeProps({
1621
+ }, 1040, ["trackedAnnotation", "isSelected", "isDraggable", "isResizable", "lockAspectRatio", "onSelect", "vertexConfig", "style"])) : unref(isHighlight)(annotation) ? (openBlock(), createBlock(_sfc_main$i, mergeProps({
1611
1622
  key: 11,
1612
1623
  trackedAnnotation: annotation,
1613
1624
  isSelected: ((_l = selectionState.value) == null ? void 0 : _l.object.id) === annotation.object.id,
@@ -1616,7 +1627,10 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
1616
1627
  lockAspectRatio: lockAspectRatio(annotation),
1617
1628
  onSelect: (e) => handleClick(e, annotation),
1618
1629
  vertexConfig: getVertexConfig(annotation),
1619
- zIndex: 0
1630
+ zIndex: 0,
1631
+ style: {
1632
+ mixBlendMode: unref(blendModeToCss)(annotation.object.blendMode ?? unref(PdfBlendMode).Multiply)
1633
+ }
1620
1634
  }, { ref_for: true }, props), {
1621
1635
  default: withCtx(({ annotation: currentObject }) => [
1622
1636
  createVNode(_sfc_main$8, mergeProps({ ref_for: true }, currentObject, {
@@ -1628,7 +1642,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
1628
1642
  renderSlot(_ctx.$slots, "selection-menu", mergeProps({ ref_for: true }, slotProps))
1629
1643
  ]),
1630
1644
  _: 2
1631
- }, 1040, ["trackedAnnotation", "isSelected", "isDraggable", "isResizable", "lockAspectRatio", "onSelect", "vertexConfig"])) : createCommentVNode("", true)
1645
+ }, 1040, ["trackedAnnotation", "isSelected", "isDraggable", "isResizable", "lockAspectRatio", "onSelect", "vertexConfig", "style"])) : createCommentVNode("", true)
1632
1646
  ], 64);
1633
1647
  }), 128);
1634
1648
  };