@embedpdf/plugin-redaction 2.14.4 → 3.0.0-next.0

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 (119) hide show
  1. package/LICENSE +192 -21
  2. package/README.md +109 -0
  3. package/dist/index.cjs +227 -2
  4. package/dist/index.cjs.map +1 -1
  5. package/dist/index.d.cts +89 -0
  6. package/dist/index.d.ts +89 -1
  7. package/dist/index.js +220 -1532
  8. package/dist/index.js.map +1 -1
  9. package/package.json +22 -67
  10. package/dist/lib/actions.d.ts +0 -113
  11. package/dist/lib/handlers/index.d.ts +0 -0
  12. package/dist/lib/index.d.ts +0 -11
  13. package/dist/lib/manifest.d.ts +0 -4
  14. package/dist/lib/redaction-plugin.d.ts +0 -153
  15. package/dist/lib/reducer.d.ts +0 -6
  16. package/dist/lib/selectors.d.ts +0 -5
  17. package/dist/lib/tools.d.ts +0 -64
  18. package/dist/lib/types.d.ts +0 -142
  19. package/dist/preact/adapter.d.ts +0 -10
  20. package/dist/preact/annotation.d.ts +0 -1
  21. package/dist/preact/core.d.ts +0 -1
  22. package/dist/preact/index.cjs +0 -2
  23. package/dist/preact/index.cjs.map +0 -1
  24. package/dist/preact/index.d.ts +0 -1
  25. package/dist/preact/index.js +0 -520
  26. package/dist/preact/index.js.map +0 -1
  27. package/dist/preact/utils.d.ts +0 -1
  28. package/dist/react/adapter.d.ts +0 -2
  29. package/dist/react/annotation.d.ts +0 -1
  30. package/dist/react/core.d.ts +0 -1
  31. package/dist/react/index.cjs +0 -2
  32. package/dist/react/index.cjs.map +0 -1
  33. package/dist/react/index.d.ts +0 -1
  34. package/dist/react/index.js +0 -519
  35. package/dist/react/index.js.map +0 -1
  36. package/dist/react/utils.d.ts +0 -1
  37. package/dist/shared/components/annotations/index.d.ts +0 -2
  38. package/dist/shared/components/annotations/redact-area.d.ts +0 -18
  39. package/dist/shared/components/annotations/redact-highlight.d.ts +0 -18
  40. package/dist/shared/components/highlight.d.ts +0 -14
  41. package/dist/shared/components/index.d.ts +0 -5
  42. package/dist/shared/components/marquee-redact.d.ts +0 -15
  43. package/dist/shared/components/pending-redactions.d.ts +0 -12
  44. package/dist/shared/components/redact-renderer-registration.d.ts +0 -5
  45. package/dist/shared/components/redact-renderers.d.ts +0 -7
  46. package/dist/shared/components/redaction-layer.d.ts +0 -16
  47. package/dist/shared/components/selection-redact.d.ts +0 -7
  48. package/dist/shared/components/types.d.ts +0 -9
  49. package/dist/shared/hooks/index.d.ts +0 -1
  50. package/dist/shared/hooks/use-redaction.d.ts +0 -15
  51. package/dist/shared/index.d.ts +0 -4
  52. package/dist/shared-preact/components/annotations/index.d.ts +0 -2
  53. package/dist/shared-preact/components/annotations/redact-area.d.ts +0 -18
  54. package/dist/shared-preact/components/annotations/redact-highlight.d.ts +0 -18
  55. package/dist/shared-preact/components/highlight.d.ts +0 -14
  56. package/dist/shared-preact/components/index.d.ts +0 -5
  57. package/dist/shared-preact/components/marquee-redact.d.ts +0 -15
  58. package/dist/shared-preact/components/pending-redactions.d.ts +0 -12
  59. package/dist/shared-preact/components/redact-renderer-registration.d.ts +0 -5
  60. package/dist/shared-preact/components/redact-renderers.d.ts +0 -7
  61. package/dist/shared-preact/components/redaction-layer.d.ts +0 -16
  62. package/dist/shared-preact/components/selection-redact.d.ts +0 -7
  63. package/dist/shared-preact/components/types.d.ts +0 -9
  64. package/dist/shared-preact/hooks/index.d.ts +0 -1
  65. package/dist/shared-preact/hooks/use-redaction.d.ts +0 -15
  66. package/dist/shared-preact/index.d.ts +0 -4
  67. package/dist/shared-react/components/annotations/index.d.ts +0 -2
  68. package/dist/shared-react/components/annotations/redact-area.d.ts +0 -18
  69. package/dist/shared-react/components/annotations/redact-highlight.d.ts +0 -18
  70. package/dist/shared-react/components/highlight.d.ts +0 -14
  71. package/dist/shared-react/components/index.d.ts +0 -5
  72. package/dist/shared-react/components/marquee-redact.d.ts +0 -15
  73. package/dist/shared-react/components/pending-redactions.d.ts +0 -12
  74. package/dist/shared-react/components/redact-renderer-registration.d.ts +0 -5
  75. package/dist/shared-react/components/redact-renderers.d.ts +0 -7
  76. package/dist/shared-react/components/redaction-layer.d.ts +0 -16
  77. package/dist/shared-react/components/selection-redact.d.ts +0 -7
  78. package/dist/shared-react/components/types.d.ts +0 -9
  79. package/dist/shared-react/hooks/index.d.ts +0 -1
  80. package/dist/shared-react/hooks/use-redaction.d.ts +0 -15
  81. package/dist/shared-react/index.d.ts +0 -4
  82. package/dist/svelte/components/RedactRendererRegistration.svelte.d.ts +0 -7
  83. package/dist/svelte/components/annotations/RedactArea.svelte.d.ts +0 -5
  84. package/dist/svelte/components/annotations/RedactHighlight.svelte.d.ts +0 -5
  85. package/dist/svelte/components/annotations/index.d.ts +0 -2
  86. package/dist/svelte/components/highlight.svelte.d.ts +0 -14
  87. package/dist/svelte/components/index.d.ts +0 -8
  88. package/dist/svelte/components/marquee-redact.svelte.d.ts +0 -16
  89. package/dist/svelte/components/pending-redactions.svelte.d.ts +0 -15
  90. package/dist/svelte/components/redact-renderers.d.ts +0 -7
  91. package/dist/svelte/components/redaction-layer.svelte.d.ts +0 -20
  92. package/dist/svelte/components/selection-redact.svelte.d.ts +0 -8
  93. package/dist/svelte/hooks/index.d.ts +0 -1
  94. package/dist/svelte/hooks/use-redaction.svelte.d.ts +0 -21
  95. package/dist/svelte/index.cjs +0 -2
  96. package/dist/svelte/index.cjs.map +0 -1
  97. package/dist/svelte/index.d.ts +0 -5
  98. package/dist/svelte/index.js +0 -801
  99. package/dist/svelte/index.js.map +0 -1
  100. package/dist/svelte/types.d.ts +0 -10
  101. package/dist/vue/components/annotations/index.d.ts +0 -2
  102. package/dist/vue/components/annotations/redact-area.vue.d.ts +0 -6
  103. package/dist/vue/components/annotations/redact-highlight.vue.d.ts +0 -6
  104. package/dist/vue/components/highlight.vue.d.ts +0 -17
  105. package/dist/vue/components/index.d.ts +0 -8
  106. package/dist/vue/components/marquee-redact.vue.d.ts +0 -19
  107. package/dist/vue/components/pending-redactions.vue.d.ts +0 -68
  108. package/dist/vue/components/redact-renderer-registration.vue.d.ts +0 -13
  109. package/dist/vue/components/redact-renderers.d.ts +0 -7
  110. package/dist/vue/components/redaction-layer.vue.d.ts +0 -50
  111. package/dist/vue/components/selection-redact.vue.d.ts +0 -8
  112. package/dist/vue/components/types.d.ts +0 -9
  113. package/dist/vue/hooks/index.d.ts +0 -1
  114. package/dist/vue/hooks/use-redaction.d.ts +0 -12
  115. package/dist/vue/index.cjs +0 -2
  116. package/dist/vue/index.cjs.map +0 -1
  117. package/dist/vue/index.d.ts +0 -5
  118. package/dist/vue/index.js +0 -638
  119. package/dist/vue/index.js.map +0 -1
