@arbidocs/react 0.4.158 → 0.4.160
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/README.md +13 -6
- package/dist/{store-CoLuVSxI.d.ts → ProductionDialog.d-BD1osHeq.d.cts} +33 -33
- package/dist/{store-BEXGdE1y.d.cts → ProductionDialog.d-CttHqQAh.d.ts} +33 -33
- package/dist/annotations/freeze/index.cjs +15 -15
- package/dist/annotations/freeze/index.d.cts +8 -3
- package/dist/annotations/freeze/index.d.ts +8 -3
- package/dist/annotations/freeze/index.js +3 -3
- package/dist/annotations/index.cjs +56 -56
- package/dist/annotations/index.d.cts +9 -4
- package/dist/annotations/index.d.ts +9 -4
- package/dist/annotations/index.js +2 -2
- package/dist/artifacts/index.cjs +12 -11
- package/dist/artifacts/index.cjs.map +1 -1
- package/dist/artifacts/index.d.cts +4 -4
- package/dist/artifacts/index.d.ts +4 -4
- package/dist/artifacts/index.js +3 -2
- package/dist/artifacts/index.js.map +1 -1
- package/dist/bundle-COMT7X3A.js +4 -0
- package/dist/{bundle-N2JIJ2T6.js.map → bundle-COMT7X3A.js.map} +1 -1
- package/dist/bundle-UWCOLMAA.cjs +13 -0
- package/dist/{bundle-T6BEVYHE.cjs.map → bundle-UWCOLMAA.cjs.map} +1 -1
- package/dist/{chunk-RDLAOB55.cjs → chunk-3LMX6GXR.cjs} +150 -14
- package/dist/chunk-3LMX6GXR.cjs.map +1 -0
- package/dist/{chunk-37TQBT7Y.cjs → chunk-6MTKKT2O.cjs} +188 -126
- package/dist/chunk-6MTKKT2O.cjs.map +1 -0
- package/dist/{chunk-HKIR456G.js → chunk-CEZCFQ47.js} +149 -92
- package/dist/chunk-CEZCFQ47.js.map +1 -0
- package/dist/chunk-CPZ36AQS.js +11 -0
- package/dist/chunk-CPZ36AQS.js.map +1 -0
- package/dist/{chunk-JFKWH6EP.cjs → chunk-EUC2BTNS.cjs} +35 -4
- package/dist/chunk-EUC2BTNS.cjs.map +1 -0
- package/dist/chunk-GTJ667CP.cjs +26 -0
- package/dist/chunk-GTJ667CP.cjs.map +1 -0
- package/dist/{chunk-3XYIQZTH.js → chunk-I5ZBQ63Y.js} +33 -5
- package/dist/chunk-I5ZBQ63Y.js.map +1 -0
- package/dist/chunk-JSSKEXRR.js +22 -0
- package/dist/chunk-JSSKEXRR.js.map +1 -0
- package/dist/{chunk-SSOPIPEX.cjs → chunk-LRBOMQ6Q.cjs} +4 -3
- package/dist/chunk-LRBOMQ6Q.cjs.map +1 -0
- package/dist/{chunk-COWZGCL5.js → chunk-NBIW7AEE.js} +4 -3
- package/dist/chunk-NBIW7AEE.js.map +1 -0
- package/dist/{chunk-QKNJ6FRD.cjs → chunk-ON4PL6DQ.cjs} +4 -4
- package/dist/chunk-ON4PL6DQ.cjs.map +1 -0
- package/dist/{chunk-ZJMUNGOY.js → chunk-R66GNDO7.js} +42 -4
- package/dist/chunk-R66GNDO7.js.map +1 -0
- package/dist/chunk-RCKA7BEF.cjs +14 -0
- package/dist/chunk-RCKA7BEF.cjs.map +1 -0
- package/dist/{chunk-L2PXZWJM.cjs → chunk-RDF2Q45F.cjs} +75 -20
- package/dist/chunk-RDF2Q45F.cjs.map +1 -0
- package/dist/{chunk-IHTBAY57.js → chunk-S33P6THG.js} +59 -4
- package/dist/chunk-S33P6THG.js.map +1 -0
- package/dist/{chunk-2HNEVAXO.js → chunk-SVHGCX25.js} +3 -3
- package/dist/chunk-SVHGCX25.js.map +1 -0
- package/dist/{chunk-QJXFRP5R.cjs → chunk-UP6PIBVF.cjs} +46 -8
- package/dist/chunk-UP6PIBVF.cjs.map +1 -0
- package/dist/{chunk-CNGWJDMG.js → chunk-WOXITGVS.js} +139 -15
- package/dist/chunk-WOXITGVS.js.map +1 -0
- package/dist/document-tools/index.cjs +188 -57
- package/dist/document-tools/index.cjs.map +1 -1
- package/dist/document-tools/index.d.cts +112 -15
- package/dist/document-tools/index.d.ts +112 -15
- package/dist/document-tools/index.js +141 -24
- package/dist/document-tools/index.js.map +1 -1
- package/dist/index.cjs +1771 -1509
- package/dist/index.cjs.map +1 -1
- package/dist/{index-DyFzmDZ2.d.ts → index.d-DfCFKora.d.cts} +49 -5
- package/dist/{index-DyFzmDZ2.d.cts → index.d-DfCFKora.d.ts} +49 -5
- package/dist/{index-CDTwtUr9.d.cts → index.d-eRbU1qpQ.d.cts} +333 -196
- package/dist/{index-CDTwtUr9.d.ts → index.d-eRbU1qpQ.d.ts} +333 -196
- package/dist/index.d.cts +1797 -1504
- package/dist/index.d.ts +1797 -1504
- package/dist/index.js +931 -768
- package/dist/index.js.map +1 -1
- package/dist/{model-DIwXRuGC.d.cts → model.d-D63gedpb.d.cts} +5 -0
- package/dist/{model-DIwXRuGC.d.ts → model.d-D63gedpb.d.ts} +5 -0
- package/dist/shell/index.cjs +24 -15
- package/dist/shell/index.d.cts +1 -1
- package/dist/shell/index.d.ts +1 -1
- package/dist/shell/index.js +2 -1
- package/dist/ui/index.cjs +200 -151
- package/dist/ui/index.d.cts +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.js +3 -2
- package/dist/viewers/index.cjs +3 -2
- package/dist/viewers/index.cjs.map +1 -1
- package/dist/viewers/index.d.cts +2 -2
- package/dist/viewers/index.d.ts +2 -2
- package/dist/viewers/index.js +2 -1
- package/dist/viewers/index.js.map +1 -1
- package/package.json +4 -6
- package/dist/bundle-N2JIJ2T6.js +0 -4
- package/dist/bundle-T6BEVYHE.cjs +0 -13
- package/dist/chunk-2HNEVAXO.js.map +0 -1
- package/dist/chunk-37TQBT7Y.cjs.map +0 -1
- package/dist/chunk-3XYIQZTH.js.map +0 -1
- package/dist/chunk-CNGWJDMG.js.map +0 -1
- package/dist/chunk-COWZGCL5.js.map +0 -1
- package/dist/chunk-CPPBN2JB.js +0 -31
- package/dist/chunk-CPPBN2JB.js.map +0 -1
- package/dist/chunk-HKIR456G.js.map +0 -1
- package/dist/chunk-IHTBAY57.js.map +0 -1
- package/dist/chunk-JFKWH6EP.cjs.map +0 -1
- package/dist/chunk-L2PXZWJM.cjs.map +0 -1
- package/dist/chunk-QJXFRP5R.cjs.map +0 -1
- package/dist/chunk-QKNJ6FRD.cjs.map +0 -1
- package/dist/chunk-R2MF7YCW.cjs +0 -36
- package/dist/chunk-R2MF7YCW.cjs.map +0 -1
- package/dist/chunk-RDLAOB55.cjs.map +0 -1
- package/dist/chunk-SSOPIPEX.cjs.map +0 -1
- package/dist/chunk-ZJMUNGOY.js.map +0 -1
- /package/dist/{PdfViewer-bQH9yxFg.d.cts → PdfViewer.d-bQH9yxFg.d.cts} +0 -0
- /package/dist/{PdfViewer-bQH9yxFg.d.ts → PdfViewer.d-bQH9yxFg.d.ts} +0 -0
- /package/dist/{bundle-BnCSbHy2.d.cts → bundle.d-BnCSbHy2.d.cts} +0 -0
- /package/dist/{bundle-BnCSbHy2.d.ts → bundle.d-BnCSbHy2.d.ts} +0 -0
- /package/dist/{stored-markdown-Bp18vrbr.d.cts → stored-markdown.d-Bp18vrbr.d.cts} +0 -0
- /package/dist/{stored-markdown-Bp18vrbr.d.ts → stored-markdown.d-Bp18vrbr.d.ts} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { parseAnnotation, parseLayer, emptyLayer, clampRect, isEffectiveRedaction } from './chunk-
|
|
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__ */
|
|
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-
|
|
2413
|
-
//# sourceMappingURL=chunk-
|
|
2467
|
+
//# sourceMappingURL=chunk-S33P6THG.js.map
|
|
2468
|
+
//# sourceMappingURL=chunk-S33P6THG.js.map
|