svelte-pdf-view 0.1.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.
- package/LICENSE.md +13 -0
- package/README.md +293 -0
- package/dist/PdfRenderer.svelte +238 -0
- package/dist/PdfRenderer.svelte.d.ts +21 -0
- package/dist/PdfToolbar.svelte +229 -0
- package/dist/PdfToolbar.svelte.d.ts +3 -0
- package/dist/PdfViewer.svelte +118 -0
- package/dist/PdfViewer.svelte.d.ts +17 -0
- package/dist/PdfViewerInner.svelte +302 -0
- package/dist/PdfViewerInner.svelte.d.ts +11 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +4 -0
- package/dist/pdf-viewer/EventBus.d.ts +12 -0
- package/dist/pdf-viewer/EventBus.js +42 -0
- package/dist/pdf-viewer/FindController.d.ts +53 -0
- package/dist/pdf-viewer/FindController.js +423 -0
- package/dist/pdf-viewer/PDFPageView.d.ts +58 -0
- package/dist/pdf-viewer/PDFPageView.js +281 -0
- package/dist/pdf-viewer/PDFViewerCore.d.ts +45 -0
- package/dist/pdf-viewer/PDFViewerCore.js +225 -0
- package/dist/pdf-viewer/context.d.ts +31 -0
- package/dist/pdf-viewer/context.js +15 -0
- package/dist/pdf-viewer/renderer-styles.css +203 -0
- package/dist/pdf-viewer/styles.css +281 -0
- package/package.json +88 -0
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
/* Copyright 2024 Mozilla Foundation
|
|
2
|
+
*
|
|
3
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License.
|
|
5
|
+
* You may obtain a copy of the License at
|
|
6
|
+
*
|
|
7
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
*
|
|
9
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
* See the License for the specific language governing permissions and
|
|
13
|
+
* limitations under the License.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/*
|
|
17
|
+
* PDF Renderer Styles - Shadow DOM Isolated
|
|
18
|
+
* This is a derivative work based on PDF.js text_layer_builder.css
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
/* CSS Custom Properties with defaults */
|
|
22
|
+
.pdf-renderer-container {
|
|
23
|
+
--pdf-background-color: #e8e8e8;
|
|
24
|
+
--pdf-page-shadow: 0 2px 8px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.08);
|
|
25
|
+
--pdf-scrollbar-track-color: #f1f1f1;
|
|
26
|
+
--pdf-scrollbar-thumb-color: #c1c1c1;
|
|
27
|
+
--pdf-scrollbar-thumb-hover-color: #a1a1a1;
|
|
28
|
+
--pdf-scrollbar-width: 10px;
|
|
29
|
+
|
|
30
|
+
display: flex;
|
|
31
|
+
flex-direction: column;
|
|
32
|
+
width: 100%;
|
|
33
|
+
height: 100%;
|
|
34
|
+
background-color: var(--pdf-background-color);
|
|
35
|
+
overflow: hidden;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/* Scroll container */
|
|
39
|
+
.pdf-scroll-container {
|
|
40
|
+
flex: 1;
|
|
41
|
+
overflow: auto;
|
|
42
|
+
position: relative;
|
|
43
|
+
background-color: var(--pdf-background-color);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/* Custom scrollbar styling */
|
|
47
|
+
.pdf-scroll-container::-webkit-scrollbar {
|
|
48
|
+
width: var(--pdf-scrollbar-width);
|
|
49
|
+
height: var(--pdf-scrollbar-width);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.pdf-scroll-container::-webkit-scrollbar-track {
|
|
53
|
+
background: var(--pdf-scrollbar-track-color);
|
|
54
|
+
border-radius: calc(var(--pdf-scrollbar-width) / 2);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.pdf-scroll-container::-webkit-scrollbar-thumb {
|
|
58
|
+
background: var(--pdf-scrollbar-thumb-color);
|
|
59
|
+
border-radius: calc(var(--pdf-scrollbar-width) / 2);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.pdf-scroll-container::-webkit-scrollbar-thumb:hover {
|
|
63
|
+
background: var(--pdf-scrollbar-thumb-hover-color);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/* Firefox scrollbar */
|
|
67
|
+
.pdf-scroll-container {
|
|
68
|
+
scrollbar-width: thin;
|
|
69
|
+
scrollbar-color: var(--pdf-scrollbar-thumb-color) var(--pdf-scrollbar-track-color);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/* Viewer - dynamically created */
|
|
73
|
+
.pdfViewer {
|
|
74
|
+
display: flex;
|
|
75
|
+
flex-direction: column;
|
|
76
|
+
align-items: center;
|
|
77
|
+
padding: 20px;
|
|
78
|
+
gap: 16px;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/* Page - dynamically created with CSS variables for text layer */
|
|
82
|
+
.page {
|
|
83
|
+
--user-unit: 1;
|
|
84
|
+
--total-scale-factor: calc(var(--scale-factor, 1) * var(--user-unit));
|
|
85
|
+
--scale-round-x: 1px;
|
|
86
|
+
--scale-round-y: 1px;
|
|
87
|
+
|
|
88
|
+
position: relative;
|
|
89
|
+
background-color: white;
|
|
90
|
+
box-shadow: var(--pdf-page-shadow);
|
|
91
|
+
border-radius: 2px;
|
|
92
|
+
margin: 0;
|
|
93
|
+
direction: ltr;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.page .loadingIcon {
|
|
97
|
+
position: absolute;
|
|
98
|
+
top: 50%;
|
|
99
|
+
left: 50%;
|
|
100
|
+
transform: translate(-50%, -50%);
|
|
101
|
+
color: #666;
|
|
102
|
+
font-size: 14px;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.page .canvasWrapper {
|
|
106
|
+
position: absolute;
|
|
107
|
+
inset: 0;
|
|
108
|
+
overflow: hidden;
|
|
109
|
+
z-index: 0;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.page .pdf-canvas {
|
|
113
|
+
display: block;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/* Text layer - essential styles from PDF.js */
|
|
117
|
+
.textLayer {
|
|
118
|
+
position: absolute;
|
|
119
|
+
text-align: initial;
|
|
120
|
+
inset: 0;
|
|
121
|
+
overflow: clip;
|
|
122
|
+
opacity: 1;
|
|
123
|
+
line-height: 1;
|
|
124
|
+
-webkit-text-size-adjust: none;
|
|
125
|
+
-moz-text-size-adjust: none;
|
|
126
|
+
text-size-adjust: none;
|
|
127
|
+
forced-color-adjust: none;
|
|
128
|
+
transform-origin: 0 0;
|
|
129
|
+
caret-color: CanvasText;
|
|
130
|
+
z-index: 2;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/* Text layer rotation transforms */
|
|
134
|
+
.textLayer[data-main-rotation='90'] {
|
|
135
|
+
transform: rotate(90deg) translateY(-100%);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.textLayer[data-main-rotation='180'] {
|
|
139
|
+
transform: rotate(180deg) translate(-100%, -100%);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.textLayer[data-main-rotation='270'] {
|
|
143
|
+
transform: rotate(270deg) translateX(-100%);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.textLayer :is(span, br) {
|
|
147
|
+
color: transparent;
|
|
148
|
+
position: absolute;
|
|
149
|
+
white-space: pre;
|
|
150
|
+
cursor: text;
|
|
151
|
+
transform-origin: 0% 0%;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.textLayer > :not(.markedContent),
|
|
155
|
+
.textLayer .markedContent span:not(.markedContent) {
|
|
156
|
+
z-index: 1;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.textLayer span.markedContent {
|
|
160
|
+
top: 0;
|
|
161
|
+
height: 0;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.textLayer ::-moz-selection {
|
|
165
|
+
background: rgba(0, 0, 255, 0.25);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.textLayer ::selection {
|
|
169
|
+
background: rgba(0, 0, 255, 0.25);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.textLayer br::-moz-selection,
|
|
173
|
+
.textLayer br::selection {
|
|
174
|
+
background: transparent;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/* Search highlights */
|
|
178
|
+
.textLayer .highlight {
|
|
179
|
+
margin: -1px;
|
|
180
|
+
padding: 1px;
|
|
181
|
+
background-color: rgba(255, 255, 0, 0.4);
|
|
182
|
+
border-radius: 4px;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.textLayer .highlight.appended {
|
|
186
|
+
position: initial;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.textLayer .highlight.selected {
|
|
190
|
+
background-color: rgba(255, 128, 0, 0.6);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.textLayer .highlight.begin {
|
|
194
|
+
border-radius: 4px 0 0 4px;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.textLayer .highlight.end {
|
|
198
|
+
border-radius: 0 4px 4px 0;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.textLayer .highlight.middle {
|
|
202
|
+
border-radius: 0;
|
|
203
|
+
}
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
/* PDF Viewer Styles - Sandboxed for Shadow DOM */
|
|
2
|
+
|
|
3
|
+
/* Container */
|
|
4
|
+
.pdf-viewer-container {
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
width: 100%;
|
|
8
|
+
height: 100%;
|
|
9
|
+
background-color: #f0f0f0;
|
|
10
|
+
overflow: hidden;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/* Toolbar */
|
|
14
|
+
.pdf-toolbar {
|
|
15
|
+
display: flex;
|
|
16
|
+
justify-content: center;
|
|
17
|
+
align-items: center;
|
|
18
|
+
gap: 1rem;
|
|
19
|
+
padding: 0.625rem 1rem;
|
|
20
|
+
background-color: #ffffff;
|
|
21
|
+
color: #333;
|
|
22
|
+
flex-shrink: 0;
|
|
23
|
+
flex-wrap: wrap;
|
|
24
|
+
border-bottom: 1px solid #e0e0e0;
|
|
25
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.pdf-toolbar-group {
|
|
29
|
+
display: flex;
|
|
30
|
+
align-items: center;
|
|
31
|
+
gap: 0.375rem;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.pdf-toolbar button {
|
|
35
|
+
display: inline-flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
justify-content: center;
|
|
38
|
+
width: 32px;
|
|
39
|
+
height: 32px;
|
|
40
|
+
padding: 0;
|
|
41
|
+
border: 1px solid #e0e0e0;
|
|
42
|
+
background-color: #fafafa;
|
|
43
|
+
color: #555;
|
|
44
|
+
border-radius: 6px;
|
|
45
|
+
cursor: pointer;
|
|
46
|
+
transition: all 0.15s ease;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.pdf-toolbar button:hover:not(:disabled) {
|
|
50
|
+
background-color: #f0f0f0;
|
|
51
|
+
border-color: #d0d0d0;
|
|
52
|
+
color: #333;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.pdf-toolbar button:active:not(:disabled) {
|
|
56
|
+
background-color: #e8e8e8;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.pdf-toolbar button:disabled {
|
|
60
|
+
opacity: 0.4;
|
|
61
|
+
cursor: not-allowed;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.pdf-toolbar input[type='text'],
|
|
65
|
+
.pdf-toolbar input[type='number'] {
|
|
66
|
+
height: 28px;
|
|
67
|
+
padding: 0 0.5rem;
|
|
68
|
+
border: 1px solid #e0e0e0;
|
|
69
|
+
border-radius: 6px;
|
|
70
|
+
background-color: #fff;
|
|
71
|
+
color: #333;
|
|
72
|
+
font-size: 0.8rem;
|
|
73
|
+
outline: none;
|
|
74
|
+
transition:
|
|
75
|
+
border-color 0.15s,
|
|
76
|
+
box-shadow 0.15s;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.pdf-toolbar input[type='text']:focus,
|
|
80
|
+
.pdf-toolbar input[type='number']:focus {
|
|
81
|
+
border-color: #0066cc;
|
|
82
|
+
box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.15);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.pdf-toolbar input[type='number'] {
|
|
86
|
+
width: 40px;
|
|
87
|
+
text-align: center;
|
|
88
|
+
appearance: textfield;
|
|
89
|
+
-moz-appearance: textfield;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.pdf-toolbar input[type='number']::-webkit-outer-spin-button,
|
|
93
|
+
.pdf-toolbar input[type='number']::-webkit-inner-spin-button {
|
|
94
|
+
-webkit-appearance: none;
|
|
95
|
+
margin: 0;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.pdf-toolbar .search-input {
|
|
99
|
+
width: 160px;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.pdf-toolbar .zoom-level {
|
|
103
|
+
min-width: 48px;
|
|
104
|
+
text-align: center;
|
|
105
|
+
font-size: 0.8rem;
|
|
106
|
+
color: #666;
|
|
107
|
+
font-weight: 500;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.pdf-toolbar .page-info {
|
|
111
|
+
font-size: 0.8rem;
|
|
112
|
+
color: #888;
|
|
113
|
+
margin-left: 0.25rem;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.pdf-toolbar .match-info {
|
|
117
|
+
font-size: 0.75rem;
|
|
118
|
+
color: #888;
|
|
119
|
+
min-width: 60px;
|
|
120
|
+
margin-left: 0.25rem;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/* Scroll container */
|
|
124
|
+
.pdf-scroll-container {
|
|
125
|
+
flex: 1;
|
|
126
|
+
overflow: auto;
|
|
127
|
+
position: relative;
|
|
128
|
+
background-color: #e8e8e8;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/* Viewer - dynamically created */
|
|
132
|
+
.pdfViewer {
|
|
133
|
+
display: flex;
|
|
134
|
+
flex-direction: column;
|
|
135
|
+
align-items: center;
|
|
136
|
+
padding: 20px;
|
|
137
|
+
gap: 16px;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/* Page - dynamically created with CSS variables for text layer */
|
|
141
|
+
.page {
|
|
142
|
+
--user-unit: 1;
|
|
143
|
+
--total-scale-factor: calc(var(--scale-factor, 1) * var(--user-unit));
|
|
144
|
+
--scale-round-x: 1px;
|
|
145
|
+
--scale-round-y: 1px;
|
|
146
|
+
|
|
147
|
+
position: relative;
|
|
148
|
+
background-color: white;
|
|
149
|
+
box-shadow:
|
|
150
|
+
0 2px 8px rgba(0, 0, 0, 0.12),
|
|
151
|
+
0 1px 3px rgba(0, 0, 0, 0.08);
|
|
152
|
+
border-radius: 2px;
|
|
153
|
+
margin: 0;
|
|
154
|
+
direction: ltr;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.page .loadingIcon {
|
|
158
|
+
position: absolute;
|
|
159
|
+
top: 50%;
|
|
160
|
+
left: 50%;
|
|
161
|
+
transform: translate(-50%, -50%);
|
|
162
|
+
color: #666;
|
|
163
|
+
font-size: 14px;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.page .canvasWrapper {
|
|
167
|
+
position: absolute;
|
|
168
|
+
inset: 0;
|
|
169
|
+
overflow: hidden;
|
|
170
|
+
z-index: 0;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.page .pdf-canvas {
|
|
174
|
+
display: block;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/* Text layer - essential styles from PDF.js */
|
|
178
|
+
.textLayer {
|
|
179
|
+
position: absolute;
|
|
180
|
+
text-align: initial;
|
|
181
|
+
inset: 0;
|
|
182
|
+
overflow: clip;
|
|
183
|
+
opacity: 1;
|
|
184
|
+
line-height: 1;
|
|
185
|
+
-webkit-text-size-adjust: none;
|
|
186
|
+
-moz-text-size-adjust: none;
|
|
187
|
+
text-size-adjust: none;
|
|
188
|
+
forced-color-adjust: none;
|
|
189
|
+
transform-origin: 0 0;
|
|
190
|
+
caret-color: CanvasText;
|
|
191
|
+
z-index: 2;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/* Text layer rotation transforms - text is rendered in raw page coordinates,
|
|
195
|
+
then rotated via CSS to match the canvas orientation */
|
|
196
|
+
.textLayer[data-main-rotation='90'] {
|
|
197
|
+
transform: rotate(90deg) translateY(-100%);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.textLayer[data-main-rotation='180'] {
|
|
201
|
+
transform: rotate(180deg) translate(-100%, -100%);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.textLayer[data-main-rotation='270'] {
|
|
205
|
+
transform: rotate(270deg) translateX(-100%);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.textLayer :is(span, br) {
|
|
209
|
+
color: transparent;
|
|
210
|
+
position: absolute;
|
|
211
|
+
white-space: pre;
|
|
212
|
+
cursor: text;
|
|
213
|
+
transform-origin: 0% 0%;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.textLayer > :not(.markedContent),
|
|
217
|
+
.textLayer .markedContent span:not(.markedContent) {
|
|
218
|
+
z-index: 1;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.textLayer span.markedContent {
|
|
222
|
+
top: 0;
|
|
223
|
+
height: 0;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.textLayer ::-moz-selection {
|
|
227
|
+
background: rgba(0, 0, 255, 0.25);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.textLayer ::selection {
|
|
231
|
+
background: rgba(0, 0, 255, 0.25);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.textLayer br::-moz-selection,
|
|
235
|
+
.textLayer br::selection {
|
|
236
|
+
background: transparent;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/* Search highlights */
|
|
240
|
+
.textLayer .highlight {
|
|
241
|
+
margin: -1px;
|
|
242
|
+
padding: 1px;
|
|
243
|
+
background-color: rgba(255, 255, 0, 0.4);
|
|
244
|
+
border-radius: 4px;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.textLayer .highlight.appended {
|
|
248
|
+
position: initial;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.textLayer .highlight.selected {
|
|
252
|
+
background-color: rgba(255, 128, 0, 0.6);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.textLayer .highlight.begin {
|
|
256
|
+
border-radius: 4px 0 0 4px;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
.textLayer .highlight.end {
|
|
260
|
+
border-radius: 0 4px 4px 0;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
.textLayer .highlight.middle {
|
|
264
|
+
border-radius: 0;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/* Loading state */
|
|
268
|
+
.pdf-loading,
|
|
269
|
+
.pdf-error {
|
|
270
|
+
display: flex;
|
|
271
|
+
justify-content: center;
|
|
272
|
+
align-items: center;
|
|
273
|
+
height: 100%;
|
|
274
|
+
min-height: 200px;
|
|
275
|
+
color: #666;
|
|
276
|
+
font-size: 1rem;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
.pdf-error {
|
|
280
|
+
color: #dc3545;
|
|
281
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "svelte-pdf-view",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "A modern, modular PDF viewer component for Svelte 5. Built on PDF.js with TypeScript support",
|
|
5
|
+
"author": "Louis Li",
|
|
6
|
+
"license": "Apache-2.0",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/nullpointerexceptionkek/svelte-pdf-view.git"
|
|
10
|
+
},
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/nullpointerexceptionkek/svelte-pdf-view/issues"
|
|
13
|
+
},
|
|
14
|
+
"homepage": "https://github.com/nullpointerexceptionkek/svelte-pdf-view#readme",
|
|
15
|
+
"scripts": {
|
|
16
|
+
"dev": "vite dev",
|
|
17
|
+
"build": "vite build && npm run prepack",
|
|
18
|
+
"preview": "vite preview",
|
|
19
|
+
"prepare": "svelte-kit sync || echo ''",
|
|
20
|
+
"prepack": "svelte-kit sync && svelte-package && publint",
|
|
21
|
+
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
|
22
|
+
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
|
23
|
+
"format": "prettier --write .",
|
|
24
|
+
"lint": "prettier --check . && eslint ."
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"dist",
|
|
28
|
+
"!dist/**/*.test.*",
|
|
29
|
+
"!dist/**/*.spec.*",
|
|
30
|
+
"LICENSE.md",
|
|
31
|
+
"README.md"
|
|
32
|
+
],
|
|
33
|
+
"sideEffects": [
|
|
34
|
+
"**/*.css"
|
|
35
|
+
],
|
|
36
|
+
"svelte": "./dist/index.js",
|
|
37
|
+
"types": "./dist/index.d.ts",
|
|
38
|
+
"type": "module",
|
|
39
|
+
"exports": {
|
|
40
|
+
".": {
|
|
41
|
+
"types": "./dist/index.d.ts",
|
|
42
|
+
"svelte": "./dist/index.js"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"peerDependencies": {
|
|
46
|
+
"svelte": "^5.0.0",
|
|
47
|
+
"@lucide/svelte": "^0.400.0"
|
|
48
|
+
},
|
|
49
|
+
"peerDependenciesMeta": {
|
|
50
|
+
"@lucide/svelte": {
|
|
51
|
+
"optional": true
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"devDependencies": {
|
|
55
|
+
"@eslint/compat": "^1.4.0",
|
|
56
|
+
"@eslint/js": "^9.39.1",
|
|
57
|
+
"@sveltejs/adapter-auto": "^7.0.0",
|
|
58
|
+
"@sveltejs/kit": "^2.48.5",
|
|
59
|
+
"@sveltejs/package": "^2.5.6",
|
|
60
|
+
"@sveltejs/vite-plugin-svelte": "^6.2.1",
|
|
61
|
+
"@types/node": "^22",
|
|
62
|
+
"eslint": "^9.39.1",
|
|
63
|
+
"eslint-config-prettier": "^10.1.8",
|
|
64
|
+
"eslint-plugin-svelte": "^3.13.0",
|
|
65
|
+
"globals": "^16.5.0",
|
|
66
|
+
"prettier": "^3.6.2",
|
|
67
|
+
"prettier-plugin-svelte": "^3.4.0",
|
|
68
|
+
"publint": "^0.3.15",
|
|
69
|
+
"svelte": "^5.43.8",
|
|
70
|
+
"svelte-check": "^4.3.4",
|
|
71
|
+
"typescript": "^5.9.3",
|
|
72
|
+
"typescript-eslint": "^8.47.0",
|
|
73
|
+
"vite": "^7.2.2"
|
|
74
|
+
},
|
|
75
|
+
"keywords": [
|
|
76
|
+
"svelte",
|
|
77
|
+
"svelte5",
|
|
78
|
+
"pdf",
|
|
79
|
+
"pdf-viewer",
|
|
80
|
+
"pdfjs",
|
|
81
|
+
"pdf.js",
|
|
82
|
+
"document-viewer",
|
|
83
|
+
"svelte-component"
|
|
84
|
+
],
|
|
85
|
+
"dependencies": {
|
|
86
|
+
"pdfjs-dist": "^5.4.394"
|
|
87
|
+
}
|
|
88
|
+
}
|