@arbidocs/react 0.4.69 → 0.4.71

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 (96) hide show
  1. package/README.md +10 -0
  2. package/dist/ProductionDialog-BRrZ5Lj5.d.cts +84 -0
  3. package/dist/ProductionDialog-DUC9BXWS.d.ts +84 -0
  4. package/dist/annotations/freeze/index.cjs +45 -1100
  5. package/dist/annotations/freeze/index.cjs.map +1 -1
  6. package/dist/annotations/freeze/index.d.cts +2 -85
  7. package/dist/annotations/freeze/index.d.ts +2 -85
  8. package/dist/annotations/freeze/index.js +4 -1084
  9. package/dist/annotations/freeze/index.js.map +1 -1
  10. package/dist/annotations/index.cjs +186 -2450
  11. package/dist/annotations/index.cjs.map +1 -1
  12. package/dist/annotations/index.d.cts +3 -81
  13. package/dist/annotations/index.d.ts +3 -81
  14. package/dist/annotations/index.js +4 -2411
  15. package/dist/annotations/index.js.map +1 -1
  16. package/dist/artifacts/index.cjs +91 -115
  17. package/dist/artifacts/index.cjs.map +1 -1
  18. package/dist/artifacts/index.js +13 -62
  19. package/dist/artifacts/index.js.map +1 -1
  20. package/dist/artifacts/redline-core.cjs +8 -7
  21. package/dist/artifacts/redline-core.js +2 -1
  22. package/dist/bundle-BnCSbHy2.d.cts +85 -0
  23. package/dist/bundle-BnCSbHy2.d.ts +85 -0
  24. package/dist/bundle-N2JIJ2T6.js +4 -0
  25. package/dist/bundle-N2JIJ2T6.js.map +1 -0
  26. package/dist/bundle-T6BEVYHE.cjs +13 -0
  27. package/dist/bundle-T6BEVYHE.cjs.map +1 -0
  28. package/dist/{chunk-PATLJSAO.cjs → chunk-3AADNIOK.cjs} +9 -52
  29. package/dist/chunk-3AADNIOK.cjs.map +1 -0
  30. package/dist/chunk-3QF5DNAP.js +2413 -0
  31. package/dist/chunk-3QF5DNAP.js.map +1 -0
  32. package/dist/chunk-5DCRIWCA.cjs +243 -0
  33. package/dist/chunk-5DCRIWCA.cjs.map +1 -0
  34. package/dist/{chunk-NA3FOYSF.cjs → chunk-5SZ2J2WT.cjs} +5 -177
  35. package/dist/chunk-5SZ2J2WT.cjs.map +1 -0
  36. package/dist/{chunk-PFKLOVGQ.js → chunk-6ERJUIMQ.js} +4 -234
  37. package/dist/chunk-6ERJUIMQ.js.map +1 -0
  38. package/dist/{chunk-Z3RRZ3KV.cjs → chunk-6TFD5OS5.cjs} +25 -263
  39. package/dist/chunk-6TFD5OS5.cjs.map +1 -0
  40. package/dist/{chunk-43AKLNBC.js → chunk-74N436VK.js} +4 -40
  41. package/dist/chunk-74N436VK.js.map +1 -0
  42. package/dist/{chunk-BWVIAATD.cjs → chunk-BTRIS3HY.cjs} +4 -4
  43. package/dist/{chunk-BWVIAATD.cjs.map → chunk-BTRIS3HY.cjs.map} +1 -1
  44. package/dist/chunk-G6FHNURH.js +234 -0
  45. package/dist/chunk-G6FHNURH.js.map +1 -0
  46. package/dist/chunk-HKUD2NZN.js +61 -0
  47. package/dist/chunk-HKUD2NZN.js.map +1 -0
  48. package/dist/{chunk-ZMTLGO3K.cjs → chunk-IIT7DMQL.cjs} +6 -2
  49. package/dist/chunk-IIT7DMQL.cjs.map +1 -0
  50. package/dist/chunk-QJXFRP5R.cjs +1103 -0
  51. package/dist/chunk-QJXFRP5R.cjs.map +1 -0
  52. package/dist/chunk-QRCMKEE6.js +173 -0
  53. package/dist/chunk-QRCMKEE6.js.map +1 -0
  54. package/dist/chunk-T4IJHRRD.cjs +71 -0
  55. package/dist/chunk-T4IJHRRD.cjs.map +1 -0
  56. package/dist/chunk-ULU5LEWF.cjs +2460 -0
  57. package/dist/chunk-ULU5LEWF.cjs.map +1 -0
  58. package/dist/{chunk-TQ6FRVAH.js → chunk-V4CXOPLB.js} +3 -3
  59. package/dist/{chunk-TQ6FRVAH.js.map → chunk-V4CXOPLB.js.map} +1 -1
  60. package/dist/chunk-VOFNX4P6.cjs +50 -0
  61. package/dist/chunk-VOFNX4P6.cjs.map +1 -0
  62. package/dist/{chunk-J4MX2W4H.js → chunk-WBYNKFUO.js} +6 -3
  63. package/dist/chunk-WBYNKFUO.js.map +1 -0
  64. package/dist/chunk-WUTL62MC.js +42 -0
  65. package/dist/chunk-WUTL62MC.js.map +1 -0
  66. package/dist/{chunk-JPGV7NMY.js → chunk-YXSXGTYQ.js} +4 -173
  67. package/dist/chunk-YXSXGTYQ.js.map +1 -0
  68. package/dist/chunk-Z3LLUO32.cjs +177 -0
  69. package/dist/chunk-Z3LLUO32.cjs.map +1 -0
  70. package/dist/chunk-ZJMUNGOY.js +1088 -0
  71. package/dist/chunk-ZJMUNGOY.js.map +1 -0
  72. package/dist/document-tools/index.cjs +898 -0
  73. package/dist/document-tools/index.cjs.map +1 -0
  74. package/dist/document-tools/index.d.cts +522 -0
  75. package/dist/document-tools/index.d.ts +522 -0
  76. package/dist/document-tools/index.js +837 -0
  77. package/dist/document-tools/index.js.map +1 -0
  78. package/dist/index.cjs +365 -359
  79. package/dist/index.cjs.map +1 -1
  80. package/dist/index.d.cts +7 -1
  81. package/dist/index.d.ts +7 -1
  82. package/dist/index.js +11 -8
  83. package/dist/index.js.map +1 -1
  84. package/dist/ui/index.cjs +132 -131
  85. package/dist/ui/index.js +3 -2
  86. package/dist/viewers/index.cjs +2 -2
  87. package/dist/viewers/index.js +1 -1
  88. package/package.json +11 -3
  89. package/dist/chunk-43AKLNBC.js.map +0 -1
  90. package/dist/chunk-J4MX2W4H.js.map +0 -1
  91. package/dist/chunk-JPGV7NMY.js.map +0 -1
  92. package/dist/chunk-NA3FOYSF.cjs.map +0 -1
  93. package/dist/chunk-PATLJSAO.cjs.map +0 -1
  94. package/dist/chunk-PFKLOVGQ.js.map +0 -1
  95. package/dist/chunk-Z3RRZ3KV.cjs.map +0 -1
  96. package/dist/chunk-ZMTLGO3K.cjs.map +0 -1