@@ -1,153 +0,0 @@
1
- import { RedactionPluginConfig, RedactionCapability, RedactionState } from './types';
2
- import { BasePlugin, PluginRegistry } from '@embedpdf/core';
3
- import { Rect } from '@embedpdf/models';
4
- import { FormattedSelection } from '@embedpdf/plugin-selection';
5
- import { RedactionAction } from './actions';
6
- export declare class RedactionPlugin extends BasePlugin<RedactionPluginConfig, RedactionCapability, RedactionState, RedactionAction> {
7
- static readonly id: "redaction";
8
- private config;
9
- private selectionCapability;
10
- private interactionManagerCapability;
11
- private annotationCapability;
12
- private historyCapability;
13
- /**
14
- * Determines which mode to use:
15
- * - true: Annotation mode (new) - uses REDACT annotations as pending state
16
- * - false: Legacy mode (deprecated) - uses internal pending state
17
- */
18
- private readonly useAnnotationMode;
19
- private readonly redactionSelection$;
20
- private readonly redactionMarquee$;
21
- private readonly pending$;
22
- private readonly selected$;
23
- private readonly state$;
24
- private readonly events$;
25
- private readonly documentUnsubscribers;
26
- constructor(id: string, registry: PluginRegistry, config: RedactionPluginConfig);
27
- /**
28
- * Setup redaction modes - registers all interaction modes for redaction.
29
- * Works for both annotation mode and legacy mode.
30
- */
31
- private setupRedactionModes;
32
- /**
33
- * Setup mode change listener - handles all redaction modes
34
- */
35
- private setupModeChangeListener;
36
- protected onDocumentLoadingStarted(documentId: string): void;
37
- protected onDocumentLoaded(documentId: string): void;
38
- protected onDocumentClosed(documentId: string): void;
39
- initialize(_config: RedactionPluginConfig): Promise<void>;
40
- protected buildCapability(): RedactionCapability;
41
- private createRedactionScope;
42
- /**
43
- * Get pending redactions derived from annotation plugin (annotation mode only)
44
- */
45
- private getPendingFromAnnotations;
46
- private getDocumentState;
47
- private getDocumentStateOrThrow;
48
- private isRedactTool;
49
- private getRedactTool;
50
- /**
51
- * Sync internal state when REDACT annotation is created.
52
- * Called from annotation event listener in annotation mode.
53
- */
54
- private syncFromAnnotationCreate;
55
- /**
56
- * Sync internal state when REDACT annotation is updated (moved/resized/color changed).
57
- * Called from annotation event listener in annotation mode.
58
- */
59
- private syncFromAnnotationUpdate;
60
- /**
61
- * Sync internal state when REDACT annotation is deleted.
62
- * Called from annotation event listener in annotation mode.
63
- */
64
- private syncFromAnnotationDelete;
65
- /**
66
- * Sync internal state from existing REDACT annotations after initial load.
67
- * Called when annotation plugin emits 'loaded' event.
68
- */
69
- private syncFromAnnotationLoad;
70
- /**
71
- * Sync selection state from annotation plugin's selected REDACT annotation.
72
- * Called when annotation plugin state changes.
73
- */
74
- private syncSelectionFromAnnotation;
75
- private addPendingItems;
76
- private removePendingItem;
77
- private clearPendingItems;
78
- private selectPending;
79
- private getSelectedPending;
80
- private deselectPending;
81
- private enableRedactSelection;
82
- private toggleRedactSelection;
83
- private isRedactSelectionActive;
84
- private enableMarqueeRedact;
85
- private toggleMarqueeRedact;
86
- private isMarqueeRedactActive;
87
- private enableRedact;
88
- private toggleRedact;
89
- private isRedactActive;
90
- private endRedact;
91
- onRedactionSelectionChange(documentId: string, callback: (formattedSelection: FormattedSelection[]) => void): import('@embedpdf/core').Unsubscribe;
92
- onRedactionMarqueeChange(documentId: string, callback: (data: {
93
- pageIndex: number;
94
- rect: Rect | null;
95
- modeId: string;
96
- }) => void): import('@embedpdf/core').Unsubscribe;
97
- /**
98
- * Get the stroke color for redaction previews.
99
- * In annotation mode: returns tool's defaults.strokeColor
100
- * In legacy mode: returns hardcoded red
101
- */
102
- getPreviewStrokeColor(): string;
103
- private queueCurrentSelectionAsPending;
104
- private commitPendingOne;
105
- /**
106
- * Legacy commit single redaction using redactTextInRects
107
- */
108
- private commitPendingOneLegacy;
109
- /**
110
- * Annotation mode: Apply single redaction using engine.applyRedaction
111
- */
112
- private applyRedactionAnnotationMode;
113
- private commitAllPending;
114
- /**
115
- * Legacy commit all redactions using redactTextInRects
116
- */
117
- private commitAllPendingLegacy;
118
- /**
119
- * Annotation mode: Apply all redactions using engine.applyAllRedactions per page
120
- */
121
- private applyAllRedactionsAnnotationMode;
122
- /**
123
- * Create REDACT annotations from text selection (annotation mode only)
124
- * @returns Array of annotation IDs that were created
125
- */
126
- private createRedactAnnotationsFromSelection;
127
- /**
128
- * Create legacy RedactionItems from text selection (legacy mode only)
129
- */
130
- private createLegacyRedactionsFromSelection;
131
- /**
132
- * Unified method to create redactions from text selection.
133
- * Delegates to annotation mode or legacy mode helper based on configuration.
134
- */
135
- private createRedactionsFromSelection;
136
- /**
137
- * Create a REDACT annotation from an area/marquee selection (annotation mode only)
138
- */
139
- private createRedactAnnotationFromArea;
140
- /**
141
- * Convert a RedactionItem to a PdfRedactAnnoObject
142
- */
143
- private redactionItemToAnnotation;
144
- /**
145
- * Convert a PdfRedactAnnoObject to a RedactionItem
146
- */
147
- private annotationToRedactionItem;
148
- private emitPendingChange;
149
- private emitSelectedChange;
150
- private emitStateChange;
151
- onStoreUpdated(_: RedactionState, newState: RedactionState): void;
152
- destroy(): Promise<void>;
153
- }
@@ -1,6 +0,0 @@
1
- import { Reducer } from '@embedpdf/core';
2
- import { RedactionState, RedactionDocumentState } from './types';
3
- import { RedactionAction } from './actions';
4
- export declare const initialDocumentState: RedactionDocumentState;
5
- export declare const initialState: RedactionState;
6
- export declare const redactionReducer: Reducer<RedactionState, RedactionAction>;
@@ -1,5 +0,0 @@
1
- import { RedactionState, RedactionDocumentState } from './types';
2
- export declare const getPendingRedactionsCount: (s: RedactionDocumentState) => number;
3
- export declare const hasPendingRedactions: (s: RedactionDocumentState) => boolean;
4
- export declare const getDocumentPendingCount: (state: RedactionState, documentId: string) => number;
5
- export declare const getTotalPendingCount: (state: RedactionState) => number;
@@ -1,64 +0,0 @@
1
- import { PdfAnnotationObject, PdfAnnotationSubtype } from '@embedpdf/models';
2
- import { RedactionMode } from './types';
3
- /**
4
- * Unified Redact tool - handles both text-based and area-based redactions.
5
- * Dynamically determines isDraggable/isResizable based on whether it has segmentRects.
6
- */
7
- export declare const redactTool: {
8
- id: string;
9
- name: string;
10
- categories: string[];
11
- matchScore: (a: PdfAnnotationObject) => 0 | 10;
12
- interaction: {
13
- mode: RedactionMode;
14
- exclusive: false;
15
- cursor: string;
16
- textSelection: true;
17
- isDraggable: (anno: PdfAnnotationObject) => boolean;
18
- isResizable: (anno: PdfAnnotationObject) => boolean;
19
- isRotatable: false;
20
- lockAspectRatio: false;
21
- isGroupDraggable: false;
22
- isGroupResizable: false;
23
- isGroupRotatable: false;
24
- };
25
- defaults: {
26
- type: PdfAnnotationSubtype.REDACT;
27
- color: string;
28
- overlayColor: string;
29
- strokeColor: string;
30
- opacity: number;
31
- };
32
- behavior: {
33
- useAppearanceStream: false;
34
- };
35
- };
36
- export declare const redactTools: {
37
- id: string;
38
- name: string;
39
- categories: string[];
40
- matchScore: (a: PdfAnnotationObject) => 0 | 10;
41
- interaction: {
42
- mode: RedactionMode;
43
- exclusive: false;
44
- cursor: string;
45
- textSelection: true;
46
- isDraggable: (anno: PdfAnnotationObject) => boolean;
47
- isResizable: (anno: PdfAnnotationObject) => boolean;
48
- isRotatable: false;
49
- lockAspectRatio: false;
50
- isGroupDraggable: false;
51
- isGroupResizable: false;
52
- isGroupRotatable: false;
53
- };
54
- defaults: {
55
- type: PdfAnnotationSubtype.REDACT;
56
- color: string;
57
- overlayColor: string;
58
- strokeColor: string;
59
- opacity: number;
60
- };
61
- behavior: {
62
- useAppearanceStream: false;
63
- };
64
- }[];
@@ -1,142 +0,0 @@
1
- import { BasePluginConfig, EventHook } from '@embedpdf/core';
2
- import { PdfErrorReason, Rect, Task } from '@embedpdf/models';
3
- export declare enum RedactionMode {
4
- /**
5
- * Unified redaction mode - supports both text selection and area marquee simultaneously.
6
- * Available when annotation plugin is present.
7
- */
8
- Redact = "redact",
9
- /**
10
- * Area-based redactions only (marquee selection).
11
- * For backwards compatibility with existing code.
12
- */
13
- MarqueeRedact = "marqueeRedact",
14
- /**
15
- * Text-based redactions only (text selection).
16
- * For backwards compatibility with existing code.
17
- */
18
- RedactSelection = "redactSelection"
19
- }
20
- export interface SelectedRedaction {
21
- page: number;
22
- id: string;
23
- }
24
- export interface RedactionDocumentState {
25
- isRedacting: boolean;
26
- activeType: RedactionMode | null;
27
- pending: Record<number, RedactionItem[]>;
28
- pendingCount: number;
29
- selected: SelectedRedaction | null;
30
- }
31
- export interface RedactionState {
32
- documents: Record<string, RedactionDocumentState>;
33
- activeDocumentId: string | null;
34
- }
35
- export type RedactionSource = 'annotation' | 'legacy';
36
- interface RedactionItemBase {
37
- id: string;
38
- page: number;
39
- rect: Rect;
40
- source: RedactionSource;
41
- markColor: string;
42
- redactionColor: string;
43
- }
44
- export type RedactionItem = (RedactionItemBase & {
45
- kind: 'text';
46
- rects: Rect[];
47
- text?: string;
48
- }) | (RedactionItemBase & {
49
- kind: 'area';
50
- });
51
- export interface RedactionPluginConfig extends BasePluginConfig {
52
- drawBlackBoxes: boolean;
53
- /**
54
- * When true, use annotation-based redactions (requires annotation plugin).
55
- * When false (default), use legacy internal pending state.
56
- */
57
- useAnnotationMode?: boolean;
58
- }
59
- export type RedactionEvent = {
60
- type: 'add';
61
- documentId: string;
62
- items: RedactionItem[];
63
- } | {
64
- type: 'remove';
65
- documentId: string;
66
- page: number;
67
- id: string;
68
- } | {
69
- type: 'clear';
70
- documentId: string;
71
- } | {
72
- type: 'commit';
73
- documentId: string;
74
- success: boolean;
75
- error?: PdfErrorReason;
76
- };
77
- export interface PendingChangeEvent {
78
- documentId: string;
79
- pending: Record<number, RedactionItem[]>;
80
- }
81
- export interface SelectedChangeEvent {
82
- documentId: string;
83
- selected: SelectedRedaction | null;
84
- }
85
- export interface StateChangeEvent {
86
- documentId: string;
87
- state: RedactionDocumentState;
88
- }
89
- export interface RedactionScope {
90
- queueCurrentSelectionAsPending(): Task<boolean, PdfErrorReason>;
91
- enableRedact(): void;
92
- toggleRedact(): void;
93
- isRedactActive(): boolean;
94
- endRedact(): void;
95
- enableMarqueeRedact(): void;
96
- toggleMarqueeRedact(): void;
97
- isMarqueeRedactActive(): boolean;
98
- enableRedactSelection(): void;
99
- toggleRedactSelection(): void;
100
- isRedactSelectionActive(): boolean;
101
- addPending(items: RedactionItem[]): void;
102
- removePending(page: number, id: string): void;
103
- clearPending(): void;
104
- commitAllPending(): Task<boolean, PdfErrorReason>;
105
- commitPending(page: number, id: string): Task<boolean, PdfErrorReason>;
106
- selectPending(page: number, id: string): void;
107
- getSelectedPending(): SelectedRedaction | null;
108
- deselectPending(): void;
109
- getState(): RedactionDocumentState;
110
- onPendingChange: EventHook<Record<number, RedactionItem[]>>;
111
- onSelectedChange: EventHook<SelectedRedaction | null>;
112
- onRedactionEvent: EventHook<RedactionEvent>;
113
- onStateChange: EventHook<RedactionDocumentState>;
114
- }
115
- export interface RedactionCapability {
116
- queueCurrentSelectionAsPending(): Task<boolean, PdfErrorReason>;
117
- enableRedact(): void;
118
- toggleRedact(): void;
119
- isRedactActive(): boolean;
120
- endRedact(): void;
121
- enableMarqueeRedact(): void;
122
- toggleMarqueeRedact(): void;
123
- isMarqueeRedactActive(): boolean;
124
- enableRedactSelection(): void;
125
- toggleRedactSelection(): void;
126
- isRedactSelectionActive(): boolean;
127
- addPending(items: RedactionItem[]): void;
128
- removePending(page: number, id: string): void;
129
- clearPending(): void;
130
- commitAllPending(): Task<boolean, PdfErrorReason>;
131
- commitPending(page: number, id: string): Task<boolean, PdfErrorReason>;
132
- selectPending(page: number, id: string): void;
133
- getSelectedPending(): SelectedRedaction | null;
134
- deselectPending(): void;
135
- getState(): RedactionDocumentState;
136
- forDocument(documentId: string): RedactionScope;
137
- onPendingChange: EventHook<PendingChangeEvent>;
138
- onSelectedChange: EventHook<SelectedChangeEvent>;
139
- onRedactionEvent: EventHook<RedactionEvent>;
140
- onStateChange: EventHook<StateChangeEvent>;
141
- }
142
- export {};
@@ -1,10 +0,0 @@
1
- import { JSX } from 'preact';
2
- export { Fragment } from 'preact';
3
- export { useEffect, useRef, useState, useMemo, useCallback } from 'preact/hooks';
4
- export type { ComponentChildren as ReactNode } from 'preact';
5
- export type HTMLAttributes<T = any> = import('preact').JSX.HTMLAttributes<T extends EventTarget ? T : never>;
6
- export type CSSProperties = import('preact').JSX.CSSProperties;
7
- export type MouseEvent<T = Element, _E = unknown> = JSX.TargetedMouseEvent<T extends EventTarget ? T : never>;
8
- export type PointerEvent<T = Element, _E = unknown> = JSX.TargetedPointerEvent<T extends EventTarget ? T : never>;
9
- export type ChangeEvent<T = Element, _E = unknown> = JSX.TargetedInputEvent<T extends EventTarget ? T : never>;
10
- export type TouchEvent<T = Element, _E = unknown> = JSX.TargetedTouchEvent<T extends EventTarget ? T : never>;
@@ -1 +0,0 @@
1
- export * from '@embedpdf/plugin-annotation/preact';
@@ -1 +0,0 @@
1
- export * from '@embedpdf/core/preact';
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@embedpdf/core"),t=require("@embedpdf/plugin-redaction"),n=require("@embedpdf/plugin-annotation/preact"),o=require("preact/jsx-runtime"),i=require("@embedpdf/models"),r=require("preact"),s=require("preact/hooks"),l=require("@embedpdf/core/preact"),a=require("@embedpdf/utils/preact");function d({annotation:e,isSelected:t,scale:n,onClick:r,style:l}){const[a,d]=s.useState(!1),{object:c}=e,u=c.segmentRects??[],g=c.rect,p=c.strokeColor??"#FF0000",x=c.color??"#000000",f=c.opacity??1,h=c.fontColor??c.overlayColor??"#FFFFFF",m=c.overlayText,y=c.overlayTextRepeat??!1,v=c.fontSize??12,b=c.fontFamily??i.PdfStandardFont.Helvetica,S=c.textAlign??i.PdfTextAlignment.Center,R=()=>{if(!m)return null;if(!y)return m;return Array(10).fill(m).join(" ")};return o.jsx("div",{onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),style:{position:"absolute",inset:0},children:u.map((e,t)=>o.jsx("div",{onPointerDown:r,style:{position:"absolute",left:(g?e.origin.x-g.origin.x:e.origin.x)*n,top:(g?e.origin.y-g.origin.y:e.origin.y)*n,width:e.size.width*n,height:e.size.height*n,background:a?x:"transparent",border:a?"none":`2px solid ${p}`,opacity:a?f:1,boxSizing:"border-box",pointerEvents:"auto",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:S===i.PdfTextAlignment.Left?"flex-start":S===i.PdfTextAlignment.Right?"flex-end":"center",overflow:"hidden",...l},children:a&&m&&o.jsx("span",{style:{color:h,fontSize:Math.min(v*n,e.size.height*n*.8),...i.standardFontCssProperties(b),textAlign:i.textAlignmentToCss(S),whiteSpace:y?"normal":"nowrap",overflow:"hidden",textOverflow:"ellipsis",lineHeight:1},children:R()})},t))})}function c({annotation:e,isSelected:t,scale:n,onClick:r,style:l}){const[a,d]=s.useState(!1),{object:c}=e,u=c.strokeColor??"#FF0000",g=c.color??"#000000",p=c.opacity??1,x=c.fontColor??c.overlayColor??"#FFFFFF",f=c.overlayText,h=c.overlayTextRepeat??!1,m=c.fontSize??12,y=c.fontFamily??i.PdfStandardFont.Helvetica,v=c.textAlign??i.PdfTextAlignment.Center;return o.jsx("div",{onPointerDown:t?void 0:r,onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),style:{position:"absolute",inset:0,background:a?g:"transparent",border:a?"none":`2px solid ${u}`,opacity:a?p:1,boxSizing:"border-box",pointerEvents:"auto",cursor:t?"move":"pointer",display:"flex",alignItems:"center",justifyContent:v===i.PdfTextAlignment.Left?"flex-start":v===i.PdfTextAlignment.Right?"flex-end":"center",overflow:"hidden",...l},children:a&&f&&o.jsx("span",{style:{color:x,fontSize:m*n,...i.standardFontCssProperties(y),textAlign:i.textAlignmentToCss(v),whiteSpace:h?"normal":"nowrap",overflow:"hidden",textOverflow:"ellipsis",padding:"4px"},children:(()=>{if(!f)return null;if(!h)return f;return Array(10).fill(f).join(" ")})()})})}const u=[n.createRenderer({id:"redactHighlight",matches:e=>{var t;return e.type===i.PdfAnnotationSubtype.REDACT&&"segmentRects"in e&&((null==(t=e.segmentRects)?void 0:t.length)??0)>0},render:({annotation:e,isSelected:t,scale:n,pageIndex:i,onClick:r})=>o.jsx(d,{annotation:e,isSelected:t,scale:n,pageIndex:i,onClick:r}),interactionDefaults:{isDraggable:!1,isResizable:!1,isRotatable:!1},useAppearanceStream:!1}),n.createRenderer({id:"redactArea",matches:e=>{var t;return!(e.type!==i.PdfAnnotationSubtype.REDACT||"segmentRects"in e&&(null==(t=e.segmentRects)?void 0:t.length))},render:({annotation:e,isSelected:t,scale:n,pageIndex:i,onClick:r})=>o.jsx(c,{annotation:e,isSelected:t,scale:n,pageIndex:i,onClick:r}),interactionDefaults:{isDraggable:!1,isResizable:!1,isRotatable:!1},useAppearanceStream:!1})];function g(){return n.useRegisterRenderers(u),null}const p=()=>l.usePlugin(t.RedactionPlugin.id),x=()=>l.useCapability(t.RedactionPlugin.id),f=({documentId:e,pageIndex:t,scale:n,className:i,stroke:r,fill:a="transparent"})=>{const{plugin:d}=p(),c=l.useDocumentState(e),[u,g]=s.useState(null),x=n??(null==c?void 0:c.scale)??1,f=r??(null==d?void 0:d.getPreviewStrokeColor())??"red";return s.useEffect(()=>{if(d&&e)return d.onRedactionMarqueeChange(e,e=>{g(e.pageIndex===t?e.rect:null)})},[d,e,t]),u?o.jsx("div",{style:{position:"absolute",pointerEvents:"none",left:u.origin.x*x,top:u.origin.y*x,width:u.size.width*x,height:u.size.height*x,border:`1px solid ${f}`,background:a,boxSizing:"border-box"},className:i}):null};function h({color:e="#FFFF00",opacity:t=1,border:n="1px solid red",rects:i,rect:r,scale:s,onClick:l,style:a,...d}){return o.jsx(o.Fragment,{children:i.map((i,c)=>o.jsx("div",{onPointerDown:l,style:{position:"absolute",border:n,left:(r?i.origin.x-r.origin.x:i.origin.x)*s,top:(r?i.origin.y-r.origin.y:i.origin.y)*s,width:i.size.width*s,height:i.size.height*s,background:e,opacity:t,pointerEvents:l?"auto":"none",cursor:l?"pointer":"default",zIndex:l?1:void 0,...a},...d},c))})}function m({documentId:e,pageIndex:t,scale:n}){const{plugin:i}=p(),[r,l]=s.useState([]),[a,d]=s.useState(null),c=(null==i?void 0:i.getPreviewStrokeColor())??"red";return s.useEffect(()=>{if(i)return i.onRedactionSelectionChange(e,e=>{const n=e.find(e=>e.pageIndex===t);l((null==n?void 0:n.segmentRects)??[]),d((null==n?void 0:n.rect)??null)})},[i,e,t]),a?o.jsx("div",{style:{mixBlendMode:"normal",pointerEvents:"none",position:"absolute",inset:0},children:o.jsx(h,{color:"transparent",opacity:1,rects:r,scale:n,border:`1px solid ${c}`})}):null}function y({documentId:e,pageIndex:t,scale:n,bboxStroke:l="rgba(0,0,0,0.8)",rotation:d=i.Rotation.Degree0,selectionMenu:c}){const{provides:u}=x(),[g,p]=s.useState([]),[f,m]=s.useState(null);s.useEffect(()=>{if(!u)return;const n=u.forDocument(e),o=n.getState();p((o.pending[t]??[]).filter(e=>"legacy"===e.source)),m(o.selected&&o.selected.page===t?o.selected.id:null);const i=n.onPendingChange(e=>{p((e[t]??[]).filter(e=>"legacy"===e.source))}),r=n.onSelectedChange(e=>{m(e&&e.page===t?e.id:null)});return()=>{null==i||i(),null==r||r()}},[u,e,t]);const y=s.useCallback((n,o)=>{n.stopPropagation(),u&&u.forDocument(e).selectPending(t,o)},[u,e,t]);return g.length?o.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:g.map(e=>{if("area"===e.kind){const i=e.rect;return o.jsxs(r.Fragment,{children:[o.jsx("div",{style:{position:"absolute",left:i.origin.x*n,top:i.origin.y*n,width:i.size.width*n,height:i.size.height*n,background:"transparent",outline:f===e.id?`1px solid ${l}`:"none",outlineOffset:"2px",border:`1px solid ${e.markColor}`,pointerEvents:"auto",cursor:"pointer"},onPointerDown:t=>y(t,e.id)}),c&&o.jsx(a.CounterRotate,{rect:{origin:{x:i.origin.x*n,y:i.origin.y*n},size:{width:i.size.width*n,height:i.size.height*n}},rotation:d,children:n=>c({...n,context:{type:"redaction",item:e,pageIndex:t},selected:f===e.id,placement:{suggestTop:!1}})})]},e.id)}const i=e.rect;return o.jsxs(r.Fragment,{children:[o.jsx("div",{style:{position:"absolute",left:i.origin.x*n,top:i.origin.y*n,width:i.size.width*n,height:i.size.height*n,background:"transparent",outline:f===e.id?`1px solid ${l}`:"none",outlineOffset:"2px",pointerEvents:"auto",cursor:f===e.id?"pointer":"default"},children:o.jsx(h,{rect:i,rects:e.rects,color:"transparent",border:`1px solid ${e.markColor}`,scale:n,onClick:t=>y(t,e.id)})}),c&&o.jsx(a.CounterRotate,{rect:{origin:{x:i.origin.x*n,y:i.origin.y*n},size:{width:i.size.width*n,height:i.size.height*n}},rotation:d,children:n=>c({...n,context:{type:"redaction",item:e,pageIndex:t},selected:f===e.id,placement:{suggestTop:!1}})})]},e.id)})}):null}const v=e.createPluginPackage(t.RedactionPluginPackage).addUtility(g).build();exports.RedactArea=c,exports.RedactHighlight=d,exports.RedactRendererRegistration=g,exports.RedactionLayer=({documentId:e,pageIndex:t,scale:n,rotation:i,selectionMenu:a})=>{var d,c;const u=l.useDocumentState(e),g=null==(c=null==(d=null==u?void 0:u.document)?void 0:d.pages)?void 0:c[t],p=s.useMemo(()=>void 0!==n?n:(null==u?void 0:u.scale)??1,[n,null==u?void 0:u.scale]),x=s.useMemo(()=>{if(void 0!==i)return i;return(((null==g?void 0:g.rotation)??0)+((null==u?void 0:u.rotation)??0))%4},[i,null==g?void 0:g.rotation,null==u?void 0:u.rotation]);return o.jsxs(r.Fragment,{children:[o.jsx(y,{documentId:e,pageIndex:t,scale:p,rotation:x,selectionMenu:a}),o.jsx(f,{documentId:e,pageIndex:t,scale:p}),o.jsx(m,{documentId:e,pageIndex:t,scale:p})]})},exports.RedactionPluginPackage=v,exports.redactRenderers=u,exports.useRedaction=e=>{const{provides:n}=x(),[o,i]=s.useState(t.initialDocumentState),r=s.useMemo(()=>n?n.forDocument(e):null,[n,e]);return s.useEffect(()=>{if(!r)return void i(t.initialDocumentState);try{i(r.getState())}catch(e){i(t.initialDocumentState)}return r.onStateChange(e=>{i(e)})},[r]),{state:o,provides:r}},exports.useRedactionCapability=x,exports.useRedactionPlugin=p,Object.keys(t).forEach(e=>{"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:()=>t[e]})});
2
- //# sourceMappingURL=index.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.cjs","sources":["../../src/shared/components/annotations/redact-highlight.tsx","../../src/shared/components/annotations/redact-area.tsx","../../src/shared/components/redact-renderers.tsx","../../src/shared/components/redact-renderer-registration.tsx","../../src/shared/hooks/use-redaction.ts","../../src/shared/components/marquee-redact.tsx","../../src/shared/components/highlight.tsx","../../src/shared/components/selection-redact.tsx","../../src/shared/components/pending-redactions.tsx","../../src/shared/components/redaction-layer.tsx","../../src/shared/index.ts"],"sourcesContent":["import { CSSProperties, MouseEvent, useState } from '@framework';\nimport {\n PdfRedactAnnoObject,\n PdfStandardFont,\n PdfTextAlignment,\n Rect,\n standardFontCssProperties,\n textAlignmentToCss,\n} from '@embedpdf/models';\nimport { TrackedAnnotation } from '@embedpdf/plugin-annotation';\n\nexport interface RedactHighlightProps {\n annotation: TrackedAnnotation<PdfRedactAnnoObject>;\n isSelected: boolean;\n scale: number;\n pageIndex: number;\n onClick?: (e: MouseEvent<Element>) => void;\n style?: CSSProperties;\n}\n\n/**\n * Renders a text-based redact annotation using QuadPoints/segmentRects.\n * Default: shows strokeColor (C) border only, no fill.\n * Hovered: shows redaction preview with color (IC) as background fill + overlayText.\n * Selected: no border (AnnotationContainer handles selection styling).\n */\nexport function RedactHighlight({\n annotation,\n isSelected,\n scale,\n onClick,\n style,\n}: RedactHighlightProps) {\n const [isHovered, setIsHovered] = useState(false);\n const { object } = annotation;\n\n const segmentRects = object.segmentRects ?? [];\n const rect = object.rect;\n\n // C - Border/stroke color\n const strokeColor = object.strokeColor ?? '#FF0000';\n // IC - Interior color (background fill when redaction is applied)\n const color = object.color ?? '#000000';\n // CA - Opacity (0-1)\n const opacity = object.opacity ?? 1;\n // OC - Overlay text color (Adobe extension), fallback to fontColor\n const textColor = object.fontColor ?? object.overlayColor ?? '#FFFFFF';\n // Overlay text properties\n const overlayText = object.overlayText;\n const overlayTextRepeat = object.overlayTextRepeat ?? false;\n const fontSize = object.fontSize ?? 12;\n const fontFamily = object.fontFamily ?? PdfStandardFont.Helvetica;\n const textAlign = object.textAlign ?? PdfTextAlignment.Center;\n\n // Calculate how many times to repeat text (approximate)\n const renderOverlayText = () => {\n if (!overlayText) return null;\n if (!overlayTextRepeat) return overlayText;\n // Repeat text multiple times to fill the space\n const reps = 10; // Enough repetitions to fill most containers\n return Array(reps).fill(overlayText).join(' ');\n };\n\n return (\n <div\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n style={{ position: 'absolute', inset: 0 }}\n >\n {segmentRects.map((b: Rect, i: number) => (\n <div\n key={i}\n onPointerDown={onClick}\n style={{\n position: 'absolute',\n left: (rect ? b.origin.x - rect.origin.x : b.origin.x) * scale,\n top: (rect ? b.origin.y - rect.origin.y : b.origin.y) * scale,\n width: b.size.width * scale,\n height: b.size.height * scale,\n // Default: transparent background with strokeColor (C) border\n // Hovered: color (IC) background fill, no border\n // Selected: no border (container handles it)\n background: isHovered ? color : 'transparent',\n border: !isHovered ? `2px solid ${strokeColor}` : 'none',\n opacity: isHovered ? opacity : 1,\n boxSizing: 'border-box',\n pointerEvents: 'auto',\n cursor: 'pointer',\n display: 'flex',\n alignItems: 'center',\n justifyContent:\n textAlign === PdfTextAlignment.Left\n ? 'flex-start'\n : textAlign === PdfTextAlignment.Right\n ? 'flex-end'\n : 'center',\n overflow: 'hidden',\n ...style,\n }}\n >\n {isHovered && overlayText && (\n <span\n style={{\n color: textColor,\n fontSize: Math.min(fontSize * scale, b.size.height * scale * 0.8),\n ...standardFontCssProperties(fontFamily),\n textAlign: textAlignmentToCss(textAlign),\n whiteSpace: overlayTextRepeat ? 'normal' : 'nowrap',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n lineHeight: 1,\n }}\n >\n {renderOverlayText()}\n </span>\n )}\n </div>\n ))}\n </div>\n );\n}\n","import { CSSProperties, MouseEvent, useState } from '@framework';\nimport {\n PdfRedactAnnoObject,\n PdfStandardFont,\n PdfTextAlignment,\n standardFontCssProperties,\n textAlignmentToCss,\n} from '@embedpdf/models';\nimport { TrackedAnnotation } from '@embedpdf/plugin-annotation';\n\nexport interface RedactAreaProps {\n annotation: TrackedAnnotation<PdfRedactAnnoObject>;\n isSelected: boolean;\n scale: number;\n pageIndex: number;\n onClick?: (e: MouseEvent<Element>) => void;\n style?: CSSProperties;\n}\n\n/**\n * Renders an area-based redact annotation (marquee redaction).\n * Default: shows strokeColor (C) border only, no fill.\n * Hovered: shows redaction preview with color (IC) as background fill + overlayText.\n * Selected: no border (AnnotationContainer handles selection styling).\n */\nexport function RedactArea({ annotation, isSelected, scale, onClick, style }: RedactAreaProps) {\n const [isHovered, setIsHovered] = useState(false);\n const { object } = annotation;\n\n // C - Border/stroke color\n const strokeColor = object.strokeColor ?? '#FF0000';\n // IC - Interior color (background fill when redaction is applied)\n const color = object.color ?? '#000000';\n // CA - Opacity (0-1)\n const opacity = object.opacity ?? 1;\n // OC - Overlay text color (Adobe extension), fallback to fontColor\n const textColor = object.fontColor ?? object.overlayColor ?? '#FFFFFF';\n // Overlay text properties\n const overlayText = object.overlayText;\n const overlayTextRepeat = object.overlayTextRepeat ?? false;\n const fontSize = object.fontSize ?? 12;\n const fontFamily = object.fontFamily ?? PdfStandardFont.Helvetica;\n const textAlign = object.textAlign ?? PdfTextAlignment.Center;\n\n // Calculate how many times to repeat text (approximate)\n const renderOverlayText = () => {\n if (!overlayText) return null;\n if (!overlayTextRepeat) return overlayText;\n // Repeat text multiple times to fill the space\n const reps = 10; // Enough repetitions to fill most containers\n return Array(reps).fill(overlayText).join(' ');\n };\n\n return (\n <div\n onPointerDown={!isSelected ? onClick : undefined}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n style={{\n position: 'absolute',\n inset: 0,\n // Default: transparent background with strokeColor (C) border\n // Hovered: color (IC) background fill, no border\n // Selected: no border (container handles it)\n background: isHovered ? color : 'transparent',\n border: !isHovered ? `2px solid ${strokeColor}` : 'none',\n opacity: isHovered ? opacity : 1,\n boxSizing: 'border-box',\n pointerEvents: 'auto',\n cursor: isSelected ? 'move' : 'pointer',\n display: 'flex',\n alignItems: 'center',\n justifyContent:\n textAlign === PdfTextAlignment.Left\n ? 'flex-start'\n : textAlign === PdfTextAlignment.Right\n ? 'flex-end'\n : 'center',\n overflow: 'hidden',\n ...style,\n }}\n >\n {isHovered && overlayText && (\n <span\n style={{\n color: textColor,\n fontSize: fontSize * scale,\n ...standardFontCssProperties(fontFamily),\n textAlign: textAlignmentToCss(textAlign),\n whiteSpace: overlayTextRepeat ? 'normal' : 'nowrap',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n padding: '4px',\n }}\n >\n {renderOverlayText()}\n </span>\n )}\n </div>\n );\n}\n","import { PdfAnnotationSubtype, PdfRedactAnnoObject } from '@embedpdf/models';\nimport { createRenderer, BoxedAnnotationRenderer } from '@embedpdf/plugin-annotation/@framework';\nimport { RedactHighlight } from './annotations/redact-highlight';\nimport { RedactArea } from './annotations/redact-area';\n\n/**\n * Boxed annotation renderers for Redact annotations.\n * Type safety is enforced at definition time via createRenderer.\n * These are automatically registered with the annotation plugin via context.\n */\nexport const redactRenderers: BoxedAnnotationRenderer[] = [\n createRenderer<PdfRedactAnnoObject>({\n id: 'redactHighlight',\n matches: (a): a is PdfRedactAnnoObject =>\n a.type === PdfAnnotationSubtype.REDACT &&\n 'segmentRects' in a &&\n (a.segmentRects?.length ?? 0) > 0,\n render: ({ annotation, isSelected, scale, pageIndex, onClick }) => (\n <RedactHighlight\n annotation={annotation}\n isSelected={isSelected}\n scale={scale}\n pageIndex={pageIndex}\n onClick={onClick}\n />\n ),\n interactionDefaults: { isDraggable: false, isResizable: false, isRotatable: false },\n useAppearanceStream: false,\n }),\n createRenderer<PdfRedactAnnoObject>({\n id: 'redactArea',\n matches: (a): a is PdfRedactAnnoObject =>\n a.type === PdfAnnotationSubtype.REDACT &&\n (!('segmentRects' in a) || !(a.segmentRects?.length ?? 0)),\n render: ({ annotation, isSelected, scale, pageIndex, onClick }) => (\n <RedactArea\n annotation={annotation}\n isSelected={isSelected}\n scale={scale}\n pageIndex={pageIndex}\n onClick={onClick}\n />\n ),\n interactionDefaults: { isDraggable: false, isResizable: false, isRotatable: false },\n useAppearanceStream: false,\n }),\n];\n","import { useRegisterRenderers } from '@embedpdf/plugin-annotation/@framework';\nimport { redactRenderers } from '../components/redact-renderers';\n\n/**\n * Utility component that registers redact renderers once at app level.\n * Added via addUtility() so it mounts once, not per-page.\n */\nexport function RedactRendererRegistration() {\n useRegisterRenderers(redactRenderers);\n return null;\n}\n","import { useCapability, usePlugin } from '@embedpdf/core/@framework';\nimport {\n initialDocumentState,\n RedactionPlugin,\n RedactionDocumentState,\n RedactionScope,\n} from '@embedpdf/plugin-redaction';\nimport { useState, useEffect, useMemo } from '@framework';\n\nexport const useRedactionPlugin = () => usePlugin<RedactionPlugin>(RedactionPlugin.id);\nexport const useRedactionCapability = () => useCapability<RedactionPlugin>(RedactionPlugin.id);\n\nexport const useRedaction = (\n documentId: string,\n): {\n state: RedactionDocumentState;\n provides: RedactionScope | null;\n} => {\n const { provides } = useRedactionCapability();\n const [state, setState] = useState<RedactionDocumentState>(initialDocumentState);\n\n const scope = useMemo(\n () => (provides ? provides.forDocument(documentId) : null),\n [provides, documentId],\n );\n\n useEffect(() => {\n if (!scope) {\n setState(initialDocumentState);\n return;\n }\n\n // Set initial state\n try {\n setState(scope.getState());\n } catch (e) {\n // Handle case where state might not be ready\n setState(initialDocumentState);\n }\n\n // Subscribe to changes\n const unsubscribe = scope.onStateChange((newState) => {\n setState(newState);\n });\n\n return unsubscribe;\n }, [scope]);\n\n return {\n state,\n provides: scope,\n };\n};\n","import { useEffect, useState } from '@framework';\nimport { useDocumentState } from '@embedpdf/core/@framework';\nimport { Rect } from '@embedpdf/models';\n\nimport { useRedactionPlugin } from '../hooks/use-redaction';\n\ninterface MarqueeRedactProps {\n /** The ID of the document */\n documentId: string;\n /** Index of the page this layer lives on */\n pageIndex: number;\n /** Scale of the page */\n scale?: number;\n /** Optional CSS class applied to the marquee rectangle */\n className?: string;\n /** Stroke / fill colours (defaults below) */\n stroke?: string;\n fill?: string;\n}\n\nexport const MarqueeRedact = ({\n documentId,\n pageIndex,\n scale: scaleOverride,\n className,\n stroke,\n fill = 'transparent',\n}: MarqueeRedactProps) => {\n const { plugin: redactionPlugin } = useRedactionPlugin();\n const documentState = useDocumentState(documentId);\n\n const [rect, setRect] = useState<Rect | null>(null);\n\n const scale = scaleOverride ?? documentState?.scale ?? 1;\n\n // Get stroke color from plugin (annotation mode uses tool defaults, legacy uses red)\n // Allow prop override for backwards compatibility\n const strokeColor = stroke ?? redactionPlugin?.getPreviewStrokeColor() ?? 'red';\n\n useEffect(() => {\n if (!redactionPlugin || !documentId) return;\n return redactionPlugin.onRedactionMarqueeChange(documentId, (data) => {\n setRect(data.pageIndex === pageIndex ? data.rect : null);\n });\n }, [redactionPlugin, documentId, pageIndex]);\n\n if (!rect) return null;\n\n return (\n <div\n style={{\n position: 'absolute',\n pointerEvents: 'none',\n left: rect.origin.x * scale,\n top: rect.origin.y * scale,\n width: rect.size.width * scale,\n height: rect.size.height * scale,\n border: `1px solid ${strokeColor}`,\n background: fill,\n boxSizing: 'border-box',\n }}\n className={className}\n />\n );\n};\n","import { HTMLAttributes, CSSProperties, MouseEvent } from '@framework';\nimport { Rect } from '@embedpdf/models';\n\ntype HighlightProps = Omit<HTMLAttributes<HTMLDivElement>, 'style'> & {\n color?: string;\n opacity?: number;\n border?: string;\n rects: Rect[];\n rect?: Rect;\n scale: number;\n onClick?: (e: MouseEvent<HTMLDivElement>) => void;\n style?: CSSProperties;\n};\n\nexport function Highlight({\n color = '#FFFF00',\n opacity = 1,\n border = '1px solid red',\n rects,\n rect,\n scale,\n onClick,\n style,\n ...props\n}: HighlightProps) {\n return (\n <>\n {rects.map((b, i) => (\n <div\n key={i}\n onPointerDown={onClick}\n style={{\n position: 'absolute',\n border,\n left: (rect ? b.origin.x - rect.origin.x : b.origin.x) * scale,\n top: (rect ? b.origin.y - rect.origin.y : b.origin.y) * scale,\n width: b.size.width * scale,\n height: b.size.height * scale,\n background: color,\n opacity: opacity,\n pointerEvents: onClick ? 'auto' : 'none',\n cursor: onClick ? 'pointer' : 'default',\n zIndex: onClick ? 1 : undefined,\n ...style,\n }}\n {...props}\n />\n ))}\n </>\n );\n}\n","import { Rect } from '@embedpdf/models';\nimport { useEffect, useState } from '@framework';\nimport { useRedactionPlugin } from '../hooks';\nimport { Highlight } from './highlight';\n\ninterface SelectionRedactProps {\n documentId: string;\n pageIndex: number;\n scale: number;\n}\n\nexport function SelectionRedact({ documentId, pageIndex, scale }: SelectionRedactProps) {\n const { plugin: redactionPlugin } = useRedactionPlugin();\n const [rects, setRects] = useState<Array<Rect>>([]);\n const [boundingRect, setBoundingRect] = useState<Rect | null>(null);\n\n // Get stroke color from plugin (annotation mode uses tool defaults, legacy uses red)\n const strokeColor = redactionPlugin?.getPreviewStrokeColor() ?? 'red';\n\n useEffect(() => {\n if (!redactionPlugin) return;\n return redactionPlugin.onRedactionSelectionChange(documentId, (formattedSelection) => {\n const selection = formattedSelection.find((s) => s.pageIndex === pageIndex);\n setRects(selection?.segmentRects ?? []);\n setBoundingRect(selection?.rect ?? null);\n });\n }, [redactionPlugin, documentId, pageIndex]);\n\n if (!boundingRect) return null;\n\n return (\n <div\n style={{\n mixBlendMode: 'normal',\n pointerEvents: 'none',\n position: 'absolute',\n inset: 0,\n }}\n >\n <Highlight\n color={'transparent'}\n opacity={1}\n rects={rects}\n scale={scale}\n border={`1px solid ${strokeColor}`}\n />\n </div>\n );\n}\n","import { Fragment, useEffect, useState, useCallback, MouseEvent } from '@framework';\nimport { CounterRotate } from '@embedpdf/utils/@framework';\nimport { useRedactionCapability } from '../hooks';\nimport { RedactionItem } from '@embedpdf/plugin-redaction';\nimport { Highlight } from './highlight';\nimport { RedactionSelectionMenuRenderFn } from './types';\nimport { Rotation } from '@embedpdf/models';\n\ninterface PendingRedactionsProps {\n documentId: string;\n pageIndex: number;\n scale: number;\n rotation: Rotation;\n bboxStroke?: string;\n selectionMenu?: RedactionSelectionMenuRenderFn;\n}\n\nexport function PendingRedactions({\n documentId,\n pageIndex,\n scale,\n bboxStroke = 'rgba(0,0,0,0.8)',\n rotation = Rotation.Degree0,\n selectionMenu,\n}: PendingRedactionsProps) {\n const { provides: redaction } = useRedactionCapability();\n const [items, setItems] = useState<RedactionItem[]>([]);\n const [selectedId, setSelectedId] = useState<string | null>(null);\n\n useEffect(() => {\n if (!redaction) return;\n\n // Use document-scoped hooks so we only receive events for this document\n const scoped = redaction.forDocument(documentId);\n\n // Initialize with current state - only show legacy mode items\n const currentState = scoped.getState();\n setItems((currentState.pending[pageIndex] ?? []).filter((it) => it.source === 'legacy'));\n setSelectedId(\n currentState.selected && currentState.selected.page === pageIndex\n ? currentState.selected.id\n : null,\n );\n\n // Subscribe to future changes - only show legacy mode items\n const off1 = scoped.onPendingChange((map) => {\n setItems((map[pageIndex] ?? []).filter((it) => it.source === 'legacy'));\n });\n const off2 = scoped.onSelectedChange((sel) => {\n setSelectedId(sel && sel.page === pageIndex ? sel.id : null);\n });\n\n return () => {\n off1?.();\n off2?.();\n };\n }, [redaction, documentId, pageIndex]);\n\n const select = useCallback(\n (e: MouseEvent, id: string) => {\n e.stopPropagation();\n if (!redaction) return;\n redaction.forDocument(documentId).selectPending(pageIndex, id);\n },\n [redaction, documentId, pageIndex],\n );\n\n if (!items.length) return null;\n\n return (\n <div style={{ position: 'absolute', inset: 0, pointerEvents: 'none' }}>\n {items.map((it) => {\n if (it.kind === 'area') {\n const r = it.rect;\n return (\n <Fragment key={it.id}>\n <div\n style={{\n position: 'absolute',\n left: r.origin.x * scale,\n top: r.origin.y * scale,\n width: r.size.width * scale,\n height: r.size.height * scale,\n background: 'transparent',\n outline: selectedId === it.id ? `1px solid ${bboxStroke}` : 'none',\n outlineOffset: '2px',\n border: `1px solid ${it.markColor}`,\n pointerEvents: 'auto',\n cursor: 'pointer',\n }}\n onPointerDown={(e) => select(e, it.id)}\n />\n {selectionMenu && (\n <CounterRotate\n rect={{\n origin: { x: r.origin.x * scale, y: r.origin.y * scale },\n size: { width: r.size.width * scale, height: r.size.height * scale },\n }}\n rotation={rotation}\n >\n {(props) =>\n selectionMenu({\n ...props,\n context: {\n type: 'redaction',\n item: it,\n pageIndex,\n },\n selected: selectedId === it.id,\n placement: {\n suggestTop: false,\n },\n })\n }\n </CounterRotate>\n )}\n </Fragment>\n );\n }\n\n const b = it.rect;\n return (\n <Fragment key={it.id}>\n <div\n style={{\n position: 'absolute',\n left: b.origin.x * scale,\n top: b.origin.y * scale,\n width: b.size.width * scale,\n height: b.size.height * scale,\n background: 'transparent',\n outline: selectedId === it.id ? `1px solid ${bboxStroke}` : 'none',\n outlineOffset: '2px',\n pointerEvents: 'auto',\n cursor: selectedId === it.id ? 'pointer' : 'default',\n }}\n >\n <Highlight\n rect={b}\n rects={it.rects}\n color=\"transparent\"\n border={`1px solid ${it.markColor}`}\n scale={scale}\n onClick={(e) => select(e, it.id)}\n />\n </div>\n {selectionMenu && (\n <CounterRotate\n rect={{\n origin: { x: b.origin.x * scale, y: b.origin.y * scale },\n size: { width: b.size.width * scale, height: b.size.height * scale },\n }}\n rotation={rotation}\n >\n {(props) =>\n selectionMenu({\n ...props,\n context: {\n type: 'redaction',\n item: it,\n pageIndex,\n },\n selected: selectedId === it.id,\n placement: {\n suggestTop: false,\n },\n })\n }\n </CounterRotate>\n )}\n </Fragment>\n );\n })}\n </div>\n );\n}\n","import { Fragment, useMemo } from '@framework';\nimport { useDocumentState } from '@embedpdf/core/@framework';\nimport { MarqueeRedact } from './marquee-redact';\nimport { SelectionRedact } from './selection-redact';\nimport { PendingRedactions } from './pending-redactions';\nimport { Rotation } from '@embedpdf/models';\nimport { RedactionSelectionMenuRenderFn } from './types';\n\ninterface RedactionLayerProps {\n /** The ID of the document this layer belongs to */\n documentId: string;\n /** Index of the page this layer lives on */\n pageIndex: number;\n /** Current render scale for this page */\n scale?: number;\n /** Page rotation (for counter-rotating menus, etc.) */\n rotation?: Rotation;\n /** Optional menu renderer for a selected redaction */\n selectionMenu?: RedactionSelectionMenuRenderFn;\n}\n\nexport const RedactionLayer = ({\n documentId,\n pageIndex,\n scale,\n rotation,\n selectionMenu,\n}: RedactionLayerProps) => {\n const documentState = useDocumentState(documentId);\n const page = documentState?.document?.pages?.[pageIndex];\n\n const actualScale = useMemo(() => {\n if (scale !== undefined) return scale;\n return documentState?.scale ?? 1;\n }, [scale, documentState?.scale]);\n\n const actualRotation = useMemo(() => {\n if (rotation !== undefined) return rotation;\n // Combine page intrinsic rotation with document rotation\n const pageRotation = page?.rotation ?? 0;\n const docRotation = documentState?.rotation ?? 0;\n return ((pageRotation + docRotation) % 4) as Rotation;\n }, [rotation, page?.rotation, documentState?.rotation]);\n\n return (\n <Fragment>\n <PendingRedactions\n documentId={documentId}\n pageIndex={pageIndex}\n scale={actualScale}\n rotation={actualRotation}\n selectionMenu={selectionMenu}\n />\n <MarqueeRedact documentId={documentId} pageIndex={pageIndex} scale={actualScale} />\n <SelectionRedact documentId={documentId} pageIndex={pageIndex} scale={actualScale} />\n </Fragment>\n );\n};\n","import { createPluginPackage } from '@embedpdf/core';\nimport { RedactionPluginPackage as BaseRedactionPackage } from '@embedpdf/plugin-redaction';\nimport { RedactRendererRegistration } from './components/redact-renderer-registration';\n\nexport * from './hooks';\nexport * from './components';\nexport * from '@embedpdf/plugin-redaction';\n\n// Automatically register redact renderers when plugin is loaded\nexport const RedactionPluginPackage = createPluginPackage(BaseRedactionPackage)\n .addUtility(RedactRendererRegistration)\n .build();\n"],"names":["RedactHighlight","annotation","isSelected","scale","onClick","style","isHovered","setIsHovered","useState","object","segmentRects","rect","strokeColor","color","opacity","textColor","fontColor","overlayColor","overlayText","overlayTextRepeat","fontSize","fontFamily","PdfStandardFont","Helvetica","textAlign","PdfTextAlignment","Center","renderOverlayText","Array","fill","join","jsx","onMouseEnter","onMouseLeave","position","inset","children","map","b","i","onPointerDown","left","origin","x","top","y","width","size","height","background","border","boxSizing","pointerEvents","cursor","display","alignItems","justifyContent","Left","Right","overflow","Math","min","standardFontCssProperties","textAlignmentToCss","whiteSpace","textOverflow","lineHeight","RedactArea","padding","redactRenderers","createRenderer","id","matches","a","type","PdfAnnotationSubtype","REDACT","_a","length","render","pageIndex","interactionDefaults","isDraggable","isResizable","isRotatable","useAppearanceStream","RedactRendererRegistration","useRegisterRenderers","useRedactionPlugin","usePlugin","RedactionPlugin","useRedactionCapability","useCapability","MarqueeRedact","documentId","scaleOverride","className","stroke","plugin","redactionPlugin","documentState","useDocumentState","setRect","getPreviewStrokeColor","useEffect","onRedactionMarqueeChange","data","Highlight","rects","props","Fragment","zIndex","SelectionRedact","setRects","boundingRect","setBoundingRect","onRedactionSelectionChange","formattedSelection","selection","find","s","mixBlendMode","PendingRedactions","bboxStroke","rotation","Rotation","Degree0","selectionMenu","provides","redaction","items","setItems","selectedId","setSelectedId","scoped","forDocument","currentState","getState","pending","filter","it","source","selected","page","off1","onPendingChange","off2","onSelectedChange","sel","select","useCallback","e","stopPropagation","selectPending","kind","r","outline","outlineOffset","markColor","CounterRotate","context","item","placement","suggestTop","RedactionPluginPackage","createPluginPackage","BaseRedactionPackage","addUtility","build","_b","document","pages","actualScale","useMemo","actualRotation","state","setState","initial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