@june24/expo-pdf-reader 0.1.13 → 0.1.18
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/README.md +50 -50
- package/android/build.gradle +23 -23
- package/android/src/main/AndroidManifest.xml +2 -2
- package/android/src/main/java/expo/modules/pdfreader/ExpoPdfReaderModule.kt +74 -202
- package/android/src/main/java/expo/modules/pdfreader/ExpoPdfReaderView.kt +954 -934
- package/build/ExpoPdfReader.types.d.ts +77 -70
- package/build/ExpoPdfReader.types.d.ts.map +1 -1
- package/build/ExpoPdfReader.types.js.map +1 -1
- package/build/ExpoPdfReaderView.d.ts +3 -26
- package/build/ExpoPdfReaderView.d.ts.map +1 -1
- package/build/ExpoPdfReaderView.js +4 -102
- package/build/ExpoPdfReaderView.js.map +1 -1
- package/build/index.d.ts +4 -4
- package/build/index.d.ts.map +1 -1
- package/build/index.js +1 -0
- package/build/index.js.map +1 -1
- package/expo-module.config.json +16 -16
- package/ios/ExpoPdfReader.podspec +27 -27
- package/ios/ExpoPdfReaderModule.swift +69 -170
- package/ios/ExpoPdfReaderView.swift +1048 -862
- package/package.json +39 -39
- package/src/ExpoPdfReader.types.ts +49 -99
- package/src/ExpoPdfReaderView.tsx +17 -136
- package/src/index.ts +12 -7
- package/tsconfig.json +9 -9
|
@@ -1,85 +1,92 @@
|
|
|
1
1
|
import { ViewProps, StyleProp, ViewStyle } from 'react-native';
|
|
2
|
-
export type AnnotationTool = 'none' | 'pen' | 'highlighter' | 'text' | 'note' | 'eraser';
|
|
3
2
|
export type DisplayMode = 'single' | 'continuous' | 'twoUp' | 'twoUpContinuous';
|
|
4
|
-
export type
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
type: 'pen' | 'highlighter' | 'text';
|
|
10
|
-
color: string;
|
|
11
|
-
page?: number;
|
|
12
|
-
points?: Point[][];
|
|
13
|
-
width?: number;
|
|
14
|
-
text?: string;
|
|
15
|
-
fontSize?: number;
|
|
16
|
-
x?: number;
|
|
17
|
-
y?: number;
|
|
18
|
-
};
|
|
19
|
-
export type AnnotationChangeEvent = {
|
|
20
|
-
nativeEvent: {
|
|
21
|
-
annotations: Annotation[];
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
export type PageChangeEvent = {
|
|
25
|
-
nativeEvent: {
|
|
26
|
-
page: number;
|
|
27
|
-
total: number;
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
export type ScrollEvent = {
|
|
31
|
-
nativeEvent: {
|
|
3
|
+
export type AnnotationTool = 'pen' | 'highlighter' | 'text' | 'note' | 'eraser' | 'line';
|
|
4
|
+
export type AnnotationData = {
|
|
5
|
+
type: AnnotationTool;
|
|
6
|
+
page: number;
|
|
7
|
+
bounds: {
|
|
32
8
|
x: number;
|
|
33
9
|
y: number;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
layoutWidth: number;
|
|
37
|
-
layoutHeight: number;
|
|
10
|
+
width: number;
|
|
11
|
+
height: number;
|
|
38
12
|
};
|
|
39
|
-
};
|
|
40
|
-
export type SearchResult = {
|
|
41
|
-
page: number;
|
|
42
|
-
x: number;
|
|
43
|
-
y: number;
|
|
44
|
-
width: number;
|
|
45
|
-
height: number;
|
|
46
|
-
textSnippet?: string;
|
|
47
|
-
};
|
|
48
|
-
export type AnnotationOptions = {
|
|
49
|
-
tool?: AnnotationTool;
|
|
50
13
|
color?: string;
|
|
51
|
-
fontSize?: number;
|
|
52
|
-
text?: string;
|
|
53
14
|
strokeWidth?: number;
|
|
15
|
+
paths?: Array<Array<{
|
|
16
|
+
x: number;
|
|
17
|
+
y: number;
|
|
18
|
+
}>>;
|
|
19
|
+
contents?: string;
|
|
20
|
+
fontSize?: number;
|
|
21
|
+
bold?: boolean;
|
|
22
|
+
italic?: boolean;
|
|
54
23
|
};
|
|
55
|
-
export
|
|
56
|
-
url: string;
|
|
57
|
-
style?: StyleProp<ViewStyle>;
|
|
58
|
-
displayMode?: DisplayMode;
|
|
59
|
-
initialPage?: number;
|
|
60
|
-
minZoom?: number;
|
|
61
|
-
maxZoom?: number;
|
|
62
|
-
annotationOptions?: AnnotationOptions;
|
|
63
|
-
initialAnnotations?: Annotation[];
|
|
64
|
-
onAnnotationChange?: (event: AnnotationChangeEvent) => void;
|
|
65
|
-
onPageChange?: (event: PageChangeEvent) => void;
|
|
66
|
-
onScroll?: (event: ScrollEvent) => void;
|
|
67
|
-
};
|
|
68
|
-
export type NativeExpoPdfReaderViewProps = ViewProps & {
|
|
24
|
+
export interface ExpoPdfReaderViewProps extends ViewProps {
|
|
69
25
|
url: string;
|
|
70
26
|
style?: StyleProp<ViewStyle>;
|
|
71
27
|
displayMode?: DisplayMode;
|
|
72
28
|
initialPage?: number;
|
|
73
29
|
minZoom?: number;
|
|
74
30
|
maxZoom?: number;
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
31
|
+
tool?: AnnotationTool;
|
|
32
|
+
strokeColor?: string;
|
|
33
|
+
strokeWidth?: number;
|
|
34
|
+
textContent?: string;
|
|
35
|
+
textColor?: string;
|
|
36
|
+
textFontSize?: number;
|
|
37
|
+
textBold?: boolean;
|
|
38
|
+
textItalic?: boolean;
|
|
39
|
+
noteColor?: string;
|
|
40
|
+
initialAnnotations?: AnnotationData[];
|
|
41
|
+
onPageChange?: (event: {
|
|
42
|
+
nativeEvent: {
|
|
43
|
+
currentPage: number;
|
|
44
|
+
totalPage: number;
|
|
45
|
+
};
|
|
46
|
+
}) => void;
|
|
47
|
+
onAnnotationChange?: (event: {
|
|
48
|
+
nativeEvent: {
|
|
49
|
+
annotations: AnnotationData[];
|
|
50
|
+
};
|
|
51
|
+
}) => void;
|
|
52
|
+
onUndoRedoStateChange?: (event: {
|
|
53
|
+
nativeEvent: {
|
|
54
|
+
canUndo: boolean;
|
|
55
|
+
canRedo: boolean;
|
|
56
|
+
};
|
|
57
|
+
}) => void;
|
|
58
|
+
onNotePress?: (event: {
|
|
59
|
+
nativeEvent: {
|
|
60
|
+
page: number;
|
|
61
|
+
index: number;
|
|
62
|
+
bounds: {
|
|
63
|
+
x: number;
|
|
64
|
+
y: number;
|
|
65
|
+
width: number;
|
|
66
|
+
height: number;
|
|
67
|
+
};
|
|
68
|
+
contents?: string;
|
|
69
|
+
};
|
|
70
|
+
}) => void;
|
|
71
|
+
onTextPress?: (event: {
|
|
72
|
+
nativeEvent: {
|
|
73
|
+
page: number;
|
|
74
|
+
index: number;
|
|
75
|
+
bounds: {
|
|
76
|
+
x: number;
|
|
77
|
+
y: number;
|
|
78
|
+
width: number;
|
|
79
|
+
height: number;
|
|
80
|
+
};
|
|
81
|
+
contents?: string;
|
|
82
|
+
};
|
|
83
|
+
}) => void;
|
|
84
|
+
}
|
|
85
|
+
export interface ExpoPdfReaderRef {
|
|
86
|
+
undo: () => Promise<void>;
|
|
87
|
+
redo: () => Promise<void>;
|
|
88
|
+
setInitialPage: (page: number) => Promise<void>;
|
|
89
|
+
updateNote: (page: number, index: number, contents: string) => Promise<void>;
|
|
90
|
+
updateText: (page: number, index: number, contents: string) => Promise<void>;
|
|
91
|
+
}
|
|
85
92
|
//# sourceMappingURL=ExpoPdfReader.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoPdfReader.types.d.ts","sourceRoot":"","sources":["../src/ExpoPdfReader.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE/D,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"ExpoPdfReader.types.d.ts","sourceRoot":"","sources":["../src/ExpoPdfReader.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE/D,MAAM,MAAM,WAAW,GAAG,QAA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E,CAAC;YAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,KAAK,IAAI,CAAC;CACrK;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1B,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1B,cAAc,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAChD,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7E,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoPdfReader.types.js","sourceRoot":"","sources":["../src/ExpoPdfReader.types.ts"],"names":[],"mappings":"","sourcesContent":["import { ViewProps, StyleProp, ViewStyle } from 'react-native';\n\nexport type
|
|
1
|
+
{"version":3,"file":"ExpoPdfReader.types.js","sourceRoot":"","sources":["../src/ExpoPdfReader.types.ts"],"names":[],"mappings":"","sourcesContent":["import { ViewProps, StyleProp, ViewStyle } from 'react-native';\r\n\r\nexport type DisplayMode = 'single' | 'continuous' | 'twoUp' | 'twoUpContinuous';\r\nexport type AnnotationTool = 'pen' | 'highlighter' | 'text' | 'note' | 'eraser' | 'line';\r\n\r\nexport type AnnotationData = {\r\n type: AnnotationTool;\r\n page: number;\r\n bounds: { x: number; y: number; width: number; height: number };\r\n color?: string;\r\n strokeWidth?: number;\r\n paths?: Array<Array<{ x: number; y: number }>>;\r\n contents?: string;\r\n fontSize?: number; // зөвхөн text-д\r\n bold?: boolean; // зөвхөн text-д\r\n italic?: boolean; // зөвхөн text-д\r\n};\r\n\r\nexport interface ExpoPdfReaderViewProps extends ViewProps {\r\n url: string;\r\n style?: StyleProp<ViewStyle>;\r\n displayMode?: DisplayMode;\r\n initialPage?: number;\r\n minZoom?: number;\r\n maxZoom?: number;\r\n tool?: AnnotationTool;\r\n strokeColor?: string;\r\n strokeWidth?: number;\r\n textContent?: string;\r\n textColor?: string;\r\n textFontSize?: number;\r\n textBold?: boolean;\r\n textItalic?: boolean;\r\n noteColor?: string;\r\n initialAnnotations?: AnnotationData[];\r\n onPageChange?: (event: { nativeEvent: { currentPage: number; totalPage: number } }) => void;\r\n onAnnotationChange?: (event: { nativeEvent: { annotations: AnnotationData[] } }) => void;\r\n onUndoRedoStateChange?: (event: { nativeEvent: { canUndo: boolean; canRedo: boolean } }) => void;\r\n onNotePress?: (event: { nativeEvent: { page: number; index: number; bounds: { x: number; y: number; width: number; height: number }; contents?: string } }) => void;\r\n onTextPress?: (event: { nativeEvent: { page: number; index: number; bounds: { x: number; y: number; width: number; height: number }; contents?: string } }) => void;\r\n}\r\n\r\nexport interface ExpoPdfReaderRef {\r\n undo: () => Promise<void>;\r\n redo: () => Promise<void>;\r\n setInitialPage: (page: number) => Promise<void>;\r\n updateNote: (page: number, index: number, contents: string) => Promise<void>;\r\n updateText: (page: number, index: number, contents: string) => Promise<void>;\r\n}"]}
|
|
@@ -1,28 +1,5 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
save: () => Promise<string>;
|
|
5
|
-
getAnnotations: () => Promise<Annotation[]>;
|
|
6
|
-
searchText: (text: string) => Promise<SearchResult[]>;
|
|
7
|
-
goToPage: (page: number) => Promise<void>;
|
|
8
|
-
undo: () => Promise<boolean>;
|
|
9
|
-
redo: () => Promise<boolean>;
|
|
10
|
-
zoomIn: () => Promise<boolean>;
|
|
11
|
-
zoomOut: () => Promise<boolean>;
|
|
12
|
-
renderThumbnail: (page: number, width: number) => Promise<string>;
|
|
13
|
-
};
|
|
14
|
-
declare const ExpoPdfReaderView: React.ForwardRefExoticComponent<import("react-native").ViewProps & {
|
|
15
|
-
url: string;
|
|
16
|
-
style?: import("react-native").StyleProp<import("react-native").ViewStyle>;
|
|
17
|
-
displayMode?: import("./ExpoPdfReader.types").DisplayMode;
|
|
18
|
-
initialPage?: number;
|
|
19
|
-
minZoom?: number;
|
|
20
|
-
maxZoom?: number;
|
|
21
|
-
annotationOptions?: import("./ExpoPdfReader.types").AnnotationOptions;
|
|
22
|
-
initialAnnotations?: Annotation[];
|
|
23
|
-
onAnnotationChange?: (event: import("./ExpoPdfReader.types").AnnotationChangeEvent) => void;
|
|
24
|
-
onPageChange?: (event: import("./ExpoPdfReader.types").PageChangeEvent) => void;
|
|
25
|
-
onScroll?: (event: import("./ExpoPdfReader.types").ScrollEvent) => void;
|
|
26
|
-
} & React.RefAttributes<ExpoPdfReaderRef>>;
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { ExpoPdfReaderViewProps, ExpoPdfReaderRef } from "./ExpoPdfReader.types";
|
|
3
|
+
declare const ExpoPdfReaderView: React.ForwardRefExoticComponent<ExpoPdfReaderViewProps & React.RefAttributes<ExpoPdfReaderRef>>;
|
|
27
4
|
export default ExpoPdfReaderView;
|
|
28
5
|
//# sourceMappingURL=ExpoPdfReaderView.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoPdfReaderView.d.ts","sourceRoot":"","sources":["../src/ExpoPdfReaderView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ExpoPdfReaderView.d.ts","sourceRoot":"","sources":["../src/ExpoPdfReaderView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,sBAAsB,EACtB,gBAAgB,EACjB,MAAM,uBAAuB,CAAC;AAI/B,QAAA,MAAM,iBAAiB,iGAKrB,CAAC;AAEH,eAAe,iBAAiB,CAAC"}
|
|
@@ -1,106 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as React from
|
|
3
|
-
|
|
4
|
-
const NativeView = requireNativeViewManager('ExpoPdfReader');
|
|
5
|
-
const NativeModule = requireNativeModule('ExpoPdfReader');
|
|
1
|
+
import { requireNativeViewManager } from "expo-modules-core";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
const NativeView = requireNativeViewManager("ExpoPdfReader");
|
|
6
4
|
const ExpoPdfReaderView = React.forwardRef((props, ref) => {
|
|
7
|
-
|
|
8
|
-
React.useImperativeHandle(ref, () => ({
|
|
9
|
-
save: async () => {
|
|
10
|
-
if (nativeRef.current) {
|
|
11
|
-
const viewTag = findNodeHandle(nativeRef.current);
|
|
12
|
-
if (viewTag && NativeModule && NativeModule.save) {
|
|
13
|
-
return await NativeModule.save(viewTag);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
throw new Error('Cannot save: Native view not found');
|
|
17
|
-
},
|
|
18
|
-
getAnnotations: async () => {
|
|
19
|
-
if (nativeRef.current) {
|
|
20
|
-
const viewTag = findNodeHandle(nativeRef.current);
|
|
21
|
-
if (viewTag && NativeModule && NativeModule.getAnnotations) {
|
|
22
|
-
return await NativeModule.getAnnotations(viewTag);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
return [];
|
|
26
|
-
},
|
|
27
|
-
searchText: async (text) => {
|
|
28
|
-
if (nativeRef.current) {
|
|
29
|
-
const viewTag = findNodeHandle(nativeRef.current);
|
|
30
|
-
if (viewTag && NativeModule && NativeModule.searchText) {
|
|
31
|
-
return await NativeModule.searchText(viewTag, text);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
return [];
|
|
35
|
-
},
|
|
36
|
-
goToPage: async (page) => {
|
|
37
|
-
if (nativeRef.current) {
|
|
38
|
-
const viewTag = findNodeHandle(nativeRef.current);
|
|
39
|
-
if (viewTag && NativeModule && NativeModule.goToPage) {
|
|
40
|
-
return await NativeModule.goToPage(viewTag, page);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
undo: async () => {
|
|
45
|
-
if (nativeRef.current) {
|
|
46
|
-
const viewTag = findNodeHandle(nativeRef.current);
|
|
47
|
-
if (viewTag && NativeModule && NativeModule.undo) {
|
|
48
|
-
return await NativeModule.undo(viewTag);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
return false;
|
|
52
|
-
},
|
|
53
|
-
redo: async () => {
|
|
54
|
-
if (nativeRef.current) {
|
|
55
|
-
const viewTag = findNodeHandle(nativeRef.current);
|
|
56
|
-
if (viewTag && NativeModule && NativeModule.redo) {
|
|
57
|
-
return await NativeModule.redo(viewTag);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
return false;
|
|
61
|
-
},
|
|
62
|
-
zoomIn: async () => {
|
|
63
|
-
if (nativeRef.current) {
|
|
64
|
-
const viewTag = findNodeHandle(nativeRef.current);
|
|
65
|
-
if (viewTag && NativeModule && NativeModule.zoomIn) {
|
|
66
|
-
return await NativeModule.zoomIn(viewTag);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
return false;
|
|
70
|
-
},
|
|
71
|
-
zoomOut: async () => {
|
|
72
|
-
if (nativeRef.current) {
|
|
73
|
-
const viewTag = findNodeHandle(nativeRef.current);
|
|
74
|
-
if (viewTag && NativeModule && NativeModule.zoomOut) {
|
|
75
|
-
return await NativeModule.zoomOut(viewTag);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
return false;
|
|
79
|
-
},
|
|
80
|
-
renderThumbnail: async (page, width) => {
|
|
81
|
-
if (nativeRef.current) {
|
|
82
|
-
const viewTag = findNodeHandle(nativeRef.current);
|
|
83
|
-
if (viewTag && NativeModule && NativeModule.renderThumbnail) {
|
|
84
|
-
return await NativeModule.renderThumbnail(viewTag, page, width);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
return '';
|
|
88
|
-
},
|
|
89
|
-
}));
|
|
90
|
-
const { annotationOptions, ...restProps } = props;
|
|
91
|
-
const nativeProps = {
|
|
92
|
-
...restProps,
|
|
93
|
-
displayMode: props.displayMode,
|
|
94
|
-
initialPage: props.initialPage,
|
|
95
|
-
minZoom: props.minZoom,
|
|
96
|
-
maxZoom: props.maxZoom,
|
|
97
|
-
annotationTool: annotationOptions?.tool,
|
|
98
|
-
annotationColor: annotationOptions?.color,
|
|
99
|
-
annotationFontSize: annotationOptions?.fontSize,
|
|
100
|
-
annotationText: annotationOptions?.text,
|
|
101
|
-
annotationStrokeWidth: annotationOptions?.strokeWidth,
|
|
102
|
-
};
|
|
103
|
-
return <NativeView ref={nativeRef} {...nativeProps}/>;
|
|
5
|
+
return <NativeView {...props} ref={ref}/>;
|
|
104
6
|
});
|
|
105
7
|
export default ExpoPdfReaderView;
|
|
106
8
|
//# sourceMappingURL=ExpoPdfReaderView.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoPdfReaderView.js","sourceRoot":"","sources":["../src/ExpoPdfReaderView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"ExpoPdfReaderView.js","sourceRoot":"","sources":["../src/ExpoPdfReaderView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,MAAM,UAAU,GAAG,wBAAwB,CAAC,eAAe,CAAC,CAAC;AAE7D,MAAM,iBAAiB,GAAG,KAAK,CAAC,UAAU,CAGxC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACf,OAAO,CAAC,UAAU,CAAC,IAAI,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAG,CAAC;AAC7C,CAAC,CAAC,CAAC;AAEH,eAAe,iBAAiB,CAAC","sourcesContent":["import { requireNativeViewManager } from \"expo-modules-core\";\r\nimport * as React from \"react\";\r\nimport {\r\n ExpoPdfReaderViewProps,\r\n ExpoPdfReaderRef,\r\n} from \"./ExpoPdfReader.types\";\r\n\r\nconst NativeView = requireNativeViewManager(\"ExpoPdfReader\");\r\n\r\nconst ExpoPdfReaderView = React.forwardRef<\r\n ExpoPdfReaderRef,\r\n ExpoPdfReaderViewProps\r\n>((props, ref) => {\r\n return <NativeView {...props} ref={ref} />;\r\n});\r\n\r\nexport default ExpoPdfReaderView;\r\n"]}
|
package/build/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Annotation, AnnotationChangeEvent, AnnotationOptions, AnnotationTool, DisplayMode, ExpoPdfReaderViewProps, PageChangeEvent, ScrollEvent, SearchResult } from './ExpoPdfReader.types';
|
|
2
|
-
import type { ExpoPdfReaderRef } from './ExpoPdfReaderView';
|
|
3
1
|
import ExpoPdfReaderView from './ExpoPdfReaderView';
|
|
4
|
-
|
|
5
|
-
export
|
|
2
|
+
import { DisplayMode, ExpoPdfReaderViewProps, AnnotationTool, AnnotationData, ExpoPdfReaderRef } from './ExpoPdfReader.types';
|
|
3
|
+
export default ExpoPdfReaderView;
|
|
4
|
+
export { ExpoPdfReaderView, DisplayMode, AnnotationTool };
|
|
5
|
+
export type { ExpoPdfReaderViewProps, AnnotationData, ExpoPdfReaderRef };
|
|
6
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,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,EACH,WAAW,EACX,sBAAsB,EACtB,cAAc,EACd,cAAc,EACd,gBAAgB,EACnB,MAAM,uBAAuB,CAAC;AAE/B,eAAe,iBAAiB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC;AAC1D,YAAY,EAAE,sBAAsB,EAAE,cAAc,EAAE,gBAAgB,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":"AAAA,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AASpD,eAAe,iBAAiB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAA+B,CAAC","sourcesContent":["import ExpoPdfReaderView from './ExpoPdfReaderView';\r\nimport {\r\n DisplayMode,\r\n ExpoPdfReaderViewProps,\r\n AnnotationTool,\r\n AnnotationData,\r\n ExpoPdfReaderRef\r\n} from './ExpoPdfReader.types';\r\n\r\nexport default ExpoPdfReaderView;\r\nexport { ExpoPdfReaderView, DisplayMode, AnnotationTool };\r\nexport type { ExpoPdfReaderViewProps, AnnotationData, ExpoPdfReaderRef };"]}
|
package/expo-module.config.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
{
|
|
2
|
-
"platforms": [
|
|
3
|
-
"ios",
|
|
4
|
-
"android"
|
|
5
|
-
],
|
|
6
|
-
"ios": {
|
|
7
|
-
"modules": [
|
|
8
|
-
"ExpoPdfReaderModule"
|
|
9
|
-
]
|
|
10
|
-
},
|
|
11
|
-
"android": {
|
|
12
|
-
"modules": [
|
|
13
|
-
"expo.modules.pdfreader.ExpoPdfReaderModule"
|
|
14
|
-
]
|
|
15
|
-
}
|
|
16
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"platforms": [
|
|
3
|
+
"ios",
|
|
4
|
+
"android"
|
|
5
|
+
],
|
|
6
|
+
"ios": {
|
|
7
|
+
"modules": [
|
|
8
|
+
"ExpoPdfReaderModule"
|
|
9
|
+
]
|
|
10
|
+
},
|
|
11
|
+
"android": {
|
|
12
|
+
"modules": [
|
|
13
|
+
"expo.modules.pdfreader.ExpoPdfReaderModule"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
require 'json'
|
|
2
|
-
|
|
3
|
-
package = JSON.parse(File.read(File.join(__dir__, '..', 'package.json')))
|
|
4
|
-
|
|
5
|
-
Pod::Spec.new do |s|
|
|
6
|
-
s.name = 'ExpoPdfReader'
|
|
7
|
-
s.version = package['version']
|
|
8
|
-
s.summary = package['description']
|
|
9
|
-
s.description = package['description']
|
|
10
|
-
s.license = package['license']
|
|
11
|
-
s.author = package['author']
|
|
12
|
-
s.homepage = package['homepage'] || 'https://github.com/june24/expo-pdf-reader'
|
|
13
|
-
s.platform = :ios, '15.1'
|
|
14
|
-
s.swift_version = '5.9'
|
|
15
|
-
s.source = { git: package['homepage'] || 'git@gitlab.com:june_241/expo-pdf-reader.git', tag: "v#{s.version}" }
|
|
16
|
-
s.static_framework = true
|
|
17
|
-
|
|
18
|
-
s.dependency 'ExpoModulesCore'
|
|
19
|
-
|
|
20
|
-
# Swift/Objective-C compatibility
|
|
21
|
-
s.pod_target_xcconfig = {
|
|
22
|
-
'DEFINES_MODULE' => 'YES',
|
|
23
|
-
'SWIFT_COMPILATION_MODE' => 'wholemodule'
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
s.source_files = "**/*.{h,m,swift}"
|
|
27
|
-
end
|
|
1
|
+
require 'json'
|
|
2
|
+
|
|
3
|
+
package = JSON.parse(File.read(File.join(__dir__, '..', 'package.json')))
|
|
4
|
+
|
|
5
|
+
Pod::Spec.new do |s|
|
|
6
|
+
s.name = 'ExpoPdfReader'
|
|
7
|
+
s.version = package['version']
|
|
8
|
+
s.summary = package['description']
|
|
9
|
+
s.description = package['description']
|
|
10
|
+
s.license = package['license']
|
|
11
|
+
s.author = package['author']
|
|
12
|
+
s.homepage = package['homepage'] || 'https://github.com/june24/expo-pdf-reader'
|
|
13
|
+
s.platform = :ios, '15.1'
|
|
14
|
+
s.swift_version = '5.9'
|
|
15
|
+
s.source = { git: package['homepage'] || 'git@gitlab.com:june_241/expo-pdf-reader.git', tag: "v#{s.version}" }
|
|
16
|
+
s.static_framework = true
|
|
17
|
+
|
|
18
|
+
s.dependency 'ExpoModulesCore'
|
|
19
|
+
|
|
20
|
+
# Swift/Objective-C compatibility
|
|
21
|
+
s.pod_target_xcconfig = {
|
|
22
|
+
'DEFINES_MODULE' => 'YES',
|
|
23
|
+
'SWIFT_COMPILATION_MODE' => 'wholemodule'
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
s.source_files = "**/*.{h,m,swift}"
|
|
27
|
+
end
|