@@ -1,5 +1,7 @@
1
1
  import { A as Annotation, e as RedactionStatus, d as CommentReply, b as AnnotationLayer, N as NormRect } from '../model-DIwXRuGC.cjs';
2
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
+ import { A as AnnotationStore } from '../ProductionDialog-BRrZ5Lj5.cjs';
4
+ export { a as AnnotationStoreOfflineError, P as ProductionChoices, b as ProductionCorner, c as ProductionDialog, d as ProductionDialogProps, e as ProductionDocument, f as createLocalStorageStore, g as createMemoryStore, m as moveItem, q as qrCornerFor } from '../ProductionDialog-BRrZ5Lj5.cjs';
3
5
  import * as React from 'react';
4
6
  import { ReactNode } from 'react';
5
7
 
@@ -66,38 +68,6 @@ declare const canRedo: (h: LayerHistory) => boolean;
66
68
  declare function annotationsOnPage(layer: AnnotationLayer, page: number): Annotation[];
67
69
  declare function pendingRedactions(layer: AnnotationLayer): Annotation[];
68
70
 
69
- /**
70
- * Where a layer is kept. The layer is data about a document, not part of it, so the host decides
71
- * (backend API, IndexedDB, a file). This package ships an in-memory store and a localStorage
72
- * store; both validate on load because stored JSON is untrusted. A store shared by several
73
- * writers (ARBI's server-side markup) also implements the optional members: it may merge on save,
74
- * pull others' changes, and say whether this user may write at all.
75
- */
76
-
77
- interface AnnotationStore {
78
- /** The saved layer, or an empty one for a document that has none yet. */
79
- load(documentId: string): Promise<AnnotationLayer>;
80
- /**
81
- * Write a layer. A store with other writers may resolve to what it actually saved — this layer
82
- * merged with theirs (see `mergeLayers`); the caller then rebases its newer edits onto it.
83
- */
84
- save(layer: AnnotationLayer): Promise<AnnotationLayer | void>;
85
- /** Others' changes since the last load or save, or null when there are none. */
86
- pull?(documentId: string): Promise<AnnotationLayer | null>;
87
- /** Whether this user may change the layer; false makes it view-only. Known after `load`. */
88
- canEdit?(documentId: string): boolean;
89
- }
90
- /** Thrown by a store whose backend cannot be reached: the layer is kept and saved when back. */
91
- declare class AnnotationStoreOfflineError extends Error {
92
- constructor(message?: string);
93
- }
94
- declare function createMemoryStore(now?: () => string): AnnotationStore;
95
- /**
96
- * Per-browser store. Storage can be absent, full or blocked (private windows), so every access is
97
- * guarded. A saved layer that no longer validates is ignored rather than crashing the viewer.
98
- */
99
- declare function createLocalStorageStore(storage?: Pick<Storage, 'getItem' | 'setItem'> | undefined, now?: () => string): AnnotationStore;
100
-
101
71
  /**
102
72
  * Merging two writers' versions of one layer, by annotation id (a PDF annotation's `/NM`).
103
73
  *
@@ -382,52 +352,4 @@ interface FreezeDialogProps {
382
352
  }
383
353
  declare function FreezeDialog({ open, onOpenChange, controller, onConfirm, busy, progress, error, }: FreezeDialogProps): React.JSX.Element;
384
354
 
385
- /**
386
- * Asks how to number and package a set of documents as a production. It only collects choices; the
387
- * host runs `buildBundle` (see `@arbidocs/react/annotations/freeze`) and saves the result.
388
- *
389
- * The documents can be put in order (drag a row, or its up/down buttons from the keyboard): that
390
- * order is the numbering order.
391
- */
392
- type ProductionCorner = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
393
- interface ProductionChoices {
394
- layout: 'merged' | 'per-document';
395
- prefix: string;
396
- start: number;
397
- digits: number;
398
- /** Corner of the Bates label; the QR code, when on, takes the opposite bottom corner. */
399
- corner: ProductionCorner;
400
- qr: boolean;
401
- /** An index page first: every document with its Bates range. */
402
- indexPage: boolean;
403
- /** Also save the result as a document in the workspace (it is downloaded either way). */
404
- saveToWorkspace: boolean;
405
- /** Document ids in numbering order. */
406
- order: string[];
407
- }
408
- interface ProductionDocument {
409
- id: string;
410
- name: string;
411
- }
412
- interface ProductionDialogProps {
413
- open: boolean;
414
- onOpenChange: (open: boolean) => void;
415
- /** The documents, in the order they are numbered until the user reorders them. */
416
- documents: ProductionDocument[];
417
- /** Selected documents that cannot be included, with the reason, e.g. "photo.jpg (no PDF)". */
418
- leftOut?: string[];
419
- onConfirm: (choices: ProductionChoices) => void;
420
- busy?: boolean;
421
- progress?: {
422
- done: number;
423
- total: number;
424
- } | null;
425
- error?: string | null;
426
- }
427
- /** The QR code sits in the bottom corner the label is not in (the label may be top or bottom). */
428
- declare function qrCornerFor(corner: ProductionCorner): ProductionCorner;
429
- /** `items` with the entry at `from` moved to `to`. */
430
- declare function moveItem<T>(items: readonly T[], from: number, to: number): T[];
431
- declare function ProductionDialog({ open, onOpenChange, documents, leftOut, onConfirm, busy, progress, error, }: ProductionDialogProps): React.JSX.Element;
432
-
433
- export { AUTOSAVE_MS, Annotation, type AnnotationAction, type AnnotationController, AnnotationLayer, AnnotationPageOverlay, type AnnotationPageOverlayProps, type AnnotationPatch, type AnnotationStore, AnnotationStoreOfflineError, type AnnotationTool, AnnotationToolbar, type AnnotationToolbarProps, CommentReply, DEFAULT_SETTINGS, type DragMode, type FreezeChoices, FreezeDialog, type FreezeDialogProps, HIGHLIGHT_COLORS, type LayerHistory, type LayerStatus, MARK_COLORS, type MergeInput, 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, RETRY_MS, type RedactionLogRow, RedactionStatus, STAMP_PRESETS, type ToolSettings, type UseAnnotationLayerOptions, 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 };
355
+ export { AUTOSAVE_MS, Annotation, type AnnotationAction, type AnnotationController, AnnotationLayer, AnnotationPageOverlay, type AnnotationPageOverlayProps, type AnnotationPatch, 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 MergeInput, type NewMark, NormRect, type PageSelection, type PageTextMark, type PixelRect, type PixelSize, REDACTION_LOG_COLUMNS, REDACTION_REASONS, RETRY_MS, type RedactionLogRow, RedactionStatus, STAMP_PRESETS, type ToolSettings, type UseAnnotationLayerOptions, annotationsOnPage, applyAction, canRedo, canUndo, containsPoint, createHistory, dragRect, dragToNorm, intersects, isTooSmall, layerStatusText, mergeLayers, mergeLineRects, patchForRect, pendingRedactions, readSelection, redactionLogCsv, redactionLogRows, redo, reduceLayer, sameMarks, selectionToPageMarks, singleRect, toNorm, toPixels, undo, useAnnotationLayer, useAnnotationShortcuts, useTextSelectionMarks };
@@ -1,5 +1,7 @@
1
1
  import { A as Annotation, e as RedactionStatus, d as CommentReply, b as AnnotationLayer, N as NormRect } from '../model-DIwXRuGC.js';
