@react-native-ohos/react-native-pdf 6.7.5-rc.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.
Files changed (64) hide show
  1. package/DoubleTapView.js +125 -0
  2. package/LICENSE +21 -0
  3. package/PdfManager.js +26 -0
  4. package/PdfPageView.js +53 -0
  5. package/PdfView.js +416 -0
  6. package/PdfViewFlatList.js +30 -0
  7. package/PinchZoomView.js +125 -0
  8. package/README.OpenSource +11 -0
  9. package/README.md +13 -0
  10. package/fabric/RNPDFPdfNativeComponent.js +46 -0
  11. package/fabric/RTNPdfViewNativeComponent.tsx +56 -0
  12. package/harmony/pdfview/Index.ets +8 -0
  13. package/harmony/pdfview/build-profile.json5 +28 -0
  14. package/harmony/pdfview/consumer-rules.txt +0 -0
  15. package/harmony/pdfview/hvigorfile.ts +6 -0
  16. package/harmony/pdfview/obfuscation-rules.txt +18 -0
  17. package/harmony/pdfview/oh-package.json5 +11 -0
  18. package/harmony/pdfview/src/main/cpp/CMakeLists.txt +8 -0
  19. package/harmony/pdfview/src/main/cpp/ComponentDescriptors.h +39 -0
  20. package/harmony/pdfview/src/main/cpp/EventEmitters.cpp +40 -0
  21. package/harmony/pdfview/src/main/cpp/EventEmitters.h +50 -0
  22. package/harmony/pdfview/src/main/cpp/PdfEventEmitRequestHandler.h +53 -0
  23. package/harmony/pdfview/src/main/cpp/PdfViewJSIBinder.h +71 -0
  24. package/harmony/pdfview/src/main/cpp/PdfViewPackage.h +58 -0
  25. package/harmony/pdfview/src/main/cpp/Props.cpp +60 -0
  26. package/harmony/pdfview/src/main/cpp/Props.h +65 -0
  27. package/harmony/pdfview/src/main/cpp/RTNPdfViewSpecsJSI-generated.cpp +30 -0
  28. package/harmony/pdfview/src/main/cpp/RTNPdfViewSpecsJSI.h +33 -0
  29. package/harmony/pdfview/src/main/cpp/ShadowNodes.cpp +33 -0
  30. package/harmony/pdfview/src/main/cpp/ShadowNodes.h +48 -0
  31. package/harmony/pdfview/src/main/cpp/States.cpp +30 -0
  32. package/harmony/pdfview/src/main/cpp/States.h +57 -0
  33. package/harmony/pdfview/src/main/ets/Logger.ets +64 -0
  34. package/harmony/pdfview/src/main/ets/PdfViewPackage.ets +34 -0
  35. package/harmony/pdfview/src/main/ets/components/mainpage/RTNPdfView.ets +521 -0
  36. package/harmony/pdfview/src/main/ets/components/mainpage/types.ts +15 -0
  37. package/harmony/pdfview/src/main/module.json5 +11 -0
  38. package/harmony/pdfview/src/main/resources/base/element/string.json +8 -0
  39. package/harmony/pdfview/src/main/resources/en_US/element/string.json +8 -0
  40. package/harmony/pdfview/src/main/resources/zh_CN/element/string.json +8 -0
  41. package/harmony/pdfview/src/test/List.test.ets +29 -0
  42. package/harmony/pdfview/src/test/LocalUnit.test.ets +57 -0
  43. package/harmony/pdfview.har +0 -0
  44. package/index.d.ts +64 -0
  45. package/index.js +475 -0
  46. package/index.js.flow +65 -0
  47. package/package.json +63 -0
  48. package/windows/RCTPdf/PropertySheet.props +16 -0
  49. package/windows/RCTPdf/RCTPdf.def +3 -0
  50. package/windows/RCTPdf/RCTPdf.vcxproj +180 -0
  51. package/windows/RCTPdf/RCTPdf.vcxproj.filters +38 -0
  52. package/windows/RCTPdf/RCTPdfControl.cpp +667 -0
  53. package/windows/RCTPdf/RCTPdfControl.h +119 -0
  54. package/windows/RCTPdf/RCTPdfControl.idl +10 -0
  55. package/windows/RCTPdf/RCTPdfControl.xaml +33 -0
  56. package/windows/RCTPdf/RCTPdfViewManager.cpp +69 -0
  57. package/windows/RCTPdf/RCTPdfViewManager.h +51 -0
  58. package/windows/RCTPdf/ReactPackageProvider.cpp +15 -0
  59. package/windows/RCTPdf/ReactPackageProvider.h +16 -0
  60. package/windows/RCTPdf/ReactPackageProvider.idl +9 -0
  61. package/windows/RCTPdf/packages.config +4 -0
  62. package/windows/RCTPdf/pch.cpp +1 -0
  63. package/windows/RCTPdf/pch.h +31 -0
  64. package/windows/README.md +21 -0
