@arbidocs/react 0.4.61 → 0.4.62

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.
@@ -1,9 +1,9 @@
1
1
  import { Button, Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter } from '../chunk-QS3Q5542.js';
2
2
  import { cn } from '../chunk-SN5YV6FF.js';
3
- import { parseAnnotation, parseLayer, emptyLayer, clampRect, isEffectiveRedaction } from '../chunk-JWXIRUWN.js';
4
- export { AnnotationLayerError, LAYER_SCHEMA_VERSION, annotationRects, clampRect, emptyLayer, isEffectiveRedaction, parseAnnotation, parseLayer } from '../chunk-JWXIRUWN.js';
3
+ import { parseAnnotation, parseLayer, emptyLayer, clampRect, isEffectiveRedaction } from '../chunk-COWZGCL5.js';
4
+ export { AnnotationLayerError, LAYER_SCHEMA_VERSION, annotationRects, clampRect, emptyLayer, isEffectiveRedaction, parseAnnotation, parseLayer } from '../chunk-COWZGCL5.js';
5
5
  import { useState, useRef, useCallback, useEffect, useMemo, useLayoutEffect } from 'react';
6
- import { MessageSquare, Check, X, RotateCcw, Trash2, Send, Undo2, Redo2, Snowflake, MousePointer2, Highlighter, Square, Stamp, ScanText, EyeOff } from 'lucide-react';
6
+ import { MessageSquare, Check, X, RotateCcw, Trash2, Send, Undo2, Redo2, Snowflake, GripVertical, ChevronUp, ChevronDown, MousePointer2, Highlighter, Square, Stamp, ScanText, EyeOff } from 'lucide-react';
7
7
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
8
8
 
9
9
  // src/annotations/state.ts
@@ -60,7 +60,14 @@ function reduceLayer(layer, action) {
60
60
  const annotations = layer.annotations.map((a) => {
61
61
  if (a.kind !== "redaction" || !ids.has(a.id) || a.status === action.status) return a;
62
62
  changed = true;
63
- return { ...a, status: action.status, updatedAt: action.now };
63
+ const next = { ...a, status: action.status, updatedAt: action.now };
64
+ delete next.reviewedBy;
65
+ delete next.reviewedAt;
66
+ if (action.status !== "pending" && action.by) {
67
+ next.reviewedBy = action.by;
68
+ next.reviewedAt = action.now;
69
+ }
70
+ return next;
64
71
  });
65
72
  return changed ? { ...layer, annotations, updatedAt: action.now } : layer;
66
73
  }
@@ -163,6 +170,35 @@ function safeLocalStorage() {
163
170
  }
164
171
  }
165
172
 
173
+ // src/annotations/redaction-log.ts
174
+ var REDACTION_LOG_COLUMNS = ["page", "reason", "status", "approved_by", "time"];
175
+ var STATUS = {
176
+ approved: "redacted (approved)",
177
+ pending: "redacted (not reviewed)",
178
+ rejected: "not redacted (rejected)"
179
+ };
180
+ var top = (a) => Math.min(...a.rects.map((r) => r.y));
181
+ var left = (a) => Math.min(...a.rects.map((r) => r.x));
182
+ function redactionLogRows(layer) {
183
+ return layer.annotations.filter((a) => a.kind === "redaction").sort((a, b) => a.page - b.page || top(a) - top(b) || left(a) - left(b)).map((a) => ({
184
+ page: a.page,
185
+ reason: a.reason,
186
+ status: STATUS[a.status],
187
+ approvedBy: a.status === "approved" ? a.reviewedBy ?? "" : "",
188
+ time: a.reviewedAt ?? a.createdAt
189
+ }));
190
+ }
191
+ var cell = (value) => {
192
+ const text = String(value);
193
+ return `"${(/^[=+\-@]/.test(text) ? `'${text}` : text).replace(/"/g, '""')}"`;
194
+ };
195
+ function redactionLogCsv(layer) {
196
+ const rows = redactionLogRows(layer).map(
197
+ (r) => [r.page, r.reason, r.status, r.approvedBy, r.time].map(cell).join(",")
198
+ );
199
+ return [REDACTION_LOG_COLUMNS.join(","), ...rows].join("\r\n") + "\r\n";
200
+ }
201
+
166
202
  // src/annotations/geometry.ts
