@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,5 +1,5 @@
1
- import { A as Annotation, e as RedactionStatus, d as CommentReply, b as AnnotationLayer, N as NormRect } from '../model-DzQxhMMz.cjs';
2
- export { a as AnnotationKind, c as AnnotationLayerError, B as BoxAnnotation, C as CommentAnnotation, H as HighlightAnnotation, L as LAYER_SCHEMA_VERSION, R as RedactionAnnotation, S as StampAnnotation, f as annotationRects, g as clampRect, h as emptyLayer, i as isEffectiveRedaction, p as parseAnnotation, j as parseLayer } from '../model-DzQxhMMz.cjs';
1
+ import { A as Annotation, e as RedactionStatus, d as CommentReply, b as AnnotationLayer, N as NormRect } from '../model-DIwXRuGC.cjs';
2
+ export { a as AnnotationKind, c as AnnotationLayerError, B as BoxAnnotation, C as CommentAnnotation, H as HighlightAnnotation, L as LAYER_SCHEMA_VERSION, R as RedactionAnnotation, S as StampAnnotation, f as annotationRects, g as clampRect, h as emptyLayer, i as isEffectiveRedaction, p as parseAnnotation, j as parseLayer } from '../model-DIwXRuGC.cjs';
3
3
  import * as React from 'react';
4
4
 
5
5
  /**
@@ -32,6 +32,8 @@ type AnnotationAction = {
32
32
  ids: string[];
33
33
  status: RedactionStatus;
34
34
  now: string;
35
+ /** Who reviewed it; recorded with the time for approve/reject, cleared for pending. */
36
+ by?: string;
35
37
  } | {
36
38
  type: 'reply';
37
39
  id: string;
@@ -81,6 +83,29 @@ declare function createMemoryStore(now?: () => string): AnnotationStore;
81
83
  */
82
84
  declare function createLocalStorageStore(storage?: Pick<Storage, 'getItem' | 'setItem'> | undefined, now?: () => string): AnnotationStore;
83
85
 
86
+ /**
87
+ * The redaction log of a layer: one CSV row per redaction mark (page, reason, status, who approved
88
+ * it and when), the record a privilege or redaction log is built from.
89
+ *
90
+ * It never carries the redacted text: the log travels with the redacted copy, so it must not undo
91
+ * it. Rows are in reading order (page, then top to bottom, then left to right).
92
+ */
93
+
94
+ declare const REDACTION_LOG_COLUMNS: readonly ["page", "reason", "status", "approved_by", "time"];
95
+ interface RedactionLogRow {
96
+ page: number;
97
+ reason: string;
98
+ /** What the frozen copy shows for this mark. */
99
+ status: 'redacted (approved)' | 'redacted (not reviewed)' | 'not redacted (rejected)';
100
+ /** Who approved it; empty when it was not approved. */
101
+ approvedBy: string;
102
+ /** When it was reviewed, or when it was made if nobody reviewed it (ISO). */
103
+ time: string;
104
+ }
105
+ declare function redactionLogRows(layer: AnnotationLayer): RedactionLogRow[];
106
+ /** The log as CSV text (header row first, CRLF line ends as RFC 4180 has them). */
107
+ declare function redactionLogCsv(layer: AnnotationLayer): string;
108
+
84
109
  /**
85
110
  * Geometry helpers: pixels <-> fractions of the displayed page, and turning a text selection's
86
111
  * many client rects into tidy line boxes.
@@ -273,6 +298,8 @@ interface FreezeChoices {
273
298
  mode: 'vector' | 'image';
274
299
  comments: 'omit' | 'markers' | 'appendix';
275
300
  pendingRedactions: 'error' | 'burn';
301
+ /** Also save the redaction log (CSV: page, reason, status, approver, time; never the text). */
302
+ redactionLog: boolean;
276
303
  }
