react-native-pdf-renderer 1.3.0 → 1.3.1
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/DEPENDENTS.md +28 -0
- package/README.md +10 -4
- package/dist/PdfRendererView.d.ts +2 -1
- package/dist/PdfRendererView.js +2 -2
- package/dist/PdfRendererView.js.map +1 -1
- package/dist/mock.d.ts +4 -0
- package/dist/mock.js +7 -0
- package/dist/mock.js.map +1 -0
- package/package.json +1 -1
package/DEPENDENTS.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Dependents stats for douglasjunior/react-native-pdf-renderer
|
|
2
|
+
|
|
3
|
+
[](https://github.com/douglasjunior/react-native-pdf-renderer/network/dependents)
|
|
4
|
+
[&message=17&color=informational&logo=slickpic)](https://github.com/douglasjunior/react-native-pdf-renderer/network/dependents)
|
|
5
|
+
[&message=-17&color=informational&logo=slickpic)](https://github.com/douglasjunior/react-native-pdf-renderer/network/dependents)
|
|
6
|
+
[&message=262&color=informational&logo=slickpic)](https://github.com/douglasjunior/react-native-pdf-renderer/network/dependents)
|
|
7
|
+
|
|
8
|
+
| Repository | Stars |
|
|
9
|
+
| :-------- | -----: |
|
|
10
|
+
|<img class="avatar mr-2" src="https://avatars.githubusercontent.com/u/114444115?s=40&v=4" width="20" height="20" alt=""> [PapillonApp](https://github.com/PapillonApp) / [Papillon](https://github.com/PapillonApp/Papillon) | 136 |
|
|
11
|
+
|<img class="avatar mr-2" src="https://avatars.githubusercontent.com/u/1512341?s=40&v=4" width="20" height="20" alt=""> [douglasjunior](https://github.com/douglasjunior) / [react-native-pdf-renderer](https://github.com/douglasjunior/react-native-pdf-renderer) | 123 |
|
|
12
|
+
|<img class="avatar mr-2" src="https://avatars.githubusercontent.com/u/92865629?s=40&v=4" width="20" height="20" alt=""> [jayasuryard31](https://github.com/jayasuryard31) / [AyurScan](https://github.com/jayasuryard31/AyurScan) | 1 |
|
|
13
|
+
|<img class="avatar mr-2" src="https://avatars.githubusercontent.com/u/79224590?s=40&v=4" width="20" height="20" alt=""> [LeMaitre4523](https://github.com/LeMaitre4523) / [Renard-archive](https://github.com/LeMaitre4523/Renard-archive) | 1 |
|
|
14
|
+
|<img class="avatar mr-2" src="https://avatars.githubusercontent.com/u/1499012?s=40&v=4" width="20" height="20" alt=""> [lukasa1993](https://github.com/lukasa1993) / [react-native-presigned-s3](https://github.com/lukasa1993/react-native-presigned-s3) | 1 |
|
|
15
|
+
|<img class="avatar mr-2" src="https://avatars.githubusercontent.com/u/43969012?s=40&v=4" width="20" height="20" alt=""> [Filahan](https://github.com/Filahan) / [promapp](https://github.com/Filahan/promapp) | 0 |
|
|
16
|
+
|<img class="avatar mr-2" src="https://avatars.githubusercontent.com/u/141116673?s=40&v=4" width="20" height="20" alt=""> [kuldip-trentium](https://github.com/kuldip-trentium) / [expo-crm](https://github.com/kuldip-trentium/expo-crm) | 0 |
|
|
17
|
+
|<img class="avatar mr-2" src="https://avatars.githubusercontent.com/u/161857344?s=40&v=4" width="20" height="20" alt=""> [uzziel-humanly](https://github.com/uzziel-humanly) / [APP-QUEJAS-AGUA-PUEBLA](https://github.com/uzziel-humanly/APP-QUEJAS-AGUA-PUEBLA) | 0 |
|
|
18
|
+
|<img class="avatar mr-2" src="https://avatars.githubusercontent.com/u/26320684?s=40&v=4" width="20" height="20" alt=""> [dariiioz](https://github.com/dariiioz) / [triphub-front](https://github.com/dariiioz/triphub-front) | 0 |
|
|
19
|
+
|<img class="avatar mr-2" src="https://avatars.githubusercontent.com/u/31977125?s=40&v=4" width="20" height="20" alt=""> [hendradedis](https://github.com/hendradedis) / [BacAku](https://github.com/hendradedis/BacAku) | 0 |
|
|
20
|
+
|<img class="avatar mr-2" src="https://avatars.githubusercontent.com/u/150951943?s=40&v=4" width="20" height="20" alt=""> [LoreneMntp](https://github.com/LoreneMntp) / [Triphub-front](https://github.com/LoreneMntp/Triphub-front) | 0 |
|
|
21
|
+
|<img class="avatar mr-2" src="https://avatars.githubusercontent.com/u/139728411?s=40&v=4" width="20" height="20" alt=""> [TPLCarloTaleon](https://github.com/TPLCarloTaleon) / [encrypt-decrypt-pdf](https://github.com/TPLCarloTaleon/encrypt-decrypt-pdf) | 0 |
|
|
22
|
+
|<img class="avatar mr-2" src="https://avatars.githubusercontent.com/u/92579981?s=40&v=4" width="20" height="20" alt=""> [janani-gopi](https://github.com/janani-gopi) / [PDFviewer](https://github.com/janani-gopi/PDFviewer) | 0 |
|
|
23
|
+
|<img class="avatar mr-2" src="https://avatars.githubusercontent.com/u/104327603?s=40&v=4" width="20" height="20" alt=""> [florvillalba21](https://github.com/florvillalba21) / [alfresco-testing](https://github.com/florvillalba21/alfresco-testing) | 0 |
|
|
24
|
+
|<img class="avatar mr-2" src="https://avatars.githubusercontent.com/u/127974191?s=40&v=4" width="20" height="20" alt=""> [typark1234](https://github.com/typark1234) / [nucampsite](https://github.com/typark1234/nucampsite) | 0 |
|
|
25
|
+
|<img class="avatar mr-2" src="https://avatars.githubusercontent.com/u/22235844?s=40&v=4" width="20" height="20" alt=""> [thanhttb](https://github.com/thanhttb) / [vee-app](https://github.com/thanhttb/vee-app) | 0 |
|
|
26
|
+
|<img class="avatar mr-2" src="https://avatars.githubusercontent.com/u/6248392?s=40&v=4" width="20" height="20" alt=""> [pangyujie](https://github.com/pangyujie) / [react-native-pdf-renderer](https://github.com/pangyujie/react-native-pdf-renderer) | 0 |
|
|
27
|
+
|
|
28
|
+
_Generated using [github-dependents-info](https://github.com/nvuillam/github-dependents-info), by [Nicolas Vuillamy](https://github.com/nvuillam)_
|
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@ The main reason why I create this library is to avoid using third party native d
|
|
|
18
18
|
|
|
19
19
|
But why?
|
|
20
20
|
|
|
21
|
-
Every React Native developer knows (or will discover soon) the pain of updating the React Native ecosystem when a new version of Android or iOS comes out, so here we want to avoid this pain as much as possible.
|
|
21
|
+
Every React Native developer knows (or will discover soon) [the pain of updating the React Native ecosystem](https://x.com/flexbox_/status/1806786055057674337) when a new version of Android or iOS comes out, so here we want to avoid this pain as much as possible.
|
|
22
22
|
|
|
23
23
|
## Requirements
|
|
24
24
|
|
|
@@ -73,14 +73,14 @@ For more details, see the [Sample Project](https://github.com/douglasjunior/reac
|
|
|
73
73
|
|
|
74
74
|
## PdfRendererView props
|
|
75
75
|
|
|
76
|
-
|Name|
|
|
76
|
+
|Name|Type|Default|Description|
|
|
77
77
|
|-|-|-|-|
|
|
78
78
|
|source|`string`||Path to a file stored on device.|
|
|
79
79
|
|distanceBetweenPages|`number`|`16`|Distance in `DPI` between pages.|
|
|
80
80
|
|maxZoom|`number`|`5`|Max zoom scale.|
|
|
81
81
|
|singlePage|`boolean`|`false`|(Experimental) Renders only the first page without scroll. (useful for display thumbnail)|
|
|
82
82
|
|onPageChange|`(current: number, total: number) => void`||Invoked on pages scroll.|
|
|
83
|
-
|style|`StyleProp<ViewStyle>`||Styles to be applied to the
|
|
83
|
+
|style|`StyleProp<ViewStyle>`||Styles to be applied to the native [view](https://reactnative.dev/docs/view-style-props).|
|
|
84
84
|
|
|
85
85
|
## Limitations
|
|
86
86
|
|
|
@@ -102,6 +102,12 @@ If you need `borderRadius`, the best option is to wrap the `PdfRendererView` in
|
|
|
102
102
|
</View>
|
|
103
103
|
```
|
|
104
104
|
|
|
105
|
+
## Mock with jest
|
|
106
|
+
|
|
107
|
+
```js
|
|
108
|
+
jest.mock('react-native-pdf-renderer', () => require('react-native-pdf-renderer/dist/mock'));
|
|
109
|
+
```
|
|
110
|
+
|
|
105
111
|
## Contribute
|
|
106
112
|
|
|
107
113
|
New features, bug fixes and improvements are welcome! For questions and suggestions use the [issues](https://github.com/douglasjunior/react-native-pdf-renderer/issues).
|
|
@@ -116,7 +122,7 @@ This lib is only possible thanks to the community help:
|
|
|
116
122
|
- RecyclerView `notifyDataSetChanged()` not working on React Native: https://stackoverflow.com/a/49381907/2826279
|
|
117
123
|
- Add pinch to zoom on RecyclerView: https://stackoverflow.com/a/37895783/2826279
|
|
118
124
|
- Using `Matrix` to handle zoom in a View: https://stackoverflow.com/a/55299327/2826279
|
|
119
|
-
-
|
|
125
|
+
- [Daniel Felipe Sartório](https://github.com/danielfelipesartorio) for the help with Android native code
|
|
120
126
|
|
|
121
127
|
## Star History
|
|
122
128
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ViewProps } from 'react-native';
|
|
2
2
|
export type PdfRendererViewPropsType = {
|
|
3
|
+
testID?: string;
|
|
3
4
|
/**
|
|
4
5
|
* Styles to be applied to the View.
|
|
5
6
|
*
|
|
@@ -40,5 +41,5 @@ export type PdfRendererViewPropsType = {
|
|
|
40
41
|
*/
|
|
41
42
|
onPageChange?: (page: number, totalPages: number) => void;
|
|
42
43
|
};
|
|
43
|
-
declare const PdfRendererView: ({ onPageChange, style, source, singlePage, distanceBetweenPages, maxZoom, }: PdfRendererViewPropsType) => JSX.Element;
|
|
44
|
+
declare const PdfRendererView: ({ testID, onPageChange, style, source, singlePage, distanceBetweenPages, maxZoom, }: PdfRendererViewPropsType) => JSX.Element;
|
|
44
45
|
export default PdfRendererView;
|
package/dist/PdfRendererView.js
CHANGED
|
@@ -24,7 +24,7 @@ const styles = StyleSheet.create({
|
|
|
24
24
|
flex: 1,
|
|
25
25
|
},
|
|
26
26
|
});
|
|
27
|
-
const PdfRendererView = ({ onPageChange, style, source, singlePage = false, distanceBetweenPages = 16, maxZoom = 5, }) => {
|
|
27
|
+
const PdfRendererView = ({ testID = undefined, onPageChange, style, source, singlePage = false, distanceBetweenPages = 16, maxZoom = 5, }) => {
|
|
28
28
|
const viewStyles = useMemo(() => [
|
|
29
29
|
styles.default,
|
|
30
30
|
style,
|
|
@@ -41,7 +41,7 @@ const PdfRendererView = ({ onPageChange, style, source, singlePage = false, dist
|
|
|
41
41
|
singlePage,
|
|
42
42
|
maxZoom,
|
|
43
43
|
}), [source, singlePage, maxZoom]);
|
|
44
|
-
return (React.createElement(PdfRendererNative, { distanceBetweenPages: distanceBetweenPages, style: viewStyles, params: params, onPageChange: handlePageChange }));
|
|
44
|
+
return (React.createElement(PdfRendererNative, { testID: testID, distanceBetweenPages: distanceBetweenPages, style: viewStyles, params: params, onPageChange: handlePageChange }));
|
|
45
45
|
};
|
|
46
46
|
export default PdfRendererView;
|
|
47
47
|
//# sourceMappingURL=PdfRendererView.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PdfRendererView.js","sourceRoot":"","sources":["../src/PdfRendererView.tsx"],"names":[],"mappings":"AAAA,cAAc;AAEd,gDAAgD;AAEhD,+EAA+E;AAC/E,gFAAgF;AAChF,+EAA+E;AAC/E,4EAA4E;AAC5E,wEAAwE;AACxE,2DAA2D;AAE3D,iFAAiF;AACjF,kDAAkD;AAElD,6EAA6E;AAC7E,2EAA2E;AAC3E,8EAA8E;AAC9E,yEAAyE;AACzE,gFAAgF;AAChF,gFAAgF;AAChF,YAAY;AAEZ,OAAO,KAAK,EAAE,EAAC,WAAW,EAAE,OAAO,EAAC,MAAM,OAAO,CAAC;AAClD,OAAO,EAEL,sBAAsB,EACtB,UAAU,GAEX,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"PdfRendererView.js","sourceRoot":"","sources":["../src/PdfRendererView.tsx"],"names":[],"mappings":"AAAA,cAAc;AAEd,gDAAgD;AAEhD,+EAA+E;AAC/E,gFAAgF;AAChF,+EAA+E;AAC/E,4EAA4E;AAC5E,wEAAwE;AACxE,2DAA2D;AAE3D,iFAAiF;AACjF,kDAAkD;AAElD,6EAA6E;AAC7E,2EAA2E;AAC3E,8EAA8E;AAC9E,yEAAyE;AACzE,gFAAgF;AAChF,gFAAgF;AAChF,YAAY;AAEZ,OAAO,KAAK,EAAE,EAAC,WAAW,EAAE,OAAO,EAAC,MAAM,OAAO,CAAC;AAClD,OAAO,EAEL,sBAAsB,EACtB,UAAU,GAEX,MAAM,cAAc,CAAC;AAkDtB,MAAM,iBAAiB,GAAG,sBAAsB,CAAC,mBAAmB,CAAQ,CAAC;AAE7E,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,OAAO,EAAE;QACP,eAAe,EAAE,MAAM;QACvB,IAAI,EAAE,CAAC;KACR;CACF,CAAC,CAAC;AAEH,MAAM,eAAe,GAAG,CAAC,EACvB,MAAM,GAAG,SAAS,EAClB,YAAY,EACZ,KAAK,EACL,MAAM,EACN,UAAU,GAAG,KAAK,EAClB,oBAAoB,GAAG,EAAE,EACzB,OAAO,GAAG,CAAC,GACc,EAAe,EAAE;IAC1C,MAAM,UAAU,GAAG,OAAO,CACxB,GAAG,EAAE,CAAC;QACJ,MAAM,CAAC,OAAO;QACd,KAAK;QACL;YACE,6EAA6E;YAC7E,YAAY,EAAE,IAAI;SACnB;KACF,EACD,CAAC,KAAK,CAAC,CACR,CAAC;IAEF,MAAM,gBAAgB,GAAG,WAAW,CAClC,CAAC,KAAkD,EAAE,EAAE;QACrD,YAAY,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,QAAQ,EAAE,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IACtE,CAAC,EACD,CAAC,YAAY,CAAC,CACf,CAAC;IAEF,MAAM,MAAM,GAAG,OAAO,CACpB,GAAG,EAAE,CAAC,CAAC;QACL,MAAM;QACN,UAAU;QACV,OAAO;KACR,CAAC,EACF,CAAC,MAAM,EAAE,UAAU,EAAE,OAAO,CAAC,CAC9B,CAAC;IAEF,OAAO,CACL,oBAAC,iBAAiB,IAChB,MAAM,EAAE,MAAM,EACd,oBAAoB,EAAE,oBAAoB,EAC1C,KAAK,EAAE,UAAU,EACjB,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,gBAAgB,GAC9B,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
package/dist/mock.d.ts
ADDED
package/dist/mock.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
const PdfRendererViewMock = (props) => {
|
|
4
|
+
return React.createElement(View, { testID: props.testID, style: props.style });
|
|
5
|
+
};
|
|
6
|
+
export default PdfRendererViewMock;
|
|
7
|
+
//# sourceMappingURL=mock.js.map
|
package/dist/mock.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mock.js","sourceRoot":"","sources":["../src/mock.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,IAAI,EAAC,MAAM,cAAc,CAAC;AAGlC,MAAM,mBAAmB,GAAG,CAAC,KAA+B,EAAE,EAAE;IAC9D,OAAO,oBAAC,IAAI,IAAC,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,GAAI,CAAC;AAC5D,CAAC,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-pdf-renderer",
|
|
3
3
|
"displayName": "React-Native Pdf Renderer",
|
|
4
|
-
"version": "1.3.
|
|
4
|
+
"version": "1.3.1",
|
|
5
5
|
"description": "⚛ A zoomable, blazing fast, zero dependencies, pure native, typed PDF Renderer for Android and iOS.",
|
|
6
6
|
"main": "dist",
|
|
7
7
|
"license": "MIT",
|