@@ -0,0 +1,60 @@
1
+ /**
2
+ * MIT License
3
+ *
4
+ * Copyright (C) 2024 Huawei Device Co., Ltd.
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ */
24
+ #include "Props.h"
25
+ #include <react/renderer/core/PropsParserContext.h>
26
+ #include <react/renderer/core/propsConversions.h>
27
+
28
+ namespace facebook {
29
+ namespace react {
30
+
31
+ RNPDFPdfViewProps::RNPDFPdfViewProps(
32
+ const PropsParserContext &context,
33
+ const RNPDFPdfViewProps &sourceProps,
34
+ const RawProps &rawProps): ViewProps(context, sourceProps, rawProps),
35
+
36
+ source(convertRawProp(context, rawProps, "source", sourceProps.source, {})),
37
+ path(convertRawProp(context, rawProps, "path", sourceProps.path, {})),
38
+ page(convertRawProp(context, rawProps, "page", sourceProps.page, {0})),
39
+ scale(convertRawProp(context, rawProps, "scale", sourceProps.scale, {0.0})),
40
+ minScale(convertRawProp(context, rawProps, "minScale", sourceProps.minScale, {0.0})),
41
+ maxScale(convertRawProp(context, rawProps, "maxScale", sourceProps.maxScale, {0.0})),
42
+ horizontal(convertRawProp(context, rawProps, "horizontal", sourceProps.horizontal, {false})),
43
+ enablePaging(convertRawProp(context, rawProps, "enablePaging", sourceProps.enablePaging, {false})),
44
+ enableRTL(convertRawProp(context, rawProps, "enableRTL", sourceProps.enableRTL, {false})),
45
+ enableAnnotationRendering(convertRawProp(
46
+ context, rawProps, "enableAnnotationRendering", sourceProps.enableAnnotationRendering, {false})),
47
+ showsHorizontalScrollIndicator(convertRawProp(
48
+ context, rawProps, "showsHorizontalScrollIndicator", sourceProps.showsHorizontalScrollIndicator, {false})),
49
+ showsVerticalScrollIndicator(convertRawProp(
50
+ context, rawProps, "showsVerticalScrollIndicator", sourceProps.showsVerticalScrollIndicator, {false})),
51
+ enableAntialiasing(convertRawProp(
52
+ context, rawProps, "enableAntialiasing", sourceProps.enableAntialiasing, {false})),
53
+ fitPolicy(convertRawProp(context, rawProps, "fitPolicy", sourceProps.fitPolicy, {0})),
54
+ spacing(convertRawProp(context, rawProps, "spacing", sourceProps.spacing, {0})),
55
+ password(convertRawProp(context, rawProps, "password", sourceProps.password, {})),
56
+ singlePage(convertRawProp(context, rawProps, "singlePage", sourceProps.singlePage, {false}))
57
+ {}
58
+
59
+ } // namespace react
60
+ } // namespace facebook
@@ -0,0 +1,65 @@
1
+ /**
2
+ * MIT License
3
+ *
4
+ * Copyright (C) 2024 Huawei Device Co., Ltd.
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ */
24
+
25
+ #pragma once
26
+
27
+ #include <jsi/jsi.h>
28
+ #include <react/renderer/components/view/ViewProps.h>
29
+ #include <react/renderer/core/PropsParserContext.h>
30
+
31
+ namespace facebook {
32
+ namespace react {
33
+
34
+ class JSI_EXPORT RNPDFPdfViewProps final : public ViewProps {
35
+
36
+ public:
37
+ RNPDFPdfViewProps() = default;
38
+ RNPDFPdfViewProps(
39
+ const PropsParserContext& context,
40
+ const RNPDFPdfViewProps &sourceProps,
41
+ const RawProps &rawProps
42
+ );
43
+
44
+ #pragma mark - Props
45
+ folly::dynamic source{};
46
+ std::string path{};
47
+ int page{0};
48
+ Float scale{0.0};
49
+ Float minScale{0.0};
50
+ Float maxScale{0.0};
51
+ bool horizontal{false};
52
+ bool enablePaging{false};
53
+ bool enableRTL{false};
54
+ bool enableAnnotationRendering{false};
55
+ bool showsHorizontalScrollIndicator{false};
56
+ bool showsVerticalScrollIndicator{false};
57
+ bool enableAntialiasing{false};
58
+ int fitPolicy{0};
59
+ int spacing{0};
60
+ std::string password{};
61
+ bool singlePage{false};
62
+ };
63
+
64
+ } // namespace react
65
+ } // namespace facebook
@@ -0,0 +1,30 @@
1
+ /**
2
+ * MIT License
3
+ *
4
+ * Copyright (C) 2024 Huawei Device Co., Ltd.
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ */
24
+
25
+ #include "RTNPdfViewSpecsJSI.h"
26
+
27
+ namespace facebook {
28
+ namespace react {
29
+ } // namespace react
30
+ } // namespace facebook
@@ -0,0 +1,33 @@
1
+ /**
2
+ * MIT License
3
+ *
4
+ * Copyright (C) 2024 Huawei Device Co., Ltd.
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ */
24
+
25
+ #pragma once
26
+
27
+ #include <ReactCommon/TurboModule.h>
28
+ #include <react/bridging/Bridging.h>
29
+
30
+ namespace facebook {
31
+ namespace react {
32
+ } // namespace react
33
+ } // namespace facebook
@@ -0,0 +1,33 @@
1
+ /**
2
+ * MIT License
3
+ *
4
+ * Copyright (C) 2024 Huawei Device Co., Ltd.
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ */
24
+
25
+ #include "ShadowNodes.h"
26
+
27
+ namespace facebook {
28
+ namespace react {
29
+
30
+ const char RNPDF_PDF_VIEW_COMPONENT_NAME[] = "RTNPdfView";
31
+
32
+ } // namespace react
33
+ } // namespace facebook
@@ -0,0 +1,48 @@
1
+ #ifndef SHADOWNODES_H
2
+ #define SHADOWNODES_H
3
+ /**
4
+ * MIT License
5
+ *
6
+ * Copyright (C) 2024 Huawei Device Co., Ltd.
7
+ *
8
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ * of this software and associated documentation files (the "Software"), to deal
10
+ * in the Software without restriction, including without limitation the rights
11
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ * copies of the Software, and to permit persons to whom the Software is
13
+ * furnished to do so, subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in all
16
+ * copies or substantial portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
+ * SOFTWARE.
25
+ */
26
+
27
+ #pragma once
28
+
29
+ #include "EventEmitters.h"
30
+ #include "States.h"
31
+ #include <react/renderer/components/view/ConcreteViewShadowNode.h>
32
+ #include <jsi/jsi.h>
33
+
34
+ namespace facebook {
35
+ namespace react {
36
+ JSI_EXPORT extern const char RNPDF_PDF_VIEW_COMPONENT_NAME[32];
37
+ /*
38
+ * `ShadowNode` for <RNPDFPdfView> component.
39
+ */
40
+ using RNPDFPdfViewShadowNode = ConcreteViewShadowNode<
41
+ RNPDF_PDF_VIEW_COMPONENT_NAME,
42
+ ViewProps,
43
+ RNPDFPdfViewEventEmitter,
44
+ RNPDFPdfViewState>;
45
+
46
+ } // namespace react
47
+ } // namespace facebook
48
+ #endif
@@ -0,0 +1,30 @@
1
+ /**
2
+ * MIT License
3
+ *
4
+ * Copyright (C) 2024 Huawei Device Co., Ltd.
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ */
24
+
25
+ #include "States.h"
26
+
27
+ namespace facebook {
28
+ namespace react {
29
+ } // namespace react
30
+ } // namespace facebook
@@ -0,0 +1,57 @@
1
+ #ifndef STATES_H
2
+ #define STATES_H
3
+ /**
4
+ * MIT License
5
+ *
6
+ * Copyright (C) 2024 Huawei Device Co., Ltd.
7
+ *
8
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ * of this software and associated documentation files (the "Software"), to deal
10
+ * in the Software without restriction, including without limitation the rights
11
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ * copies of the Software, and to permit persons to whom the Software is
13
+ * furnished to do so, subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in all
16
+ * copies or substantial portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
+ * SOFTWARE.
25
+ */
26
+
27
+ #pragma once
28
+
29
+ #ifdef ANDROID
30
+ #include <folly/dynamic.h>
31
+ #include <react/renderer/mapbuffer/MapBuffer.h>
32
+ #include <react/renderer/mapbuffer/MapBufferBuilder.h>
33
+ #endif
34
+
35
+ namespace facebook {
36
+ namespace react {
37
+
38
+ class RNPDFPdfViewState {
39
+ public:
40
+ RNPDFPdfViewState() = default;
41
+
42
+ #ifdef ANDROID
43
+ RNPDFPdfViewState(RNPDFPdfViewState const &previousState, folly::dynamic data) {};
44
+ folly::dynamic getDynamic() const
45
+ {
46
+ return {};
47
+ };
48
+ MapBuffer getMapBuffer() const
49
+ {
50
+ return MapBufferBuilder::EMPTY();
51
+ };
52
+ #endif
53
+ };
54
+
55
+ } // namespace react
56
+ } // namespace facebook
57
+ #endif
@@ -0,0 +1,64 @@
1
+ /**
2
+ * MIT License
3
+ *
4
+ * Copyright (C) 2024 Huawei Device Co., Ltd.
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ */
24
+
25
+ import hilog from '@ohos.hilog';
26
+
27
+ class Logger {
28
+ private domain : number;
29
+ private prefix : string;
30
+ private format : string = '%{public}s, %{public}s';
31
+ private isDebug : boolean;
32
+
33
+ /**
34
+ * constructor.
35
+ *
36
+ * @param Prefix Identifies the log tag.
37
+ * @param domain Domain Indicates the service domain, which is a hexadecimal integer ranging from 0x0 to 0xFFFFF.
38
+ */
39
+ constructor(prefix: string = 'MyApp', domain: number = 0xFF00, isDebug = false) {
40
+ this.prefix = prefix;
41
+ this.domain = domain;
42
+ this.isDebug = isDebug;
43
+ }
44
+
45
+ debug(...args: string[]): void {
46
+ if (this.isDebug) {
47
+ hilog.debug(this.domain, this.prefix, this.format, args);
48
+ }
49
+ }
50
+
51
+ info(...args: string[]): void {
52
+ hilog.info(this.domain, this.prefix, this.format, args);
53
+ }
54
+
55
+ warn(...args: string[]) : void {
56
+ hilog.warn(this.domain, this.prefix, this.format, args);
57
+ }
58
+
59
+ error(...args: string[]) : void {
60
+ hilog.error(this.domain, this.prefix, this.format, args);
61
+ }
62
+ }
63
+
64
+ export default new Logger('RNCSlider', 0xFF00, false)
@@ -0,0 +1,34 @@
1
+ /**
2
+ * MIT License
3
+ *
4
+ * Copyright (C) 2025 Huawei Device Co., Ltd.
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ */
24
+ import { RNOHPackage, ComponentBuilderContext } from '@rnoh/react-native-openharmony';
25
+ import { RTNPdfView } from './components/mainpage/RTNPdfView';
26
+ @Builder
27
+ function buildPdfView(ctx: ComponentBuilderContext) {
28
+ RTNPdfView({ ctx: ctx.rnComponentContext, tag: ctx.tag, })
29
+ }
30
+ export class PdfViewPackage extends RNOHPackage {
31
+ createWrappedCustomRNComponentBuilderByComponentNameMap(): Map<string, WrappedBuilder<[ComponentBuilderContext]>> {
32
+ return new Map().set("RTNPdfView", wrapBuilder(buildPdfView))
33
+ }
34
+ }