@arbidocs/react 0.4.157 → 0.4.159

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 (43) hide show
  1. package/dist/{ProductionDialog-DUC9BXWS.d.ts → ProductionDialog-BvRVGdvH.d.ts} +1 -1
  2. package/dist/{ProductionDialog-BRrZ5Lj5.d.cts → ProductionDialog-Dhf9MXH-.d.cts} +1 -1
  3. package/dist/annotations/freeze/index.cjs +15 -15
  4. package/dist/annotations/freeze/index.d.cts +6 -1
  5. package/dist/annotations/freeze/index.d.ts +6 -1
  6. package/dist/annotations/freeze/index.js +3 -3
  7. package/dist/annotations/index.cjs +56 -56
  8. package/dist/annotations/index.d.cts +9 -4
  9. package/dist/annotations/index.d.ts +9 -4
  10. package/dist/annotations/index.js +2 -2
  11. package/dist/bundle-COMT7X3A.js +4 -0
  12. package/dist/{bundle-N2JIJ2T6.js.map → bundle-COMT7X3A.js.map} +1 -1
  13. package/dist/bundle-UWCOLMAA.cjs +13 -0
  14. package/dist/{bundle-T6BEVYHE.cjs.map → bundle-UWCOLMAA.cjs.map} +1 -1
  15. package/dist/{chunk-SSOPIPEX.cjs → chunk-LRBOMQ6Q.cjs} +4 -3
  16. package/dist/chunk-LRBOMQ6Q.cjs.map +1 -0
  17. package/dist/{chunk-COWZGCL5.js → chunk-NBIW7AEE.js} +4 -3
  18. package/dist/chunk-NBIW7AEE.js.map +1 -0
  19. package/dist/{chunk-ZJMUNGOY.js → chunk-R66GNDO7.js} +42 -4
  20. package/dist/chunk-R66GNDO7.js.map +1 -0
  21. package/dist/{chunk-L2PXZWJM.cjs → chunk-RDF2Q45F.cjs} +75 -20
  22. package/dist/chunk-RDF2Q45F.cjs.map +1 -0
  23. package/dist/{chunk-IHTBAY57.js → chunk-S33P6THG.js} +59 -4
  24. package/dist/chunk-S33P6THG.js.map +1 -0
  25. package/dist/{chunk-QJXFRP5R.cjs → chunk-UP6PIBVF.cjs} +46 -8
  26. package/dist/chunk-UP6PIBVF.cjs.map +1 -0
  27. package/dist/document-tools/index.cjs +156 -26
  28. package/dist/document-tools/index.cjs.map +1 -1
  29. package/dist/document-tools/index.d.cts +110 -13
  30. package/dist/document-tools/index.d.ts +110 -13
  31. package/dist/document-tools/index.js +136 -20
  32. package/dist/document-tools/index.js.map +1 -1
  33. package/dist/{model-DIwXRuGC.d.ts → model-D63gedpb.d.cts} +5 -0
  34. package/dist/{model-DIwXRuGC.d.cts → model-D63gedpb.d.ts} +5 -0
  35. package/package.json +3 -3
  36. package/dist/bundle-N2JIJ2T6.js +0 -4
  37. package/dist/bundle-T6BEVYHE.cjs +0 -13
  38. package/dist/chunk-COWZGCL5.js.map +0 -1
  39. package/dist/chunk-IHTBAY57.js.map +0 -1
  40. package/dist/chunk-L2PXZWJM.cjs.map +0 -1
  41. package/dist/chunk-QJXFRP5R.cjs.map +0 -1
  42. package/dist/chunk-SSOPIPEX.cjs.map +0 -1
  43. package/dist/chunk-ZJMUNGOY.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { parseAnnotation, parseLayer, emptyLayer, clampRect, isEffectiveRedaction } from './chunk-COWZGCL5.js';
1
+ import { parseAnnotation, parseLayer, emptyLayer, clampRect, isEffectiveRedaction } from './chunk-NBIW7AEE.js';
2
2
  import { Button, Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter } from './chunk-YNNAJJ5Z.js';
3
3
  import { usePortalContainer, DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem } from './chunk-47CCGUWR.js';
4
4
  import { cn } from './chunk-SN5YV6FF.js';
@@ -333,6 +333,7 @@ var TEXT_TOOLS = ["highlight", "redact-text"];
333
333
  var DEFAULT_SETTINGS = {
334
334
  colors: { highlight: "#ffe066", box: "#e03131", stamp: "#c92a2a" },
335
335
  stampLabel: "CONFIDENTIAL",
336
+ stampImage: null,
336
337
  redactionReason: "Privileged",
337
338
  strokeWidth: 2
338
339
  };
@@ -982,6 +983,25 @@ function AnnotationPageOverlay({
982
983
  reason: settings.redactionReason,
983
984
  status: "pending"
984
985
  });
