@kishannareshpal/expo-pdf 0.2.2 โ†’ 0.2.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.
package/.bun-version ADDED
@@ -0,0 +1 @@
1
+ 1.3.6
package/.node-version CHANGED
@@ -1 +1 @@
1
- v24.12.0
1
+ lts/*
package/CHANGELOG.md CHANGED
@@ -13,18 +13,59 @@
13
13
  _This version does not introduce any user-facing changes._
14
14
  -->
15
15
 
16
+ ## 0.2.4 - 2026-01-18
17
+
18
+
19
+ ### ๐Ÿ“š Documentation
20
+
21
+ - docs: update readme with prior art and uniwind info ([41eed16](https://github.com/kishannareshpal/expo-pdf/commit/41eed169f5f1e8edcaf819e42706020f27bdf5f9)) by `Kishan Jadav`
22
+ - docs: fix typo ([75204b4](https://github.com/kishannareshpal/expo-pdf/commit/75204b4b04466b3c62ccb78f3fc28b2472c08e9f)) by `Kishan Jadav`
23
+
24
+
25
+ ### ๐Ÿงน Chores
26
+
27
+ - chore: add uniwind styled component example ([592aafd](https://github.com/kishannareshpal/expo-pdf/commit/592aafdc40aed850a733d1f9eadf8c7410de8143)) by `Kishan Jadav`
28
+
29
+
30
+ ### ๐Ÿ“ฆ Other Changes
31
+
32
+ - ci: relax pr req and push directly from ci ([baa6a52](https://github.com/kishannareshpal/expo-pdf/commit/baa6a527771ce25aa8dddca055b8cd77f6874453)) by `Kishan Jadav`
33
+ - ci: try admin priv. for merging release pr ([f4f3496](https://github.com/kishannareshpal/expo-pdf/commit/f4f349616e7fc26e4bc68630016ba1825106ad76)) by `Kishan Jadav`
34
+ - ci: merge release pr ([90b2b2d](https://github.com/kishannareshpal/expo-pdf/commit/90b2b2dd96aecf4734899d70e85cbf0f878450cc)) by `Kishan Jadav`
35
+ - ci: fix changelog update ([ca9f012](https://github.com/kishannareshpal/expo-pdf/commit/ca9f0123887c567e325fab9ddc159a01e49bbae8)) by `Kishan Jadav`
36
+ - ci: fix pr not merging on release again ([b933332](https://github.com/kishannareshpal/expo-pdf/commit/b9333328a19d0518192aecfab78f5096726c7c7c)) by `Kishan Jadav`
37
+ - ci: fix pr not merging on release ([e3cc3bb](https://github.com/kishannareshpal/expo-pdf/commit/e3cc3bb3f5cc7c19baa8ad97d1229b7d37aee662)) by `Kishan Jadav`
38
+ - ci: release to create pr to allow push ([60dfc8a](https://github.com/kishannareshpal/expo-pdf/commit/60dfc8a7058dd84e27d071d5ba317e9e306a5b8f)) by `Kishan Jadav`
39
+ - ci: tidy release action summary ([64de3d7](https://github.com/kishannareshpal/expo-pdf/commit/64de3d7607f7625994704a66cdedbad25412b695)) by `Kishan Jadav`
40
+ - ci: fix gen release notes format ([14d6d2a](https://github.com/kishannareshpal/expo-pdf/commit/14d6d2a391de506e5c7cb201d8616c5e07d145ed)) by `Kishan Jadav`
41
+ - ci: update release notes format to include link to commit and author name ([d4c88fa](https://github.com/kishannareshpal/expo-pdf/commit/d4c88fa4c20cad9aaa8165acec262dbdde62c15b)) by `Kishan Jadav`
42
+ - ci: include generated summary notes in action summary ([23412a6](https://github.com/kishannareshpal/expo-pdf/commit/23412a6efb602afd1ec2a0a96ac348d714954f69)) by `Kishan Jadav`
43
+ - ci: improve release process, update docs preview ([5503c3e](https://github.com/kishannareshpal/expo-pdf/commit/5503c3ec4bafe49ed7a68a2ec8ce821118ad3757)) by `Kishan Jadav`
44
+
45
+
46
+ **Full Changelog**: https://github.com/kishannareshpal/expo-pdf/compare/v0.2.3...v0.2.4
47
+
48
+
49
+ ## 0.2.3 - 2026-01-11
50
+
51
+ _This version does not introduce any user-facing changes._
52
+
53
+ ### ๐Ÿ’ก Others
54
+
55
+ - Expose `react-native` `ViewProps` as part of `PdfViewProps`. This change also allows for better compatibility with other libraries such as `uniwind` or `nativewind` that supports `className` ([db7e666](https://github.com/kishannareshpal/expo-pdf/commit/db7e666) by [@kishannareshpal](https://github.com/kishannareshpal))
56
+ - Fix TS docs as well as README prop descriptions ([db7e666](https://github.com/kishannareshpal/expo-pdf/commit/db7e666) by [@kishannareshpal](https://github.com/kishannareshpal))
57
+
16
58
  ## 0.2.2 - 2026-01-11
17
59
 
18
60
  _This version does not introduce any user-facing changes._
19
61
 
20
62
  ### ๐Ÿ’ก Others
21
63
 
22
- - Export `PdfViewProps`, the props for the main `PdfView` component ([f9be18c](https://github.com/kishannareshpal/expo-pdf/commit/8d5c963) by [@kishannareshpal](https://github.com/kishannareshpal))
64
+ - Export `PdfViewProps`, the props for the main `PdfView` component ([8d5c963](https://github.com/kishannareshpal/expo-pdf/commit/8d5c963) by [@kishannareshpal](https://github.com/kishannareshpal))
23
65
 
24
66
  ### ๐Ÿ› Bug fixes
25
67
 
26
- - Fix exported `ErrorCode` literal type to match updated error codes from the native ([f9be18c](https://github.com/kishannareshpal/expo-pdf/commit/3a34f39) by [@kishannareshpal](https://github.com/kishannareshpal))
27
-
68
+ - Fix exported `ErrorCode` literal type to match updated error codes from the native ([3a34f39](https://github.com/kishannareshpal/expo-pdf/commit/3a34f39) by [@kishannareshpal](https://github.com/kishannareshpal))
28
69
 
29
70
  ## 0.2.1 - 2026-01-09
30
71
 
package/README.md CHANGED
@@ -5,9 +5,9 @@
5
5
 
6
6
  A cross-platform, high-performance PDF viewer for React Native and Expo, built on top of native PDF rendering engines.
7
7
 
8
- | [iOS](./docs/demo-ios.mp4) | [Android](./docs/demo-android.mp4) |
9
- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
10
- | <video src="https://github.com/user-attachments/assets/57000914-4f7a-4139-9079-9cfd8ece740b" /> | <video src="https://github.com/user-attachments/assets/14faf4f1-b7cc-4e8b-97a5-c0da94fd26c2" /> |
8
+ | [iOS](./docs/preview-ios.mp4) | [Android](./docs/preview-android.mp4) |
9
+ | ----------------------------------------------------------- | --------------------------------------------------------------- |
10
+ | ![@kishannareshpal/expo-pdf iOS preview](./preview-ios.gif) | ![@kishannareshpal/expo-pdf iOS preview](./preview-android.gif) |
11
11
 
12
12
  ## Features
13
13
 
@@ -174,104 +174,101 @@ export const App = () => {
174
174
  ## API
175
175
 
176
176
  <table>
177
- <thead>
178
- <tr>
179
- <th>Props</th>
180
- <th>Required</th>
181
- <th>Type</th>
182
- <th>Description</th>
183
- <th>Default</th>
184
- </tr>
185
- </thead>
186
- <tbody>
187
- <tr>
188
- <td><code>uri</code></td>
189
- <td>Required</td>
190
- <td><code>string</code></td>
191
- <td>PDF document URL or local file path.</td>
192
- <td>-</td>
193
- </tr>
194
- <tr>
195
- <td><code>password</code></td>
196
- <td>No</td>
197
- <td><code>string</code></td>
198
- <td>PDF document URL or local file path.</td>
199
- <td><code>undefined</code></td>
200
- </tr>
201
- <tr>
202
- <td><code>pagingEnabled</code></td>
203
- <td>No</td>
204
- <td><code>boolean</code></td>
205
- <td>PDF document URL or local file path.</td>
206
- <td><code>false</code></td>
207
- </tr>
208
- <tr>
209
- <td><code>doubleTapToZoom</code></td>
210
- <td>No</td>
211
- <td><code>boolean</code></td>
212
- <td>PDF document URL or local file path.</td>
213
- <td><code>true</code></td>
214
- </tr>
215
- <tr>
216
- <td><code>horizontal</code></td>
217
- <td>No</td>
218
- <td><code>boolean</code></td>
219
- <td>PDF document URL or local file path.</td>
220
- <td><code>false</code></td>
221
- </tr>
222
- <tr>
223
- <td><code>pageGap</code></td>
224
- <td>No</td>
225
- <td><code>number</code></td>
226
- <td>PDF document URL or local file path.</td>
227
- <td><code>0</code></td>
228
- </tr>
229
- <tr>
230
- <td><code>contentPadding</code></td>
231
- <td>No</td>
232
- <td><a href="#contentpadding"><code>ContentPadding</code></a></td>
233
- <td>PDF document URL or local file path.</td>
234
- <td><code>{ top: 0, left: 0, right: 0, bottom: 0 }</code></td>
235
- </tr>
236
- <tr>
237
- <td><code>fitMode</code></td>
238
- <td>No</td>
239
- <td><a href="#fitmode"><code>FitMode</code></a></td>
240
- <td>PDF document URL or local file path.</td>
241
- <td><code>"width"</code></td>
242
- </tr>
243
- <tr>
244
- <td><code>autoScale</code></td>
245
- <td>No</td>
246
- <td><code>boolean</code></td>
247
- <td>
248
- Whether the document should auto-scale when itself or its parent view changes its layout metrics.
249
- Please note that the initial render will always auto-scale to fit whatever <code>fitMode</code> is set to.
250
- This prop only affects subsequent layout changes.</td>
251
- <td><code>true</code></td>
252
- </tr>
253
- <tr>
254
- <td><code>onLoadComplete</code></td>
255
- <td>No</td>
256
- <td><a href="#onloadcompleteeventpayload"><code>(OnLoadCompleteEventPayload) =&gt; void</code></a></td>
257
- <td>Triggered once the document has been fully loaded.</td>
258
- <td>-</td>
259
- </tr>
260
- <tr>
261
- <td><code>onPageChanged</code></td>
262
- <td>No</td>
263
- <td><a href="#onpagechangedeventpayload"><code>(OnPageChangedPayload) =&gt; void</code></a></td>
264
- <td>Triggered when the user navigates to a different page.</td>
265
- <td>-</td>
266
- </tr>
267
- <tr>
268
- <td><code>onError</code></td>
269
- <td>No</td>
270
- <td><a href="#onerroreventpayload"><code>(OnErrorPayload) =&gt; void</code></a></td>
271
- <td>Triggered when the PDF fails to load or render.</td>
272
- <td>-</td>
273
- </tr>
274
- </tbody>
177
+ <thead>
178
+ <tr>
179
+ <th>Props</th>
180
+ <th>Required</th>
181
+ <th>Type</th>
182
+ <th>Description</th>
183
+ <th>Default</th>
184
+ </tr>
185
+ </thead>
186
+ <tbody>
187
+ <tr>
188
+ <td><code>uri</code></td>
189
+ <td>Required</td>
190
+ <td><code>string</code></td>
191
+ <td>PDF document local file URI.</td>
192
+ <td>-</td>
193
+ </tr>
194
+ <tr>
195
+ <td><code>password</code></td>
196
+ <td>No</td>
197
+ <td><code>string</code></td>
198
+ <td>Password to apply for password-protected PDFs by on load.</td>
199
+ <td><code>undefined</code></td>
200
+ </tr>
201
+ <tr>
202
+ <td><code>pagingEnabled</code></td>
203
+ <td>No</td>
204
+ <td><code>boolean</code></td>
205
+ <td>Enables page-by-page snapping instead of free scrolling in vertical direction by default, unless the <code>horizontal</code> prop is provided to page horizontally instead.</td>
206
+ <td><code>false</code></td>
207
+ </tr>
208
+ <tr>
209
+ <td><code>doubleTapToZoom</code></td>
210
+ <td>No</td>
211
+ <td><code>boolean</code></td>
212
+ <td>Allows the user to zoom in/out by double-tapping the document.</td>
213
+ <td><code>true</code></td>
214
+ </tr>
215
+ <tr>
216
+ <td><code>horizontal</code></td>
217
+ <td>No</td>
218
+ <td><code>boolean</code></td>
219
+ <td>Renders and scrolls pages horizontally instead of vertically. If paging is enabled, then it changes horizontally.</td>
220
+ <td><code>false</code></td>
221
+ </tr>
222
+ <tr>
223
+ <td><code>pageGap</code></td>
224
+ <td>No</td>
225
+ <td><code>number</code></td>
226
+ <td>Space between adjacent pages.</td>
227
+ <td><code>0</code></td>
228
+ </tr>
229
+ <tr>
230
+ <td><code>contentPadding</code></td>
231
+ <td>No</td>
232
+ <td><a href="#contentpadding"><code>ContentPadding</code></a></td>
233
+ <td>Padding applied around the document inside the viewer container.</td>
234
+ <td><code>{ top: 0, left: 0, right: 0, bottom: 0 }</code></td>
235
+ </tr>
236
+ <tr>
237
+ <td><code>fitMode</code></td>
238
+ <td>No</td>
239
+ <td><a href="#fitmode"><code>FitMode</code></a></td>
240
+ <td>How the document is scaled to fit within the viewer.</td>
241
+ <td><code>"width"</code></td>
242
+ </tr>
243
+ <tr>
244
+ <td><code>autoScale</code></td>
245
+ <td>No</td>
246
+ <td><code>boolean</code></td>
247
+ <td>Automatically rescales the document when its or its parentโ€™s layout changes after initial render.</td>
248
+ <td><code>true</code></td>
249
+ </tr>
250
+ <tr>
251
+ <td><code>onLoadComplete</code></td>
252
+ <td>No</td>
253
+ <td><a href="#onloadcompleteeventpayload"><code>(OnLoadCompleteEventPayload) =&gt; void</code></a></td>
254
+ <td>Triggered once the document and its metadata have finished loading.</td>
255
+ <td>-</td>
256
+ </tr>
257
+ <tr>
258
+ <td><code>onPageChanged</code></td>
259
+ <td>No</td>
260
+ <td><a href="#onpagechangedeventpayload"><code>(OnPageChangedEventPayload) =&gt; void</code></a></td>
261
+ <td>Triggered when the currently visible page index changes.</td>
262
+ <td>-</td>
263
+ </tr>
264
+ <tr>
265
+ <td><code>onError</code></td>
266
+ <td>No</td>
267
+ <td><a href="#onerroreventpayload"><code>(OnErrorEventPayload) =&gt; void</code></a></td>
268
+ <td>Triggered when the PDF fails to load, decrypt, or render.</td>
269
+ <td>-</td>
270
+ </tr>
271
+ </tbody>
275
272
  </table>
276
273
 
277
274
  ### API Reference
@@ -311,6 +308,44 @@ export const App = () => {
311
308
  }
312
309
  ```
313
310
 
311
+ ## Support for CSS using `uniwind` (TailwindCSS)
312
+
313
+ To use `uniwind` class names, you must wrap the component with the [`withUniwind`](https://docs.uniwind.dev/api/with-uniwind#withuniwind) Higher-Order Component (HOC).
314
+ This allows the component to process the `className` prop and convert it into native styles.
315
+
316
+ ```tsx
317
+ // src/lib/styled.tsx
318
+ import { PdfView as PdfViewPrimitive } from '@kishannareshpal/expo-pdf';
319
+ import { ComponentProps } from 'react';
320
+ import { withUniwind } from 'uniwind';
321
+
322
+ export const StyledPdfViewPrimitive = withUniwind(PdfViewPrimitive);
323
+ export type StyledPdfViewPrimitiveProps = ComponentProps<
324
+ typeof StyledPdfViewPrimitive
325
+ >;
326
+ ```
327
+
328
+ ```tsx
329
+ // src/app.tsx
330
+ import { StyledPdfView } from '@/lib/styled';
331
+
332
+ const App = () => {
333
+ return (
334
+ <StyledPdfView
335
+ className="flex-1 rounded-4xl bg-red-500"
336
+ uri="..."
337
+ ...
338
+ />
339
+ )
340
+ }
341
+ ```
342
+
343
+ ## References
344
+
345
+ ### Prior art
346
+
347
+ This project is inspired by [`react-native-pdf`](https://github.com/wonday/react-native-pdf) and maintained to the more modern React Native and Expo ecosystem.
348
+
314
349
  ## Contributing
315
350
 
316
351
  Contributions are welcome!
@@ -323,21 +358,23 @@ Please read [CONTRIBUTING.md](./CONTRIBUTING.md)
323
358
 
324
359
  > **NOTE**
325
360
  >
326
- > This package follows semantic versioning with the format: `major.minor.patch`.
361
+ > This package follows semantic versioning with the format: `major.minor.patch(-beta.n|next)`.
327
362
  >
328
363
  > - Major version: Increment when making incompatible API changes.
329
364
  > - Minor version: Increment when adding new functionality in a backward-compatible way.
330
365
  > - Patch version: Increment when fixing bugs in a backward-compatible manner.
331
-
332
- 1. Bump `package.json` version using one of `npm version patch|minor|major` - this will create a new `tag`.
333
- 2. `git push --tags` to push the new changes including the newly created tag.
334
- 3. Navigate to [Create a New Release](https://github.com/kishannareshpal/expo-pdf/releases/new)
335
- 4. Select the latest tag you've created above.
336
- 5. Use the same name as the tag for the release title.
337
- 6. Click <kbd>Generate release notes</kbd>, and/or edit the description to detail the changes.
338
- 7. Click the green <kbd>Publish release</kbd> button.
339
- 8. A GitHub action will automatically run to publish the new version of the package to the registry.
340
- - Monitor the status at [kishannareshpal/expo-pdf/actions](https://github.com/kishannareshpal/expo-pdf/actions)
366
+ >
367
+ > **Only approved repository members with access to our NPM account can publish new versions.**
368
+
369
+ 1. Ensure all changes ready for release are merged into `main`.
370
+ 2. Go to the [`โœณ๏ธ Release Package`](https://github.com/kishannareshpal/expo-pdf/actions/workflows/release.yml) workflow
371
+ 3. Click the `Run workflow` dropdown button and configure the inputs:
372
+ - `Dry run`: Uncheck this to perform the actual release (Default is `true` to test the build/versioning without publishing - only useful when updating the `release.yml` workflow during maintenance)
373
+ - `NPM tag`: Leave as `latest` for standard releases, or use `beta` / `next` for pre-releases.
374
+ - `Version override`: Leave as `auto` to let it automatically increment the patch version (or beta version if `beta` was specified above).
375
+ if you to bump the minor or major version, you must specify that here (e.g. `1.2.0` or `2.0.0`)
376
+ 4. Click the `Run workflow` button to publish ๐Ÿš€
377
+ - Monitor the status at [**kishannareshpal/expo-pdf/actions**](https://github.com/kishannareshpal/expo-pdf/actions)
341
378
 
342
379
  ## License
343
380
 
@@ -1,19 +1,56 @@
1
1
  import * as React from 'react';
2
2
  import { ContentPadding, FitMode, OnErrorEventPayload, OnLoadCompleteEventPayload, OnPageChangedEventPayload } from './types';
3
- import { StyleProp, ViewStyle } from 'react-native';
4
- type BaseProps = {
5
- style?: StyleProp<ViewStyle>;
3
+ import { ViewProps } from 'react-native';
4
+ type BaseProps = ViewProps & {
6
5
  /**
7
- * The file URI. Accepts a remote resource (e.g. via HTTPs) or a local file path (e.g. file:///)
6
+ * The file URI.
7
+ *
8
+ * Accepts either:
9
+ * - a remote resource (e.g., https://โ€ฆ)
10
+ * - a local file path (e.g., file:///โ€ฆ)
8
11
  */
