@june24/expo-pdf-reader 0.1.7 → 0.1.8
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/build/ExpoPdfReaderView.d.ts.map +1 -1
- package/build/ExpoPdfReaderView.js +1 -2
- package/build/ExpoPdfReaderView.js.map +1 -1
- package/build/index.d.ts +5 -3
- package/build/index.d.ts.map +1 -1
- package/build/index.js +1 -1
- package/build/index.js.map +1 -1
- package/ios/ExpoPdfReaderView.swift +2 -4
- package/package.json +1 -1
- package/src/ExpoPdfReaderView.tsx +2 -3
- package/src/index.ts +6 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoPdfReaderView.d.ts","sourceRoot":"","sources":["../src/ExpoPdfReaderView.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ExpoPdfReaderView.d.ts","sourceRoot":"","sources":["../src/ExpoPdfReaderView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EACL,UAAU,EAGV,YAAY,EACb,MAAM,uBAAuB,CAAC;AAQ/B,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IAC5B,cAAc,EAAE,MAAM,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC;IAC5C,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;IACtD,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1C,IAAI,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IAC7B,IAAI,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IAC7B,MAAM,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IAC/B,OAAO,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IAChC,eAAe,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;CACnE,CAAC;AAEF,QAAA,MAAM,iBAAiB;;;;;;;;;;;;0CAwGtB,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { requireNativeModule } from 'expo-modules-core';
|
|
2
|
-
import { requireNativeViewManager } from 'expo-modules-core';
|
|
1
|
+
import { requireNativeModule, requireNativeViewManager } from 'expo-modules-core';
|
|
3
2
|
import * as React from 'react';
|
|
4
3
|
import { findNodeHandle } from 'react-native';
|
|
5
4
|
const NativeView = requireNativeViewManager('ExpoPdfReader');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoPdfReaderView.js","sourceRoot":"","sources":["../src/ExpoPdfReaderView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,
|
|
1
|
+
{"version":3,"file":"ExpoPdfReaderView.js","sourceRoot":"","sources":["../src/ExpoPdfReaderView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAClF,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAS9C,MAAM,UAAU,GAEZ,wBAAwB,CAAC,eAAe,CAAC,CAAC;AAE9C,MAAM,YAAY,GAAG,mBAAmB,CAAC,eAAe,CAAC,CAAC;AAc1D,MAAM,iBAAiB,GAAG,KAAK,CAAC,UAAU,CACxC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACb,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,CAAM,IAAI,CAAC,CAAC;IAE1C,KAAK,CAAC,mBAAmB,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;QACpC,IAAI,EAAE,KAAK,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,iBAAiB,CAAC","sourcesContent":["import { requireNativeModule, requireNativeViewManager } from 'expo-modules-core';\nimport * as React from 'react';\nimport { findNodeHandle } from 'react-native';\n\nimport {\n Annotation,\n ExpoPdfReaderViewProps,\n NativeExpoPdfReaderViewProps,\n SearchResult,\n} from './ExpoPdfReader.types';\n\nconst NativeView: React.ComponentType<\n NativeExpoPdfReaderViewProps & { ref?: React.Ref<any> }\n> = requireNativeViewManager('ExpoPdfReader');\n\nconst NativeModule = requireNativeModule('ExpoPdfReader');\n\nexport type ExpoPdfReaderRef = {\n save: () => Promise<string>;\n getAnnotations: () => Promise<Annotation[]>;\n searchText: (text: string) => Promise<SearchResult[]>;\n goToPage: (page: number) => Promise<void>;\n undo: () => Promise<boolean>;\n redo: () => Promise<boolean>;\n zoomIn: () => Promise<boolean>;\n zoomOut: () => Promise<boolean>;\n renderThumbnail: (page: number, width: number) => Promise<string>;\n};\n\nconst ExpoPdfReaderView = React.forwardRef<ExpoPdfReaderRef, ExpoPdfReaderViewProps>(\n (props, ref) => {\n const nativeRef = React.useRef<any>(null);\n\n React.useImperativeHandle(ref, () => ({\n save: async () => {\n if (nativeRef.current) {\n const viewTag = findNodeHandle(nativeRef.current);\n if (viewTag && NativeModule && NativeModule.save) {\n return await NativeModule.save(viewTag);\n }\n }\n throw new Error('Cannot save: Native view not found');\n },\n getAnnotations: async () => {\n if (nativeRef.current) {\n const viewTag = findNodeHandle(nativeRef.current);\n if (viewTag && NativeModule && NativeModule.getAnnotations) {\n return await NativeModule.getAnnotations(viewTag);\n }\n }\n return [];\n },\n searchText: async (text: string) => {\n if (nativeRef.current) {\n const viewTag = findNodeHandle(nativeRef.current);\n if (viewTag && NativeModule && NativeModule.searchText) {\n return await NativeModule.searchText(viewTag, text);\n }\n }\n return [];\n },\n goToPage: async (page: number) => {\n if (nativeRef.current) {\n const viewTag = findNodeHandle(nativeRef.current);\n if (viewTag && NativeModule && NativeModule.goToPage) {\n return await NativeModule.goToPage(viewTag, page);\n }\n }\n },\n undo: async () => {\n if (nativeRef.current) {\n const viewTag = findNodeHandle(nativeRef.current);\n if (viewTag && NativeModule && NativeModule.undo) {\n return await NativeModule.undo(viewTag);\n }\n }\n return false;\n },\n redo: async () => {\n if (nativeRef.current) {\n const viewTag = findNodeHandle(nativeRef.current);\n if (viewTag && NativeModule && NativeModule.redo) {\n return await NativeModule.redo(viewTag);\n }\n }\n return false;\n },\n zoomIn: async () => {\n if (nativeRef.current) {\n const viewTag = findNodeHandle(nativeRef.current);\n if (viewTag && NativeModule && NativeModule.zoomIn) {\n return await NativeModule.zoomIn(viewTag);\n }\n }\n return false;\n },\n zoomOut: async () => {\n if (nativeRef.current) {\n const viewTag = findNodeHandle(nativeRef.current);\n if (viewTag && NativeModule && NativeModule.zoomOut) {\n return await NativeModule.zoomOut(viewTag);\n }\n }\n return false;\n },\n renderThumbnail: async (page: number, width: number) => {\n if (nativeRef.current) {\n const viewTag = findNodeHandle(nativeRef.current);\n if (viewTag && NativeModule && NativeModule.renderThumbnail) {\n return await NativeModule.renderThumbnail(viewTag, page, width);\n }\n }\n return '';\n },\n }));\n\n const { annotationOptions, ...restProps } = props;\n\n const nativeProps: NativeExpoPdfReaderViewProps = {\n ...(restProps as NativeExpoPdfReaderViewProps),\n displayMode: props.displayMode,\n initialPage: props.initialPage,\n minZoom: props.minZoom,\n maxZoom: props.maxZoom,\n annotationTool: annotationOptions?.tool,\n annotationColor: annotationOptions?.color,\n annotationFontSize: annotationOptions?.fontSize,\n annotationText: annotationOptions?.text,\n annotationStrokeWidth: annotationOptions?.strokeWidth,\n };\n\n return <NativeView ref={nativeRef} {...nativeProps} />;\n }\n);\n\nexport default ExpoPdfReaderView;\n"]}
|
package/build/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import type { Annotation, AnnotationChangeEvent, AnnotationOptions, AnnotationTool, DisplayMode, ExpoPdfReaderViewProps, PageChangeEvent, ScrollEvent, SearchResult } from './ExpoPdfReader.types';
|
|
2
|
+
import type { ExpoPdfReaderRef } from './ExpoPdfReaderView';
|
|
3
|
+
import ExpoPdfReaderView from './ExpoPdfReaderView';
|
|
4
|
+
export { ExpoPdfReaderView };
|
|
5
|
+
export type { Annotation, AnnotationChangeEvent, AnnotationOptions, AnnotationTool, DisplayMode, ExpoPdfReaderRef, ExpoPdfReaderViewProps, PageChangeEvent, ScrollEvent, SearchResult };
|
|
4
6
|
//# sourceMappingURL=index.d.ts.map
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,cAAc,EAAE,WAAW,EAAE,sBAAsB,EAAE,eAAe,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACnM,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,iBAAiB,EAAE,CAAC;AAC7B,YAAY,EAAE,UAAU,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,cAAc,EAAE,WAAW,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,eAAe,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC"}
|
package/build/index.js
CHANGED
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,iBAAiB,EAAE,CAAC","sourcesContent":["import type { Annotation, AnnotationChangeEvent, AnnotationOptions, AnnotationTool, DisplayMode, ExpoPdfReaderViewProps, PageChangeEvent, ScrollEvent, SearchResult } from './ExpoPdfReader.types';\nimport type { ExpoPdfReaderRef } from './ExpoPdfReaderView';\nimport ExpoPdfReaderView from './ExpoPdfReaderView';\n\nexport { ExpoPdfReaderView };\nexport type { Annotation, AnnotationChangeEvent, AnnotationOptions, AnnotationTool, DisplayMode, ExpoPdfReaderRef, ExpoPdfReaderViewProps, PageChangeEvent, ScrollEvent, SearchResult };\n\n"]}
|
|
@@ -672,8 +672,7 @@ class ExpoPdfReaderView: ExpoView, UIGestureRecognizerDelegate {
|
|
|
672
672
|
|
|
673
673
|
// Force comprehensive PDF view update
|
|
674
674
|
pdfView.layoutDocumentView()
|
|
675
|
-
pdfView.setNeedsDisplay()
|
|
676
|
-
pdfView.currentPage?.setNeedsDisplay(pdfView.displayBox)
|
|
675
|
+
pdfView.setNeedsDisplay(pdfView.bounds)
|
|
677
676
|
}
|
|
678
677
|
else if currentTool == "highlighter" {
|
|
679
678
|
let annotation = PDFAnnotation(bounds: pathBounds, forType: .ink, withProperties: nil)
|
|
@@ -696,8 +695,7 @@ class ExpoPdfReaderView: ExpoView, UIGestureRecognizerDelegate {
|
|
|
696
695
|
|
|
697
696
|
// Force comprehensive PDF view update
|
|
698
697
|
pdfView.layoutDocumentView()
|
|
699
|
-
pdfView.setNeedsDisplay()
|
|
700
|
-
pdfView.currentPage?.setNeedsDisplay(pdfView.displayBox)
|
|
698
|
+
pdfView.setNeedsDisplay(pdfView.bounds)
|
|
701
699
|
}
|
|
702
700
|
|
|
703
701
|
// Clear redo stack when new annotation is added
|
package/package.json
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { requireNativeModule } from 'expo-modules-core';
|
|
2
|
-
import { requireNativeViewManager } from 'expo-modules-core';
|
|
1
|
+
import { requireNativeModule, requireNativeViewManager } from 'expo-modules-core';
|
|
3
2
|
import * as React from 'react';
|
|
4
3
|
import { findNodeHandle } from 'react-native';
|
|
5
4
|
|
|
6
5
|
import {
|
|
6
|
+
Annotation,
|
|
7
7
|
ExpoPdfReaderViewProps,
|
|
8
8
|
NativeExpoPdfReaderViewProps,
|
|
9
|
-
Annotation,
|
|
10
9
|
SearchResult,
|
|
11
10
|
} from './ExpoPdfReader.types';
|
|
12
11
|
|
package/src/index.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import type { Annotation, AnnotationChangeEvent, AnnotationOptions, AnnotationTool, DisplayMode, ExpoPdfReaderViewProps, PageChangeEvent, ScrollEvent, SearchResult } from './ExpoPdfReader.types';
|
|
2
|
+
import type { ExpoPdfReaderRef } from './ExpoPdfReaderView';
|
|
3
|
+
import ExpoPdfReaderView from './ExpoPdfReaderView';
|
|
4
|
+
|
|
5
|
+
export { ExpoPdfReaderView };
|
|
6
|
+
export type { Annotation, AnnotationChangeEvent, AnnotationOptions, AnnotationTool, DisplayMode, ExpoPdfReaderRef, ExpoPdfReaderViewProps, PageChangeEvent, ScrollEvent, SearchResult };
|
|
3
7
|
|
|
4
|
-
export { ExpoPdfReaderView, ExpoPdfReaderRef, ExpoPdfReaderViewProps, Annotation, AnnotationOptions, AnnotationTool, AnnotationChangeEvent, PageChangeEvent, ScrollEvent, SearchResult, DisplayMode, };
|