@arbidocs/react 0.4.55 → 0.4.57

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 (49) hide show
  1. package/dist/PdfViewer-bQH9yxFg.d.cts +55 -0
  2. package/dist/PdfViewer-bQH9yxFg.d.ts +55 -0
  3. package/dist/annotations/freeze/index.cjs +748 -0
  4. package/dist/annotations/freeze/index.cjs.map +1 -0
  5. package/dist/annotations/freeze/index.d.cts +199 -0
  6. package/dist/annotations/freeze/index.d.ts +199 -0
  7. package/dist/annotations/freeze/index.js +738 -0
  8. package/dist/annotations/freeze/index.js.map +1 -0
  9. package/dist/annotations/index.cjs +1756 -0
  10. package/dist/annotations/index.cjs.map +1 -0
  11. package/dist/annotations/index.d.cts +291 -0
  12. package/dist/annotations/index.d.ts +291 -0
  13. package/dist/annotations/index.js +1690 -0
  14. package/dist/annotations/index.js.map +1 -0
  15. package/dist/artifacts/index.cjs +16 -16
  16. package/dist/artifacts/index.js +5 -5
  17. package/dist/chunk-BGDE4DP5.cjs +192 -0
  18. package/dist/chunk-BGDE4DP5.cjs.map +1 -0
  19. package/dist/{chunk-MS7VH2BY.js → chunk-CVN7MAGQ.js} +6 -146
  20. package/dist/chunk-CVN7MAGQ.js.map +1 -0
  21. package/dist/chunk-JWXIRUWN.js +183 -0
  22. package/dist/chunk-JWXIRUWN.js.map +1 -0
  23. package/dist/chunk-QS3Q5542.js +151 -0
  24. package/dist/chunk-QS3Q5542.js.map +1 -0
  25. package/dist/{chunk-RI3BZQWD.cjs → chunk-R6V6YHPD.cjs} +3 -3
  26. package/dist/{chunk-RI3BZQWD.cjs.map → chunk-R6V6YHPD.cjs.map} +1 -1
  27. package/dist/{chunk-LOESXNVT.cjs → chunk-X3F5ABY2.cjs} +5 -158
  28. package/dist/chunk-X3F5ABY2.cjs.map +1 -0
  29. package/dist/chunk-XDCRWZF2.cjs +185 -0
  30. package/dist/chunk-XDCRWZF2.cjs.map +1 -0
  31. package/dist/{chunk-GT6KN3DV.js → chunk-XKGTZ3H6.js} +3 -3
  32. package/dist/{chunk-GT6KN3DV.js.map → chunk-XKGTZ3H6.js.map} +1 -1
  33. package/dist/index.cjs +475 -474
  34. package/dist/index.cjs.map +1 -1
  35. package/dist/index.js +11 -9
  36. package/dist/index.js.map +1 -1
  37. package/dist/model-DzQxhMMz.d.cts +102 -0
  38. package/dist/model-DzQxhMMz.d.ts +102 -0
  39. package/dist/ui/index.cjs +186 -185
  40. package/dist/ui/index.js +3 -2
  41. package/dist/viewers/index.cjs +61 -52
  42. package/dist/viewers/index.cjs.map +1 -1
  43. package/dist/viewers/index.d.cts +3 -43
  44. package/dist/viewers/index.d.ts +3 -43
  45. package/dist/viewers/index.js +61 -52
  46. package/dist/viewers/index.js.map +1 -1
  47. package/package.json +31 -9
  48. package/dist/chunk-LOESXNVT.cjs.map +0 -1
  49. package/dist/chunk-MS7VH2BY.js.map +0 -1
