react-pdf-highlighter-plus 1.1.2 → 1.1.3

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.
@@ -0,0 +1,134 @@
1
+ .AreaHighlight {
2
+ position: absolute;
3
+ }
4
+
5
+ .AreaHighlight__part {
6
+ cursor: pointer;
7
+ position: absolute;
8
+ background: rgba(255, 226, 143, 1);
9
+ transition: background 0.3s;
10
+ }
11
+
12
+ .AreaHighlight--scrolledTo .AreaHighlight__part {
13
+ background: #ff4141;
14
+ }
15
+
16
+ /* Toolbar wrapper - creates hover bridge between toolbar and highlight */
17
+ .AreaHighlight__toolbar-wrapper {
18
+ z-index: 10;
19
+ }
20
+
21
+ /* Toolbar - appears on hover */
22
+ .AreaHighlight__toolbar {
23
+ display: flex;
24
+ align-items: center;
25
+ gap: 4px;
26
+ padding: 2px 4px;
27
+ background: rgba(0, 0, 0, 0.7);
28
+ border-radius: 4px;
29
+ opacity: 0;
30
+ pointer-events: none;
31
+ transition: opacity 0.2s ease;
32
+ }
33
+
34
+ .AreaHighlight__toolbar--visible {
35
+ opacity: 1;
36
+ pointer-events: auto;
37
+ }
38
+
39
+ .AreaHighlight__style-button,
40
+ .AreaHighlight__delete-button {
41
+ display: flex;
42
+ align-items: center;
43
+ justify-content: center;
44
+ width: 20px;
45
+ height: 20px;
46
+ border: none;
47
+ background: transparent;
48
+ cursor: pointer;
49
+ color: white;
50
+ border-radius: 3px;
51
+ padding: 0;
52
+ transition: background 0.2s;
53
+ }
54
+
55
+ .AreaHighlight__style-button:hover {
56
+ background: rgba(255, 255, 255, 0.2);
57
+ }
58
+
59
+ .AreaHighlight__delete-button:hover {
60
+ background: rgba(255, 100, 100, 0.6);
61
+ }
62
+
63
+ /* Style Panel */
64
+ .AreaHighlight__style-panel {
65
+ margin-top: 4px;
66
+ background: rgba(0, 0, 0, 0.9);
67
+ border-radius: 6px;
68
+ padding: 8px;
69
+ min-width: 160px;
70
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
71
+ }
72
+
73
+ .AreaHighlight__style-row {
74
+ display: flex;
75
+ align-items: center;
76
+ justify-content: space-between;
77
+ }
78
+
79
+ .AreaHighlight__style-row label {
80
+ color: #ccc;
81
+ font-size: 11px;
82
+ text-transform: uppercase;
83
+ letter-spacing: 0.5px;
84
+ margin-right: 8px;
85
+ }
86
+
87
+ /* Color options */
88
+ .AreaHighlight__color-options {
89
+ display: flex;
90
+ align-items: center;
91
+ gap: 6px;
92
+ }
93
+
94
+ .AreaHighlight__color-presets {
95
+ display: flex;
96
+ gap: 4px;
97
+ }
98
+
99
+ .AreaHighlight__color-preset {
100
+ width: 18px;
101
+ height: 18px;
102
+ border: 2px solid transparent;
103
+ border-radius: 50%;
104
+ cursor: pointer;
105
+ transition: transform 0.2s, border-color 0.2s;
106
+ padding: 0;
107
+ }
108
+
109
+ .AreaHighlight__color-preset:hover {
110
+ transform: scale(1.15);
111
+ }
112
+
113
+ .AreaHighlight__color-preset.active {
114
+ border-color: #b958ff;
115
+ }
116
+
117
+ .AreaHighlight__color-options input[type="color"] {
118
+ width: 24px;
119
+ height: 24px;
120
+ padding: 0;
121
+ border: none;
122
+ border-radius: 4px;
123
+ cursor: pointer;
124
+ background: transparent;
125
+ }
126
+
127
+ .AreaHighlight__color-options input[type="color"]::-webkit-color-swatch-wrapper {
128
+ padding: 0;
129
+ }
130
+
131
+ .AreaHighlight__color-options input[type="color"]::-webkit-color-swatch {
132
+ border: 1px solid #666;
133
+ border-radius: 4px;
134
+ }
@@ -0,0 +1,62 @@
1
+ .DrawingCanvas {
2
+ position: absolute;
3
+ top: 0;
4
+ left: 0;
5
+ z-index: 5;
6
+ cursor: crosshair;
7
+ touch-action: none;
8
+ }
9
+
10
+ .DrawingCanvas__controls {
11
+ position: fixed;
12
+ bottom: 20px;
13
+ left: 50%;
14
+ transform: translateX(-50%);
15
+ display: flex;
16
+ gap: 10px;
17
+ padding: 10px 20px;
18
+ background-color: rgba(43, 46, 51, 0.95);
19
+ border-radius: 8px;
20
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
21
+ z-index: 10;
22
+ }
23
+
24
+ .DrawingCanvas__controls button {
25
+ padding: 8px 16px;
26
+ border: none;
27
+ border-radius: 4px;
28
+ cursor: pointer;
29
+ font-size: 14px;
30
+ transition: background-color 0.2s, transform 0.1s;
31
+ }
32
+
33
+ .DrawingCanvas__controls button:hover {
34
+ transform: scale(1.02);
35
+ }
36
+
37
+ .DrawingCanvas__doneButton {
38
+ background-color: #4CAF50;
39
+ color: white;
40
+ }
41
+
42
+ .DrawingCanvas__doneButton:hover {
43
+ background-color: #45a049;
44
+ }
45
+
46
+ .DrawingCanvas__cancelButton {
47
+ background-color: #f44336;
48
+ color: white;
49
+ }
50
+
51
+ .DrawingCanvas__cancelButton:hover {
52
+ background-color: #da190b;
53
+ }
54
+
55
+ .DrawingCanvas__clearButton {
56
+ background-color: #ff9800;
57
+ color: white;
58
+ }
59
+
60
+ .DrawingCanvas__clearButton:hover {
61
+ background-color: #e68a00;
62
+ }
@@ -0,0 +1,184 @@
1
+ .DrawingHighlight {
2
+ position: absolute;
3
+ }
4
+
5
+ .DrawingHighlight__container {
6
+ width: 100%;
7
+ height: 100%;
8
+ display: flex;
9
+ flex-direction: column;
10
+ border-radius: 4px;
11
+ overflow: visible;
12
+ transition: box-shadow 0.2s ease;
13
+ }
14
+
15
+ .DrawingHighlight__container:hover {
16
+ box-shadow: 2px 2px 12px rgba(0, 0, 0, 0.3);
17
+ }
18
+
19
+ .DrawingHighlight__toolbar {
20
+ display: flex;
21
+ align-items: center;
22
+ gap: 4px;
23
+ padding: 2px 4px;
24
+ background: rgba(0, 0, 0, 0.6);
25
+ border-radius: 4px;
26
+ position: absolute;
27
+ top: 4px;
28
+ left: 4px;
29
+ z-index: 10;
30
+ opacity: 0;
31
+ transition: opacity 0.2s ease;
32
+ }
33
+
34
+ .DrawingHighlight__container:hover .DrawingHighlight__toolbar {
35
+ opacity: 1;
36
+ }
37
+
38
+ .DrawingHighlight__drag-handle {
39
+ display: flex;
40
+ align-items: center;
41
+ justify-content: center;
42
+ width: 20px;
43
+ height: 20px;
44
+ cursor: grab;
45
+ color: white;
46
+ border-radius: 3px;
47
+ transition: background 0.2s;
48
+ }
49
+
50
+ .DrawingHighlight__drag-handle:hover {
51
+ background: rgba(255, 255, 255, 0.2);
52
+ }
53
+
54
+ .DrawingHighlight__drag-handle:active {
55
+ cursor: grabbing;
56
+ }
57
+
58
+ .DrawingHighlight__content {
59
+ flex: 1;
60
+ display: flex;
61
+ align-items: center;
62
+ justify-content: center;
63
+ overflow: hidden;
64
+ border-radius: 4px;
65
+ /* Transparent background for drawings */
66
+ background: transparent;
67
+ }
68
+
69
+ .DrawingHighlight__image {
70
+ max-width: 100%;
71
+ max-height: 100%;
72
+ object-fit: contain;
73
+ pointer-events: none;
74
+ user-select: none;
75
+ }
76
+
77
+ .DrawingHighlight--scrolledTo .DrawingHighlight__container {
78
+ box-shadow: 0 0 0 3px #ff4141, 2px 2px 8px rgba(0, 0, 0, 0.2);
79
+ }
80
+
81
+ /* Style edit button */
82
+ .DrawingHighlight__style-button {
83
+ display: flex;
84
+ align-items: center;
85
+ justify-content: center;
86
+ width: 20px;
87
+ height: 20px;
88
+ padding: 0;
89
+ background: transparent;
90
+ border: none;
91
+ cursor: pointer;
92
+ color: white;
93
+ border-radius: 3px;
94
+ transition: background 0.2s;
95
+ }
96
+
97
+ .DrawingHighlight__style-button:hover {
98
+ background: rgba(255, 255, 255, 0.2);
99
+ }
100
+
101
+ /* Style controls dropdown */
102
+ .DrawingHighlight__style-controls {
103
+ position: absolute;
104
+ top: 28px;
105
+ left: 4px;
106
+ background: rgba(0, 0, 0, 0.85);
107
+ border-radius: 6px;
108
+ padding: 8px;
109
+ z-index: 20;
110
+ display: flex;
111
+ flex-direction: column;
112
+ gap: 8px;
113
+ min-width: 120px;
114
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
115
+ }
116
+
117
+ .DrawingHighlight__color-picker {
118
+ display: flex;
119
+ gap: 4px;
120
+ flex-wrap: wrap;
121
+ }
122
+
123
+ .DrawingHighlight__color-button {
124
+ width: 20px;
125
+ height: 20px;
126
+ border: 2px solid transparent;
127
+ border-radius: 50%;
128
+ cursor: pointer;
129
+ transition: transform 0.2s, border-color 0.2s;
130
+ padding: 0;
131
+ }
132
+
133
+ .DrawingHighlight__color-button:hover {
134
+ transform: scale(1.15);
135
+ }
136
+
137
+ .DrawingHighlight__color-button.active {
138
+ border-color: #b958ff;
139
+ }
140
+
141
+ .DrawingHighlight__width-picker {
142
+ display: flex;
143
+ gap: 4px;
144
+ }
145
+
146
+ .DrawingHighlight__width-button {
147
+ background: transparent;
148
+ color: #f5f5f5;
149
+ border: 1px solid #666;
150
+ border-radius: 4px;
151
+ cursor: pointer;
152
+ font-size: 10px;
153
+ padding: 2px 6px;
154
+ transition: color 0.2s, border-color 0.2s, background-color 0.2s;
155
+ }
156
+
157
+ .DrawingHighlight__width-button:hover {
158
+ border-color: #b958ff;
159
+ }
160
+
161
+ .DrawingHighlight__width-button.active {
162
+ color: #b958ff;
163
+ border-color: #b958ff;
164
+ background-color: rgba(185, 88, 255, 0.2);
165
+ }
166
+
167
+ .DrawingHighlight__delete-button {
168
+ display: flex;
169
+ align-items: center;
170
+ justify-content: center;
171
+ width: 20px;
172
+ height: 20px;
173
+ border: none;
174
+ background: transparent;
175
+ cursor: pointer;
176
+ color: white;
177
+ border-radius: 3px;
178
+ padding: 0;
179
+ transition: background 0.2s;
180
+ }
181
+
182
+ .DrawingHighlight__delete-button:hover {
183
+ background: rgba(255, 100, 100, 0.6);
184
+ }
@@ -0,0 +1,249 @@
1
+ .FreetextHighlight {
2
+ position: absolute;
3
+ }
4
+
5
+ .FreetextHighlight__container {
6
+ display: flex;
7
+ flex-direction: column;
8
+ width: 100%;
9
+ height: 100%;
10
+ border-radius: 4px;
11
+ box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.2);
12
+ overflow: visible;
13
+ transition: box-shadow 0.2s ease;
14
+ }
15
+
16
+ .FreetextHighlight__container:hover {
17
+ box-shadow: 2px 2px 12px rgba(0, 0, 0, 0.3);
18
+ }
19
+
20
+ .FreetextHighlight__toolbar {
21
+ display: flex;
22
+ align-items: center;
23
+ gap: 4px;
24
+ padding: 2px 4px;
25
+ background: rgba(0, 0, 0, 0.6);
26
+ border-radius: 4px;
27
+ position: absolute;
28
+ top: 4px;
29
+ left: 4px;
30
+ z-index: 10;
31
+ opacity: 0;
32
+ transition: opacity 0.2s ease;
33
+ }
34
+
35
+ .FreetextHighlight__container:hover .FreetextHighlight__toolbar {
36
+ opacity: 1;
37
+ }
38
+
39
+ .FreetextHighlight__drag-handle {
40
+ display: flex;
41
+ align-items: center;
42
+ justify-content: center;
43
+ width: 20px;
44
+ height: 20px;
45
+ cursor: grab;
46
+ user-select: none;
47
+ color: white;
48
+ border-radius: 3px;
49
+ transition: background 0.2s;
50
+ }
51
+
52
+ .FreetextHighlight__drag-handle:hover {
53
+ background: rgba(255, 255, 255, 0.2);
54
+ }
55
+
56
+ .FreetextHighlight__drag-handle:active {
57
+ cursor: grabbing;
58
+ }
59
+
60
+ .FreetextHighlight__edit-button {
61
+ display: flex;
62
+ align-items: center;
63
+ justify-content: center;
64
+ width: 20px;
65
+ height: 20px;
66
+ border: none;
67
+ background: transparent;
68
+ cursor: pointer;
69
+ color: white;
70
+ border-radius: 3px;
71
+ padding: 0;
72
+ transition: background 0.2s;
73
+ }
74
+
75
+ .FreetextHighlight__edit-button:hover {
76
+ background: rgba(255, 255, 255, 0.2);
77
+ }
78
+
79
+ .FreetextHighlight__content {
80
+ flex: 1;
81
+ padding: 8px;
82
+ overflow: hidden;
83
+ position: relative;
84
+ z-index: 1;
85
+ }
86
+
87
+ .FreetextHighlight__text {
88
+ width: 100%;
89
+ height: 100%;
90
+ cursor: text;
91
+ overflow: auto;
92
+ word-wrap: break-word;
93
+ white-space: pre-wrap;
94
+ }
95
+
96
+ .FreetextHighlight__input {
97
+ width: 100%;
98
+ height: 100%;
99
+ border: none;
100
+ background: transparent;
101
+ font: inherit;
102
+ color: inherit;
103
+ resize: none;
104
+ outline: none;
105
+ padding: 0;
106
+ margin: 0;
107
+ }
108
+
109
+ .FreetextHighlight--scrolledTo .FreetextHighlight__container {
110
+ box-shadow: 0 0 0 3px #ff4141, 2px 2px 8px rgba(0, 0, 0, 0.2);
111
+ }
112
+
113
+ .FreetextHighlight--editing .FreetextHighlight__container {
114
+ box-shadow: 0 0 0 2px #4a90d9, 2px 2px 8px rgba(0, 0, 0, 0.2);
115
+ }
116
+
117
+ .FreetextHighlight__style-button {
118
+ display: flex;
119
+ align-items: center;
120
+ justify-content: center;
121
+ width: 20px;
122
+ height: 20px;
123
+ border: none;
124
+ background: transparent;
125
+ cursor: pointer;
126
+ color: white;
127
+ border-radius: 3px;
128
+ padding: 0;
129
+ transition: background 0.2s;
130
+ }
131
+
132
+ .FreetextHighlight__style-button:hover {
133
+ background: rgba(255, 255, 255, 0.2);
134
+ }
135
+
136
+ .FreetextHighlight__style-panel {
137
+ position: absolute;
138
+ top: 100%;
139
+ left: 0;
140
+ right: 0;
141
+ background: white;
142
+ border: 1px solid rgba(0, 0, 0, 0.15);
143
+ border-radius: 4px;
144
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
145
+ padding: 8px;
146
+ z-index: 9999;
147
+ margin-top: 2px;
148
+ }
149
+
150
+ .FreetextHighlight__style-row {
151
+ display: flex;
152
+ flex-direction: column;
153
+ align-items: flex-start;
154
+ gap: 4px;
155
+ margin-bottom: 8px;
156
+ }
157
+
158
+ .FreetextHighlight__style-row:last-child {
159
+ margin-bottom: 0;
160
+ }
161
+
162
+ .FreetextHighlight__style-row label {
163
+ font-size: 11px;
164
+ color: #555;
165
+ white-space: nowrap;
166
+ }
167
+
168
+ .FreetextHighlight__style-row input[type="color"] {
169
+ width: 28px;
170
+ height: 24px;
171
+ border: 1px solid rgba(0, 0, 0, 0.15);
172
+ border-radius: 3px;
173
+ padding: 0;
174
+ cursor: pointer;
175
+ }
176
+
177
+ .FreetextHighlight__style-row select {
178
+ padding: 4px 6px;
179
+ font-size: 11px;
180
+ border: 1px solid rgba(0, 0, 0, 0.15);
181
+ border-radius: 3px;
182
+ background: white;
183
+ cursor: pointer;
184
+ min-width: 80px;
185
+ }
186
+
187
+ .FreetextHighlight__color-options {
188
+ display: flex;
189
+ align-items: center;
190
+ gap: 6px;
191
+ flex-wrap: wrap;
192
+ width: 100%;
193
+ }
194
+
195
+ .FreetextHighlight__color-presets {
196
+ display: flex;
197
+ gap: 4px;
198
+ flex-wrap: wrap;
199
+ }
200
+
201
+ .FreetextHighlight__color-preset {
202
+ width: 20px;
203
+ height: 20px;
204
+ border: 2px solid rgba(0, 0, 0, 0.15);
205
+ border-radius: 3px;
206
+ cursor: pointer;
207
+ padding: 0;
208
+ transition: transform 0.15s, border-color 0.15s;
209
+ }
210
+
211
+ .FreetextHighlight__color-preset:hover {
212
+ transform: scale(1.15);
213
+ border-color: rgba(0, 0, 0, 0.3);
214
+ }
215
+
216
+ .FreetextHighlight__color-preset.active {
217
+ border-color: #333;
218
+ box-shadow: 0 0 0 1px white, 0 0 0 2px #333;
219
+ }
220
+
221
+ .FreetextHighlight__color-preset--transparent {
222
+ background:
223
+ linear-gradient(45deg, #ccc 25%, transparent 25%),
224
+ linear-gradient(-45deg, #ccc 25%, transparent 25%),
225
+ linear-gradient(45deg, transparent 75%, #ccc 75%),
226
+ linear-gradient(-45deg, transparent 75%, #ccc 75%);
227
+ background-size: 8px 8px;
228
+ background-position: 0 0, 0 4px, 4px -4px, -4px 0px;
229
+ background-color: white;
230
+ }
231
+
232
+ .FreetextHighlight__delete-button {
233
+ display: flex;
234
+ align-items: center;
235
+ justify-content: center;
236
+ width: 20px;
237
+ height: 20px;
238
+ border: none;
239
+ background: transparent;
240
+ cursor: pointer;
241
+ color: white;
242
+ border-radius: 3px;
243
+ padding: 0;
244
+ transition: background 0.2s;
245
+ }
246
+
247
+ .FreetextHighlight__delete-button:hover {
248
+ background: rgba(255, 100, 100, 0.6);
249
+ }
@@ -0,0 +1,97 @@
1
+ .ImageHighlight {
2
+ position: absolute;
3
+ }
4
+
5
+ .ImageHighlight__container {
6
+ width: 100%;
7
+ height: 100%;
8
+ display: flex;
9
+ flex-direction: column;
10
+ border-radius: 4px;
11
+ overflow: visible;
12
+ transition: box-shadow 0.2s ease;
13
+ }
14
+
15
+ .ImageHighlight__container:hover {
16
+ box-shadow: 2px 2px 12px rgba(0, 0, 0, 0.3);
17
+ }
18
+
19
+ .ImageHighlight__toolbar {
20
+ display: flex;
21
+ align-items: center;
22
+ gap: 4px;
23
+ padding: 2px 4px;
24
+ background: rgba(0, 0, 0, 0.6);
25
+ border-radius: 4px;
26
+ position: absolute;
27
+ top: 4px;
28
+ left: 4px;
29
+ z-index: 10;
30
+ opacity: 0;
31
+ transition: opacity 0.2s ease;
32
+ }
33
+
34
+ .ImageHighlight__container:hover .ImageHighlight__toolbar {
35
+ opacity: 1;
36
+ }
37
+
38
+ .ImageHighlight__drag-handle {
39
+ display: flex;
40
+ align-items: center;
41
+ justify-content: center;
42
+ width: 20px;
43
+ height: 20px;
44
+ cursor: grab;
45
+ color: white;
46
+ border-radius: 3px;
47
+ transition: background 0.2s;
48
+ }
49
+
50
+ .ImageHighlight__drag-handle:hover {
51
+ background: rgba(255, 255, 255, 0.2);
52
+ }
53
+
54
+ .ImageHighlight__drag-handle:active {
55
+ cursor: grabbing;
56
+ }
57
+
58
+ .ImageHighlight__content {
59
+ flex: 1;
60
+ display: flex;
61
+ align-items: center;
62
+ justify-content: center;
63
+ background: white;
64
+ overflow: hidden;
65
+ border-radius: 4px;
66
+ }
67
+
68
+ .ImageHighlight__image {
69
+ width: 100%;
70
+ height: 100%;
71
+ object-fit: fill;
72
+ pointer-events: none;
73
+ user-select: none;
74
+ }
75
+
76
+ .ImageHighlight--scrolledTo .ImageHighlight__container {
77
+ box-shadow: 0 0 0 3px #ff4141, 2px 2px 8px rgba(0, 0, 0, 0.2);
78
+ }
79
+
80
+ .ImageHighlight__delete-button {
81
+ display: flex;
82
+ align-items: center;
83
+ justify-content: center;
84
+ width: 20px;
85
+ height: 20px;
86
+ border: none;
87
+ background: transparent;
88
+ cursor: pointer;
89
+ color: white;
90
+ border-radius: 3px;
91
+ padding: 0;
92
+ transition: background 0.2s;
93
+ }
94
+
95
+ .ImageHighlight__delete-button:hover {
96
+ background: rgba(255, 100, 100, 0.6);
97
+ }
@@ -0,0 +1,15 @@
1
+ .MouseSelection {
2
+ position: absolute;
3
+ border: 1px dashed #333;
4
+ background: rgba(153,193,218,255);
5
+ mix-blend-mode: multiply;
6
+ }
7
+ /* Internet Explorer support method */
8
+ @media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
9
+ .MouseSelection {opacity: 0.5 }
10
+ }
11
+
12
+ /* Microsoft Edge Browser 12+ (All) - @supports method */
13
+ @supports (-ms-ime-align:auto) {
14
+ .MouseSelection {opacity: 0.5 }
15
+ }
@@ -0,0 +1,91 @@
1
+ .PdfHighlighter {
2
+ position: absolute;
3
+ overflow: auto;
4
+ width: 100%;
5
+ height: 100%;
6
+ /* background-color is now controlled via inline style for theming */
7
+ }
8
+
9
+ /* Style the scrollbar */
10
+ .PdfHighlighter::-webkit-scrollbar {
11
+ width: 10px;
12
+ height: 10px;
13
+ }
14
+
15
+ .PdfHighlighter::-webkit-scrollbar-thumb {
16
+ background-color: #9f9f9f;
17
+ border-radius: 5px;
18
+ }
19
+
20
+ .PdfHighlighter::-webkit-scrollbar-thumb:hover {
21
+ background-color: #d1d1d1;
22
+ }
23
+
24
+ .PdfHighlighter::-webkit-scrollbar-track {
25
+ background-color: #2c2c2c;
26
+ border-radius: 5px;
27
+ }
28
+
29
+ .PdfHighlighter::-webkit-scrollbar-track-piece {
30
+ background-color: #2c2c2c;
31
+ }
32
+
33
+ .PdfHighlighter__tip-container {
34
+ z-index: 6;
35
+ position: absolute;
36
+ }
37
+
38
+ .PdfHighlighter--disable-selection {
39
+ user-select: none;
40
+ pointer-events: none;
41
+ }
42
+
43
+ .PdfHighlighter--freetext-mode {
44
+ cursor: crosshair;
45
+ }
46
+
47
+ .PdfHighlighter--freetext-mode .pdfViewer,
48
+ .PdfHighlighter--freetext-mode .textLayer {
49
+ cursor: crosshair;
50
+ }
51
+
52
+ .PdfHighlighter--image-mode {
53
+ cursor: crosshair;
54
+ }
55
+
56
+ .PdfHighlighter--image-mode .pdfViewer,
57
+ .PdfHighlighter--image-mode .textLayer {
58
+ cursor: crosshair;
59
+ }
60
+
61
+ .PdfHighlighter--drawing-mode {
62
+ cursor: crosshair;
63
+ }
64
+
65
+ .PdfHighlighter--drawing-mode .pdfViewer,
66
+ .PdfHighlighter--drawing-mode .textLayer {
67
+ cursor: crosshair;
68
+ }
69
+
70
+ .PdfHighlighter--area-mode {
71
+ cursor: crosshair;
72
+ }
73
+
74
+ .PdfHighlighter--area-mode .pdfViewer,
75
+ .PdfHighlighter--area-mode .textLayer {
76
+ cursor: crosshair;
77
+ }
78
+
79
+ /* Dark mode - softer inversion for comfortable reading
80
+ Uses 0.9 intensity by default for a dark gray (~#1a1a1a) instead of pure black.
81
+ The brightness adjustment helps maintain readability.
82
+ Note: These are fallback values - actual intensity is controlled via inline styles
83
+ when darkModeInvertIntensity is customized in the theme prop. */
84
+ .PdfHighlighter--dark .page {
85
+ filter: invert(0.9) hue-rotate(180deg) brightness(1.05);
86
+ }
87
+
88
+ /* Double-invert highlights to preserve their original colors */
89
+ .PdfHighlighter--dark .PdfHighlighter__highlight-layer {
90
+ filter: invert(0.9) hue-rotate(180deg) brightness(0.95);
91
+ }
@@ -0,0 +1,47 @@
1
+ .ShapeCanvas {
2
+ position: fixed;
3
+ top: 0;
4
+ left: 0;
5
+ width: 100%;
6
+ height: 100%;
7
+ cursor: crosshair;
8
+ z-index: 1000;
9
+ background: rgba(0, 0, 0, 0.1);
10
+ }
11
+
12
+ .ShapeCanvas__controls {
13
+ position: fixed;
14
+ bottom: 20px;
15
+ left: 50%;
16
+ transform: translateX(-50%);
17
+ display: flex;
18
+ flex-direction: column;
19
+ align-items: center;
20
+ gap: 12px;
21
+ z-index: 1002;
22
+ }
23
+
24
+ .ShapeCanvas__hint {
25
+ background: rgba(0, 0, 0, 0.8);
26
+ color: white;
27
+ padding: 8px 16px;
28
+ border-radius: 6px;
29
+ font-size: 14px;
30
+ white-space: nowrap;
31
+ }
32
+
33
+ .ShapeCanvas__cancelButton {
34
+ padding: 8px 20px;
35
+ background: #f44336;
36
+ color: white;
37
+ border: none;
38
+ border-radius: 4px;
39
+ cursor: pointer;
40
+ font-size: 14px;
41
+ font-weight: 500;
42
+ transition: background 0.2s;
43
+ }
44
+
45
+ .ShapeCanvas__cancelButton:hover {
46
+ background: #d32f2f;
47
+ }
@@ -0,0 +1,182 @@
1
+ .ShapeHighlight {
2
+ position: absolute;
3
+ }
4
+
5
+ .ShapeHighlight__rnd {
6
+ cursor: move;
7
+ }
8
+
9
+ .ShapeHighlight__container {
10
+ width: 100%;
11
+ height: 100%;
12
+ position: relative;
13
+ }
14
+
15
+ .ShapeHighlight__svg {
16
+ width: 100%;
17
+ height: 100%;
18
+ display: block;
19
+ }
20
+
21
+ .ShapeHighlight--scrolledTo .ShapeHighlight__svg rect,
22
+ .ShapeHighlight--scrolledTo .ShapeHighlight__svg ellipse,
23
+ .ShapeHighlight--scrolledTo .ShapeHighlight__svg line {
24
+ stroke: #ff4141 !important;
25
+ }
26
+
27
+ .ShapeHighlight--scrolledTo .ShapeHighlight__svg polygon {
28
+ fill: #ff4141 !important;
29
+ }
30
+
31
+ /* Toolbar wrapper - creates hover bridge between toolbar and shape */
32
+ .ShapeHighlight__toolbar-wrapper {
33
+ z-index: 10;
34
+ }
35
+
36
+ /* Toolbar - appears on hover */
37
+ .ShapeHighlight__toolbar {
38
+ display: flex;
39
+ align-items: center;
40
+ gap: 4px;
41
+ padding: 2px 4px;
42
+ background: rgba(0, 0, 0, 0.7);
43
+ border-radius: 4px;
44
+ opacity: 0;
45
+ pointer-events: none;
46
+ transition: opacity 0.2s ease;
47
+ }
48
+
49
+ .ShapeHighlight__toolbar--visible {
50
+ opacity: 1;
51
+ pointer-events: auto;
52
+ }
53
+
54
+ .ShapeHighlight__style-button,
55
+ .ShapeHighlight__delete-button {
56
+ display: flex;
57
+ align-items: center;
58
+ justify-content: center;
59
+ width: 20px;
60
+ height: 20px;
61
+ border: none;
62
+ background: transparent;
63
+ cursor: pointer;
64
+ color: white;
65
+ border-radius: 3px;
66
+ padding: 0;
67
+ transition: background 0.2s;
68
+ }
69
+
70
+ .ShapeHighlight__style-button:hover {
71
+ background: rgba(255, 255, 255, 0.2);
72
+ }
73
+
74
+ .ShapeHighlight__delete-button:hover {
75
+ background: rgba(255, 100, 100, 0.6);
76
+ }
77
+
78
+ /* Style Panel */
79
+ .ShapeHighlight__style-panel {
80
+ margin-top: 4px;
81
+ background: rgba(0, 0, 0, 0.9);
82
+ border-radius: 6px;
83
+ padding: 8px;
84
+ min-width: 180px;
85
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
86
+ }
87
+
88
+ .ShapeHighlight__style-row {
89
+ display: flex;
90
+ align-items: center;
91
+ justify-content: space-between;
92
+ margin-bottom: 8px;
93
+ }
94
+
95
+ .ShapeHighlight__style-row:last-child {
96
+ margin-bottom: 0;
97
+ }
98
+
99
+ .ShapeHighlight__style-row label {
100
+ color: #ccc;
101
+ font-size: 11px;
102
+ text-transform: uppercase;
103
+ letter-spacing: 0.5px;
104
+ margin-right: 8px;
105
+ }
106
+
107
+ /* Color options */
108
+ .ShapeHighlight__color-options {
109
+ display: flex;
110
+ align-items: center;
111
+ gap: 6px;
112
+ }
113
+
114
+ .ShapeHighlight__color-presets {
115
+ display: flex;
116
+ gap: 4px;
117
+ }
118
+
119
+ .ShapeHighlight__color-preset {
120
+ width: 18px;
121
+ height: 18px;
122
+ border: 2px solid transparent;
123
+ border-radius: 50%;
124
+ cursor: pointer;
125
+ transition: transform 0.2s, border-color 0.2s;
126
+ padding: 0;
127
+ }
128
+
129
+ .ShapeHighlight__color-preset:hover {
130
+ transform: scale(1.15);
131
+ }
132
+
133
+ .ShapeHighlight__color-preset.active {
134
+ border-color: #b958ff;
135
+ }
136
+
137
+ .ShapeHighlight__color-options input[type="color"] {
138
+ width: 24px;
139
+ height: 24px;
140
+ padding: 0;
141
+ border: none;
142
+ border-radius: 4px;
143
+ cursor: pointer;
144
+ background: transparent;
145
+ }
146
+
147
+ .ShapeHighlight__color-options input[type="color"]::-webkit-color-swatch-wrapper {
148
+ padding: 0;
149
+ }
150
+
151
+ .ShapeHighlight__color-options input[type="color"]::-webkit-color-swatch {
152
+ border: 1px solid #666;
153
+ border-radius: 4px;
154
+ }
155
+
156
+ /* Stroke width options */
157
+ .ShapeHighlight__width-options {
158
+ display: flex;
159
+ gap: 4px;
160
+ }
161
+
162
+ .ShapeHighlight__width-button {
163
+ padding: 4px 8px;
164
+ background: transparent;
165
+ border: 1px solid #666;
166
+ border-radius: 4px;
167
+ cursor: pointer;
168
+ color: #ccc;
169
+ font-size: 11px;
170
+ transition: all 0.2s;
171
+ }
172
+
173
+ .ShapeHighlight__width-button:hover {
174
+ border-color: #b958ff;
175
+ color: white;
176
+ }
177
+
178
+ .ShapeHighlight__width-button.active {
179
+ background: rgba(185, 88, 255, 0.2);
180
+ border-color: #b958ff;
181
+ color: #b958ff;
182
+ }
@@ -0,0 +1,83 @@
1
+ .SignaturePad__overlay {
2
+ position: fixed;
3
+ top: 0;
4
+ left: 0;
5
+ right: 0;
6
+ bottom: 0;
7
+ background: rgba(0, 0, 0, 0.5);
8
+ display: flex;
9
+ align-items: center;
10
+ justify-content: center;
11
+ z-index: 10000;
12
+ }
13
+
14
+ .SignaturePad__modal {
15
+ background: white;
16
+ border-radius: 8px;
17
+ padding: 16px;
18
+ box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
19
+ }
20
+
21
+ .SignaturePad__title {
22
+ margin: 0 0 12px 0;
23
+ font-size: 16px;
24
+ font-weight: 600;
25
+ color: #333;
26
+ }
27
+
28
+ .SignaturePad__canvas {
29
+ display: block;
30
+ border: 1px solid #ccc;
31
+ border-radius: 4px;
32
+ cursor: crosshair;
33
+ touch-action: none;
34
+ background: white;
35
+ }
36
+
37
+ .SignaturePad__buttons {
38
+ display: flex;
39
+ gap: 8px;
40
+ margin-top: 12px;
41
+ justify-content: flex-end;
42
+ }
43
+
44
+ .SignaturePad__button {
45
+ padding: 8px 16px;
46
+ font-size: 14px;
47
+ border-radius: 4px;
48
+ cursor: pointer;
49
+ transition: background-color 0.2s, border-color 0.2s;
50
+ }
51
+
52
+ .SignaturePad__button--clear {
53
+ background: white;
54
+ border: 1px solid #ccc;
55
+ color: #666;
56
+ }
57
+
58
+ .SignaturePad__button--clear:hover {
59
+ background: #f5f5f5;
60
+ border-color: #999;
61
+ }
62
+
63
+ .SignaturePad__button--cancel {
64
+ background: white;
65
+ border: 1px solid #ccc;
66
+ color: #666;
67
+ }
68
+
69
+ .SignaturePad__button--cancel:hover {
70
+ background: #f5f5f5;
71
+ border-color: #999;
72
+ }
73
+
74
+ .SignaturePad__button--done {
75
+ background: #2196f3;
76
+ border: 1px solid #2196f3;
77
+ color: white;
78
+ }
79
+
80
+ .SignaturePad__button--done:hover {
81
+ background: #1976d2;
82
+ border-color: #1976d2;
83
+ }
@@ -0,0 +1,199 @@
1
+ .TextHighlight {
2
+ position: absolute;
3
+ }
4
+
5
+ .TextHighlight__parts {
6
+ opacity: 1;
7
+ }
8
+
9
+ .TextHighlight__part {
10
+ cursor: pointer;
11
+ position: absolute;
12
+ background: rgba(255, 226, 143, 1);
13
+ transition: background 0.3s;
14
+ }
15
+
16
+ .TextHighlight--scrolledTo .TextHighlight__part {
17
+ background: #ff4141;
18
+ }
19
+
20
+ /* Toolbar wrapper - creates hover bridge between toolbar and highlight */
21
+ .TextHighlight__toolbar-wrapper {
22
+ z-index: 10;
23
+ }
24
+
25
+ /* Toolbar - appears on hover */
26
+ .TextHighlight__toolbar {
27
+ display: flex;
28
+ align-items: center;
29
+ gap: 4px;
30
+ padding: 2px 4px;
31
+ background: rgba(0, 0, 0, 0.7);
32
+ border-radius: 4px;
33
+ opacity: 0;
34
+ pointer-events: none;
35
+ transition: opacity 0.2s ease;
36
+ }
37
+
38
+ .TextHighlight__toolbar--visible {
39
+ opacity: 1;
40
+ pointer-events: auto;
41
+ }
42
+
43
+ .TextHighlight__style-button,
44
+ .TextHighlight__delete-button {
45
+ display: flex;
46
+ align-items: center;
47
+ justify-content: center;
48
+ width: 20px;
49
+ height: 20px;
50
+ border: none;
51
+ background: transparent;
52
+ cursor: pointer;
53
+ color: white;
54
+ border-radius: 3px;
55
+ padding: 0;
56
+ transition: background 0.2s;
57
+ }
58
+
59
+ .TextHighlight__style-button:hover {
60
+ background: rgba(255, 255, 255, 0.2);
61
+ }
62
+
63
+ .TextHighlight__delete-button:hover {
64
+ background: rgba(255, 100, 100, 0.6);
65
+ }
66
+
67
+ /* Style Panel */
68
+ .TextHighlight__style-panel {
69
+ margin-top: 4px;
70
+ background: rgba(0, 0, 0, 0.9);
71
+ border-radius: 6px;
72
+ padding: 8px;
73
+ min-width: 180px;
74
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
75
+ }
76
+
77
+ .TextHighlight__style-row {
78
+ display: flex;
79
+ align-items: center;
80
+ justify-content: space-between;
81
+ margin-bottom: 8px;
82
+ }
83
+
84
+ .TextHighlight__style-row:last-child {
85
+ margin-bottom: 0;
86
+ }
87
+
88
+ .TextHighlight__style-row label {
89
+ color: #ccc;
90
+ font-size: 11px;
91
+ text-transform: uppercase;
92
+ letter-spacing: 0.5px;
93
+ margin-right: 8px;
94
+ }
95
+
96
+ /* Style type buttons (highlight, underline, strikethrough) */
97
+ .TextHighlight__style-buttons {
98
+ display: flex;
99
+ gap: 4px;
100
+ }
101
+
102
+ .TextHighlight__style-type-button {
103
+ display: flex;
104
+ align-items: center;
105
+ justify-content: center;
106
+ width: 28px;
107
+ height: 28px;
108
+ padding: 0;
109
+ background: transparent;
110
+ border: 1px solid #666;
111
+ border-radius: 4px;
112
+ cursor: pointer;
113
+ color: #f5f5f5;
114
+ transition: all 0.2s;
115
+ }
116
+
117
+ .TextHighlight__style-type-button:hover {
118
+ border-color: #b958ff;
119
+ }
120
+
121
+ .TextHighlight__style-type-button.active {
122
+ color: #b958ff;
123
+ border-color: #b958ff;
124
+ background: rgba(185, 88, 255, 0.2);
125
+ }
126
+
127
+ /* Color options */
128
+ .TextHighlight__color-options {
129
+ display: flex;
130
+ align-items: center;
131
+ gap: 6px;
132
+ }
133
+
134
+ .TextHighlight__color-presets {
135
+ display: flex;
136
+ gap: 4px;
137
+ }
138
+
139
+ .TextHighlight__color-preset {
140
+ width: 18px;
141
+ height: 18px;
142
+ border: 2px solid transparent;
143
+ border-radius: 50%;
144
+ cursor: pointer;
145
+ transition: transform 0.2s, border-color 0.2s;
146
+ padding: 0;
147
+ }
148
+
149
+ .TextHighlight__color-preset:hover {
150
+ transform: scale(1.15);
151
+ }
152
+
153
+ .TextHighlight__color-preset.active {
154
+ border-color: #b958ff;
155
+ }
156
+
157
+ .TextHighlight__color-options input[type="color"] {
158
+ width: 24px;
159
+ height: 24px;
160
+ padding: 0;
161
+ border: none;
162
+ border-radius: 4px;
163
+ cursor: pointer;
164
+ background: transparent;
165
+ }
166
+
167
+ .TextHighlight__color-options input[type="color"]::-webkit-color-swatch-wrapper {
168
+ padding: 0;
169
+ }
170
+
171
+ .TextHighlight__color-options input[type="color"]::-webkit-color-swatch {
172
+ border: 1px solid #666;
173
+ border-radius: 4px;
174
+ }
175
+
176
+ /* Underline style */
177
+ .TextHighlight__part--underline {
178
+ background: transparent !important;
179
+ border-bottom: 2px solid currentColor;
180
+ }
181
+
182
+ /* Strikethrough style */
183
+ .TextHighlight__part.TextHighlight__part--strikethrough {
184
+ background: transparent !important;
185
+ overflow: visible;
186
+ }
187
+
188
+ .TextHighlight__part.TextHighlight__part--strikethrough::after {
189
+ content: "";
190
+ position: absolute;
191
+ left: 0;
192
+ right: 0;
193
+ top: 50%;
194
+ height: 2px;
195
+ background-color: currentColor;
196
+ transform: translateY(-50%);
197
+ pointer-events: none;
198
+ z-index: 1;
199
+ }
@@ -0,0 +1,41 @@
1
+ /* overrides for pdf_viewer.css from PDF.JS web viewer */
2
+
3
+ .textLayer {
4
+ z-index: 2;
5
+ opacity: 1;
6
+ mix-blend-mode: multiply;
7
+ display: flex;
8
+ }
9
+
10
+ .annotationLayer {
11
+ position: absolute;
12
+ top: 0;
13
+
14
+ z-index: 3;
15
+ }
16
+
17
+ html
18
+ body
19
+ .textLayer
20
+ > div:not(.PdfHighlighter__highlight-layer):not(.TextHighlight):not(.TextHighlight-icon) {
21
+ opacity: 1;
22
+ mix-blend-mode: multiply;
23
+ }
24
+
25
+ .textLayer ::selection {
26
+ mix-blend-mode: multiply;
27
+ }
28
+
29
+ @media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
30
+ .textLayer {opacity: 0.5;}
31
+ }
32
+
33
+ /* Internet Explorer support method */
34
+ @media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
35
+ .textLayer {opacity: 0.5 }
36
+ }
37
+
38
+ /* Microsoft Edge Browser 12+ (All) - @supports method */
39
+ @supports (-ms-ime-align:auto) {
40
+ .textLayer {opacity: 0.5 }
41
+ }
@@ -0,0 +1,13 @@
1
+ /* Combined styles for react-pdf-highlighter-plus */
2
+ @import "./pdf_viewer.css";
3
+ @import "./PdfHighlighter.css";
4
+ @import "./MouseSelection.css";
5
+ @import "./TextHighlight.css";
6
+ @import "./AreaHighlight.css";
7
+ @import "./FreetextHighlight.css";
8
+ @import "./ImageHighlight.css";
9
+ @import "./DrawingHighlight.css";
10
+ @import "./DrawingCanvas.css";
11
+ @import "./SignaturePad.css";
12
+ @import "./ShapeCanvas.css";
13
+ @import "./ShapeHighlight.css";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "react-pdf-highlighter-plus",
3
3
  "type": "module",
4
- "version": "1.1.2",
4
+ "version": "1.1.3",
5
5
  "description": "Set of modern React components for PDF highlighting",
6
6
  "author": "Edward Ha <quocvietha08@gmail.com>",
7
7
  "license": "MIT",
@@ -30,11 +30,21 @@
30
30
  "exports": {
31
31
  ".": {
32
32
  "types": "./dist/esm/index.d.ts",
33
- "import": "./dist/esm/index.js"
33
+ "import": "./dist/esm/index.js",
34
+ "default": "./dist/esm/index.js"
34
35
  },
35
- "./style/style.css": "./dist/esm/style/style.css",
36
- "./style/pdf_viewer.css": "./dist/esm/style/pdf_viewer.css",
37
- "./style/*.css": "./dist/esm/style/*.css"
36
+ "./style/style.css": {
37
+ "import": "./dist/esm/style/style.css",
38
+ "default": "./dist/esm/style/style.css"
39
+ },
40
+ "./style/pdf_viewer.css": {
41
+ "import": "./dist/esm/style/pdf_viewer.css",
42
+ "default": "./dist/esm/style/pdf_viewer.css"
43
+ },
44
+ "./style/*.css": {
45
+ "import": "./dist/esm/style/*.css",
46
+ "default": "./dist/esm/style/*.css"
47
+ }
38
48
  },
39
49
  "scripts": {
40
50
  "start": "npm run dev",