277
304
  interface FreezeDialogProps {
278
305
  open: boolean;
@@ -288,4 +315,52 @@ interface FreezeDialogProps {
288
315
  }
289
316
  declare function FreezeDialog({ open, onOpenChange, controller, onConfirm, busy, progress, error, }: FreezeDialogProps): React.JSX.Element;
290
317
 
291
- export { Annotation, type AnnotationAction, type AnnotationController, AnnotationLayer, AnnotationPageOverlay, type AnnotationPageOverlayProps, type AnnotationPatch, type AnnotationStore, type AnnotationTool, AnnotationToolbar, type AnnotationToolbarProps, CommentReply, DEFAULT_SETTINGS, type DragMode, type FreezeChoices, FreezeDialog, type FreezeDialogProps, HIGHLIGHT_COLORS, type LayerHistory, type LayerStatus, MARK_COLORS, type NewMark, NormRect, type PageSelection, type PageTextMark, type PixelRect, type PixelSize, REDACTION_REASONS, RedactionStatus, STAMP_PRESETS, type ToolSettings, type UseAnnotationLayerOptions, 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 };
318
+ /**
319
+ * Asks how to number and package a set of documents as a production. It only collects choices; the
320
+ * host runs `buildBundle` (see `@arbidocs/react/annotations/freeze`) and saves the result.
321
+ *
322
+ * The documents can be put in order (drag a row, or its up/down buttons from the keyboard): that
323
+ * order is the numbering order.
324
+ */
325
+ type ProductionCorner = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
326
+ interface ProductionChoices {
327
+ layout: 'merged' | 'per-document';
328
+ prefix: string;
329
+ start: number;
330
+ digits: number;
331
+ /** Corner of the Bates label; the QR code, when on, takes the opposite bottom corner. */
332
+ corner: ProductionCorner;
333
+ qr: boolean;
334
+ /** An index page first: every document with its Bates range. */
335
+ indexPage: boolean;
336
+ /** Also save the result as a document in the workspace (it is downloaded either way). */
337
+ saveToWorkspace: boolean;
338
+ /** Document ids in numbering order. */
339
+ order: string[];
340
+ }
341
+ interface ProductionDocument {
342
+ id: string;
343
+ name: string;
344
+ }
345
+ interface ProductionDialogProps {
346
+ open: boolean;
347
+ onOpenChange: (open: boolean) => void;
348
+ /** The documents, in the order they are numbered until the user reorders them. */
349
+ documents: ProductionDocument[];
350
+ /** Selected documents that cannot be included, with the reason, e.g. "photo.jpg (no PDF)". */
351
+ leftOut?: string[];
352
+ onConfirm: (choices: ProductionChoices) => void;
353
+ busy?: boolean;
354
+ progress?: {
355
+ done: number;
356
+ total: number;
357
+ } | null;
358
+ error?: string | null;
359
+ }
360
+ /** The QR code sits in the bottom corner the label is not in (the label may be top or bottom). */
361
+ declare function qrCornerFor(corner: ProductionCorner): ProductionCorner;
362
+ /** `items` with the entry at `from` moved to `to`. */
363
+ declare function moveItem<T>(items: readonly T[], from: number, to: number): T[];
364
+ declare function ProductionDialog({ open, onOpenChange, documents, leftOut, onConfirm, busy, progress, error, }: ProductionDialogProps): React.JSX.Element;
365
+
366
+ export { Annotation, type AnnotationAction, type AnnotationController, AnnotationLayer, AnnotationPageOverlay, type AnnotationPageOverlayProps, type AnnotationPatch, type AnnotationStore, type AnnotationTool, AnnotationToolbar, type AnnotationToolbarProps, CommentReply, DEFAULT_SETTINGS, type DragMode, type FreezeChoices, FreezeDialog, type FreezeDialogProps, HIGHLIGHT_COLORS, type LayerHistory, type LayerStatus, MARK_COLORS, type NewMark, NormRect, type PageSelection, type PageTextMark, type PixelRect, type PixelSize, type ProductionChoices, type ProductionCorner, ProductionDialog, type ProductionDialogProps, type ProductionDocument, REDACTION_LOG_COLUMNS, REDACTION_REASONS, type RedactionLogRow, RedactionStatus, STAMP_PRESETS, type ToolSettings, type UseAnnotationLayerOptions, 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 };
@@ -1,5 +1,5 @@
1
- import { A as Annotation, e as RedactionStatus, d as CommentReply, b as AnnotationLayer, N as NormRect } from '../model-DzQxhMMz.js';
2
- export { a as AnnotationKind, c as AnnotationLayerError, B as BoxAnnotation, C as CommentAnnotation, H as HighlightAnnotation, L as LAYER_SCHEMA_VERSION, R as RedactionAnnotation, S as StampAnnotation, f as annotationRects, g as clampRect, h as emptyLayer, i as isEffectiveRedaction, p as parseAnnotation, j as parseLayer } from '../model-DzQxhMMz.js';
1
+ import { A as Annotation, e as RedactionStatus, d as CommentReply, b as AnnotationLayer, N as NormRect } from '../model-DIwXRuGC.js';
2
+ export { a as AnnotationKind, c as AnnotationLayerError, B as BoxAnnotation, C as CommentAnnotation, H as HighlightAnnotation, L as LAYER_SCHEMA_VERSION, R as RedactionAnnotation, S as StampAnnotation, f as annotationRects, g as clampRect, h as emptyLayer, i as isEffectiveRedaction, p as parseAnnotation, j as parseLayer } from '../model-DIwXRuGC.js';
3
3
  import * as React from 'react';
4
4
 
5
5
  /**
@@ -32,6 +32,8 @@ type AnnotationAction = {
32
32
  ids: string[];
33
33
  status: RedactionStatus;
34
34
  now: string;
35
+ /** Who reviewed it; recorded with the time for approve/reject, cleared for pending. */
36
+ by?: string;
35
37
  } | {
36
38
  type: 'reply';
37
39
  id: string;
@@ -81,6 +83,29 @@ declare function createMemoryStore(now?: () => string): AnnotationStore;
81
83
  */
82
84
  declare function createLocalStorageStore(storage?: Pick<Storage, 'getItem' | 'setItem'> | undefined, now?: () => string): AnnotationStore;
83
85
 
86
+ /**
87
+ * The redaction log of a layer: one CSV row per redaction mark (page, reason, status, who approved
88
+ * it and when), the record a privilege or redaction log is built from.
89
+ *
90
+ * It never carries the redacted text: the log travels with the redacted copy, so it must not undo
91
+ * it. Rows are in reading order (page, then top to bottom, then left to right).
92
+ */
93
+
94
+ declare const REDACTION_LOG_COLUMNS: readonly ["page", "reason", "status", "approved_by", "time"];
95
+ interface RedactionLogRow {
96
+ page: number;
97
+ reason: string;
98
+ /** What the frozen copy shows for this mark. */
99
+ status: 'redacted (approved)' | 'redacted (not reviewed)' | 'not redacted (rejected)';
100
+ /** Who approved it; empty when it was not approved. */
101
+ approvedBy: string;
102
+ /** When it was reviewed, or when it was made if nobody reviewed it (ISO). */
103
+ time: string;
104
+ }
105
+ declare function redactionLogRows(layer: AnnotationLayer): RedactionLogRow[];
106
+ /** The log as CSV text (header row first, CRLF line ends as RFC 4180 has them). */
107
+ declare function redactionLogCsv(layer: AnnotationLayer): string;
108
+
84
109
  /**
85
110
  * Geometry helpers: pixels <-> fractions of the displayed page, and turning a text selection's
86
111
  * many client rects into tidy line boxes.
@@ -273,6 +298,8 @@ interface FreezeChoices {
273
298
  mode: 'vector' | 'image';
274
299
  comments: 'omit' | 'markers' | 'appendix';
275
300
  pendingRedactions: 'error' | 'burn';
301
+ /** Also save the redaction log (CSV: page, reason, status, approver, time; never the text). */
302
+ redactionLog: boolean;
276
303
  }
