@arbidocs/react 0.5.19 → 0.5.20
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/{ProductionDialog.d-CttHqQAh.d.ts → ProductionDialog.d-BDJwBSzj.d.ts} +1 -1
- package/dist/{ProductionDialog.d-BD1osHeq.d.cts → ProductionDialog.d-DjRQFmQw.d.cts} +1 -1
- package/dist/annotations/freeze/index.cjs +15 -15
- package/dist/annotations/freeze/index.d.cts +1 -1
- package/dist/annotations/freeze/index.d.ts +1 -1
- package/dist/annotations/freeze/index.js +3 -3
- package/dist/annotations/index.cjs +56 -56
- package/dist/annotations/index.d.cts +5 -5
- package/dist/annotations/index.d.ts +5 -5
- package/dist/annotations/index.js +2 -2
- package/dist/artifacts/index.cjs +10 -10
- package/dist/artifacts/index.js +3 -3
- package/dist/bundle-DCWPYNGD.cjs +14 -0
- package/dist/{bundle-B5AN4B7H.cjs.map → bundle-DCWPYNGD.cjs.map} +1 -1
- package/dist/bundle-JCKKGEJE.js +5 -0
- package/dist/{bundle-4TKU5WEQ.js.map → bundle-JCKKGEJE.js.map} +1 -1
- package/dist/calls/livekit/index.cjs +42 -42
- package/dist/calls/livekit/index.js +3 -3
- package/dist/{chunk-YWYCEEBF.js → chunk-2HVCNYFH.js} +32 -3
- package/dist/chunk-2HVCNYFH.js.map +1 -0
- package/dist/{chunk-NSSGDZSL.cjs → chunk-2IJP73ZG.cjs} +2 -2
- package/dist/{chunk-NSSGDZSL.cjs.map → chunk-2IJP73ZG.cjs.map} +1 -1
- package/dist/{chunk-KFFH2JJM.cjs → chunk-4UDIA47U.cjs} +32 -32
- package/dist/{chunk-KFFH2JJM.cjs.map → chunk-4UDIA47U.cjs.map} +1 -1
- package/dist/{chunk-D63FAYES.js → chunk-A2XSLTIP.js} +5 -5
- package/dist/chunk-A2XSLTIP.js.map +1 -0
- package/dist/{chunk-EYOXZHXM.cjs → chunk-B6I2HRRF.cjs} +9 -9
- package/dist/chunk-B6I2HRRF.cjs.map +1 -0
- package/dist/{chunk-2M4B4FFA.cjs → chunk-CZP7FF3E.cjs} +31 -2
- package/dist/chunk-CZP7FF3E.cjs.map +1 -0
- package/dist/{chunk-GUCQMP6G.js → chunk-DUU537MW.js} +4 -4
- package/dist/{chunk-GUCQMP6G.js.map → chunk-DUU537MW.js.map} +1 -1
- package/dist/{chunk-4VQ3XHAQ.cjs → chunk-DYCONTUK.cjs} +41 -41
- package/dist/{chunk-4VQ3XHAQ.cjs.map → chunk-DYCONTUK.cjs.map} +1 -1
- package/dist/{chunk-CNRF5SLZ.cjs → chunk-FLAZSNC5.cjs} +33 -33
- package/dist/{chunk-CNRF5SLZ.cjs.map → chunk-FLAZSNC5.cjs.map} +1 -1
- package/dist/{chunk-J2GERLMU.js → chunk-LYGJVSNM.js} +3 -3
- package/dist/{chunk-J2GERLMU.js.map → chunk-LYGJVSNM.js.map} +1 -1
- package/dist/{chunk-GN33GLHR.js → chunk-MQ7LZWGP.js} +3 -3
- package/dist/{chunk-GN33GLHR.js.map → chunk-MQ7LZWGP.js.map} +1 -1
- package/dist/{chunk-RG2ZE7DF.js → chunk-PBXJFMES.js} +5 -2
- package/dist/chunk-PBXJFMES.js.map +1 -0
- package/dist/{chunk-H4FGDXYB.cjs → chunk-RRWAX52L.cjs} +5 -2
- package/dist/chunk-RRWAX52L.cjs.map +1 -0
- package/dist/{chunk-ALLWAYMB.cjs → chunk-SUZORMAB.cjs} +157 -65
- package/dist/chunk-SUZORMAB.cjs.map +1 -0
- package/dist/{chunk-XTWUMTCQ.js → chunk-T3USOSVN.js} +2 -2
- package/dist/{chunk-XTWUMTCQ.js.map → chunk-T3USOSVN.js.map} +1 -1
- package/dist/{chunk-2XMHFQ7M.js → chunk-T4CLW3DN.js} +141 -49
- package/dist/chunk-T4CLW3DN.js.map +1 -0
- package/dist/document-tools/index.cjs +174 -69
- package/dist/document-tools/index.cjs.map +1 -1
- package/dist/document-tools/index.d.cts +99 -6
- package/dist/document-tools/index.d.ts +99 -6
- package/dist/document-tools/index.js +107 -10
- package/dist/document-tools/index.js.map +1 -1
- package/dist/index.cjs +855 -746
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +68 -8
- package/dist/index.d.ts +68 -8
- package/dist/index.js +118 -12
- package/dist/index.js.map +1 -1
- package/dist/{model.d-D63gedpb.d.cts → model.d-CNtRWKVK.d.cts} +1 -1
- package/dist/{model.d-D63gedpb.d.ts → model.d-CNtRWKVK.d.ts} +1 -1
- package/dist/{query-keys.d-ClYiYNBR.d.cts → query-keys.d-DM2N5pzN.d.cts} +3 -0
- package/dist/{query-keys.d-ClYiYNBR.d.ts → query-keys.d-DM2N5pzN.d.ts} +3 -0
- package/dist/shell/index.cjs +1 -1
- package/dist/shell/index.js +1 -1
- package/dist/ui/index.cjs +9 -9
- package/dist/ui/index.js +1 -1
- package/package.json +3 -3
- package/dist/bundle-4TKU5WEQ.js +0 -5
- package/dist/bundle-B5AN4B7H.cjs +0 -14
- package/dist/chunk-2M4B4FFA.cjs.map +0 -1
- package/dist/chunk-2XMHFQ7M.js.map +0 -1
- package/dist/chunk-ALLWAYMB.cjs.map +0 -1
- package/dist/chunk-D63FAYES.js.map +0 -1
- package/dist/chunk-EYOXZHXM.cjs.map +0 -1
- package/dist/chunk-H4FGDXYB.cjs.map +0 -1
- package/dist/chunk-RG2ZE7DF.js.map +0 -1
- package/dist/chunk-YWYCEEBF.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk2IJP73ZG_cjs = require('./chunk-2IJP73ZG.cjs');
|
|
4
4
|
var chunkWYZJLZ67_cjs = require('./chunk-WYZJLZ67.cjs');
|
|
5
5
|
var chunkHJDR5HEO_cjs = require('./chunk-HJDR5HEO.cjs');
|
|
6
6
|
var chunkS6A6FSG7_cjs = require('./chunk-S6A6FSG7.cjs');
|
|
@@ -18,7 +18,7 @@ function reduceLayer(layer, action) {
|
|
|
18
18
|
case "replaceAll":
|
|
19
19
|
return action.layer;
|
|
20
20
|
case "add": {
|
|
21
|
-
const annotation =
|
|
21
|
+
const annotation = chunk2IJP73ZG_cjs.parseAnnotation(action.annotation);
|
|
22
22
|
if (layer.annotations.some((a) => a.id === annotation.id)) {
|
|
23
23
|
throw new Error(`annotation ${annotation.id} already exists`);
|
|
24
24
|
}
|
|
@@ -37,7 +37,7 @@ function reduceLayer(layer, action) {
|
|
|
37
37
|
case "update": {
|
|
38
38
|
const found = layer.annotations.find((a) => a.id === action.id);
|
|
39
39
|
if (!found) return layer;
|
|
40
|
-
const next =
|
|
40
|
+
const next = chunk2IJP73ZG_cjs.parseAnnotation({
|
|
41
41
|
...found,
|
|
42
42
|
...action.patch,
|
|
43
43
|
id: found.id,
|
|
@@ -76,7 +76,7 @@ function reduceLayer(layer, action) {
|
|
|
76
76
|
case "reply": {
|
|
77
77
|
const found = layer.annotations.find((a) => a.id === action.id);
|
|
78
78
|
if (!found || found.kind !== "comment") return layer;
|
|
79
|
-
const next =
|
|
79
|
+
const next = chunk2IJP73ZG_cjs.parseAnnotation({
|
|
80
80
|
...found,
|
|
81
81
|
replies: [...found.replies, action.reply],
|
|
82
82
|
updatedAt: action.now
|
|
@@ -146,10 +146,10 @@ function createMemoryStore(now = () => (/* @__PURE__ */ new Date()).toISOString(
|
|
|
146
146
|
return {
|
|
147
147
|
async load(documentId) {
|
|
148
148
|
const raw = layers.get(documentId);
|
|
149
|
-
return raw ?
|
|
149
|
+
return raw ? chunk2IJP73ZG_cjs.parseLayer(JSON.parse(raw)) : chunk2IJP73ZG_cjs.emptyLayer(documentId, now());
|
|
150
150
|
},
|
|
151
151
|
async save(layer) {
|
|
152
|
-
layers.set(layer.documentId, JSON.stringify(
|
|
152
|
+
layers.set(layer.documentId, JSON.stringify(chunk2IJP73ZG_cjs.parseLayer(layer)));
|
|
153
153
|
}
|
|
154
154
|
};
|
|
155
155
|
}
|
|
@@ -159,14 +159,14 @@ function createLocalStorageStore(storage = safeLocalStorage(), now = () => (/* @
|
|
|
159
159
|
async load(documentId) {
|
|
160
160
|
try {
|
|
161
161
|
const raw = storage?.getItem(STORAGE_PREFIX + documentId);
|
|
162
|
-
if (raw) return
|
|
162
|
+
if (raw) return chunk2IJP73ZG_cjs.parseLayer(JSON.parse(raw));
|
|
163
163
|
} catch {
|
|
164
164
|
}
|
|
165
|
-
return
|
|
165
|
+
return chunk2IJP73ZG_cjs.emptyLayer(documentId, now());
|
|
166
166
|
},
|
|
167
167
|
async save(layer) {
|
|
168
168
|
if (!storage) throw new Error("storage is not available");
|
|
169
|
-
storage.setItem(STORAGE_PREFIX + layer.documentId, JSON.stringify(
|
|
169
|
+
storage.setItem(STORAGE_PREFIX + layer.documentId, JSON.stringify(chunk2IJP73ZG_cjs.parseLayer(layer)));
|
|
170
170
|
}
|
|
171
171
|
};
|
|
172
172
|
}
|
|
@@ -269,7 +269,7 @@ function toNorm(r, page) {
|
|
|
269
269
|
const cy1 = Math.min(Math.max(y1, 0), page.height);
|
|
270
270
|
const cx2 = Math.min(Math.max(x2, 0), page.width);
|
|
271
271
|
const cy2 = Math.min(Math.max(y2, 0), page.height);
|
|
272
|
-
return
|
|
272
|
+
return chunk2IJP73ZG_cjs.clampRect({
|
|
273
273
|
x: cx1 / page.width,
|
|
274
274
|
y: cy1 / page.height,
|
|
275
275
|
w: (cx2 - cx1) / page.width,
|
|
@@ -334,14 +334,22 @@ var DRAW_TOOLS = ["box", "comment", "stamp", "redact-area"];
|
|
|
334
334
|
var TEXT_TOOLS = ["highlight", "redact-text"];
|
|
335
335
|
var DEFAULT_SETTINGS = {
|
|
336
336
|
colors: { highlight: "#ffe066", box: "#e03131", stamp: "#c92a2a" },
|
|
337
|
-
stampLabel: "
|
|
337
|
+
stampLabel: "[REDACTED]",
|
|
338
338
|
stampImage: null,
|
|
339
339
|
redactionReason: "Privileged",
|
|
340
340
|
strokeWidth: 2
|
|
341
341
|
};
|
|
342
342
|
var HIGHLIGHT_COLORS = ["#ffe066", "#8ce99a", "#74c0fc", "#ffa8a8", "#eebefa"];
|
|
343
343
|
var MARK_COLORS = ["#e03131", "#1c7ed6", "#2f9e44", "#f08c00", "#000000"];
|
|
344
|
-
var STAMP_PRESETS = [
|
|
344
|
+
var STAMP_PRESETS = [
|
|
345
|
+
"[REDACTED]",
|
|
346
|
+
"CONFIDENTIAL",
|
|
347
|
+
"DRAFT",
|
|
348
|
+
"APPROVED",
|
|
349
|
+
"FILED",
|
|
350
|
+
"PRIVILEGED",
|
|
351
|
+
"COPY"
|
|
352
|
+
];
|
|
345
353
|
var REDACTION_REASONS = [
|
|
346
354
|
"Privileged",
|
|
347
355
|
"Confidential",
|
|
@@ -384,7 +392,7 @@ function useAnnotationLayer({
|
|
|
384
392
|
makeId = defaultId
|
|
385
393
|
}) {
|
|
386
394
|
const [history, setHistory] = react.useState(
|
|
387
|
-
() => createHistory(
|
|
395
|
+
() => createHistory(chunk2IJP73ZG_cjs.emptyLayer(documentId, now()))
|
|
388
396
|
);
|
|
389
397
|
const [savedLayer, setSavedLayer] = react.useState(null);
|
|
390
398
|
const [status, setStatus] = react.useState("loading");
|
|
@@ -435,7 +443,7 @@ function useAnnotationLayer({
|
|
|
435
443
|
setSavedLayer(null);
|
|
436
444
|
setStoreReadOnly(false);
|
|
437
445
|
savedRef.current = null;
|
|
438
|
-
commit(createHistory(
|
|
446
|
+
commit(createHistory(chunk2IJP73ZG_cjs.emptyLayer(documentId, nowRef.current())));
|
|
439
447
|
storeRef.current.load(documentId).then((layer) => {
|
|
440
448
|
if (cancelled) return;
|
|
441
449
|
savedRef.current = layer;
|
|
@@ -879,7 +887,7 @@ function dragRect(origin, mode, dx, dy) {
|
|
|
879
887
|
const x2 = Math.min(Math.max(Math.max(left2, right), 0), 1);
|
|
880
888
|
const y1 = Math.min(Math.max(Math.min(top2, bottom), 0), 1);
|
|
881
889
|
const y2 = Math.min(Math.max(Math.max(top2, bottom), 0), 1);
|
|
882
|
-
return
|
|
890
|
+
return chunk2IJP73ZG_cjs.clampRect({
|
|
883
891
|
x: x1,
|
|
884
892
|
y: y1,
|
|
885
893
|
w: Math.max(x2 - x1, MIN_MARK),
|
|
@@ -996,7 +1004,7 @@ function AnnotationPageOverlay({
|
|
|
996
1004
|
const id = controller.add({
|
|
997
1005
|
kind: "stamp",
|
|
998
1006
|
page: pageNumber,
|
|
999
|
-
rect:
|
|
1007
|
+
rect: chunk2IJP73ZG_cjs.clampRect({ x: a.x / page.width - w / 2, y: a.y / page.height - h / 2, w, h }),
|
|
1000
1008
|
label,
|
|
1001
1009
|
color: "#0d1a59",
|
|
1002
1010
|
image
|
|
@@ -1005,7 +1013,7 @@ function AnnotationPageOverlay({
|
|
|
1005
1013
|
controller.setTool("select");
|
|
1006
1014
|
if (id) controller.select(id);
|
|
1007
1015
|
} else if (tool === "stamp") {
|
|
1008
|
-
const placed = isTooSmall(rect) ?
|
|
1016
|
+
const placed = isTooSmall(rect) ? chunk2IJP73ZG_cjs.clampRect({
|
|
1009
1017
|
x: a.x / page.width - DEFAULT_STAMP.w / 2,
|
|
1010
1018
|
y: a.y / page.height - DEFAULT_STAMP.h / 2,
|
|
1011
1019
|
...DEFAULT_STAMP
|
|
@@ -1018,7 +1026,7 @@ function AnnotationPageOverlay({
|
|
|
1018
1026
|
color: settings.colors.stamp
|
|
1019
1027
|
});
|
|
1020
1028
|
} else if (tool === "comment") {
|
|
1021
|
-
const anchor =
|
|
1029
|
+
const anchor = chunk2IJP73ZG_cjs.clampRect({
|
|
1022
1030
|
x: a.x / page.width,
|
|
1023
1031
|
y: a.y / page.height,
|
|
1024
1032
|
w: COMMENT_ICON_PX / page.width,
|
|
@@ -1336,7 +1344,7 @@ function RedactionView({
|
|
|
1336
1344
|
const rects = rectOverride ? [rectOverride] : a.rects;
|
|
1337
1345
|
const approved = a.status === "approved";
|
|
1338
1346
|
const rejected = a.status === "rejected";
|
|
1339
|
-
const label = `Redaction (${a.status}): ${a.reason}`;
|
|
1347
|
+
const label = `Redaction (${a.status}, not applied): ${a.reason}`;
|
|
1340
1348
|
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: rects.map((r, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1341
1349
|
"div",
|
|
1342
1350
|
{
|
|
@@ -1358,7 +1366,7 @@ function RedactionView({
|
|
|
1358
1366
|
color: "#c92a2a"
|
|
1359
1367
|
}
|
|
1360
1368
|
},
|
|
1361
|
-
children: i === 0 && !rejected && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate px-1", children:
|
|
1369
|
+
children: i === 0 && !rejected && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate px-1", children: "[REDACTED]" })
|
|
1362
1370
|
},
|
|
1363
1371
|
i
|
|
1364
1372
|
)) });
|
|
@@ -1776,9 +1784,13 @@ function AnnotationToolbar({
|
|
|
1776
1784
|
}) {
|
|
1777
1785
|
useTextSelectionMarks(controller);
|
|
1778
1786
|
useAnnotationShortcuts(controller);
|
|
1787
|
+
const [reviewing, setReviewing] = react.useState(false);
|
|
1779
1788
|
const { tool, settings } = controller;
|
|
1780
1789
|
const pending = pendingRedactions(controller.layer);
|
|
1781
|
-
const
|
|
1790
|
+
const redactions = controller.layer.annotations.filter((a) => a.kind === "redaction");
|
|
1791
|
+
const redactionCount = redactions.length;
|
|
1792
|
+
const approved = redactions.filter((a) => a.status === "approved").length;
|
|
1793
|
+
const rejected = redactions.filter((a) => a.status === "rejected").length;
|
|
1782
1794
|
const colored = tool === "highlight" || tool === "box" || tool === "stamp";
|
|
1783
1795
|
const redacting = tool === "redact-text" || tool === "redact-area";
|
|
1784
1796
|
const status = layerStatusText(controller);
|
|
@@ -1799,7 +1811,11 @@ function AnnotationToolbar({
|
|
|
1799
1811
|
redactionCount > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 text-sm", "data-testid": "annotation-review", children: [
|
|
1800
1812
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "rounded-md bg-muted px-2 py-1", "data-testid": "annotation-pending-count", children: [
|
|
1801
1813
|
pending.length,
|
|
1802
|
-
" pending"
|
|
1814
|
+
" pending \xB7 ",
|
|
1815
|
+
approved,
|
|
1816
|
+
" approved, not applied \xB7 ",
|
|
1817
|
+
rejected,
|
|
1818
|
+
" rejected"
|
|
1803
1819
|
] }),
|
|
1804
1820
|
editable && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1805
1821
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1911,7 +1927,7 @@ function AnnotationToolbar({
|
|
|
1911
1927
|
editable && tool === "stamp" && settings.stampImage && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-xs text-muted-foreground", "data-testid": "annotation-place-signature", children: [
|
|
1912
1928
|
"Click where your ",
|
|
1913
1929
|
settings.stampImage.label.toLowerCase(),
|
|
1914
|
-
" goes.
|
|
1930
|
+
" goes."
|
|
1915
1931
|
] }),
|
|
1916
1932
|
editable && tool === "stamp" && !settings.stampImage && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1917
1933
|
PresetField,
|
|
@@ -1925,12 +1941,98 @@ function AnnotationToolbar({
|
|
|
1925
1941
|
onChange: (stampLabel) => controller.setSettings({ stampLabel })
|
|
1926
1942
|
}
|
|
1927
1943
|
),
|
|
1928
|
-
(redacting || redactionCount > 0) && /* @__PURE__ */ jsxRuntime.
|
|
1944
|
+
(redacting || redactionCount > 0) && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1929
1945
|
"div",
|
|
1930
1946
|
{
|
|
1931
1947
|
className: "flex w-full flex-wrap items-center gap-x-3 gap-y-2",
|
|
1932
1948
|
"data-testid": "annotation-redaction-row",
|
|
1933
|
-
children:
|
|
1949
|
+
children: [
|
|
1950
|
+
redactionControls,
|
|
1951
|
+
redactionCount > 0 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1952
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1953
|
+
chunkWYZJLZ67_cjs.Button,
|
|
1954
|
+
{
|
|
1955
|
+
type: "button",
|
|
1956
|
+
size: "sm",
|
|
1957
|
+
variant: "outline",
|
|
1958
|
+
onClick: () => setReviewing((on) => !on),
|
|
1959
|
+
"aria-expanded": reviewing,
|
|
1960
|
+
"data-testid": "annotation-review-toggle",
|
|
1961
|
+
children: "Review redactions"
|
|
1962
|
+
}
|
|
1963
|
+
),
|
|
1964
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1965
|
+
"p",
|
|
1966
|
+
{
|
|
1967
|
+
className: "w-full text-xs text-amber-700 dark:text-amber-400",
|
|
1968
|
+
role: "status",
|
|
1969
|
+
"data-testid": "annotation-preview-warning",
|
|
1970
|
+
children: "Preview only: black boxes, including approved ones, have not removed the underlying content. Apply approved redactions to create a redacted copy."
|
|
1971
|
+
}
|
|
1972
|
+
)
|
|
1973
|
+
] })
|
|
1974
|
+
]
|
|
1975
|
+
}
|
|
1976
|
+
),
|
|
1977
|
+
reviewing && redactionCount > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1978
|
+
"div",
|
|
1979
|
+
{
|
|
1980
|
+
className: "max-h-64 w-full overflow-auto rounded border",
|
|
1981
|
+
"data-testid": "annotation-redaction-review-list",
|
|
1982
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("table", { className: "w-full text-left text-sm", children: [
|
|
1983
|
+
/* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
|
|
1984
|
+
/* @__PURE__ */ jsxRuntime.jsx("th", { className: "p-2", children: "Page" }),
|
|
1985
|
+
/* @__PURE__ */ jsxRuntime.jsx("th", { children: "Reason" }),
|
|
1986
|
+
/* @__PURE__ */ jsxRuntime.jsx("th", { children: "Review status" }),
|
|
1987
|
+
/* @__PURE__ */ jsxRuntime.jsx("th", { children: "Decision" })
|
|
1988
|
+
] }) }),
|
|
1989
|
+
/* @__PURE__ */ jsxRuntime.jsx("tbody", { children: redactions.map((a) => /* @__PURE__ */ jsxRuntime.jsxs("tr", { className: "border-t", "data-testid": `redaction-review-${a.id}`, children: [
|
|
1990
|
+
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "p-2", children: /* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", onClick: () => controller.select(a.id), children: [
|
|
1991
|
+
"Page ",
|
|
1992
|
+
a.page
|
|
1993
|
+
] }) }),
|
|
1994
|
+
/* @__PURE__ */ jsxRuntime.jsx("td", { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1995
|
+
"input",
|
|
1996
|
+
{
|
|
1997
|
+
"aria-label": `Reason for redaction ${a.id}`,
|
|
1998
|
+
value: a.reason,
|
|
1999
|
+
disabled: !editable,
|
|
2000
|
+
className: "rounded border bg-background px-2 py-1",
|
|
2001
|
+
onChange: (e) => controller.update(a.id, {
|
|
2002
|
+
reason: e.target.value,
|
|
2003
|
+
status: "pending",
|
|
2004
|
+
reviewedBy: void 0,
|
|
2005
|
+
reviewedAt: void 0
|
|
2006
|
+
})
|
|
2007
|
+
}
|
|
2008
|
+
) }),
|
|
2009
|
+
/* @__PURE__ */ jsxRuntime.jsx("td", { children: a.status === "approved" ? "Approved \xB7 not applied" : a.status }),
|
|
2010
|
+
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "flex gap-1 p-2", children: editable && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2011
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2012
|
+
chunkWYZJLZ67_cjs.Button,
|
|
2013
|
+
{
|
|
2014
|
+
type: "button",
|
|
2015
|
+
size: "sm",
|
|
2016
|
+
variant: "outline",
|
|
2017
|
+
disabled: a.status === "approved",
|
|
2018
|
+
onClick: () => controller.setRedactionStatus([a.id], "approved"),
|
|
2019
|
+
children: "Approve"
|
|
2020
|
+
}
|
|
2021
|
+
),
|
|
2022
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2023
|
+
chunkWYZJLZ67_cjs.Button,
|
|
2024
|
+
{
|
|
2025
|
+
type: "button",
|
|
2026
|
+
size: "sm",
|
|
2027
|
+
variant: "outline",
|
|
2028
|
+
disabled: a.status === "rejected",
|
|
2029
|
+
onClick: () => controller.setRedactionStatus([a.id], "rejected"),
|
|
2030
|
+
children: "Reject"
|
|
2031
|
+
}
|
|
2032
|
+
)
|
|
2033
|
+
] }) })
|
|
2034
|
+
] }, a.id)) })
|
|
2035
|
+
] })
|
|
1934
2036
|
}
|
|
1935
2037
|
),
|
|
1936
2038
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-full items-center justify-end gap-3 text-xs text-muted-foreground", children: [
|
|
@@ -1946,10 +2048,21 @@ function AnnotationToolbar({
|
|
|
1946
2048
|
}
|
|
1947
2049
|
),
|
|
1948
2050
|
actions,
|
|
1949
|
-
onFreeze && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
2051
|
+
onFreeze && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2052
|
+
chunkWYZJLZ67_cjs.Button,
|
|
2053
|
+
{
|
|
2054
|
+
type: "button",
|
|
2055
|
+
size: "sm",
|
|
2056
|
+
"data-testid": "annotation-freeze",
|
|
2057
|
+
onClick: onFreeze,
|
|
2058
|
+
disabled: pending.length > 0,
|
|
2059
|
+
title: pending.length ? "Approve or reject each proposed redaction first" : void 0,
|
|
2060
|
+
children: [
|
|
2061
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.EyeOff, { size: 14 }),
|
|
2062
|
+
redactionCount ? "Apply approved redactions" : "Create annotated copy"
|
|
2063
|
+
]
|
|
2064
|
+
}
|
|
2065
|
+
)
|
|
1953
2066
|
] })
|
|
1954
2067
|
]
|
|
1955
2068
|
}
|
|
@@ -1973,25 +2086,24 @@ function FreezeDialog({
|
|
|
1973
2086
|
}) {
|
|
1974
2087
|
const [mode, setMode] = react.useState("vector");
|
|
1975
2088
|
const [comments, setComments] = react.useState("omit");
|
|
1976
|
-
const [burnPending, setBurnPending] = react.useState(false);
|
|
1977
2089
|
const [redactionLog, setRedactionLog] = react.useState(true);
|
|
1978
2090
|
const marks = controller.layer.annotations;
|
|
1979
|
-
const redactions = marks.filter(
|
|
2091
|
+
const redactions = marks.filter(chunk2IJP73ZG_cjs.isEffectiveRedaction);
|
|
1980
2092
|
const pending = pendingRedactions(controller.layer);
|
|
1981
2093
|
const hasRedactionMarks = marks.some((a) => a.kind === "redaction");
|
|
1982
2094
|
const forced = redactions.length > 0;
|
|
1983
2095
|
const effectiveMode = forced ? "image" : mode;
|
|
1984
|
-
const blocked = pending.length > 0
|
|
2096
|
+
const blocked = pending.length > 0;
|
|
1985
2097
|
const counts = Object.keys(KIND_LABELS).map(
|
|
1986
2098
|
(k) => [
|
|
1987
2099
|
k,
|
|
1988
|
-
marks.filter((a) => a.kind === k && (k !== "redaction" ||
|
|
2100
|
+
marks.filter((a) => a.kind === k && (k !== "redaction" || chunk2IJP73ZG_cjs.isEffectiveRedaction(a))).length
|
|
1989
2101
|
]
|
|
1990
2102
|
).filter(([, n]) => n > 0);
|
|
1991
2103
|
return /* @__PURE__ */ jsxRuntime.jsx(chunkWYZJLZ67_cjs.Dialog, { open, onOpenChange: (next) => !busy && onOpenChange(next), children: /* @__PURE__ */ jsxRuntime.jsxs(chunkWYZJLZ67_cjs.DialogContent, { "data-testid": "freeze-dialog", children: [
|
|
1992
2104
|
/* @__PURE__ */ jsxRuntime.jsxs(chunkWYZJLZ67_cjs.DialogHeader, { children: [
|
|
1993
|
-
/* @__PURE__ */ jsxRuntime.jsx(chunkWYZJLZ67_cjs.DialogTitle, { children: "
|
|
1994
|
-
/* @__PURE__ */ jsxRuntime.jsx(chunkWYZJLZ67_cjs.DialogDescription, { children: "
|
|
2105
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkWYZJLZ67_cjs.DialogTitle, { children: hasRedactionMarks ? "Apply approved redactions" : "Create annotated copy" }),
|
|
2106
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkWYZJLZ67_cjs.DialogDescription, { children: "Approval records your review decision. Applying permanently removes the covered content from a new redacted copy. The original remains in your files." })
|
|
1995
2107
|
] }),
|
|
1996
2108
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", "data-testid": "freeze-summary", children: counts.length === 0 ? "No annotations yet." : counts.map(([k, n]) => `${n} ${KIND_LABELS[k]}`).join(", ") }),
|
|
1997
2109
|
/* @__PURE__ */ jsxRuntime.jsxs("fieldset", { className: "space-y-2 text-sm", disabled: busy, children: [
|
|
@@ -2050,32 +2162,12 @@ function FreezeDialog({
|
|
|
2050
2162
|
)
|
|
2051
2163
|
] }),
|
|
2052
2164
|
forced && comments !== "omit" && marks.some((a) => a.kind === "comment") && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-destructive", "data-testid": "freeze-comment-warning", children: "Comments are copied as written and may repeat text you have redacted." }),
|
|
2053
|
-
pending.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2060
|
-
"input",
|
|
2061
|
-
{
|
|
2062
|
-
type: "checkbox",
|
|
2063
|
-
"data-testid": "freeze-burn-pending",
|
|
2064
|
-
checked: burnPending,
|
|
2065
|
-
disabled: busy,
|
|
2066
|
-
onChange: (e) => setBurnPending(e.target.checked)
|
|
2067
|
-
}
|
|
2068
|
-
),
|
|
2069
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
2070
|
-
pending.length,
|
|
2071
|
-
" redaction",
|
|
2072
|
-
pending.length === 1 ? " has" : "s have",
|
|
2073
|
-
" not been reviewed",
|
|
2074
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "block text-xs text-muted-foreground", children: "Tick to redact them as well, or approve or reject them first." })
|
|
2075
|
-
] })
|
|
2076
|
-
]
|
|
2077
|
-
}
|
|
2078
|
-
),
|
|
2165
|
+
pending.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "rounded border p-2 text-sm", "data-testid": "freeze-pending", children: [
|
|
2166
|
+
pending.length,
|
|
2167
|
+
" redaction",
|
|
2168
|
+
pending.length === 1 ? " has" : "s have",
|
|
2169
|
+
" not been reviewed. Approve or reject each one before applying redactions."
|
|
2170
|
+
] }),
|
|
2079
2171
|
hasRedactionMarks && /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "flex items-start gap-2 text-sm", children: [
|
|
2080
2172
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2081
2173
|
"input",
|
|
@@ -2120,10 +2212,10 @@ function FreezeDialog({
|
|
|
2120
2212
|
onClick: () => onConfirm({
|
|
2121
2213
|
mode: effectiveMode,
|
|
2122
2214
|
comments,
|
|
2123
|
-
pendingRedactions:
|
|
2215
|
+
pendingRedactions: "error",
|
|
2124
2216
|
redactionLog: hasRedactionMarks && redactionLog
|
|
2125
2217
|
}),
|
|
2126
|
-
children: busy ? "
|
|
2218
|
+
children: busy ? "Creating copy\u2026" : hasRedactionMarks ? "Apply redactions and create copy" : "Create annotated copy"
|
|
2127
2219
|
}
|
|
2128
2220
|
)
|
|
2129
2221
|
] })
|
|
@@ -2511,5 +2603,5 @@ exports.undo = undo;
|
|
|
2511
2603
|
exports.useAnnotationLayer = useAnnotationLayer;
|
|
2512
2604
|
exports.useAnnotationShortcuts = useAnnotationShortcuts;
|
|
2513
2605
|
exports.useTextSelectionMarks = useTextSelectionMarks;
|
|
2514
|
-
//# sourceMappingURL=chunk-
|
|
2515
|
-
//# sourceMappingURL=chunk-
|
|
2606
|
+
//# sourceMappingURL=chunk-SUZORMAB.cjs.map
|
|
2607
|
+
//# sourceMappingURL=chunk-SUZORMAB.cjs.map
|