986
+ } else if (tool === "stamp" && settings.stampImage) {
987
+ const { image, label } = settings.stampImage;
988
+ const size2 = pngPixelSize(image);
989
+ const h = 0.06;
990
+ const w = Math.min(
991
+ 0.5,
992
+ h * page.height * (size2.width / Math.max(1, size2.height)) / page.width
993
+ );
994
+ const id = controller.add({
995
+ kind: "stamp",
996
+ page: pageNumber,
997
+ rect: clampRect({ x: a.x / page.width - w / 2, y: a.y / page.height - h / 2, w, h }),
998
+ label,
999
+ color: "#0d1a59",
1000
+ image
1001
+ });
1002
+ controller.setSettings({ stampImage: null });
1003
+ controller.setTool("select");
1004
+ if (id) controller.select(id);
985
1005
  } else if (tool === "stamp") {
986
1006
  const placed = isTooSmall(rect) ? clampRect({
987
1007
  x: a.x / page.width - DEFAULT_STAMP.w / 2,
@@ -1217,6 +1237,31 @@ function MarkView(props) {
1217
1237
  }
1218
1238
  );
1219
1239
  }
1240
+ if (a.kind === "stamp" && a.image) {
1241
+ const r = rectOverride ?? a.rect;
1242
+ return /* @__PURE__ */ jsx(
1243
+ "div",
1244
+ {
1245
+ ...base(`Stamp: ${a.label}`),
1246
+ className: cn("absolute", ring),
1247
+ style: {
1248
+ ...rectStyle(r),
1249
+ pointerEvents: events,
1250
+ touchAction: dragsByTouch ? "none" : void 0,
1251
+ cursor
1252
+ },
1253
+ children: /* @__PURE__ */ jsx(
1254
+ "img",
1255
+ {
1256
+ src: `data:image/png;base64,${a.image}`,
1257
+ alt: a.label,
1258
+ draggable: false,
1259
+ className: "pointer-events-none h-full w-full object-contain select-none"
1260
+ }
1261
+ )
1262
+ }
1263
+ );
1264
+ }
1220
1265
  if (a.kind === "stamp") {
1221
1266
  const r = rectOverride ?? a.rect;
1222
1267
  const fontPx = Math.max(
@@ -1620,6 +1665,11 @@ function CommentPopover({
1620
1665
  }
1621
1666
  );
1622
1667
  }
1668
+ function pngPixelSize(base64) {
1669
+ const raw = atob(base64.slice(0, 64));
1670
+ const at = (i) => (raw.charCodeAt(i) << 24 | raw.charCodeAt(i + 1) << 16 | raw.charCodeAt(i + 2) << 8 | raw.charCodeAt(i + 3)) >>> 0;
1671
+ return { width: at(16), height: at(20) };
1672
+ }
1623
1673
  var isEditable = (el) => el instanceof HTMLElement && (el.isContentEditable || /^(INPUT|TEXTAREA|SELECT)$/.test(el.tagName));
1624
1674
  function useAnnotationShortcuts(controller, enabled = true) {
1625
1675
  useEffect(() => {
@@ -1856,7 +1906,12 @@ function AnnotationToolbar({
1856
1906
  onChange: (c) => controller.setSettings({ colors: { ...settings.colors, [tool]: c } })
1857
1907
  }
1858
1908
  ),
1859
- editable && tool === "stamp" && /* @__PURE__ */ jsx(
1909
+ editable && tool === "stamp" && settings.stampImage && /* @__PURE__ */ jsxs("span", { className: "text-xs text-muted-foreground", "data-testid": "annotation-place-signature", children: [
1910
+ "Click where your ",
1911
+ settings.stampImage.label.toLowerCase(),
1912
+ " goes. Informal signature: for verified signing, use Request signatures."
1913
+ ] }),
1914
+ editable && tool === "stamp" && !settings.stampImage && /* @__PURE__ */ jsx(
1860
1915
  PresetField,
1861
1916
  {
1862
1917
  label: "Stamp text",
@@ -2409,5 +2464,5 @@ function ProductionDialog({
2409
2464
  }
2410
2465
 
2411
2466
  export { AUTOSAVE_MS, AnnotationPageOverlay, AnnotationStoreOfflineError, AnnotationToolbar, DEFAULT_SETTINGS, FreezeDialog, HIGHLIGHT_COLORS, MARK_COLORS, ProductionDialog, REDACTION_LOG_COLUMNS, REDACTION_REASONS, RETRY_MS, STAMP_PRESETS, annotationsOnPage, applyAction, canRedo, canUndo, containsPoint, createHistory, createLocalStorageStore, createMemoryStore, dragRect, dragToNorm, intersects, isTooSmall, layerStatusText, mergeLayers, mergeLineRects, moveItem, patchForRect, pendingRedactions, qrCornerFor, readSelection, redactionLogCsv, redactionLogRows, redo, reduceLayer, sameMarks, selectionToPageMarks, singleRect, toNorm, toPixels, undo, useAnnotationLayer, useAnnotationShortcuts, useTextSelectionMarks };
2412
- //# sourceMappingURL=chunk-IHTBAY57.js.map
2413
- //# sourceMappingURL=chunk-IHTBAY57.js.map
2467
+ //# sourceMappingURL=chunk-S33P6THG.js.map
2468
+ //# sourceMappingURL=chunk-S33P6THG.js.map