167
203
  var MIN_MARK_FRACTION = 4e-3;
168
204
  function toNorm(r, page) {
@@ -222,9 +258,9 @@ function mergeLineRects(input, gap = 2) {
222
258
  for (const r of line.slice(1)) {
223
259
  if (r.x <= cur.x + cur.width + gap) {
224
260
  const right = Math.max(cur.x + cur.width, r.x + r.width);
225
- const top = Math.min(cur.y, r.y);
261
+ const top2 = Math.min(cur.y, r.y);
226
262
  const bottom = Math.max(cur.y + cur.height, r.y + r.height);
227
- cur = { x: cur.x, y: top, width: right - cur.x, height: bottom - top };
263
+ cur = { x: cur.x, y: top2, width: right - cur.x, height: bottom - top2 };
228
264
  } else {
229
265
  out.push(cur);
230
266
  cur = { ...r };
@@ -403,7 +439,13 @@ function useAnnotationLayer({
403
439
  },
404
440
  update: (id, patch) => void dispatch({ type: "update", id, patch, now: nowRef.current() }),
405
441
  remove: (id) => void dispatch({ type: "remove", id, now: nowRef.current() }),
406
- setRedactionStatus: (ids, next) => void dispatch({ type: "setRedactionStatus", ids, status: next, now: nowRef.current() }),
442
+ setRedactionStatus: (ids, next) => void dispatch({
443
+ type: "setRedactionStatus",
444
+ ids,
445
+ status: next,
446
+ now: nowRef.current(),
447
+ by: author
448
+ }),
407
449
  reply: (id, body) => {
408
450
  const t = nowRef.current();
409
451
  void dispatch({
@@ -612,18 +654,18 @@ function dragRect(origin, mode, dx, dy) {
612
654
  y: Math.min(Math.max(origin.y + dy, 0), 1 - origin.h)
613
655
  };
614
656
  }
615
- let left = origin.x;
657
+ let left2 = origin.x;
616
658
  let right = origin.x + origin.w;
617
- let top = origin.y;
659
+ let top2 = origin.y;
618
660
  let bottom = origin.y + origin.h;
619
- if (mode.includes("w")) left += dx;
661
+ if (mode.includes("w")) left2 += dx;
620
662
  else right += dx;
621
- if (mode.includes("n")) top += dy;
663
+ if (mode.includes("n")) top2 += dy;
622
664
  else bottom += dy;
623
- const x1 = Math.min(Math.max(Math.min(left, right), 0), 1);
624
- const x2 = Math.min(Math.max(Math.max(left, right), 0), 1);
625
- const y1 = Math.min(Math.max(Math.min(top, bottom), 0), 1);
626
- const y2 = Math.min(Math.max(Math.max(top, bottom), 0), 1);
665
+ const x1 = Math.min(Math.max(Math.min(left2, right), 0), 1);
666
+ const x2 = Math.min(Math.max(Math.max(left2, right), 0), 1);
667
+ const y1 = Math.min(Math.max(Math.min(top2, bottom), 0), 1);
668
+ const y2 = Math.min(Math.max(Math.max(top2, bottom), 0), 1);
627
669
  return clampRect({
628
670
  x: x1,
629
671
  y: y1,
@@ -1561,9 +1603,11 @@ function FreezeDialog({
1561
1603
  const [mode, setMode] = useState("vector");
1562
1604
  const [comments, setComments] = useState("omit");
1563
1605
  const [burnPending, setBurnPending] = useState(false);
1606
+ const [redactionLog, setRedactionLog] = useState(true);
1564
1607
  const marks = controller.layer.annotations;
1565
1608
  const redactions = marks.filter(isEffectiveRedaction);
1566
1609
  const pending = pendingRedactions(controller.layer);
1610
+ const hasRedactionMarks = marks.some((a) => a.kind === "redaction");
1567
1611
  const forced = redactions.length > 0;
1568
1612
  const effectiveMode = forced ? "image" : mode;
1569
1613
  const blocked = pending.length > 0 && !burnPending;
@@ -1576,7 +1620,7 @@ function FreezeDialog({
1576
1620
  return /* @__PURE__ */ jsx(Dialog, { open, onOpenChange: (next) => !busy && onOpenChange(next), children: /* @__PURE__ */ jsxs(DialogContent, { "data-testid": "freeze-dialog", children: [
1577
1621
  /* @__PURE__ */ jsxs(DialogHeader, { children: [
1578
1622
  /* @__PURE__ */ jsx(DialogTitle, { children: "Freeze a copy" }),
1579
- /* @__PURE__ */ jsx(DialogDescription, { children: "Creates a new document with your annotations built in. The original is never changed." })
1623
+ /* @__PURE__ */ jsx(DialogDescription, { children: "Saves a separate document with your annotations built in, next to the original. The original stays as it is." })
1580
1624
  ] }),
1581
1625
  /* @__PURE__ */ 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(", ") }),
1582
1626
  /* @__PURE__ */ jsxs("fieldset", { className: "space-y-2 text-sm", disabled: busy, children: [
@@ -1661,6 +1705,22 @@ function FreezeDialog({
1661
1705
  ]
1662
1706
  }
1663
1707
  ),
1708
+ hasRedactionMarks && /* @__PURE__ */ jsxs("label", { className: "flex items-start gap-2 text-sm", children: [
1709
+ /* @__PURE__ */ jsx(
1710
+ "input",
1711
+ {
1712
+ type: "checkbox",
1713
+ "data-testid": "freeze-redaction-log",
1714
+ checked: redactionLog,
1715
+ disabled: busy,
1716
+ onChange: (e) => setRedactionLog(e.target.checked)
1717
+ }
1718
+ ),
1719
+ /* @__PURE__ */ jsxs("span", { children: [
1720
+ "Download a redaction log (CSV)",
1721
+ /* @__PURE__ */ jsx("span", { className: "block text-xs text-muted-foreground", children: "Page, reason, status, who approved it and when. Never the redacted text." })
1722
+ ] })
1723
+ ] }),
1664
1724
  busy && progress && /* @__PURE__ */ jsxs("p", { className: "text-sm", role: "status", "data-testid": "freeze-progress", children: [
1665
1725
  "Page ",
1666
1726
  progress.done,
@@ -1689,7 +1749,8 @@ function FreezeDialog({
1689
1749
  onClick: () => onConfirm({
1690
1750
  mode: effectiveMode,
1691
1751
  comments,
1692
- pendingRedactions: burnPending ? "burn" : "error"
1752
+ pendingRedactions: burnPending ? "burn" : "error",
1753
+ redactionLog: hasRedactionMarks && redactionLog
1693
1754
  }),
1694
1755
  children: busy ? "Freezing\u2026" : "Freeze"
1695
1756
  }
@@ -1697,7 +1758,342 @@ function FreezeDialog({
1697
1758
  ] })
1698
1759
  ] }) });
1699
1760
  }
1761
+ var MAX_PREFIX = 24;
1762
+ function previewLabel(choices) {
1763
+ return `${choices.prefix}${String(choices.start).padStart(choices.digits, "0")}`;
1764
+ }
1765
+ function qrCornerFor(corner) {
1766
+ return corner.endsWith("left") ? "bottom-right" : "bottom-left";
1767
+ }
1768
+ function moveItem(items, from, to) {
1769
+ if (from === to || from < 0 || to < 0 || from >= items.length || to >= items.length)
1770
+ return [...items];
1771
+ const next = [...items];
1772
+ const [moved] = next.splice(from, 1);
1773
+ next.splice(to, 0, moved);
1774
+ return next;
1775
+ }
1776
+ function ProductionDialog({
1777
+ open,
1778
+ onOpenChange,
1779
+ documents,
1780
+ leftOut = [],
1781
+ onConfirm,
1782
+ busy,
1783
+ progress,
1784
+ error
1785
+ }) {
1786
+ const [layout, setLayout] = useState("merged");
1787
+ const [prefix, setPrefix] = useState("");
1788
+ const [start, setStart] = useState(1);
1789
+ const [digits, setDigits] = useState(6);
1790
+ const [corner, setCorner] = useState("bottom-right");
1791
+ const [qr, setQr] = useState(false);
1792
+ const [indexPage, setIndexPage] = useState(false);
1793
+ const [saveToWorkspace, setSaveToWorkspace] = useState(true);
1794
+ const documentKey = documents.map((d) => d.id).join("|");
1795
+ const [ordered, setOrdered] = useState(documents);
1796
+ useEffect(() => setOrdered(documents), [documentKey]);
1797
+ const listRef = useRef(null);
1798
+ const [dragFrom, setDragFrom] = useState(null);
1799
+ const focusAfterMove = useRef(null);
1800
+ useEffect(() => {
1801
+ const pending = focusAfterMove.current;
1802
+ focusAfterMove.current = null;
1803
+ if (!pending || !listRef.current) return;
1804
+ const button = (arrow) => listRef.current?.querySelector(
1805
+ `[data-testid="production-move-${arrow}-${pending.index}"]:not(:disabled)`
1806
+ );
1807
+ (button(pending.arrow) ?? button(pending.arrow === "up" ? "down" : "up"))?.focus();
1808
+ }, [ordered]);
1809
+ const move = (from, to, arrow) => {
1810
+ if (arrow) focusAfterMove.current = { index: to, arrow };
1811
+ setOrdered((items) => moveItem(items, from, to));
1812
+ };
1813
+ const onDrop = (to) => (e) => {
1814
+ e.preventDefault();
1815
+ if (dragFrom !== null) move(dragFrom, to);
1816
+ setDragFrom(null);
1817
+ };
1818
+ const valid = Number.isInteger(start) && start >= 0 && Number.isInteger(digits) && digits >= 1 && digits <= 12;
1819
+ return /* @__PURE__ */ jsx(Dialog, { open, onOpenChange: (next) => !busy && onOpenChange(next), children: /* @__PURE__ */ jsxs(DialogContent, { "data-testid": "production-dialog", className: "max-h-[90dvh] overflow-y-auto", children: [
1820
+ /* @__PURE__ */ jsxs(DialogHeader, { children: [
1821
+ /* @__PURE__ */ jsx(DialogTitle, { children: "Production set" }),
1822
+ /* @__PURE__ */ jsx(DialogDescription, { children: "Numbers every page with a Bates label, in the order shown. The originals are never changed; the result is downloaded and, if you choose, saved to the workspace." })
1823
+ ] }),
1824
+ /* @__PURE__ */ jsxs("p", { className: "text-sm text-muted-foreground", "data-testid": "production-summary", children: [
1825
+ documents.length,
1826
+ " document",
1827
+ documents.length === 1 ? "" : "s",
1828
+ ", numbered in this order.",
1829
+ ordered.length > 1 ? " Drag a row or use its arrows to reorder." : ""
1830
+ ] }),
1831
+ /* @__PURE__ */ jsx(
1832
+ "ol",
1833
+ {
1834
+ ref: listRef,
1835
+ className: "max-h-48 space-y-1 overflow-y-auto text-sm",
1836
+ "data-testid": "production-order",
1837
+ "aria-label": "Numbering order",
1838
+ children: ordered.map((doc, i) => /* @__PURE__ */ jsxs(
1839
+ "li",
1840
+ {
1841
+ draggable: !busy,
1842
+ onDragStart: () => setDragFrom(i),
1843
+ onDragOver: (e) => e.preventDefault(),
1844
+ onDrop: onDrop(i),
1845
+ onDragEnd: () => setDragFrom(null),
1846
+ className: `flex items-center gap-1 rounded-md border border-border px-2 py-1 ${dragFrom === i ? "opacity-50" : ""}`,
1847
+ "data-testid": `production-order-item-${i}`,
1848
+ "data-document-id": doc.id,
1849
+ children: [
1850
+ /* @__PURE__ */ jsx(
1851
+ GripVertical,
1852
+ {
1853
+ className: "size-4 shrink-0 cursor-grab text-muted-foreground",
1854
+ "aria-hidden": true
1855
+ }
1856
+ ),
1857
+ /* @__PURE__ */ jsxs("span", { className: "w-6 shrink-0 text-right tabular-nums text-muted-foreground", children: [
1858
+ i + 1,
1859
+ "."
1860
+ ] }),
1861
+ /* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate", title: doc.name, children: doc.name }),
1862
+ /* @__PURE__ */ jsx(
1863
+ Button,
1864
+ {
1865
+ type: "button",
1866
+ variant: "ghost",
1867
+ size: "icon",
1868
+ className: "size-7 pointer-coarse:size-11",
1869
+ "aria-label": `Move ${doc.name} up`,
1870
+ "data-testid": `production-move-up-${i}`,
1871
+ disabled: busy || i === 0,
1872
+ onClick: () => move(i, i - 1, "up"),
1873
+ children: /* @__PURE__ */ jsx(ChevronUp, { className: "size-4" })
1874
+ }
1875
+ ),
1876
+ /* @__PURE__ */ jsx(
1877
+ Button,
1878
+ {
1879
+ type: "button",
1880
+ variant: "ghost",
1881
+ size: "icon",
1882
+ className: "size-7 pointer-coarse:size-11",
1883
+ "aria-label": `Move ${doc.name} down`,
1884
+ "data-testid": `production-move-down-${i}`,
1885
+ disabled: busy || i === ordered.length - 1,
1886
+ onClick: () => move(i, i + 1, "down"),
1887
+ children: /* @__PURE__ */ jsx(ChevronDown, { className: "size-4" })
1888
+ }
1889
+ )
1890
+ ]
1891
+ },
1892
+ doc.id
1893
+ ))
1894
+ }
1895
+ ),
1896
+ leftOut.length > 0 && /* @__PURE__ */ jsxs("p", { className: "text-xs text-muted-foreground", "data-testid": "production-left-out", children: [
1897
+ "Left out, with no PDF version to number: ",
1898
+ leftOut.join(", ")
1899
+ ] }),
1900
+ /* @__PURE__ */ jsxs("fieldset", { className: "space-y-2 text-sm", disabled: busy, children: [
1901
+ /* @__PURE__ */ jsx("legend", { className: "mb-1 font-medium", children: "Files" }),
1902
+ /* @__PURE__ */ jsxs("label", { className: "flex items-start gap-2", children: [
1903
+ /* @__PURE__ */ jsx(
1904
+ "input",
1905
+ {
1906
+ type: "radio",
1907
+ name: "production-layout",
1908
+ "data-testid": "production-layout-merged",
1909
+ checked: layout === "merged",
1910
+ onChange: () => setLayout("merged")
1911
+ }
1912
+ ),
1913
+ /* @__PURE__ */ jsxs("span", { children: [
1914
+ "One merged file",
1915
+ /* @__PURE__ */ jsx("span", { className: "block text-xs text-muted-foreground", children: "All documents joined, numbered consecutively." })
1916
+ ] })
1917
+ ] }),
1918
+ /* @__PURE__ */ jsxs("label", { className: "flex items-start gap-2", children: [
1919
+ /* @__PURE__ */ jsx(
1920
+ "input",
1921
+ {
1922
+ type: "radio",
1923
+ name: "production-layout",
1924
+ "data-testid": "production-layout-per-document",
1925
+ checked: layout === "per-document",
1926
+ onChange: () => setLayout("per-document")
1927
+ }
1928
+ ),
1929
+ /* @__PURE__ */ jsxs("span", { children: [
1930
+ "One file per document",
1931
+ /* @__PURE__ */ jsx("span", { className: "block text-xs text-muted-foreground", children: "Numbering carries on from one file to the next." })
1932
+ ] })
1933
+ ] })
1934
+ ] }),
1935
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-3 gap-2 text-sm", children: [
1936
+ /* @__PURE__ */ jsxs("label", { className: "space-y-1", children: [
1937
+ "Prefix",
1938
+ /* @__PURE__ */ jsx(
1939
+ "input",
1940
+ {
1941
+ "data-testid": "production-prefix",
1942
+ className: "h-8 w-full rounded-md border border-input bg-background px-2",
1943
+ value: prefix,
1944
+ maxLength: MAX_PREFIX,
1945
+ disabled: busy,
1946
+ onChange: (e) => setPrefix(e.target.value)
1947
+ }
1948
+ )
1949
+ ] }),
1950
+ /* @__PURE__ */ jsxs("label", { className: "space-y-1", children: [
1951
+ "Start at",
1952
+ /* @__PURE__ */ jsx(
1953
+ "input",
1954
+ {
1955
+ "data-testid": "production-start",
1956
+ type: "number",
1957
+ min: 0,
1958
+ className: "h-8 w-full rounded-md border border-input bg-background px-2",
1959
+ value: start,
1960
+ disabled: busy,
1961
+ onChange: (e) => setStart(e.target.valueAsNumber)
1962
+ }
1963
+ )
1964
+ ] }),
1965
+ /* @__PURE__ */ jsxs("label", { className: "space-y-1", children: [
1966
+ "Digits",
1967
+ /* @__PURE__ */ jsx(
1968
+ "input",
1969
+ {
1970
+ "data-testid": "production-digits",
1971
+ type: "number",
1972
+ min: 1,
1973
+ max: 12,
1974
+ className: "h-8 w-full rounded-md border border-input bg-background px-2",
1975
+ value: digits,
1976
+ disabled: busy,
1977
+ onChange: (e) => setDigits(e.target.valueAsNumber)
1978
+ }
1979
+ )
1980
+ ] })
1981
+ ] }),
1982
+ /* @__PURE__ */ jsxs("label", { className: "flex items-center gap-2 text-sm", children: [
1983
+ "Label position",
1984
+ /* @__PURE__ */ jsxs(
1985
+ "select",
1986
+ {
1987
+ "data-testid": "production-corner",
1988
+ className: "h-8 rounded-md border border-input bg-background px-2",
1989
+ value: corner,
1990
+ disabled: busy,
1991
+ onChange: (e) => setCorner(e.target.value),
1992
+ children: [
1993
+ /* @__PURE__ */ jsx("option", { value: "bottom-right", children: "Bottom right" }),
1994
+ /* @__PURE__ */ jsx("option", { value: "bottom-left", children: "Bottom left" }),
1995
+ /* @__PURE__ */ jsx("option", { value: "top-right", children: "Top right" }),
1996
+ /* @__PURE__ */ jsx("option", { value: "top-left", children: "Top left" })
1997
+ ]
1998
+ }
1999
+ )
2000
+ ] }),
2001
+ /* @__PURE__ */ jsxs("label", { className: "flex items-start gap-2 text-sm", children: [
2002
+ /* @__PURE__ */ jsx(
2003
+ "input",
2004
+ {
2005
+ type: "checkbox",
2006
+ "data-testid": "production-qr",
2007
+ checked: qr,
2008
+ disabled: busy,
2009
+ onChange: (e) => setQr(e.target.checked)
2010
+ }
2011
+ ),
2012
+ /* @__PURE__ */ jsxs("span", { children: [
2013
+ "QR code on every page",
2014
+ /* @__PURE__ */ jsx("span", { className: "block text-xs text-muted-foreground", children: "Opens the document in ARBI for anyone with access." })
2015
+ ] })
2016
+ ] }),
2017
+ /* @__PURE__ */ jsxs("label", { className: "flex items-start gap-2 text-sm", children: [
2018
+ /* @__PURE__ */ jsx(
2019
+ "input",
2020
+ {
2021
+ type: "checkbox",
2022
+ "data-testid": "production-index",
2023
+ checked: indexPage,
2024
+ disabled: busy,
2025
+ onChange: (e) => setIndexPage(e.target.checked)
2026
+ }
2027
+ ),
2028
+ /* @__PURE__ */ jsxs("span", { children: [
2029
+ "Index page at the start",
2030
+ /* @__PURE__ */ jsx("span", { className: "block text-xs text-muted-foreground", children: "Lists every document with its Bates range. The index itself is not numbered." })
2031
+ ] })
2032
+ ] }),
2033
+ /* @__PURE__ */ jsxs("label", { className: "flex items-start gap-2 text-sm", children: [
2034
+ /* @__PURE__ */ jsx(
2035
+ "input",
2036
+ {
2037
+ type: "checkbox",
2038
+ "data-testid": "production-save",
2039
+ checked: saveToWorkspace,
2040
+ disabled: busy,
2041
+ onChange: (e) => setSaveToWorkspace(e.target.checked)
2042
+ }
2043
+ ),
2044
+ /* @__PURE__ */ jsxs("span", { children: [
2045
+ "Save to workspace",
2046
+ /* @__PURE__ */ jsx("span", { className: "block text-xs text-muted-foreground", children: layout === "merged" ? "Adds the merged PDF to the Productions folder, so it can be shared or emailed." : "Adds each numbered file to a folder under Productions, so they can be shared or emailed." })
2047
+ ] })
2048
+ ] }),
2049
+ valid && /* @__PURE__ */ jsxs("p", { className: "text-sm", "data-testid": "production-preview", children: [
2050
+ "First label:",
2051
+ " ",
2052
+ /* @__PURE__ */ jsx("span", { className: "font-mono", children: previewLabel({ prefix, start, digits }) })
2053
+ ] }),
2054
+ busy && progress && /* @__PURE__ */ jsxs("p", { className: "text-sm", role: "status", "data-testid": "production-progress", children: [
2055
+ "Document ",
2056
+ progress.done,
2057
+ " of ",
2058
+ progress.total,
2059
+ "\u2026"
2060
+ ] }),
2061
+ error && /* @__PURE__ */ jsx("p", { className: "text-sm text-destructive", role: "alert", "data-testid": "production-error", children: error }),
2062
+ /* @__PURE__ */ jsxs(DialogFooter, { children: [
2063
+ /* @__PURE__ */ jsx(
2064
+ Button,
2065
+ {
2066
+ type: "button",
2067
+ variant: "outline",
2068
+ disabled: busy,
2069
+ onClick: () => onOpenChange(false),
2070
+ children: "Cancel"
2071
+ }
2072
+ ),
2073
+ /* @__PURE__ */ jsx(
2074
+ Button,
2075
+ {
2076
+ type: "button",
2077
+ "data-testid": "production-confirm",
2078
+ disabled: busy || !valid || ordered.length === 0,
2079
+ onClick: () => onConfirm({
2080
+ layout,
2081
+ prefix,
2082
+ start,
2083
+ digits,
2084
+ corner,
2085
+ qr,
2086
+ indexPage,
2087
+ saveToWorkspace,
2088
+ order: ordered.map((d) => d.id)
2089
+ }),
2090
+ children: busy ? "Working\u2026" : "Create production"
2091
+ }
2092
+ )
2093
+ ] })
2094
+ ] }) });
2095
+ }
1700
2096
 
1701
- export { AnnotationPageOverlay, AnnotationToolbar, DEFAULT_SETTINGS, FreezeDialog, HIGHLIGHT_COLORS, MARK_COLORS, REDACTION_REASONS, STAMP_PRESETS, annotationsOnPage, applyAction, canRedo, canUndo, containsPoint, createHistory, createLocalStorageStore, createMemoryStore, dragRect, dragToNorm, intersects, isTooSmall, mergeLineRects, patchForRect, pendingRedactions, readSelection, redo, reduceLayer, selectionToPageMarks, singleRect, toNorm, toPixels, undo, useAnnotationLayer, useAnnotationShortcuts, useTextSelectionMarks };
2097
+ export { AnnotationPageOverlay, AnnotationToolbar, DEFAULT_SETTINGS, FreezeDialog, HIGHLIGHT_COLORS, MARK_COLORS, ProductionDialog, REDACTION_LOG_COLUMNS, REDACTION_REASONS, STAMP_PRESETS, annotationsOnPage, applyAction, canRedo, canUndo, containsPoint, createHistory, createLocalStorageStore, createMemoryStore, dragRect, dragToNorm, intersects, isTooSmall, mergeLineRects, moveItem, patchForRect, pendingRedactions, qrCornerFor, readSelection, redactionLogCsv, redactionLogRows, redo, reduceLayer, selectionToPageMarks, singleRect, toNorm, toPixels, undo, useAnnotationLayer, useAnnotationShortcuts, useTextSelectionMarks };
1702
2098
  //# sourceMappingURL=index.js.map
1703
2099
  //# sourceMappingURL=index.js.map