9
12
  uri: string;
13
+ /**
14
+ * Password used to open password-protected or encrypted PDFs.
15
+ * If not provided, locked documents will fail to load.
16
+ */
10
17
  password?: string;
18
+ /**
19
+ * Enables page-by-page snapping instead of free scrolling.
20
+ *
21
+ * Defaults to vertical paging. If `horizontal` is true,
22
+ * paging occurs horizontally instead.
23
+ */
11
24
  pagingEnabled?: boolean;
25
+ /**
26
+ * Enables zoom in/out via double-tap gestures on the document.
27
+ */
12
28
  doubleTapToZoom?: boolean;
29
+ /**
30
+ * Renders and scrolls pages horizontally instead of vertically.
31
+ *
32
+ * If `pagingEnabled` is true, page snapping will follow the same direction.
33
+ */
13
34
  horizontal?: boolean;
35
+ /**
36
+ * Space between adjacent pages, expressed in layout units (dp/px depending on platform).
37
+ */
14
38
  pageGap?: number;
39
+ /**
40
+ * Padding applied around the document inside the viewer container.
41
+ */
15
42
  contentPadding?: ContentPadding;
43
+ /**
44
+ * Determines how the document is scaled to fit within the viewer
45
+ * (e.g., fit to width, height, or entire page depending on enum value).
46
+ */
16
47
  fitMode?: FitMode;
