react-pdf-highlighter-plus 1.1.2 → 1.1.4

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,206 @@
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, box-shadow 0.2s ease;
14
+ }
15
+
16
+ .TextHighlight--scrolledTo .TextHighlight__part {
17
+ box-shadow:
18
+ 0 0 0 2px #ff4141,
19
+ 0 0 0 4px rgba(255, 65, 65, 0.2);
20
+ }
21
+
22
+ /* Toolbar wrapper - creates hover bridge between toolbar and highlight */
23
+ .TextHighlight__toolbar-wrapper {
24
+ z-index: 10;
25
+ }
26
+
27
+ /* Toolbar - appears on hover */
28
+ .TextHighlight__toolbar {
29
+ display: flex;
30
+ align-items: center;
31
+ gap: 4px;
32
+ padding: 2px 4px;
33
+ background: rgba(0, 0, 0, 0.7);
34
+ border-radius: 4px;
35
+ opacity: 0;
36
+ pointer-events: none;
37
+ transition: opacity 0.2s ease;
38
+ }
39
+
40
+ .TextHighlight__toolbar--visible {
41
+ opacity: 1;
42
+ pointer-events: auto;
43
+ }
44
+
45
+ .TextHighlight__style-button,
46
+ .TextHighlight__copy-button,
47
+ .TextHighlight__delete-button {
48
+ display: flex;
49
+ align-items: center;
50
+ justify-content: center;
51
+ width: 20px;
52
+ height: 20px;
53
+ border: none;
54
+ background: transparent;
55
+ cursor: pointer;
56
+ color: white;
57
+ border-radius: 3px;
58
+ padding: 0;
59
+ transition: background 0.2s;
60
+ }
61
+
62
+ .TextHighlight__style-button:hover {
63
+ background: rgba(255, 255, 255, 0.2);
64
+ }
65
+
66
+ .TextHighlight__copy-button:hover {
67
+ background: rgba(255, 255, 255, 0.2);
68
+ }
69
+
70
+ .TextHighlight__delete-button:hover {
71
+ background: rgba(255, 100, 100, 0.6);
72
+ }
73
+
74
+ /* Style Panel */
75
+ .TextHighlight__style-panel {
76
+ margin-top: 4px;
77
+ background: rgba(0, 0, 0, 0.9);
78
+ border-radius: 6px;
79
+ padding: 8px;
80
+ min-width: 180px;
81
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
82
+ }
83
+
84
+ .TextHighlight__style-row {
85
+ display: flex;
86
+ align-items: center;
87
+ justify-content: space-between;
88
+ margin-bottom: 8px;
89
+ }
90
+
91
+ .TextHighlight__style-row:last-child {
92
+ margin-bottom: 0;
93
+ }
94
+
95
+ .TextHighlight__style-row label {
96
+ color: #ccc;
97
+ font-size: 11px;
98
+ text-transform: uppercase;
99
+ letter-spacing: 0.5px;
100
+ margin-right: 8px;
101
+ }
102
+
103
+ /* Style type buttons (highlight, underline, strikethrough) */
104
+ .TextHighlight__style-buttons {
105
+ display: flex;
106
+ gap: 4px;
107
+ }
108
+
109
+ .TextHighlight__style-type-button {
110
+ display: flex;
111
+ align-items: center;
112
+ justify-content: center;
113
+ width: 28px;
114
+ height: 28px;
115
+ padding: 0;
116
+ background: transparent;
117
+ border: 1px solid #666;
118
+ border-radius: 4px;
119
+ cursor: pointer;
120
+ color: #f5f5f5;
121
+ transition: all 0.2s;
122
+ }
123
+
124
+ .TextHighlight__style-type-button:hover {
125
+ border-color: #b958ff;
126
+ }
127
+
128
+ .TextHighlight__style-type-button.active {
129
+ color: #b958ff;
130
+ border-color: #b958ff;
131
+ background: rgba(185, 88, 255, 0.2);
132
+ }
133
+
134
+ /* Color options */
135
+ .TextHighlight__color-options {
136
+ display: flex;
137
+ align-items: center;
138
+ gap: 6px;
139
+ }
140
+
141
+ .TextHighlight__color-presets {
142
+ display: flex;
143
+ gap: 4px;
144
+ }
145
+
146
+ .TextHighlight__color-preset {
147
+ width: 18px;
148
+ height: 18px;
149
+ border: 2px solid transparent;
150
+ border-radius: 50%;
151
+ cursor: pointer;
152
+ transition: transform 0.2s, border-color 0.2s;
153
+ padding: 0;
154
+ }
155
+
156
+ .TextHighlight__color-preset:hover {
157
+ transform: scale(1.15);
158
+ }
159
+
160
+ .TextHighlight__color-preset.active {
161
+ border-color: #b958ff;
162
+ }
163
+
164
+ .TextHighlight__color-options input[type="color"] {
165
+ width: 24px;
166
+ height: 24px;
167
+ padding: 0;
168
+ border: none;
169
+ border-radius: 4px;
170
+ cursor: pointer;
171
+ background: transparent;
172
+ }
173
+
174
+ .TextHighlight__color-options input[type="color"]::-webkit-color-swatch-wrapper {
175
+ padding: 0;
176
+ }
177
+
178
+ .TextHighlight__color-options input[type="color"]::-webkit-color-swatch {
179
+ border: 1px solid #666;
180
+ border-radius: 4px;
181
+ }
182
+
183
+ /* Underline style */
184
+ .TextHighlight__part--underline {
185
+ background: transparent !important;
186
+ border-bottom: 2px solid currentColor;
187
+ }
188
+
189
+ /* Strikethrough style */
190
+ .TextHighlight__part.TextHighlight__part--strikethrough {
191
+ background: transparent !important;
192
+ overflow: visible;
193
+ }
194
+
195
+ .TextHighlight__part.TextHighlight__part--strikethrough::after {
196
+ content: "";
197
+ position: absolute;
198
+ left: 0;
199
+ right: 0;
200
+ top: 50%;
201
+ height: 2px;
202
+ background-color: currentColor;
203
+ transform: translateY(-50%);
204
+ pointer-events: none;
205
+ z-index: 1;
206
+ }
@@ -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.4",
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",