react-pdf-highlighter-plus 1.1.1 → 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
+ }