48
+ /**
49
+ * Automatically rescales the document when its own layout
50
+ * or its parent viewโ€™s layout changes after initial render.
51
+ *
52
+ * Note: initial render always auto-scales according to `fitMode`.
53
+ */
17
54
  autoScale?: boolean;
18
55
  };
19
56
  export type PdfViewProps = BaseProps & {
@@ -1 +1 @@
1
- {"version":3,"file":"pdf-view.d.ts","sourceRoot":"","sources":["../src/pdf-view.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,mBAAmB,EAAE,0B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C,CAAC,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC,CACjC,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CACf,eAAe,CAAC,CAAC,KAAK,CAAC,eAAe,CAAC,CACvC,UAAU,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,CAC7B,OAAO,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CACvB,aAAa,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CACnC,QAAQ,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CACzB,cAAc,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CACrC,OAAO,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CACvB,SAAS,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAC3B,cAAc,CAAC,CAAC,oBAAoB,CAAC,cAAc,CAAC,CAAC,CACrD,aAAa,CAAC,CAAC,oBAAoB,CAAC,aAAa,CAAC,CAAC,CACnD,OAAO,CAAC,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC,EACvC,CACH,CAAA;AACH,CAAC,CAAA;AAED,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,eAAe,EAAE,SAAS;KAC3B;CACF,CAAC,CAAA","sourcesContent":["import { requireNativeView } from 'expo';\nimport * as React from 'react';\n\nimport { ContentPadding, FitMode, OnErrorEventPayload, OnLoadCompleteEventPayload, OnPageChangedEventPayload } from './types';\nimport { NativeSyntheticEvent, StyleProp, StyleSheet, ViewStyle } from 'react-native';\nimport { forwardNativeEventTo } from './utils';\n\ntype BaseProps = {\n style?: StyleProp<ViewStyle>;\n /**\n * The file URI. Accepts a remote resource (e.g. via HTTPs) or a local file path (e.g. file:///)\n */\n uri: string;\n password?: string;\n pagingEnabled?: boolean\n doubleTapToZoom?: boolean\n horizontal?: boolean\n pageGap?: number\n contentPadding?: ContentPadding\n fitMode?: FitMode\n autoScale?: boolean\n}\n\ntype NativePdfViewProps = BaseProps & {\n onLoadComplete?: (event: NativeSyntheticEvent<OnLoadCompleteEventPayload>) => void;\n onPageChanged?: (event: NativeSyntheticEvent<OnPageChangedEventPayload>) => void;\n onError?: (event: NativeSyntheticEvent<OnErrorEventPayload>) => void;\n};\n\nconst NativePdfView: React.ComponentType<NativePdfViewProps> = requireNativeView('KJExpoPdf');\n\n// -----------\n\nexport type PdfViewProps = BaseProps & {\n onLoadComplete?: (params: OnLoadCompleteEventPayload) => void,\n onPageChanged?: (params: OnPageChangedEventPayload) => void,\n onError?: (params: OnErrorEventPayload) => void\n};\n\nexport const PdfView = ({\n style,\n onLoadComplete,\n onError,\n onPageChanged,\n ...props\n}: PdfViewProps) => {\n return (\n <NativePdfView\n style={[styles.container, style]}\n uri={props.uri}\n doubleTapToZoom={props.doubleTapToZoom}\n horizontal={props.horizontal}\n pageGap={props.pageGap}\n pagingEnabled={props.pagingEnabled}\n password={props.password}\n contentPadding={props.contentPadding}\n fitMode={props.fitMode}\n autoScale={props.autoScale}\n onLoadComplete={forwardNativeEventTo(onLoadComplete)}\n onPageChanged={forwardNativeEventTo(onPageChanged)}\n onError={forwardNativeEventTo(onError)}\n />\n )\n}\n\nconst styles = StyleSheet.create({\n container: {\n backgroundColor: '#eeeeee'\n }\n})\n"]}
1
+ {"version":3,"file":"pdf-view.js","sourceRoot":"","sources":["../src/pdf-view.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAwB,UAAU,EAAa,MAAM,cAAc,CAAC;AAC3E,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAyF/C,MAAM,aAAa,GAA4C,iBAAiB,CAAC,WAAW,CAAC,CAAC;AAU9F,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,EACtB,KAAK,EACL,cAAc,EACd,OAAO,EACP,aAAa,EACb,GAAG,KAAK,EACK,EAAE,EAAE;IACjB,OAAO,CACL,CAAC,aAAa,CACZ,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC,CACjC,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CACf,eAAe,CAAC,CAAC,KAAK,CAAC,eAAe,CAAC,CACvC,UAAU,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,CAC7B,OAAO,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CACvB,aAAa,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CACnC,QAAQ,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CACzB,cAAc,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CACrC,OAAO,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CACvB,SAAS,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAC3B,cAAc,CAAC,CAAC,oBAAoB,CAAC,cAAc,CAAC,CAAC,CACrD,aAAa,CAAC,CAAC,oBAAoB,CAAC,aAAa,CAAC,CAAC,CACnD,OAAO,CAAC,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC,EACvC,CACH,CAAA;AACH,CAAC,CAAA;AAED,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,eAAe,EAAE,SAAS;KAC3B;CACF,CAAC,CAAA","sourcesContent":["import { requireNativeView } from 'expo';\nimport * as React from 'react';\n\nimport { ContentPadding, FitMode, OnErrorEventPayload, OnLoadCompleteEventPayload, OnPageChangedEventPayload } from './types';\nimport { NativeSyntheticEvent, StyleSheet, ViewProps } from 'react-native';\nimport { forwardNativeEventTo } from './utils';\n\ntype BaseProps = ViewProps & {\n /**\n * The file URI.\n *\n * Accepts either:\n * - a remote resource (e.g., https://โ€ฆ)\n * - a local file path (e.g., file:///โ€ฆ)\n */\n uri: string;\n\n /**\n * Password used to open password-protected or encrypted PDFs.\n * If not provided, locked documents will fail to load.\n */\n password?: string;\n\n /**\n * Enables page-by-page snapping instead of free scrolling.\n *\n * Defaults to vertical paging. If `horizontal` is true,\n * paging occurs horizontally instead.\n */\n pagingEnabled?: boolean;\n\n /**\n * Enables zoom in/out via double-tap gestures on the document.\n */\n doubleTapToZoom?: boolean;\n\n /**\n * Renders and scrolls pages horizontally instead of vertically.\n *\n * If `pagingEnabled` is true, page snapping will follow the same direction.\n */\n horizontal?: boolean;\n\n /**\n * Space between adjacent pages, expressed in layout units (dp/px depending on platform).\n */\n pageGap?: number;\n\n /**\n * Padding applied around the document inside the viewer container.\n */\n contentPadding?: ContentPadding;\n\n /**\n * Determines how the document is scaled to fit within the viewer\n * (e.g., fit to width, height, or entire page depending on enum value).\n */\n fitMode?: FitMode;\n\n /**\n * Automatically rescales the document when its own layout\n * or its parent viewโ€™s layout changes after initial render.\n *\n * Note: initial render always auto-scales according to `fitMode`.\n */\n autoScale?: boolean;\n}\n\ntype NativePdfViewProps = BaseProps & {\n /**\n * Fired after the PDF document has been fully loaded\n * and its metadata (such as page count) is available.\n */\n onLoadComplete?: (\n event: NativeSyntheticEvent<OnLoadCompleteEventPayload>\n ) => void;\n\n /**\n * Fired when the currently visible page changes due to user interaction\n * or programmatic scroll/paging.\n */\n onPageChanged?: (\n event: NativeSyntheticEvent<OnPageChangedEventPayload>\n ) => void;\n\n /**\n * Fired when the PDF fails to load, decrypt, or render.\n * The payload contains error information.\n */\n onError?: (\n event: NativeSyntheticEvent<OnErrorEventPayload>\n ) => void;\n};\n\nconst NativePdfView: React.ComponentType<NativePdfViewProps> = requireNativeView('KJExpoPdf');\n\n// -----------\n\nexport type PdfViewProps = BaseProps & {\n onLoadComplete?: (params: OnLoadCompleteEventPayload) => void,\n onPageChanged?: (params: OnPageChangedEventPayload) => void,\n onError?: (params: OnErrorEventPayload) => void\n};\n\nexport const PdfView = ({\n style,\n onLoadComplete,\n onError,\n onPageChanged,\n ...props\n}: PdfViewProps) => {\n return (\n <NativePdfView\n style={[styles.container, style]}\n uri={props.uri}\n doubleTapToZoom={props.doubleTapToZoom}\n horizontal={props.horizontal}\n pageGap={props.pageGap}\n pagingEnabled={props.pagingEnabled}\n password={props.password}\n contentPadding={props.contentPadding}\n fitMode={props.fitMode}\n autoScale={props.autoScale}\n onLoadComplete={forwardNativeEventTo(onLoadComplete)}\n onPageChanged={forwardNativeEventTo(onPageChanged)}\n onError={forwardNativeEventTo(onError)}\n />\n )\n}\n\nconst styles = StyleSheet.create({\n container: {\n backgroundColor: '#eeeeee'\n }\n})\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kishannareshpal/expo-pdf",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "author": "Kishan Jadav <kishan_jadav@hotmail.com> (https://github.com/kishannareshpal)",
5
5
  "repository": "https://github.com/kishannareshpal/expo-pdf",
6
6
  "main": "build/index.js",
@@ -0,0 +1,32 @@
1
+
2
+ ### ๐Ÿ“š Documentation
3
+
4
+ - docs: update readme with prior art and uniwind info ([41eed16](https://github.com/kishannareshpal/expo-pdf/commit/41eed169f5f1e8edcaf819e42706020f27bdf5f9)) by `Kishan Jadav`
5
+ - docs: fix typo ([75204b4](https://github.com/kishannareshpal/expo-pdf/commit/75204b4b04466b3c62ccb78f3fc28b2472c08e9f)) by `Kishan Jadav`
6
+
7
+
8
+ ### ๐Ÿงน Chores
9
+
10
+ - chore: bump version to 0.2.4 ([446601b](https://github.com/kishannareshpal/expo-pdf/commit/446601b3ac3ffc46d1331f0418ae15e46e9776d1)) by `github-actions[bot]`
11
+ - chore: add uniwind styled component example ([592aafd](https://github.com/kishannareshpal/expo-pdf/commit/592aafdc40aed850a733d1f9eadf8c7410de8143)) by `Kishan Jadav`
12
+
13
+
14
+ ### ๐Ÿ“ฆ Other Changes
15
+
16
+ - ci: normalize gh release title ([100a27e](https://github.com/kishannareshpal/expo-pdf/commit/100a27e751fc7f09a43e339ef5720b49661a0d2c)) by `Kishan Jadav`
17
+ - ci: fix ci release ([99fa945](https://github.com/kishannareshpal/expo-pdf/commit/99fa945234141ea26b2c15214c97f0dc4412d3e8)) by `Kishan Jadav`
18
+ - ci: relax pr req and push directly from ci ([baa6a52](https://github.com/kishannareshpal/expo-pdf/commit/baa6a527771ce25aa8dddca055b8cd77f6874453)) by `Kishan Jadav`
19
+ - ci: try admin priv. for merging release pr ([f4f3496](https://github.com/kishannareshpal/expo-pdf/commit/f4f349616e7fc26e4bc68630016ba1825106ad76)) by `Kishan Jadav`
20
+ - ci: merge release pr ([90b2b2d](https://github.com/kishannareshpal/expo-pdf/commit/90b2b2dd96aecf4734899d70e85cbf0f878450cc)) by `Kishan Jadav`
21
+ - ci: fix changelog update ([ca9f012](https://github.com/kishannareshpal/expo-pdf/commit/ca9f0123887c567e325fab9ddc159a01e49bbae8)) by `Kishan Jadav`
22
+ - ci: fix pr not merging on release again ([b933332](https://github.com/kishannareshpal/expo-pdf/commit/b9333328a19d0518192aecfab78f5096726c7c7c)) by `Kishan Jadav`
23
+ - ci: fix pr not merging on release ([e3cc3bb](https://github.com/kishannareshpal/expo-pdf/commit/e3cc3bb3f5cc7c19baa8ad97d1229b7d37aee662)) by `Kishan Jadav`
24
+ - ci: release to create pr to allow push ([60dfc8a](https://github.com/kishannareshpal/expo-pdf/commit/60dfc8a7058dd84e27d071d5ba317e9e306a5b8f)) by `Kishan Jadav`
25
+ - ci: tidy release action summary ([64de3d7](https://github.com/kishannareshpal/expo-pdf/commit/64de3d7607f7625994704a66cdedbad25412b695)) by `Kishan Jadav`
26
+ - ci: fix gen release notes format ([14d6d2a](https://github.com/kishannareshpal/expo-pdf/commit/14d6d2a391de506e5c7cb201d8616c5e07d145ed)) by `Kishan Jadav`
27
+ - ci: update release notes format to include link to commit and author name ([d4c88fa](https://github.com/kishannareshpal/expo-pdf/commit/d4c88fa4c20cad9aaa8165acec262dbdde62c15b)) by `Kishan Jadav`
28
+ - ci: include generated summary notes in action summary ([23412a6](https://github.com/kishannareshpal/expo-pdf/commit/23412a6efb602afd1ec2a0a96ac348d714954f69)) by `Kishan Jadav`
29
+ - ci: improve release process, update docs preview ([5503c3e](https://github.com/kishannareshpal/expo-pdf/commit/5503c3ec4bafe49ed7a68a2ec8ce821118ad3757)) by `Kishan Jadav`
30
+
31
+
32
+ **Full Changelog**: https://github.com/kishannareshpal/expo-pdf/compare/v0.2.3...v0.2.4
package/src/pdf-view.tsx CHANGED
@@ -2,29 +2,94 @@ import { requireNativeView } from 'expo';
2
2
  import * as React from 'react';
3
3
 
4
4
  import { ContentPadding, FitMode, OnErrorEventPayload, OnLoadCompleteEventPayload, OnPageChangedEventPayload } from './types';
5
- import { NativeSyntheticEvent, StyleProp, StyleSheet, ViewStyle } from 'react-native';
5
+ import { NativeSyntheticEvent, StyleSheet, ViewProps } from 'react-native';
6
6
  import { forwardNativeEventTo } from './utils';
7
7
 
8
- type BaseProps = {
9
- style?: StyleProp<ViewStyle>;
8
+ type BaseProps = ViewProps & {
10
9
  /**
11
- * The file URI. Accepts a remote resource (e.g. via HTTPs) or a local file path (e.g. file:///)
10
+ * The file URI.
11
+ *
12
+ * Accepts either:
13
+ * - a remote resource (e.g., https://โ€ฆ)
14
+ * - a local file path (e.g., file:///โ€ฆ)
12
15
  */
13
16
  uri: string;
17
+
18
+ /**
19
+ * Password used to open password-protected or encrypted PDFs.
20
+ * If not provided, locked documents will fail to load.
21
+ */
14
22
  password?: string;
15
- pagingEnabled?: boolean
16
- doubleTapToZoom?: boolean
17
- horizontal?: boolean
18
- pageGap?: number
19
- contentPadding?: ContentPadding
20
- fitMode?: FitMode
21
- autoScale?: boolean
23
+
24
+ /**
25
+ * Enables page-by-page snapping instead of free scrolling.
26
+ *
27
+ * Defaults to vertical paging. If `horizontal` is true,
28
+ * paging occurs horizontally instead.
29
+ */
30
+ pagingEnabled?: boolean;
31
+
32
+ /**
33
+ * Enables zoom in/out via double-tap gestures on the document.
34
+ */
35
+ doubleTapToZoom?: boolean;
36
+
37
+ /**
38
+ * Renders and scrolls pages horizontally instead of vertically.
39
+ *
40
+ * If `pagingEnabled` is true, page snapping will follow the same direction.
41
+ */
42
+ horizontal?: boolean;
43
+
44
+ /**
45
+ * Space between adjacent pages, expressed in layout units (dp/px depending on platform).
46
+ */
47
+ pageGap?: number;
48
+
49
+ /**
50
+ * Padding applied around the document inside the viewer container.
51
+ */
52
+ contentPadding?: ContentPadding;
53
+
54
+ /**
55
+ * Determines how the document is scaled to fit within the viewer
56
+ * (e.g., fit to width, height, or entire page depending on enum value).
57
+ */
58
+ fitMode?: FitMode;
59
+
60
+ /**
61
+ * Automatically rescales the document when its own layout
62
+ * or its parent viewโ€™s layout changes after initial render.
63
+ *
64
+ * Note: initial render always auto-scales according to `fitMode`.
65
+ */
66
+ autoScale?: boolean;
22
67
  }
23
68
 
24
69
  type NativePdfViewProps = BaseProps & {
25
- onLoadComplete?: (event: NativeSyntheticEvent<OnLoadCompleteEventPayload>) => void;
26
- onPageChanged?: (event: NativeSyntheticEvent<OnPageChangedEventPayload>) => void;
27
- onError?: (event: NativeSyntheticEvent<OnErrorEventPayload>) => void;
70
+ /**
71
+ * Fired after the PDF document has been fully loaded
72
+ * and its metadata (such as page count) is available.
73
+ */
74
+ onLoadComplete?: (
75
+ event: NativeSyntheticEvent<OnLoadCompleteEventPayload>
76
+ ) => void;
77
+
78
+ /**
79
+ * Fired when the currently visible page changes due to user interaction
80
+ * or programmatic scroll/paging.
81
+ */
82
+ onPageChanged?: (
83
+ event: NativeSyntheticEvent<OnPageChangedEventPayload>
84
+ ) => void;
85
+
86
+ /**
87
+ * Fired when the PDF fails to load, decrypt, or render.
88
+ * The payload contains error information.
89
+ */
90
+ onError?: (
91
+ event: NativeSyntheticEvent<OnErrorEventPayload>
92
+ ) => void;
28
93
  };
29
94
 
30
95
  const NativePdfView: React.ComponentType<NativePdfViewProps> = requireNativeView('KJExpoPdf');