@@ -0,0 +1,102 @@
1
+ /**
2
+ * Annotation layer data model.
3
+ *
4
+ * A layer is plain JSON that sits NEXT TO an immutable document: the original file is never
5
+ * touched, marks are drawn over it, and "freezing" (see `freeze.ts`) derives a new document.
6
+ *
7
+ * Geometry is stored as fractions (0..1) of the page as DISPLAYED (after rotation and crop),
8
+ * origin top-left. That makes a mark independent of zoom, device pixel ratio and PDF units, and
9
+ * because the original never changes the coordinates never drift.
10
+ *
11
+ * A redaction mark carries the matched text so a reviewer (or an agent) can see what it hides.
12
+ * That text is sensitive: the layer must never travel with a frozen copy.
13
+ */
14
+ declare const LAYER_SCHEMA_VERSION = 1;
15
+ type AnnotationKind = 'highlight' | 'box' | 'comment' | 'stamp' | 'redaction';
16
+ type RedactionStatus = 'pending' | 'approved' | 'rejected';
17
+ /** Fractions of the displayed page, origin top-left. */
18
+ interface NormRect {
19
+ x: number;
20
+ y: number;
21
+ w: number;
22
+ h: number;
23
+ }
24
+ interface CommentReply {
25
+ id: string;
26
+ author: string;
27
+ createdAt: string;
28
+ body: string;
29
+ }
30
+ interface AnnotationBase {
31
+ id: string;
32
+ /** 1-based page number. */
33
+ page: number;
34
+ author: string;
35
+ createdAt: string;
36
+ updatedAt: string;
37
+ }
38
+ interface HighlightAnnotation extends AnnotationBase {
39
+ kind: 'highlight';
40
+ rects: NormRect[];
41
+ color: string;
42
+ /** The highlighted text, when it came from a text selection. */
43
+ text?: string;
44
+ }
45
+ interface BoxAnnotation extends AnnotationBase {
46
+ kind: 'box';
47
+ rect: NormRect;
48
+ color: string;
49
+ /** Outline width in PDF points at 100%. */
50
+ strokeWidth: number;
51
+ }
52
+ interface CommentAnnotation extends AnnotationBase {
53
+ kind: 'comment';
54
+ /** Anchor box; the note icon is drawn at its top-left corner. */
55
+ rect: NormRect;
56
+ body: string;
57
+ replies: CommentReply[];
58
+ resolved: boolean;
59
+ }
60
+ interface StampAnnotation extends AnnotationBase {
61
+ kind: 'stamp';
62
+ rect: NormRect;
63
+ label: string;
64
+ color: string;
65
+ }
66
+ interface RedactionAnnotation extends AnnotationBase {
67
+ kind: 'redaction';
68
+ rects: NormRect[];
69
+ /** Why it is redacted (e.g. "Privileged"). Printed on the frozen copy, never the text itself. */
70
+ reason: string;
71
+ /** The text under the mark. Sensitive: stays in the layer, never in a frozen document. */
72
+ text?: string;
73
+ status: RedactionStatus;
74
+ }
75
+ type Annotation = HighlightAnnotation | BoxAnnotation | CommentAnnotation | StampAnnotation | RedactionAnnotation;
76
+ interface AnnotationLayer {
77
+ schema: typeof LAYER_SCHEMA_VERSION;
78
+ /** External id of the immutable document the layer annotates. */
79
+ documentId: string;
80
+ /** Optional content hash of the original, so a layer can be checked against the file it marks. */
81
+ documentHash?: string;
82
+ annotations: Annotation[];
83
+ updatedAt: string;
84
+ }
85
+ declare class AnnotationLayerError extends Error {
86
+ constructor(message: string);
87
+ }
88
+ declare function emptyLayer(documentId: string, now: string): AnnotationLayer;
89
+ declare function clampRect(r: NormRect): NormRect;
90
+ /** Validate one annotation from untrusted JSON. Throws `AnnotationLayerError`. */
91
+ declare function parseAnnotation(v: unknown, path?: string): Annotation;
92
+ /** Validate a whole layer from untrusted JSON (storage, network, an agent). */
93
+ declare function parseLayer(v: unknown): AnnotationLayer;
94
+ /** The rectangles a mark covers, whatever its kind. */
95
+ declare function annotationRects(a: Annotation): NormRect[];
96
+ /**
97
+ * True when a redaction mark will be burned into a frozen copy. Fails closed: only an explicit
98
+ * rejection leaves content visible, so a mark nobody reviewed is never silently skipped.
99
+ */
100
+ declare function isEffectiveRedaction(a: Annotation): a is RedactionAnnotation;
101
+
102
+ export { type Annotation as A, type BoxAnnotation as B, type CommentAnnotation as C, type HighlightAnnotation as H, LAYER_SCHEMA_VERSION as L, type NormRect as N, type RedactionAnnotation as R, type StampAnnotation as S, type AnnotationKind as a, type AnnotationLayer as b, AnnotationLayerError as c, type CommentReply as d, type RedactionStatus as e, annotationRects as f, clampRect as g, emptyLayer as h, isEffectiveRedaction as i, parseLayer as j, parseAnnotation as p };
@@ -0,0 +1,102 @@
1
+ /**
2
+ * Annotation layer data model.
3
+ *
4
+ * A layer is plain JSON that sits NEXT TO an immutable document: the original file is never
5
+ * touched, marks are drawn over it, and "freezing" (see `freeze.ts`) derives a new document.
6
+ *
7
+ * Geometry is stored as fractions (0..1) of the page as DISPLAYED (after rotation and crop),
8
+ * origin top-left. That makes a mark independent of zoom, device pixel ratio and PDF units, and
9
+ * because the original never changes the coordinates never drift.
10
+ *
11
+ * A redaction mark carries the matched text so a reviewer (or an agent) can see what it hides.
12
+ * That text is sensitive: the layer must never travel with a frozen copy.
13
+ */
14
+ declare const LAYER_SCHEMA_VERSION = 1;
15
+ type AnnotationKind = 'highlight' | 'box' | 'comment' | 'stamp' | 'redaction';
16
+ type RedactionStatus = 'pending' | 'approved' | 'rejected';
17
+ /** Fractions of the displayed page, origin top-left. */
18
+ interface NormRect {
19
+ x: number;
20
+ y: number;
21
+ w: number;
22
+ h: number;
23
+ }
24
+ interface CommentReply {
25
+ id: string;
26
+ author: string;
27
+ createdAt: string;
28
+ body: string;
29
+ }
30
+ interface AnnotationBase {
31
+ id: string;
32
+ /** 1-based page number. */
33
+ page: number;
34
+ author: string;
35
+ createdAt: string;
36
+ updatedAt: string;
37
+ }
38
+ interface HighlightAnnotation extends AnnotationBase {
39
+ kind: 'highlight';
40
+ rects: NormRect[];
41
+ color: string;
42
+ /** The highlighted text, when it came from a text selection. */
43
+ text?: string;
44
+ }
45
+ interface BoxAnnotation extends AnnotationBase {
46
+ kind: 'box';
47
+ rect: NormRect;
48
+ color: string;
49
+ /** Outline width in PDF points at 100%. */
50
+ strokeWidth: number;
51
+ }
52
+ interface CommentAnnotation extends AnnotationBase {
53
+ kind: 'comment';
54
+ /** Anchor box; the note icon is drawn at its top-left corner. */
55
+ rect: NormRect;
56
+ body: string;
57
+ replies: CommentReply[];
58
+ resolved: boolean;
59
+ }
60
+ interface StampAnnotation extends AnnotationBase {
61
+ kind: 'stamp';
62
+ rect: NormRect;
63
+ label: string;
64
+ color: string;
65
+ }
66
+ interface RedactionAnnotation extends AnnotationBase {
67
+ kind: 'redaction';
68
+ rects: NormRect[];
69
+ /** Why it is redacted (e.g. "Privileged"). Printed on the frozen copy, never the text itself. */
70
+ reason: string;
71
+ /** The text under the mark. Sensitive: stays in the layer, never in a frozen document. */
72
+ text?: string;
73
+ status: RedactionStatus;
74
+ }
75
+ type Annotation = HighlightAnnotation | BoxAnnotation | CommentAnnotation | StampAnnotation | RedactionAnnotation;
76
+ interface AnnotationLayer {
77
+ schema: typeof LAYER_SCHEMA_VERSION;
78
+ /** External id of the immutable document the layer annotates. */
79
+ documentId: string;
80
+ /** Optional content hash of the original, so a layer can be checked against the file it marks. */
81
+ documentHash?: string;
82
+ annotations: Annotation[];
83
+ updatedAt: string;
84
+ }
85
+ declare class AnnotationLayerError extends Error {
86
+ constructor(message: string);
87
+ }
88
+ declare function emptyLayer(documentId: string, now: string): AnnotationLayer;
89
+ declare function clampRect(r: NormRect): NormRect;
90
+ /** Validate one annotation from untrusted JSON. Throws `AnnotationLayerError`. */
91
+ declare function parseAnnotation(v: unknown, path?: string): Annotation;
92
+ /** Validate a whole layer from untrusted JSON (storage, network, an agent). */
93
+ declare function parseLayer(v: unknown): AnnotationLayer;
94
+ /** The rectangles a mark covers, whatever its kind. */
95
+ declare function annotationRects(a: Annotation): NormRect[];
96
+ /**
97
+ * True when a redaction mark will be burned into a frozen copy. Fails closed: only an explicit
98
+ * rejection leaves content visible, so a mark nobody reviewed is never silently skipped.
99
+ */
100
+ declare function isEffectiveRedaction(a: Annotation): a is RedactionAnnotation;
101
+
102
+ export { type Annotation as A, type BoxAnnotation as B, type CommentAnnotation as C, type HighlightAnnotation as H, LAYER_SCHEMA_VERSION as L, type NormRect as N, type RedactionAnnotation as R, type StampAnnotation as S, type AnnotationKind as a, type AnnotationLayer as b, AnnotationLayerError as c, type CommentReply as d, type RedactionStatus as e, annotationRects as f, clampRect as g, emptyLayer as h, isEffectiveRedaction as i, parseLayer as j, parseAnnotation as p };