2
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
+ import { A as AnnotationStore } from '../ProductionDialog-DUC9BXWS.js';
4
+ export { a as AnnotationStoreOfflineError, P as ProductionChoices, b as ProductionCorner, c as ProductionDialog, d as ProductionDialogProps, e as ProductionDocument, f as createLocalStorageStore, g as createMemoryStore, m as moveItem, q as qrCornerFor } from '../ProductionDialog-DUC9BXWS.js';
3
5
  import * as React from 'react';
4
6
  import { ReactNode } from 'react';
5
7
 
@@ -66,38 +68,6 @@ declare const canRedo: (h: LayerHistory) => boolean;
66
68
  declare function annotationsOnPage(layer: AnnotationLayer, page: number): Annotation[];
67
69
  declare function pendingRedactions(layer: AnnotationLayer): Annotation[];
68
70
 
69
- /**
70
- * Where a layer is kept. The layer is data about a document, not part of it, so the host decides
71
- * (backend API, IndexedDB, a file). This package ships an in-memory store and a localStorage
72
- * store; both validate on load because stored JSON is untrusted. A store shared by several
73
- * writers (ARBI's server-side markup) also implements the optional members: it may merge on save,
74
- * pull others' changes, and say whether this user may write at all.
75
- */
76
-
77
- interface AnnotationStore {
78
- /** The saved layer, or an empty one for a document that has none yet. */
79
- load(documentId: string): Promise<AnnotationLayer>;
80
- /**
81
- * Write a layer. A store with other writers may resolve to what it actually saved — this layer
82
- * merged with theirs (see `mergeLayers`); the caller then rebases its newer edits onto it.
83
- */
84
- save(layer: AnnotationLayer): Promise<AnnotationLayer | void>;
85
- /** Others' changes since the last load or save, or null when there are none. */
86
- pull?(documentId: string): Promise<AnnotationLayer | null>;
87
- /** Whether this user may change the layer; false makes it view-only. Known after `load`. */
88
- canEdit?(documentId: string): boolean;
89
- }
90
- /** Thrown by a store whose backend cannot be reached: the layer is kept and saved when back. */
91
- declare class AnnotationStoreOfflineError extends Error {
92
- constructor(message?: string);
93
- }
94
- declare function createMemoryStore(now?: () => string): AnnotationStore;
95
- /**
96
- * Per-browser store. Storage can be absent, full or blocked (private windows), so every access is
97
- * guarded. A saved layer that no longer validates is ignored rather than crashing the viewer.
98
- */
99
- declare function createLocalStorageStore(storage?: Pick<Storage, 'getItem' | 'setItem'> | undefined, now?: () => string): AnnotationStore;
100
-
101
71
  /**
102
72
  * Merging two writers' versions of one layer, by annotation id (a PDF annotation's `/NM`).
103
73
  *
@@ -382,52 +352,4 @@ interface FreezeDialogProps {
382
352
  }
383
353
  declare function FreezeDialog({ open, onOpenChange, controller, onConfirm, busy, progress, error, }: FreezeDialogProps): React.JSX.Element;
384
354
 
385
- /**
386
- * Asks how to number and package a set of documents as a production. It only collects choices; the
387
- * host runs `buildBundle` (see `@arbidocs/react/annotations/freeze`) and saves the result.
388
- *
389
- * The documents can be put in order (drag a row, or its up/down buttons from the keyboard): that
390
- * order is the numbering order.
391
- */
392
- type ProductionCorner = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
393
- interface ProductionChoices {
394
- layout: 'merged' | 'per-document';
395
- prefix: string;
396
- start: number;
397
- digits: number;
398
- /** Corner of the Bates label; the QR code, when on, takes the opposite bottom corner. */
399
- corner: ProductionCorner;
400
- qr: boolean;
401
- /** An index page first: every document with its Bates range. */
402
- indexPage: boolean;
403
- /** Also save the result as a document in the workspace (it is downloaded either way). */
404
- saveToWorkspace: boolean;
405
- /** Document ids in numbering order. */
406
- order: string[];
407
- }
408
- interface ProductionDocument {
409
- id: string;
410
- name: string;
411
- }
412
- interface ProductionDialogProps {
413
- open: boolean;
414
- onOpenChange: (open: boolean) => void;
415
- /** The documents, in the order they are numbered until the user reorders them. */
416
- documents: ProductionDocument[];
417
- /** Selected documents that cannot be included, with the reason, e.g. "photo.jpg (no PDF)". */
418
- leftOut?: string[];
419
- onConfirm: (choices: ProductionChoices) => void;
420
- busy?: boolean;
421
- progress?: {
422
- done: number;
423
- total: number;
424
- } | null;
425
- error?: string | null;
426
- }
427
- /** The QR code sits in the bottom corner the label is not in (the label may be top or bottom). */
428
- declare function qrCornerFor(corner: ProductionCorner): ProductionCorner;
429
- /** `items` with the entry at `from` moved to `to`. */
430
- declare function moveItem<T>(items: readonly T[], from: number, to: number): T[];
431
- declare function ProductionDialog({ open, onOpenChange, documents, leftOut, onConfirm, busy, progress, error, }: ProductionDialogProps): React.JSX.Element;
432
-
433
- export { AUTOSAVE_MS, Annotation, type AnnotationAction, type AnnotationController, AnnotationLayer, AnnotationPageOverlay, type AnnotationPageOverlayProps, type AnnotationPatch, type AnnotationStore, AnnotationStoreOfflineError, type AnnotationTool, AnnotationToolbar, type AnnotationToolbarProps, CommentReply, DEFAULT_SETTINGS, type DragMode, type FreezeChoices, FreezeDialog, type FreezeDialogProps, HIGHLIGHT_COLORS, type LayerHistory, type LayerStatus, MARK_COLORS, type MergeInput, 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, RETRY_MS, type RedactionLogRow, RedactionStatus, STAMP_PRESETS, type ToolSettings, type UseAnnotationLayerOptions, 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 };
355
+ export { AUTOSAVE_MS, Annotation, type AnnotationAction, type AnnotationController, AnnotationLayer, AnnotationPageOverlay, type AnnotationPageOverlayProps, type AnnotationPatch, 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 MergeInput, type NewMark, NormRect, type PageSelection, type PageTextMark, type PixelRect, type PixelSize, REDACTION_LOG_COLUMNS, REDACTION_REASONS, RETRY_MS, type RedactionLogRow, RedactionStatus, STAMP_PRESETS, type ToolSettings, type UseAnnotationLayerOptions, annotationsOnPage, applyAction, canRedo, canUndo, containsPoint, createHistory, dragRect, dragToNorm, intersects, isTooSmall, layerStatusText, mergeLayers, mergeLineRects, patchForRect, pendingRedactions, readSelection, redactionLogCsv, redactionLogRows, redo, reduceLayer, sameMarks, selectionToPageMarks, singleRect, toNorm, toPixels, undo, useAnnotationLayer, useAnnotationShortcuts, useTextSelectionMarks };