277
304
  interface FreezeDialogProps {
278
305
  open: boolean;
@@ -288,4 +315,52 @@ interface FreezeDialogProps {
288
315
  }
289
316
  declare function FreezeDialog({ open, onOpenChange, controller, onConfirm, busy, progress, error, }: FreezeDialogProps): React.JSX.Element;
290
317
 
291
- export { Annotation, type AnnotationAction, type AnnotationController, AnnotationLayer, AnnotationPageOverlay, type AnnotationPageOverlayProps, type AnnotationPatch, type AnnotationStore, type AnnotationTool, AnnotationToolbar, type AnnotationToolbarProps, CommentReply, DEFAULT_SETTINGS, type DragMode, type FreezeChoices, FreezeDialog, type FreezeDialogProps, HIGHLIGHT_COLORS, type LayerHistory, type LayerStatus, MARK_COLORS, type NewMark, NormRect, type PageSelection, type PageTextMark, type PixelRect, type PixelSize, REDACTION_REASONS, RedactionStatus, STAMP_PRESETS, type ToolSettings, type UseAnnotationLayerOptions, 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 };
318
+ /**
319
+ * Asks how to number and package a set of documents as a production. It only collects choices; the
320
+ * host runs `buildBundle` (see `@arbidocs/react/annotations/freeze`) and saves the result.
321
+ *
322
+ * The documents can be put in order (drag a row, or its up/down buttons from the keyboard): that
323
+ * order is the numbering order.
324
+ */
325
+ type ProductionCorner = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
326
+ interface ProductionChoices {
327
+ layout: 'merged' | 'per-document';
328
+ prefix: string;
329
+ start: number;
330
+ digits: number;
331
+ /** Corner of the Bates label; the QR code, when on, takes the opposite bottom corner. */
332
+ corner: ProductionCorner;
333
+ qr: boolean;
334
+ /** An index page first: every document with its Bates range. */
335
+ indexPage: boolean;
336
+ /** Also save the result as a document in the workspace (it is downloaded either way). */
337
+ saveToWorkspace: boolean;
338
+ /** Document ids in numbering order. */
339
+ order: string[];
340
+ }
341
+ interface ProductionDocument {
342
+ id: string;
343
+ name: string;
344
+ }
345
+ interface ProductionDialogProps {
346
+ open: boolean;
347
+ onOpenChange: (open: boolean) => void;
348
+ /** The documents, in the order they are numbered until the user reorders them. */
349
+ documents: ProductionDocument[];
350
+ /** Selected documents that cannot be included, with the reason, e.g. "photo.jpg (no PDF)". */
351
+ leftOut?: string[];
352
+ onConfirm: (choices: ProductionChoices) => void;
353
+ busy?: boolean;
354
+ progress?: {
355
+ done: number;
356
+ total: number;
357
+ } | null;
358
+ error?: string | null;
359
+ }
360
+ /** The QR code sits in the bottom corner the label is not in (the label may be top or bottom). */
361
+ declare function qrCornerFor(corner: ProductionCorner): ProductionCorner;
362
+ /** `items` with the entry at `from` moved to `to`. */
363
+ declare function moveItem<T>(items: readonly T[], from: number, to: number): T[];
364
+ declare function ProductionDialog({ open, onOpenChange, documents, leftOut, onConfirm, busy, progress, error, }: ProductionDialogProps): React.JSX.Element;
365
+
366
+ export { Annotation, type AnnotationAction, type AnnotationController, AnnotationLayer, AnnotationPageOverlay, type AnnotationPageOverlayProps, type AnnotationPatch, type AnnotationStore, type AnnotationTool, AnnotationToolbar, type AnnotationToolbarProps, CommentReply, DEFAULT_SETTINGS, type DragMode, type FreezeChoices, FreezeDialog, type FreezeDialogProps, HIGHLIGHT_COLORS, type LayerHistory, type LayerStatus, MARK_COLORS, type NewMark, NormRect, type PageSelection, type PageTextMark, type PixelRect, type PixelSize, type ProductionChoices, type ProductionCorner, ProductionDialog, type ProductionDialogProps, type ProductionDocument, REDACTION_LOG_COLUMNS, REDACTION_REASONS, type RedactionLogRow, RedactionStatus, STAMP_PRESETS, type ToolSettings, type UseAnnotationLayerOptions, 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 };