@react-native-ohos/react-native-pdf 6.7.7-rc.1 → 6.8.0-rc.2

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # @react-native-ohos/react-native-pdf
2
2
 
3
- This project is based on [react-native-pdf](https://github.com/wonday/react-native-pdf)
3
+ This project is based on [react-native-pdf@6.7.6](https://github.com/wonday/react-native-pdf/tree/v6.7.6)
4
4
 
5
5
  ## Documentation
6
6
 
@@ -1,48 +1,48 @@
1
- /**
2
- * @flow
3
- * @format
4
- */
5
- 'use strict';
6
-
7
- import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
8
- import codegenNativeCommands from 'react-native/Libraries/Utilities/codegenNativeCommands';
9
-
10
- type ChangeEvent = $ReadOnly<{|
11
- message: ?string,
12
- |}>;
13
-
14
- export type NativeProps = $ReadOnly<{|
15
- ...ViewProps,
16
- path: ?string,
17
- page: ?Int32,
18
- scale: ?Float,
19
- minScale: ?Float,
20
- maxScale: ?Float,
21
- horizontal: ?boolean,
22
- enablePaging: ?boolean,
23
- enableRTL: ?boolean,
24
- enableAnnotationRendering: ?boolean,
25
- showsHorizontalScrollIndicator: ?boolean,
26
- showsVerticalScrollIndicator: ?boolean,
27
- scrollEnabled: ?boolean,
28
- enableAntialiasing: ?boolean,
29
- enableDoubleTapZoom: ?boolean,
30
- fitPolicy: ?Int32,
31
- spacing: ?Int32,
32
- password: ?string,
33
- onChange: ?BubblingEventHandler<ChangeEvent>,
34
- singlePage: ?boolean,
35
- |}>;
36
-
37
- interface NativeCommands {
38
- +setNativePage: (
39
- viewRef: React.ElementRef<ComponentType>,
40
- page: Int32,
41
- ) => void;
42
- }
43
-
44
- export const Commands: NativeCommands = codegenNativeCommands<NativeCommands>({
45
- supportedCommands: ['setNativePage'],
46
- });
47
-
48
- export default codegenNativeComponent<NativeProps>('RNPDFPdfView');
1
+ /**
2
+ * @flow
3
+ * @format
4
+ */
5
+ 'use strict';
6
+
7
+ import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
8
+ import codegenNativeCommands from 'react-native/Libraries/Utilities/codegenNativeCommands';
9
+
10
+ type ChangeEvent = $ReadOnly<{|
11
+ message: ?string,
12
+ |}>;
13
+
14
+ export type NativeProps = $ReadOnly<{|
15
+ ...ViewProps,
16
+ path: ?string,
17
+ page: ?Int32,
18
+ scale: ?Float,
19
+ minScale: ?Float,
20
+ maxScale: ?Float,
21
+ horizontal: ?boolean,
22
+ enablePaging: ?boolean,
23
+ enableRTL: ?boolean,
24
+ enableAnnotationRendering: ?boolean,
25
+ showsHorizontalScrollIndicator: ?boolean,
26
+ showsVerticalScrollIndicator: ?boolean,
27
+ scrollEnabled: ?boolean,
28
+ enableAntialiasing: ?boolean,
29
+ enableDoubleTapZoom: ?boolean,
30
+ fitPolicy: ?Int32,
31
+ spacing: ?Int32,
32
+ password: ?string,
33
+ onChange: ?BubblingEventHandler<ChangeEvent>,
34
+ singlePage: ?boolean,
35
+ |}>;
36
+
37
+ interface NativeCommands {
38
+ +setNativePage: (
39
+ viewRef: React.ElementRef<ComponentType>,
40
+ page: Int32,
41
+ ) => void;
42
+ }
43
+
44
+ export const Commands: NativeCommands = codegenNativeCommands<NativeCommands>({
45
+ supportedCommands: ['setNativePage'],
46
+ });
47
+
48
+ export default codegenNativeComponent<NativeProps>('RNPDFPdfView');
@@ -1,17 +1,17 @@
1
- /**
2
- * Use these variables when you tailor your ArkTS code. They must be of the const type.
3
- */
4
- export const HAR_VERSION = '6.7.7-rc.1';
5
- export const BUILD_MODE_NAME = 'debug';
6
- export const DEBUG = true;
7
- export const TARGET_NAME = 'default';
8
-
9
- /**
10
- * BuildProfile Class is used only for compatibility purposes.
11
- */
12
- export default class BuildProfile {
13
- static readonly HAR_VERSION = HAR_VERSION;
14
- static readonly BUILD_MODE_NAME = BUILD_MODE_NAME;
15
- static readonly DEBUG = DEBUG;
16
- static readonly TARGET_NAME = TARGET_NAME;
1
+ /**
2
+ * Use these variables when you tailor your ArkTS code. They must be of the const type.
3
+ */
4
+ export const HAR_VERSION = '6.7.7-rc.1';
5
+ export const BUILD_MODE_NAME = 'debug';
6
+ export const DEBUG = true;
7
+ export const TARGET_NAME = 'default';
8
+
9
+ /**
10
+ * BuildProfile Class is used only for compatibility purposes.
11
+ */
12
+ export default class BuildProfile {
13
+ static readonly HAR_VERSION = HAR_VERSION;
14
+ static readonly BUILD_MODE_NAME = BUILD_MODE_NAME;
15
+ static readonly DEBUG = DEBUG;
16
+ static readonly TARGET_NAME = TARGET_NAME;
17
17
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-native-ohos/react-native-pdf",
3
- "version": "6.7.7-rc.1",
3
+ "version": "6.8.0-rc.2",
4
4
  "description": "Please describe the basic information.",
5
5
  "main": "Index.ets",
6
6
  "author": "",
@@ -389,6 +389,7 @@ export struct RTNPdfView {
389
389
  }
390
390
 
391
391
  aboutToDisappear() {
392
+ this.pdfController.releaseDocument();
392
393
  this.cleanupCommandCallback?.();
393
394
  this.unregisterDescriptorChangesListener?.();
394
395
  }
Binary file
package/index.d.ts CHANGED
@@ -1,72 +1,72 @@
1
- /**
2
- * Copyright (c) 2017-present, Wonday (@wonday.org)
3
- * All rights reserved.
4
- *
5
- * This source code is licensed under the MIT-style license found in the
6
- * LICENSE file in the root directory of this source tree.
7
- */
8
-
9
- import * as React from 'react';
10
- import * as ReactNative from 'react-native';
11
-
12
- export type TableContent = {
13
- children: TableContent[],
14
- mNativePtr: number,
15
- pageIdx: number,
16
- title: string,
17
- };
18
-
19
- export type Source = {
20
- uri?: string;
21
- headers?: {
22
- [key: string]: string;
23
- };
24
- cache?: boolean;
25
- cacheFileName?: string;
26
- expiration?: number;
27
- method?: string;
28
- };
29
-
30
- export interface PdfProps {
31
- style?: ReactNative.StyleProp<ReactNative.ViewStyle>,
32
- progressContainerStyle?: ReactNative.StyleProp<ReactNative.ViewStyle>,
33
- source: Source | number,
34
- page?: number,
35
- scale?: number,
36
- minScale?: number,
37
- maxScale?: number,
38
- horizontal?: boolean,
39
- showsHorizontalScrollIndicator?: boolean,
40
- showsVerticalScrollIndicator?: boolean,
41
- scrollEnabled?: boolean,
42
- spacing?: number,
43
- password?: string,
44
- renderActivityIndicator?: (progress: number) => React.ReactElement,
45
- enableAntialiasing?: boolean,
46
- enablePaging?: boolean,
47
- enableRTL?: boolean,
48
- enableAnnotationRendering?: boolean,
49
- enableDoubleTapZoom?: boolean;
50
- /**
51
- * Fit policy. This will adjust the initial zoom of the PDF based on the initial size of the view and the scale factor.
52
- * 0 = fit width
53
- * 1 = fit height
54
- * 2 = fit both
55
- */
56
- fitPolicy?: 0 | 1 | 2,
57
- trustAllCerts?: boolean,
58
- singlePage?: boolean,
59
- onLoadProgress?: (percent: number,) => void,
60
- onLoadComplete?: (numberOfPages: number, path: string, size: {height: number, width: number}, tableContents?: TableContent[]) => void,
61
- onPageChanged?: (page: number, numberOfPages: number) => void,
62
- onError?: (error: object) => void,
63
- onPageSingleTap?: (page: number, x: number, y: number) => void,
64
- onScaleChanged?: (scale: number) => void,
65
- onPressLink?: (url: string) => void,
66
- }
67
-
68
- declare class Pdf extends React.Component<PdfProps, any> {
69
- setPage: (pageNumber: number) => void;
70
- }
71
-
72
- export default Pdf;
1
+ /**
2
+ * Copyright (c) 2017-present, Wonday (@wonday.org)
3
+ * All rights reserved.
4
+ *
5
+ * This source code is licensed under the MIT-style license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+
9
+ import * as React from 'react';
10
+ import * as ReactNative from 'react-native';
11
+
12
+ export type TableContent = {
13
+ children: TableContent[],
14
+ mNativePtr: number,
15
+ pageIdx: number,
16
+ title: string,
17
+ };
18
+
19
+ export type Source = {
20
+ uri?: string;
21
+ headers?: {
22
+ [key: string]: string;
23
+ };
24
+ cache?: boolean;
25
+ cacheFileName?: string;
26
+ expiration?: number;
27
+ method?: string;
28
+ };
29
+
30
+ export interface PdfProps {
31
+ style?: ReactNative.StyleProp<ReactNative.ViewStyle>,
32
+ progressContainerStyle?: ReactNative.StyleProp<ReactNative.ViewStyle>,
33
+ source: Source | number,
34
+ page?: number,
35
+ scale?: number,
36
+ minScale?: number,
37
+ maxScale?: number,
38
+ horizontal?: boolean,
39
+ showsHorizontalScrollIndicator?: boolean,
40
+ showsVerticalScrollIndicator?: boolean,
41
+ scrollEnabled?: boolean,
42
+ spacing?: number,
43
+ password?: string,
44
+ renderActivityIndicator?: (progress: number) => React.ReactElement,
45
+ enableAntialiasing?: boolean,
46
+ enablePaging?: boolean,
47
+ enableRTL?: boolean,
48
+ enableAnnotationRendering?: boolean,
49
+ enableDoubleTapZoom?: boolean;
50
+ /**
51
+ * Fit policy. This will adjust the initial zoom of the PDF based on the initial size of the view and the scale factor.
52
+ * 0 = fit width
53
+ * 1 = fit height
54
+ * 2 = fit both
55
+ */
56
+ fitPolicy?: 0 | 1 | 2,
57
+ trustAllCerts?: boolean,
58
+ singlePage?: boolean,
59
+ onLoadProgress?: (percent: number,) => void,
60
+ onLoadComplete?: (numberOfPages: number, path: string, size: {height: number, width: number}, tableContents?: TableContent[]) => void,
61
+ onPageChanged?: (page: number, numberOfPages: number) => void,
62
+ onError?: (error: object) => void,
63
+ onPageSingleTap?: (page: number, x: number, y: number) => void,
64
+ onScaleChanged?: (scale: number) => void,
65
+ onPressLink?: (url: string) => void,
66
+ }
67
+
68
+ declare class Pdf extends React.Component<PdfProps, any> {
69
+ setPage: (pageNumber: number) => void;
70
+ }
71
+
72
+ export default Pdf;