@tobyt/expo-pdf-markup 1.1.3 → 1.2.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/CHANGELOG.md +14 -0
- package/android/src/main/java/dev/terhoeven/expopdfmarkup/AnnotationSerializer.kt +7 -1
- package/android/src/main/java/dev/terhoeven/expopdfmarkup/BookPager.kt +66 -0
- package/android/src/main/java/dev/terhoeven/expopdfmarkup/BookTurnPolicy.kt +117 -0
- package/android/src/main/java/dev/terhoeven/expopdfmarkup/ContinuousPdfView.kt +370 -57
- package/android/src/main/java/dev/terhoeven/expopdfmarkup/ExpoPdfMarkupModule.kt +4 -0
- package/android/src/main/java/dev/terhoeven/expopdfmarkup/ExpoPdfMarkupView.kt +96 -5
- package/build/ExpoPdfMarkup.types.d.ts +12 -0
- package/build/ExpoPdfMarkup.types.d.ts.map +1 -1
- package/build/ExpoPdfMarkup.types.js.map +1 -1
- package/build/ExpoPdfMarkupView.web.d.ts.map +1 -1
- package/build/ExpoPdfMarkupView.web.js +369 -44
- package/build/ExpoPdfMarkupView.web.js.map +1 -1
- package/build/web/bookMode.d.ts +77 -0
- package/build/web/bookMode.d.ts.map +1 -0
- package/build/web/bookMode.js +169 -0
- package/build/web/bookMode.js.map +1 -0
- package/build/web/layout.d.ts +8 -0
- package/build/web/layout.d.ts.map +1 -0
- package/build/web/layout.js +22 -0
- package/build/web/layout.js.map +1 -0
- package/build/web/types.d.ts +2 -0
- package/build/web/types.d.ts.map +1 -1
- package/build/web/types.js.map +1 -1
- package/docs/agents/domain.md +51 -0
- package/docs/agents/issue-tracker.md +46 -0
- package/docs/agents/triage-labels.md +15 -0
- package/ios/AnnotationSerializer.swift +36 -7
- package/ios/ExpoPdfMarkupModule.swift +4 -0
- package/ios/ExpoPdfMarkupView+Book.swift +455 -0
- package/ios/ExpoPdfMarkupView+Ink.swift +10 -2
- package/ios/ExpoPdfMarkupView+Move.swift +3 -4
- package/ios/ExpoPdfMarkupView.swift +49 -6
- package/ios/Tests/AnnotationSerializerTests.swift +0 -22
- package/ios/Tests/BookModeTests.swift +534 -0
- package/ios/Tests/book-sample.pdf +207 -0
- package/ios/Tests/single-page.pdf +52 -0
- package/metro.js +32 -14
- package/package.json +4 -3
- package/src/ExpoPdfMarkup.types.ts +13 -0
- package/src/ExpoPdfMarkupView.web.tsx +443 -52
- package/src/web/bookMode.ts +186 -0
- package/src/web/layout.ts +30 -0
- package/src/web/types.ts +3 -0
- package/tsconfig.test.json +10 -0
- package/docs/.nojekyll +0 -1
- package/docs/assets/hierarchy.js +0 -1
- package/docs/assets/highlight.css +0 -113
- package/docs/assets/icons.js +0 -18
- package/docs/assets/icons.svg +0 -1
- package/docs/assets/main.js +0 -60
- package/docs/assets/navigation.js +0 -1
- package/docs/assets/search.js +0 -1
- package/docs/assets/style.css +0 -1648
- package/docs/functions/ExpoPdfMarkupView.html +0 -42
- package/docs/functions/setPdfJsWorkerSrc.html +0 -42
- package/docs/hierarchy.html +0 -29
- package/docs/index.html +0 -148
- package/docs/modules.html +0 -40
- package/docs/types/Annotation.html +0 -33
- package/docs/types/AnnotationBounds.html +0 -73
- package/docs/types/AnnotationMode.html +0 -33
- package/docs/types/AnnotationPoint.html +0 -61
- package/docs/types/AnnotationsData.html +0 -61
- package/docs/types/ExpoPdfMarkupViewProps.html +0 -184
- package/docs/types/HighlightAnnotation.html +0 -91
- package/docs/types/InkAnnotation.html +0 -91
- package/docs/types/StampAnnotation.html +0 -95
- package/docs/types/StampDefinition.html +0 -72
- package/docs/types/TextAnnotation.html +0 -110
- package/docs/types/TextInputRequest.html +0 -73
- package/docs/types/UnderlineAnnotation.html +0 -85
- package/ios/InkPDFAnnotation.swift +0 -45
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
%PDF-1.4
|
|
2
|
+
1 0 obj
|
|
3
|
+
<< /Type /Catalog /Pages 2 0 R >>
|
|
4
|
+
endobj
|
|
5
|
+
2 0 obj
|
|
6
|
+
<< /Type /Pages /Kids [5 0 R 7 0 R 9 0 R 11 0 R 13 0 R 15 0 R] /Count 6 >>
|
|
7
|
+
endobj
|
|
8
|
+
3 0 obj
|
|
9
|
+
<< /Type /Font /Subtype /Type1 /BaseFont /Helvetica >>
|
|
10
|
+
endobj
|
|
11
|
+
4 0 obj
|
|
12
|
+
<< /Length 370 >>
|
|
13
|
+
stream
|
|
14
|
+
0.85 0.2 0.2 rg
|
|
15
|
+
0 0 24 842 re f
|
|
16
|
+
571 0 24 842 re f
|
|
17
|
+
0 0 0 rg
|
|
18
|
+
BT /F1 160 Tf
|
|
19
|
+
252.5 461.0 Td
|
|
20
|
+
(1) Tj ET
|
|
21
|
+
BT /F1 28 Tf
|
|
22
|
+
227.5 411.0 Td
|
|
23
|
+
(Page 1 of 6) Tj ET
|
|
24
|
+
0.6 w 0 0 0 RG
|
|
25
|
+
60 260 m 535 260 l S
|
|
26
|
+
60 250 m 535 250 l S
|
|
27
|
+
60 240 m 535 240 l S
|
|
28
|
+
60 230 m 535 230 l S
|
|
29
|
+
60 220 m 535 220 l S
|
|
30
|
+
60 160 m 535 160 l S
|
|
31
|
+
60 150 m 535 150 l S
|
|
32
|
+
60 140 m 535 140 l S
|
|
33
|
+
60 130 m 535 130 l S
|
|
34
|
+
60 120 m 535 120 l S
|
|
35
|
+
endstream
|
|
36
|
+
endobj
|
|
37
|
+
5 0 obj
|
|
38
|
+
<< /Type /Page /Parent 2 0 R /MediaBox [0 0 595 842] /Resources << /Font << /F1 3 0 R >> >> /Contents 4 0 R >>
|
|
39
|
+
endobj
|
|
40
|
+
6 0 obj
|
|
41
|
+
<< /Length 371 >>
|
|
42
|
+
stream
|
|
43
|
+
0.95 0.55 0.1 rg
|
|
44
|
+
0 0 24 842 re f
|
|
45
|
+
571 0 24 842 re f
|
|
46
|
+
0 0 0 rg
|
|
47
|
+
BT /F1 160 Tf
|
|
48
|
+
252.5 461.0 Td
|
|
49
|
+
(2) Tj ET
|
|
50
|
+
BT /F1 28 Tf
|
|
51
|
+
227.5 411.0 Td
|
|
52
|
+
(Page 2 of 6) Tj ET
|
|
53
|
+
0.6 w 0 0 0 RG
|
|
54
|
+
60 260 m 535 260 l S
|
|
55
|
+
60 250 m 535 250 l S
|
|
56
|
+
60 240 m 535 240 l S
|
|
57
|
+
60 230 m 535 230 l S
|
|
58
|
+
60 220 m 535 220 l S
|
|
59
|
+
60 160 m 535 160 l S
|
|
60
|
+
60 150 m 535 150 l S
|
|
61
|
+
60 140 m 535 140 l S
|
|
62
|
+
60 130 m 535 130 l S
|
|
63
|
+
60 120 m 535 120 l S
|
|
64
|
+
endstream
|
|
65
|
+
endobj
|
|
66
|
+
7 0 obj
|
|
67
|
+
<< /Type /Page /Parent 2 0 R /MediaBox [0 0 595 842] /Resources << /Font << /F1 3 0 R >> >> /Contents 6 0 R >>
|
|
68
|
+
endobj
|
|
69
|
+
8 0 obj
|
|
70
|
+
<< /Length 370 >>
|
|
71
|
+
stream
|
|
72
|
+
0.2 0.65 0.3 rg
|
|
73
|
+
0 0 24 842 re f
|
|
74
|
+
571 0 24 842 re f
|
|
75
|
+
0 0 0 rg
|
|
76
|
+
BT /F1 160 Tf
|
|
77
|
+
252.5 461.0 Td
|
|
78
|
+
(3) Tj ET
|
|
79
|
+
BT /F1 28 Tf
|
|
80
|
+
227.5 411.0 Td
|
|
81
|
+
(Page 3 of 6) Tj ET
|
|
82
|
+
0.6 w 0 0 0 RG
|
|
83
|
+
60 260 m 535 260 l S
|
|
84
|
+
60 250 m 535 250 l S
|
|
85
|
+
60 240 m 535 240 l S
|
|
86
|
+
60 230 m 535 230 l S
|
|
87
|
+
60 220 m 535 220 l S
|
|
88
|
+
60 160 m 535 160 l S
|
|
89
|
+
60 150 m 535 150 l S
|
|
90
|
+
60 140 m 535 140 l S
|
|
91
|
+
60 130 m 535 130 l S
|
|
92
|
+
60 120 m 535 120 l S
|
|
93
|
+
endstream
|
|
94
|
+
endobj
|
|
95
|
+
9 0 obj
|
|
96
|
+
<< /Type /Page /Parent 2 0 R /MediaBox [0 0 595 842] /Resources << /Font << /F1 3 0 R >> >> /Contents 8 0 R >>
|
|
97
|
+
endobj
|
|
98
|
+
10 0 obj
|
|
99
|
+
<< /Length 372 >>
|
|
100
|
+
stream
|
|
101
|
+
0.15 0.45 0.85 rg
|
|
102
|
+
0 0 24 842 re f
|
|
103
|
+
571 0 24 842 re f
|
|
104
|
+
0 0 0 rg
|
|
105
|
+
BT /F1 160 Tf
|
|
106
|
+
252.5 461.0 Td
|
|
107
|
+
(4) Tj ET
|
|
108
|
+
BT /F1 28 Tf
|
|
109
|
+
227.5 411.0 Td
|
|
110
|
+
(Page 4 of 6) Tj ET
|
|
111
|
+
0.6 w 0 0 0 RG
|
|
112
|
+
60 260 m 535 260 l S
|
|
113
|
+
60 250 m 535 250 l S
|
|
114
|
+
60 240 m 535 240 l S
|
|
115
|
+
60 230 m 535 230 l S
|
|
116
|
+
60 220 m 535 220 l S
|
|
117
|
+
60 160 m 535 160 l S
|
|
118
|
+
60 150 m 535 150 l S
|
|
119
|
+
60 140 m 535 140 l S
|
|
120
|
+
60 130 m 535 130 l S
|
|
121
|
+
60 120 m 535 120 l S
|
|
122
|
+
endstream
|
|
123
|
+
endobj
|
|
124
|
+
11 0 obj
|
|
125
|
+
<< /Type /Page /Parent 2 0 R /MediaBox [0 0 595 842] /Resources << /Font << /F1 3 0 R >> >> /Contents 10 0 R >>
|
|
126
|
+
endobj
|
|
127
|
+
12 0 obj
|
|
128
|
+
<< /Length 369 >>
|
|
129
|
+
stream
|
|
130
|
+
0.5 0.3 0.8 rg
|
|
131
|
+
0 0 24 842 re f
|
|
132
|
+
571 0 24 842 re f
|
|
133
|
+
0 0 0 rg
|
|
134
|
+
BT /F1 160 Tf
|
|
135
|
+
252.5 461.0 Td
|
|
136
|
+
(5) Tj ET
|
|
137
|
+
BT /F1 28 Tf
|
|
138
|
+
227.5 411.0 Td
|
|
139
|
+
(Page 5 of 6) Tj ET
|
|
140
|
+
0.6 w 0 0 0 RG
|
|
141
|
+
60 260 m 535 260 l S
|
|
142
|
+
60 250 m 535 250 l S
|
|
143
|
+
60 240 m 535 240 l S
|
|
144
|
+
60 230 m 535 230 l S
|
|
145
|
+
60 220 m 535 220 l S
|
|
146
|
+
60 160 m 535 160 l S
|
|
147
|
+
60 150 m 535 150 l S
|
|
148
|
+
60 140 m 535 140 l S
|
|
149
|
+
60 130 m 535 130 l S
|
|
150
|
+
60 120 m 535 120 l S
|
|
151
|
+
endstream
|
|
152
|
+
endobj
|
|
153
|
+
13 0 obj
|
|
154
|
+
<< /Type /Page /Parent 2 0 R /MediaBox [0 0 595 842] /Resources << /Font << /F1 3 0 R >> >> /Contents 12 0 R >>
|
|
155
|
+
endobj
|
|
156
|
+
14 0 obj
|
|
157
|
+
<< /Length 369 >>
|
|
158
|
+
stream
|
|
159
|
+
0.4 0.4 0.4 rg
|
|
160
|
+
0 0 24 842 re f
|
|
161
|
+
571 0 24 842 re f
|
|
162
|
+
0 0 0 rg
|
|
163
|
+
BT /F1 160 Tf
|
|
164
|
+
252.5 461.0 Td
|
|
165
|
+
(6) Tj ET
|
|
166
|
+
BT /F1 28 Tf
|
|
167
|
+
227.5 411.0 Td
|
|
168
|
+
(Page 6 of 6) Tj ET
|
|
169
|
+
0.6 w 0 0 0 RG
|
|
170
|
+
60 260 m 535 260 l S
|
|
171
|
+
60 250 m 535 250 l S
|
|
172
|
+
60 240 m 535 240 l S
|
|
173
|
+
60 230 m 535 230 l S
|
|
174
|
+
60 220 m 535 220 l S
|
|
175
|
+
60 160 m 535 160 l S
|
|
176
|
+
60 150 m 535 150 l S
|
|
177
|
+
60 140 m 535 140 l S
|
|
178
|
+
60 130 m 535 130 l S
|
|
179
|
+
60 120 m 535 120 l S
|
|
180
|
+
endstream
|
|
181
|
+
endobj
|
|
182
|
+
15 0 obj
|
|
183
|
+
<< /Type /Page /Parent 2 0 R /MediaBox [0 0 595 842] /Resources << /Font << /F1 3 0 R >> >> /Contents 14 0 R >>
|
|
184
|
+
endobj
|
|
185
|
+
xref
|
|
186
|
+
0 16
|
|
187
|
+
0000000000 65535 f
|
|
188
|
+
0000000009 00000 n
|
|
189
|
+
0000000058 00000 n
|
|
190
|
+
0000000148 00000 n
|
|
191
|
+
0000000218 00000 n
|
|
192
|
+
0000000639 00000 n
|
|
193
|
+
0000000765 00000 n
|
|
194
|
+
0000001187 00000 n
|
|
195
|
+
0000001313 00000 n
|
|
196
|
+
0000001734 00000 n
|
|
197
|
+
0000001860 00000 n
|
|
198
|
+
0000002284 00000 n
|
|
199
|
+
0000002412 00000 n
|
|
200
|
+
0000002833 00000 n
|
|
201
|
+
0000002961 00000 n
|
|
202
|
+
0000003382 00000 n
|
|
203
|
+
trailer
|
|
204
|
+
<< /Size 16 /Root 1 0 R >>
|
|
205
|
+
startxref
|
|
206
|
+
3510
|
|
207
|
+
%%EOF
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
%PDF-1.4
|
|
2
|
+
1 0 obj
|
|
3
|
+
<< /Type /Catalog /Pages 2 0 R >>
|
|
4
|
+
endobj
|
|
5
|
+
2 0 obj
|
|
6
|
+
<< /Type /Pages /Kids [5 0 R] /Count 1 >>
|
|
7
|
+
endobj
|
|
8
|
+
3 0 obj
|
|
9
|
+
<< /Type /Font /Subtype /Type1 /BaseFont /Helvetica >>
|
|
10
|
+
endobj
|
|
11
|
+
4 0 obj
|
|
12
|
+
<< /Length 370 >>
|
|
13
|
+
stream
|
|
14
|
+
0.85 0.2 0.2 rg
|
|
15
|
+
0 0 24 842 re f
|
|
16
|
+
571 0 24 842 re f
|
|
17
|
+
0 0 0 rg
|
|
18
|
+
BT /F1 160 Tf
|
|
19
|
+
252.5 461.0 Td
|
|
20
|
+
(1) Tj ET
|
|
21
|
+
BT /F1 28 Tf
|
|
22
|
+
227.5 411.0 Td
|
|
23
|
+
(Page 1 of 1) Tj ET
|
|
24
|
+
0.6 w 0 0 0 RG
|
|
25
|
+
60 260 m 535 260 l S
|
|
26
|
+
60 250 m 535 250 l S
|
|
27
|
+
60 240 m 535 240 l S
|
|
28
|
+
60 230 m 535 230 l S
|
|
29
|
+
60 220 m 535 220 l S
|
|
30
|
+
60 160 m 535 160 l S
|
|
31
|
+
60 150 m 535 150 l S
|
|
32
|
+
60 140 m 535 140 l S
|
|
33
|
+
60 130 m 535 130 l S
|
|
34
|
+
60 120 m 535 120 l S
|
|
35
|
+
endstream
|
|
36
|
+
endobj
|
|
37
|
+
5 0 obj
|
|
38
|
+
<< /Type /Page /Parent 2 0 R /MediaBox [0 0 595 842] /Resources << /Font << /F1 3 0 R >> >> /Contents 4 0 R >>
|
|
39
|
+
endobj
|
|
40
|
+
xref
|
|
41
|
+
0 6
|
|
42
|
+
0000000000 65535 f
|
|
43
|
+
0000000009 00000 n
|
|
44
|
+
0000000058 00000 n
|
|
45
|
+
0000000115 00000 n
|
|
46
|
+
0000000185 00000 n
|
|
47
|
+
0000000606 00000 n
|
|
48
|
+
trailer
|
|
49
|
+
<< /Size 6 /Root 1 0 R >>
|
|
50
|
+
startxref
|
|
51
|
+
732
|
|
52
|
+
%%EOF
|
package/metro.js
CHANGED
|
@@ -15,6 +15,9 @@
|
|
|
15
15
|
* browser's JS engine refuses to parse the bundle).
|
|
16
16
|
* 2. Copies the pdfjs worker file to <projectRoot>/public/pdf.worker.min.mjs
|
|
17
17
|
* so it is served at /pdf.worker.min.mjs (same-origin, no CORS issues).
|
|
18
|
+
* Copies are refreshed whenever the installed pdfjs-dist differs from the
|
|
19
|
+
* copy in public/, so upgrading pdfjs-dist cannot leave a stale worker
|
|
20
|
+
* behind (pdfjs throws if the API and worker versions disagree).
|
|
18
21
|
*/
|
|
19
22
|
|
|
20
23
|
'use strict';
|
|
@@ -56,6 +59,30 @@ module.exports.transform = function transform({ filename, src, options, plugins
|
|
|
56
59
|
// Metro config helper
|
|
57
60
|
// ---------------------------------------------------------------------------
|
|
58
61
|
|
|
62
|
+
// Copy `src` to `dest` when they differ. pdfjs refuses to run when the API and
|
|
63
|
+
// worker versions disagree ("The API version does not match the Worker
|
|
64
|
+
// version"), and the wasm assets are equally version-locked, so an
|
|
65
|
+
// exists-only check would pin a consumer to whichever pdfjs version they first
|
|
66
|
+
// installed. Comparing content keeps upgrades and downgrades both correct while
|
|
67
|
+
// staying a no-op on the common path, so repeated Metro restarts remain fast.
|
|
68
|
+
function copyIfDifferent(src, dest) {
|
|
69
|
+
let destStat;
|
|
70
|
+
try {
|
|
71
|
+
destStat = fs.statSync(dest);
|
|
72
|
+
} catch {
|
|
73
|
+
destStat = null;
|
|
74
|
+
}
|
|
75
|
+
if (destStat) {
|
|
76
|
+
const srcStat = fs.statSync(src);
|
|
77
|
+
if (srcStat.size === destStat.size && fs.readFileSync(src).equals(fs.readFileSync(dest))) {
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
fs.mkdirSync(path.dirname(dest), { recursive: true });
|
|
82
|
+
fs.copyFileSync(src, dest);
|
|
83
|
+
return true;
|
|
84
|
+
}
|
|
85
|
+
|
|
59
86
|
module.exports.withPdfMarkup = function withPdfMarkup(config) {
|
|
60
87
|
// 1. Swap in this file as the babel transformer so import.meta is patched.
|
|
61
88
|
config.transformer.babelTransformerPath = require.resolve('./metro.js');
|
|
@@ -76,14 +103,10 @@ module.exports.withPdfMarkup = function withPdfMarkup(config) {
|
|
|
76
103
|
}
|
|
77
104
|
|
|
78
105
|
// 2. Copy the pdfjs worker to <projectRoot>/public/ so it is served at
|
|
79
|
-
// /pdf.worker.min.mjs (same-origin).
|
|
80
|
-
// so
|
|
106
|
+
// /pdf.worker.min.mjs (same-origin). Re-copied whenever it differs from
|
|
107
|
+
// the installed pdfjs-dist, so an upgrade cannot leave a stale worker.
|
|
81
108
|
const workerDest = path.join(publicDir, 'pdf.worker.min.mjs');
|
|
82
|
-
if (
|
|
83
|
-
if (!fs.existsSync(publicDir)) {
|
|
84
|
-
fs.mkdirSync(publicDir, { recursive: true });
|
|
85
|
-
}
|
|
86
|
-
fs.copyFileSync(path.join(pdfjsDir, 'build', 'pdf.worker.min.mjs'), workerDest);
|
|
109
|
+
if (copyIfDifferent(path.join(pdfjsDir, 'build', 'pdf.worker.min.mjs'), workerDest)) {
|
|
87
110
|
console.log('[expo-pdf-markup] Copied pdfjs worker → ' + workerDest);
|
|
88
111
|
}
|
|
89
112
|
|
|
@@ -91,18 +114,13 @@ module.exports.withPdfMarkup = function withPdfMarkup(config) {
|
|
|
91
114
|
// are served at /wasm/ (same-origin). pdfjs-dist v6 decodes JBIG2/CCITT
|
|
92
115
|
// fax, JPEG2000 and ICC data in WebAssembly and fetches these files at
|
|
93
116
|
// runtime; without them such image data (e.g. scanned pages, some music
|
|
94
|
-
// notation) renders blank.
|
|
117
|
+
// notation) renders blank. Refreshed on change, like the worker above.
|
|
95
118
|
const wasmSrcDir = path.join(pdfjsDir, 'wasm');
|
|
96
119
|
const wasmDestDir = path.join(publicDir, 'wasm');
|
|
97
120
|
if (fs.existsSync(wasmSrcDir)) {
|
|
98
121
|
let copied = 0;
|
|
99
122
|
for (const file of fs.readdirSync(wasmSrcDir)) {
|
|
100
|
-
|
|
101
|
-
if (!fs.existsSync(dest)) {
|
|
102
|
-
if (!fs.existsSync(wasmDestDir)) {
|
|
103
|
-
fs.mkdirSync(wasmDestDir, { recursive: true });
|
|
104
|
-
}
|
|
105
|
-
fs.copyFileSync(path.join(wasmSrcDir, file), dest);
|
|
123
|
+
if (copyIfDifferent(path.join(wasmSrcDir, file), path.join(wasmDestDir, file))) {
|
|
106
124
|
copied++;
|
|
107
125
|
}
|
|
108
126
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tobyt/expo-pdf-markup",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "An Expo module for displaying and annotating PDFs",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -20,7 +20,8 @@
|
|
|
20
20
|
"test:swift": "bash scripts/test-swift.sh",
|
|
21
21
|
"test:kotlin": "cd example/android && ./gradlew :tobyt-expo-pdf-markup:testDebugUnitTest",
|
|
22
22
|
"typecheck": "expo-module typecheck",
|
|
23
|
-
"
|
|
23
|
+
"typecheck:tests": "tsc -p tsconfig.test.json",
|
|
24
|
+
"qa:ts": "export EXPO_NONINTERACTIVE=1 && npm run typecheck && npm run typecheck:tests && npm run format && npm run lint && npm run test",
|
|
24
25
|
"qa:ios": "npm run format:swift && npm run lint:swift && npm run test:swift",
|
|
25
26
|
"qa:android": "npm run format:kotlin && npm run lint:kotlin && npm run test:kotlin",
|
|
26
27
|
"qa": "npm run qa:ts && npm run qa:ios && npm run qa:android",
|
|
@@ -52,7 +53,7 @@
|
|
|
52
53
|
"access": "public"
|
|
53
54
|
},
|
|
54
55
|
"devDependencies": {
|
|
55
|
-
"@changesets/cli": "^
|
|
56
|
+
"@changesets/cli": "^3.0.1",
|
|
56
57
|
"@types/react": "~19.2.17",
|
|
57
58
|
"@types/react-test-renderer": "^19.1.0",
|
|
58
59
|
"expo": "~56.0.16",
|
|
@@ -92,9 +92,22 @@ export type TextInputRequest = {
|
|
|
92
92
|
currentText?: string;
|
|
93
93
|
};
|
|
94
94
|
|
|
95
|
+
/**
|
|
96
|
+
* How the document's pages are presented.
|
|
97
|
+
* - `'continuous'`: every page stacked in one continuous vertical scroll.
|
|
98
|
+
* - `'book'`: one page at a time, fitted to the view, turned sideways by swiping, tapping near
|
|
99
|
+
* the left or right edge, or pressing the arrow or Page Up / Page Down keys.
|
|
100
|
+
*/
|
|
101
|
+
export type DisplayMode = 'continuous' | 'book';
|
|
102
|
+
|
|
95
103
|
export type ExpoPdfMarkupViewProps = {
|
|
96
104
|
/** Absolute local file path of the PDF to display. */
|
|
97
105
|
source: string;
|
|
106
|
+
/**
|
|
107
|
+
* How pages are presented: `'continuous'` vertical scroll, or `'book'` mode with one page at a
|
|
108
|
+
* time. `page` and `onPageChanged` mean the same in both modes. Defaults to `'continuous'`.
|
|
109
|
+
*/
|
|
110
|
+
displayMode?: DisplayMode;
|
|
98
111
|
/** 0-based page number to display. Can be used to restore scroll position on orientation change. */
|
|
99
112
|
page?: number;
|
|
100
113
|
/** Background colour shown behind the PDF pages. */
|