react-native-pdf-light
Advanced tools
Comparing version 2.0.0-4 to 2.0.0
@@ -16,5 +16,5 @@ "use strict"; | ||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
@@ -165,14 +165,17 @@ const separatorSize = 8; | ||
ref: listRef, | ||
renderItem: ({ | ||
index | ||
}) => /*#__PURE__*/_react.default.createElement(_reactNative.View, { | ||
style: [styles.pageAlign, { | ||
maxHeight: maxPageHeight | ||
}] | ||
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, null, /*#__PURE__*/_react.default.createElement(_PdfView.PdfView, { | ||
annotation: props.annotation, | ||
page: index, | ||
source: source, | ||
style: styles.page | ||
}))), | ||
renderItem: _ref => { | ||
let { | ||
index | ||
} = _ref; | ||
return /*#__PURE__*/_react.default.createElement(_reactNative.View, { | ||
style: [styles.pageAlign, { | ||
maxHeight: maxPageHeight | ||
}] | ||
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, null, /*#__PURE__*/_react.default.createElement(_PdfView.PdfView, { | ||
annotation: props.annotation, | ||
page: index, | ||
source: source, | ||
style: styles.page | ||
}))); | ||
}, | ||
windowSize: 5, | ||
@@ -179,0 +182,0 @@ initialScrollIndex: props.initialScrollIndex, |
@@ -10,7 +10,20 @@ "use strict"; | ||
var _Util = require("./Util"); | ||
const PdfUtilNative = _reactNative.NativeModules.RNPdfUtil; | ||
/** | ||
* Utility pdf actions. | ||
*/ | ||
const PdfUtil = _reactNative.NativeModules.RNPdfUtil; | ||
const PdfUtil = { | ||
getPageCount(source) { | ||
return PdfUtilNative.getPageCount((0, _Util.asPath)(source)); | ||
}, | ||
getPageSizes(source) { | ||
return PdfUtilNative.getPageSizes((0, _Util.asPath)(source)); | ||
} | ||
}; | ||
exports.PdfUtil = PdfUtil; | ||
//# sourceMappingURL=PdfUtil.js.map |
@@ -12,6 +12,8 @@ "use strict"; | ||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } | ||
var _Util = require("./Util"); | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
const PdfViewNative = (0, _reactNative.requireNativeComponent)('RNPdfView'); | ||
@@ -39,3 +41,3 @@ /** | ||
return /*#__PURE__*/_react.default.createElement(PdfViewNative, { | ||
annotation: props.annotation, | ||
annotation: (0, _Util.asPath)(props.annotation), | ||
onLayout: onLayout, | ||
@@ -46,3 +48,3 @@ onPdfError: onPdfError, | ||
resizeMode: props.resizeMode, | ||
source: props.source, | ||
source: (0, _Util.asPath)(props.source), | ||
style: props.style | ||
@@ -49,0 +51,0 @@ }); |
@@ -147,14 +147,17 @@ import React, { forwardRef, useEffect, useImperativeHandle, useRef, useState } from 'react'; | ||
ref: listRef, | ||
renderItem: ({ | ||
index | ||
}) => /*#__PURE__*/React.createElement(View, { | ||
style: [styles.pageAlign, { | ||
maxHeight: maxPageHeight | ||
}] | ||
}, /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(PdfView, { | ||
annotation: props.annotation, | ||
page: index, | ||
source: source, | ||
style: styles.page | ||
}))), | ||
renderItem: _ref => { | ||
let { | ||
index | ||
} = _ref; | ||
return /*#__PURE__*/React.createElement(View, { | ||
style: [styles.pageAlign, { | ||
maxHeight: maxPageHeight | ||
}] | ||
}, /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(PdfView, { | ||
annotation: props.annotation, | ||
page: index, | ||
source: source, | ||
style: styles.page | ||
}))); | ||
}, | ||
windowSize: 5, | ||
@@ -161,0 +164,0 @@ initialScrollIndex: props.initialScrollIndex, |
import { NativeModules } from 'react-native'; | ||
import { asPath } from './Util'; | ||
const PdfUtilNative = NativeModules.RNPdfUtil; | ||
/** | ||
* Utility pdf actions. | ||
*/ | ||
export const PdfUtil = NativeModules.RNPdfUtil; | ||
export const PdfUtil = { | ||
getPageCount(source) { | ||
return PdfUtilNative.getPageCount(asPath(source)); | ||
}, | ||
getPageSizes(source) { | ||
return PdfUtilNative.getPageSizes(asPath(source)); | ||
} | ||
}; | ||
//# sourceMappingURL=PdfUtil.js.map |
import React, { useCallback } from 'react'; | ||
import { requireNativeComponent } from 'react-native'; | ||
import { asPath } from './Util'; | ||
const PdfViewNative = requireNativeComponent('RNPdfView'); | ||
@@ -25,3 +26,3 @@ /** | ||
return /*#__PURE__*/React.createElement(PdfViewNative, { | ||
annotation: props.annotation, | ||
annotation: asPath(props.annotation), | ||
onLayout: onLayout, | ||
@@ -32,3 +33,3 @@ onPdfError: onPdfError, | ||
resizeMode: props.resizeMode, | ||
source: props.source, | ||
source: asPath(props.source), | ||
style: props.style | ||
@@ -35,0 +36,0 @@ }); |
@@ -0,1 +1,2 @@ | ||
/// <reference types="react" /> | ||
import { LayoutChangeEvent, ViewStyle } from 'react-native'; | ||
@@ -2,0 +3,0 @@ export declare type ErrorEvent = { |
{ | ||
"name": "react-native-pdf-light", | ||
"version": "2.0.0-4", | ||
"version": "2.0.0", | ||
"description": "Minimalist PDF viewer for React Native", | ||
@@ -56,5 +56,5 @@ "main": "lib/commonjs/index", | ||
"@types/jest": "^26.0.0", | ||
"@types/react": "^16.9.19", | ||
"@types/react-native": "0.63.52", | ||
"@types/react-test-renderer": "^16.9.3", | ||
"@types/react": "^17.0.0", | ||
"@types/react-native": "^0.64.0", | ||
"@types/react-test-renderer": "^17.0.1", | ||
"commitlint": "^11.0.0", | ||
@@ -68,6 +68,6 @@ "eslint": "^7.2.0", | ||
"prettier": "^2.0.5", | ||
"react": "16.13.1", | ||
"react-native": "0.63.4", | ||
"react": "17.0.1", | ||
"react-native": "0.64.2", | ||
"react-native-builder-bob": "^0.18.1", | ||
"react-test-renderer": "16.13.1", | ||
"react-test-renderer": "17.0.1", | ||
"release-it": "^14.2.2", | ||
@@ -74,0 +74,0 @@ "typescript": "^4.1.3" |
import { NativeModules } from 'react-native'; | ||
import { asPath } from './Util'; | ||
@@ -17,5 +18,14 @@ export type PageDim = { height: number; width: number }; | ||
const PdfUtilNative: PdfUtilType = NativeModules.RNPdfUtil; | ||
/** | ||
* Utility pdf actions. | ||
*/ | ||
export const PdfUtil: PdfUtilType = NativeModules.RNPdfUtil; | ||
export const PdfUtil: PdfUtilType = { | ||
getPageCount(source: string) { | ||
return PdfUtilNative.getPageCount(asPath(source)); | ||
}, | ||
getPageSizes(source: string) { | ||
return PdfUtilNative.getPageSizes(asPath(source)); | ||
}, | ||
}; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
141276
53
1197
0