@profpowell/pdf-viewer 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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Prof Thomas Powell
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,6 @@
1
+ pdf-viewer is a stand alone web component like browser-window, code-block, code-playground, and others. The components use CSS variables for deep theme support and work with vanilla breeze but are stand alone.
2
+ The components use custom events and are frame work agnostic. The component follows the same repository patterns with JSDocs, a doc site, heavy unit and playwright testing and best practices established elsewhere. Actual viewing of PDFs can be performed by dependencies this component coordinates, wraps, and controls. This makes it like code-block and code-playground which very much rely on other things
3
+
4
+ All source here is local, but once figured out it will be pushed to Github in the ProfPowell account
5
+
6
+ See ~/src/browser-window, ~/src/vanilla-breeze, ~/src/code-block, ~src/code-playground for patterns
@@ -0,0 +1,316 @@
1
+ {
2
+ "schemaVersion": "1.0.0",
3
+ "readme": "",
4
+ "modules": [
5
+ {
6
+ "kind": "javascript-module",
7
+ "path": "src/pdf-viewer.js",
8
+ "declarations": [
9
+ {
10
+ "kind": "class",
11
+ "description": "",
12
+ "name": "PdfViewer",
13
+ "members": [
14
+ {
15
+ "kind": "field",
16
+ "name": "src"
17
+ },
18
+ {
19
+ "kind": "field",
20
+ "name": "page"
21
+ },
22
+ {
23
+ "kind": "field",
24
+ "name": "zoom"
25
+ },
26
+ {
27
+ "kind": "field",
28
+ "name": "mode"
29
+ },
30
+ {
31
+ "kind": "field",
32
+ "name": "view"
33
+ },
34
+ {
35
+ "kind": "field",
36
+ "name": "showToolbar",
37
+ "readonly": true
38
+ },
39
+ {
40
+ "kind": "field",
41
+ "name": "showThumbnails",
42
+ "readonly": true
43
+ },
44
+ {
45
+ "kind": "field",
46
+ "name": "showSearch",
47
+ "readonly": true
48
+ },
49
+ {
50
+ "kind": "field",
51
+ "name": "noDownload",
52
+ "readonly": true
53
+ },
54
+ {
55
+ "kind": "field",
56
+ "name": "noPrint",
57
+ "readonly": true
58
+ },
59
+ {
60
+ "kind": "field",
61
+ "name": "viewerTitle",
62
+ "readonly": true
63
+ },
64
+ {
65
+ "kind": "field",
66
+ "name": "lazy",
67
+ "readonly": true
68
+ },
69
+ {
70
+ "kind": "method",
71
+ "name": "nextPage"
72
+ },
73
+ {
74
+ "kind": "method",
75
+ "name": "prevPage"
76
+ },
77
+ {
78
+ "kind": "method",
79
+ "name": "goToPage",
80
+ "parameters": [
81
+ {
82
+ "name": "pageNumber"
83
+ }
84
+ ]
85
+ },
86
+ {
87
+ "kind": "method",
88
+ "name": "getPageCount"
89
+ },
90
+ {
91
+ "kind": "method",
92
+ "name": "getCurrentPage"
93
+ },
94
+ {
95
+ "kind": "method",
96
+ "name": "zoomIn"
97
+ },
98
+ {
99
+ "kind": "method",
100
+ "name": "zoomOut"
101
+ },
102
+ {
103
+ "kind": "method",
104
+ "name": "setZoom",
105
+ "parameters": [
106
+ {
107
+ "name": "level"
108
+ }
109
+ ]
110
+ },
111
+ {
112
+ "kind": "method",
113
+ "name": "search",
114
+ "parameters": [
115
+ {
116
+ "name": "query"
117
+ }
118
+ ]
119
+ },
120
+ {
121
+ "kind": "method",
122
+ "name": "clearSearch"
123
+ },
124
+ {
125
+ "kind": "method",
126
+ "name": "setData",
127
+ "parameters": [
128
+ {
129
+ "name": "source"
130
+ }
131
+ ]
132
+ },
133
+ {
134
+ "kind": "method",
135
+ "name": "openFile"
136
+ },
137
+ {
138
+ "kind": "method",
139
+ "name": "download"
140
+ },
141
+ {
142
+ "kind": "method",
143
+ "name": "print"
144
+ },
145
+ {
146
+ "kind": "method",
147
+ "name": "toggleFullscreen"
148
+ },
149
+ {
150
+ "kind": "method",
151
+ "name": "toggleThumbnails"
152
+ },
153
+ {
154
+ "kind": "method",
155
+ "name": "toggleSearch"
156
+ }
157
+ ],
158
+ "events": [
159
+ {
160
+ "name": "pdf-loaded",
161
+ "type": {
162
+ "text": "CustomEvent"
163
+ }
164
+ },
165
+ {
166
+ "name": "pdf-load-error",
167
+ "type": {
168
+ "text": "CustomEvent"
169
+ }
170
+ },
171
+ {
172
+ "name": "page-change",
173
+ "type": {
174
+ "text": "CustomEvent"
175
+ }
176
+ },
177
+ {
178
+ "name": "zoom-change",
179
+ "type": {
180
+ "text": "CustomEvent"
181
+ }
182
+ },
183
+ {
184
+ "name": "view-change",
185
+ "type": {
186
+ "text": "CustomEvent"
187
+ }
188
+ },
189
+ {
190
+ "name": "file-opened",
191
+ "type": {
192
+ "text": "CustomEvent"
193
+ }
194
+ }
195
+ ],
196
+ "attributes": [
197
+ {
198
+ "name": "src"
199
+ },
200
+ {
201
+ "name": "page"
202
+ },
203
+ {
204
+ "name": "zoom"
205
+ },
206
+ {
207
+ "name": "mode"
208
+ },
209
+ {
210
+ "name": "view"
211
+ },
212
+ {
213
+ "name": "show-toolbar"
214
+ },
215
+ {
216
+ "name": "show-thumbnails"
217
+ },
218
+ {
219
+ "name": "show-search"
220
+ },
221
+ {
222
+ "name": "no-download"
223
+ },
224
+ {
225
+ "name": "no-print"
226
+ },
227
+ {
228
+ "name": "title"
229
+ },
230
+ {
231
+ "name": "lazy"
232
+ }
233
+ ],
234
+ "superclass": {
235
+ "name": "HTMLElement"
236
+ },
237
+ "tagName": "pdf-viewer",
238
+ "customElement": true,
239
+ "cssParts": [
240
+ {
241
+ "name": "toolbar",
242
+ "description": "The toolbar area"
243
+ },
244
+ {
245
+ "name": "content",
246
+ "description": "The PDF viewport/content area"
247
+ },
248
+ {
249
+ "name": "sidebar",
250
+ "description": "The thumbnail sidebar"
251
+ },
252
+ {
253
+ "name": "search",
254
+ "description": "The search bar"
255
+ }
256
+ ]
257
+ }
258
+ ],
259
+ "exports": [
260
+ {
261
+ "kind": "js",
262
+ "name": "PdfViewer",
263
+ "declaration": {
264
+ "name": "PdfViewer",
265
+ "module": "src/pdf-viewer.js"
266
+ }
267
+ },
268
+ {
269
+ "kind": "custom-element-definition",
270
+ "name": "pdf-viewer",
271
+ "declaration": {
272
+ "name": "PdfViewer",
273
+ "module": "src/pdf-viewer.js"
274
+ }
275
+ }
276
+ ]
277
+ },
278
+ {
279
+ "kind": "javascript-module",
280
+ "path": "src/lib/theme-observer.js",
281
+ "declarations": [
282
+ {
283
+ "kind": "function",
284
+ "name": "detectPageThemeState"
285
+ },
286
+ {
287
+ "kind": "function",
288
+ "name": "observePageTheme",
289
+ "parameters": [
290
+ {
291
+ "name": "listener"
292
+ }
293
+ ]
294
+ }
295
+ ],
296
+ "exports": [
297
+ {
298
+ "kind": "js",
299
+ "name": "detectPageThemeState",
300
+ "declaration": {
301
+ "name": "detectPageThemeState",
302
+ "module": "src/lib/theme-observer.js"
303
+ }
304
+ },
305
+ {
306
+ "kind": "js",
307
+ "name": "observePageTheme",
308
+ "declaration": {
309
+ "name": "observePageTheme",
310
+ "module": "src/lib/theme-observer.js"
311
+ }
312
+ }
313
+ ]
314
+ }
315
+ ]
316
+ }