@react-native-ohos/react-native-keyboard-controller 1.12.8 → 1.12.9

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 (166) hide show
  1. package/LICENSE +21 -21
  2. package/README.OpenSource +10 -10
  3. package/README.md +603 -19
  4. package/harmony/keyboard_controller/BuildProfile.ets +16 -16
  5. package/harmony/keyboard_controller/Index.ets +8 -29
  6. package/harmony/keyboard_controller/ResourceTable.txt +8 -8
  7. package/harmony/keyboard_controller/build-profile.json5 +31 -31
  8. package/harmony/keyboard_controller/hvigorfile.ts +6 -6
  9. package/harmony/keyboard_controller/obfuscation-rules.txt +17 -17
  10. package/harmony/keyboard_controller/oh-package-lock.json5 +28 -18
  11. package/harmony/keyboard_controller/oh-package.json5 +11 -11
  12. package/harmony/keyboard_controller/src/main/cpp/CMakeLists.txt +7 -7
  13. package/harmony/keyboard_controller/src/main/cpp/EventEmitters.cpp +119 -96
  14. package/harmony/keyboard_controller/src/main/cpp/EventEmitters.h +90 -111
  15. package/harmony/keyboard_controller/src/main/cpp/KeyboardControllerViewComponentDescriptor.h +77 -98
  16. package/harmony/keyboard_controller/src/main/cpp/KeyboardControllerViewComponentInstance.cpp +816 -274
  17. package/harmony/keyboard_controller/src/main/cpp/KeyboardControllerViewComponentInstance.h +147 -101
  18. package/harmony/keyboard_controller/src/main/cpp/KeyboardControllerViewJSIBinder.h +43 -64
  19. package/harmony/keyboard_controller/src/main/cpp/KeyboardGestureAreaComponentDescriptor.h +64 -85
  20. package/harmony/keyboard_controller/src/main/cpp/KeyboardGestureAreaComponentInstance.cpp +88 -109
  21. package/harmony/keyboard_controller/src/main/cpp/KeyboardGestureAreaComponentInstance.h +63 -84
  22. package/harmony/keyboard_controller/src/main/cpp/KeyboardGestureAreaJSIBinder.h +39 -60
  23. package/harmony/keyboard_controller/src/main/cpp/RNKeyboardController.cpp +25 -46
  24. package/harmony/keyboard_controller/src/main/cpp/RNKeyboardController.h +27 -48
  25. package/harmony/keyboard_controller/src/main/cpp/RNKeyboardControllerPackage.cpp +43 -64
  26. package/harmony/keyboard_controller/src/main/cpp/RNKeyboardControllerPackage.h +56 -77
  27. package/harmony/keyboard_controller/src/main/cpp/RNStatusBarManagerCompat.cpp +24 -45
  28. package/harmony/keyboard_controller/src/main/cpp/RNStatusBarManagerCompat.h +28 -49
  29. package/harmony/keyboard_controller/src/main/cpp/ViewHierarchyNavigator.cpp +186 -186
  30. package/harmony/keyboard_controller/src/main/cpp/ViewHierarchyNavigator.h +112 -112
  31. package/harmony/keyboard_controller/src/main/cpp/keyboardControllerPackage.cpp +43 -64
  32. package/harmony/keyboard_controller/src/main/cpp/keyboardControllerPackage.h +56 -77
  33. package/harmony/keyboard_controller/src/main/ets/Logger.ts +45 -66
  34. package/harmony/keyboard_controller/src/main/ets/RNKeyboardControllerPackage.ets +49 -70
  35. package/harmony/keyboard_controller/src/main/ets/RNKeyboardControllerTurboModule.ts +405 -245
  36. package/harmony/keyboard_controller/src/main/ets/RNStatusBarManagerCompatTurboModule.ts +107 -119
  37. package/harmony/keyboard_controller/src/main/ets/Type.ts +41 -62
  38. package/harmony/keyboard_controller/src/main/module.json +29 -29
  39. package/harmony/keyboard_controller/src/main/module.json5 +11 -11
  40. package/harmony/keyboard_controller/src/main/resources/base/element/string.json +8 -8
  41. package/harmony/keyboard_controller/src/main/resources/en_US/element/string.json +8 -8
  42. package/harmony/keyboard_controller/src/main/resources/zh_CN/element/string.json +8 -8
  43. package/harmony/keyboard_controller/ts.ets +8 -29
  44. package/harmony/keyboard_controller.har +0 -0
  45. package/lib/commonjs/animated.js +4 -16
  46. package/lib/commonjs/animated.js.map +1 -1
  47. package/lib/commonjs/bindings.js +3 -3
  48. package/lib/commonjs/bindings.js.map +1 -1
  49. package/lib/commonjs/bindings.native.js +3 -3
  50. package/lib/commonjs/bindings.native.js.map +1 -1
  51. package/lib/commonjs/components/KeyboardAvoidingView/hooks.js.map +1 -1
  52. package/lib/commonjs/components/KeyboardAvoidingView/index.js +3 -3
  53. package/lib/commonjs/components/KeyboardAvoidingView/index.js.map +1 -1
  54. package/lib/commonjs/components/KeyboardAwareScrollView/index.js +43 -41
  55. package/lib/commonjs/components/KeyboardAwareScrollView/index.js.map +1 -1
  56. package/lib/commonjs/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.js +3 -3
  57. package/lib/commonjs/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.js.map +1 -1
  58. package/lib/commonjs/components/KeyboardAwareScrollView/utils.js.map +1 -1
  59. package/lib/commonjs/components/KeyboardStickyView/index.js.map +1 -1
  60. package/lib/commonjs/components/KeyboardToolbar/Arrow.js.map +1 -1
  61. package/lib/commonjs/components/KeyboardToolbar/Button.js.map +1 -1
  62. package/lib/commonjs/components/KeyboardToolbar/colors.js.map +1 -1
  63. package/lib/commonjs/components/KeyboardToolbar/colors.native.js.map +1 -1
  64. package/lib/commonjs/components/KeyboardToolbar/index.js +3 -3
  65. package/lib/commonjs/components/KeyboardToolbar/index.js.map +1 -1
  66. package/lib/commonjs/components/KeyboardToolbar/types.js.map +1 -1
  67. package/lib/commonjs/components/hooks/useColorScheme.js.map +1 -1
  68. package/lib/commonjs/components/index.js.map +1 -1
  69. package/lib/commonjs/constants.js.map +1 -1
  70. package/lib/commonjs/context.js.map +1 -1
  71. package/lib/commonjs/hooks/index.js.map +1 -1
  72. package/lib/commonjs/hooks/useWindowDimensions/index.android.js.map +1 -1
  73. package/lib/commonjs/hooks/useWindowDimensions/index.js.map +1 -1
  74. package/lib/commonjs/index.js.map +1 -1
  75. package/lib/commonjs/internal.js +18 -18
  76. package/lib/commonjs/internal.js.map +1 -1
  77. package/lib/commonjs/monkey-patch.android.js +4 -4
  78. package/lib/commonjs/monkey-patch.android.js.map +1 -1
  79. package/lib/commonjs/monkey-patch.js.map +1 -1
  80. package/lib/commonjs/reanimated.js.map +1 -1
  81. package/lib/commonjs/reanimated.native.js.map +1 -1
  82. package/lib/commonjs/specs/KeyboardControllerViewNativeComponent.js.map +1 -1
  83. package/lib/commonjs/specs/KeyboardGestureAreaNativeComponent.js.map +1 -1
  84. package/lib/commonjs/specs/NativeKeyboardController.js.map +1 -1
  85. package/lib/commonjs/specs/NativeStatusBarManagerCompat.js.map +1 -1
  86. package/lib/commonjs/types.js.map +1 -1
  87. package/lib/commonjs/utils.js.map +1 -1
  88. package/lib/module/animated.js +5 -17
  89. package/lib/module/animated.js.map +1 -1
  90. package/lib/module/bindings.js +3 -3
  91. package/lib/module/bindings.js.map +1 -1
  92. package/lib/module/bindings.native.js +3 -3
  93. package/lib/module/bindings.native.js.map +1 -1
  94. package/lib/module/components/KeyboardAvoidingView/hooks.js.map +1 -1
  95. package/lib/module/components/KeyboardAvoidingView/index.js +3 -3
  96. package/lib/module/components/KeyboardAvoidingView/index.js.map +1 -1
  97. package/lib/module/components/KeyboardAwareScrollView/index.js +44 -42
  98. package/lib/module/components/KeyboardAwareScrollView/index.js.map +1 -1
  99. package/lib/module/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.js +3 -3
  100. package/lib/module/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.js.map +1 -1
  101. package/lib/module/components/KeyboardAwareScrollView/utils.js.map +1 -1
  102. package/lib/module/components/KeyboardStickyView/index.js.map +1 -1
  103. package/lib/module/components/KeyboardToolbar/Arrow.js.map +1 -1
  104. package/lib/module/components/KeyboardToolbar/Button.js.map +1 -1
  105. package/lib/module/components/KeyboardToolbar/colors.js.map +1 -1
  106. package/lib/module/components/KeyboardToolbar/colors.native.js.map +1 -1
  107. package/lib/module/components/KeyboardToolbar/index.js +3 -3
  108. package/lib/module/components/KeyboardToolbar/index.js.map +1 -1
  109. package/lib/module/components/KeyboardToolbar/types.js.map +1 -1
  110. package/lib/module/components/hooks/useColorScheme.js.map +1 -1
  111. package/lib/module/components/index.js.map +1 -1
  112. package/lib/module/constants.js.map +1 -1
  113. package/lib/module/context.js.map +1 -1
  114. package/lib/module/hooks/index.js.map +1 -1
  115. package/lib/module/hooks/useWindowDimensions/index.android.js.map +1 -1
  116. package/lib/module/hooks/useWindowDimensions/index.js.map +1 -1
  117. package/lib/module/index.js.map +1 -1
  118. package/lib/module/internal.js +18 -18
  119. package/lib/module/internal.js.map +1 -1
  120. package/lib/module/monkey-patch.android.js +4 -4
  121. package/lib/module/monkey-patch.android.js.map +1 -1
  122. package/lib/module/monkey-patch.js.map +1 -1
  123. package/lib/module/reanimated.js.map +1 -1
  124. package/lib/module/reanimated.native.js.map +1 -1
  125. package/lib/module/specs/KeyboardControllerViewNativeComponent.js.map +1 -1
  126. package/lib/module/specs/KeyboardGestureAreaNativeComponent.js.map +1 -1
  127. package/lib/module/specs/NativeKeyboardController.js.map +1 -1
  128. package/lib/module/specs/NativeStatusBarManagerCompat.js.map +1 -1
  129. package/lib/module/types.js.map +1 -1
  130. package/lib/module/utils.js.map +1 -1
  131. package/lib/typescript/types.d.ts +1 -0
  132. package/package.json +181 -178
  133. package/src/animated.tsx +246 -253
  134. package/src/bindings.native.ts +57 -57
  135. package/src/bindings.ts +38 -38
  136. package/src/components/KeyboardAvoidingView/hooks.ts +58 -58
  137. package/src/components/KeyboardAvoidingView/index.tsx +156 -156
  138. package/src/components/KeyboardAwareScrollView/index.tsx +381 -373
  139. package/src/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.ts +133 -133
  140. package/src/components/KeyboardAwareScrollView/utils.ts +41 -41
  141. package/src/components/KeyboardStickyView/index.tsx +57 -57
  142. package/src/components/KeyboardToolbar/Arrow.tsx +80 -80
  143. package/src/components/KeyboardToolbar/Button.tsx +98 -98
  144. package/src/components/KeyboardToolbar/colors.native.ts +37 -37
  145. package/src/components/KeyboardToolbar/colors.ts +16 -16
  146. package/src/components/KeyboardToolbar/index.tsx +211 -211
  147. package/src/components/KeyboardToolbar/types.ts +40 -40
  148. package/src/components/hooks/useColorScheme.ts +5 -5
  149. package/src/components/index.ts +11 -11
  150. package/src/constants.ts +19 -19
  151. package/src/context.ts +65 -65
  152. package/src/hooks/index.ts +90 -90
  153. package/src/hooks/useWindowDimensions/index.android.ts +33 -33
  154. package/src/hooks/useWindowDimensions/index.ts +1 -1
  155. package/src/index.ts +21 -21
  156. package/src/internal.ts +84 -84
  157. package/src/monkey-patch.android.ts +44 -44
  158. package/src/monkey-patch.ts +4 -4
  159. package/src/reanimated.native.ts +132 -132
  160. package/src/reanimated.ts +29 -29
  161. package/src/specs/KeyboardControllerViewNativeComponent.ts +70 -70
  162. package/src/specs/KeyboardGestureAreaNativeComponent.ts +15 -15
  163. package/src/specs/NativeKeyboardController.ts +19 -19
  164. package/src/specs/NativeStatusBarManagerCompat.ts +14 -14
  165. package/src/types.ts +212 -211
  166. package/src/utils.ts +1 -1
@@ -1,119 +1,107 @@
1
- /*
2
- * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved.
3
- */
4
- /**
5
- * MIT License
6
- *
7
- * Copyright (C) 2024 Huawei Device Co., Ltd.
8
- *
9
- * Permission is hereby granted, free of charge, to any person obtaining a copy
10
- * of this software and associated documentation files (the "Software"), to deal
11
- * in the Software without restriction, including without limitation the rights
12
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
- * copies of the Software, and to permit persons to whom the Software is
14
- * furnished to do so, subject to the following conditions:
15
- *
16
- * The above copyright notice and this permission notice shall be included in all
17
- * copies or substantial portions of the Software.
18
- *
19
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
- * SOFTWARE.
26
- */
27
-
28
- import { TurboModule } from "@rnoh/react-native-openharmony/ts";
29
- import window from '@ohos.window';
30
- import common from '@ohos.app.ability.common';
31
- import { BusinessError } from '@kit.BasicServicesKit';
32
- import Logger from './Logger';
33
-
34
-
35
- interface StatusBarManagerCompatSpec {
36
- getConstants(): {};
37
- setHidden(hidden: boolean): void;
38
- setColor(color: number, animated: boolean): void;
39
- setTranslucent(translucent: boolean): void;
40
- setStyle(style: string): void;
41
-
42
- }
43
- export class RNStatusBarManagerCompatTurboModule extends TurboModule implements StatusBarManagerCompatSpec{
44
- private context: common.UIAbilityContext;
45
- constructor(ctx) {
46
- super(ctx);
47
- this.context = this.ctx.uiAbilityContext;
48
- }
49
- private async setWindowSystemBarProperties(properties:window.SystemBarProperties){
50
- let windowInstance: window.Window | undefined = undefined;
51
- windowInstance = await window.getLastWindow(this.context);
52
- let systemBarProperty = windowInstance.getWindowSystemBarProperties();
53
- let newSystemBarProperty: window.SystemBarProperties = {
54
- ...systemBarProperty,
55
- ...properties
56
- };
57
- try {
58
- let promise = windowInstance.setWindowSystemBarProperties(newSystemBarProperty);
59
- promise.then(() => {
60
- Logger.info('Succeeded in setting the system bar properties.');
61
- }).catch((err: BusinessError) => {
62
- Logger.error(`Failed to set the system bar properties. Cause code: ${err.code}, message: ${err.message}`);
63
- });
64
- } catch (exception) {
65
- Logger.error(`Failed to set the system bar properties. Cause code: ${exception.code}, message: ${exception.message}`);
66
- }
67
- }
68
- readonly getConstants:()=>{};
69
- // set mode
70
- async setHidden(hidden: boolean): Promise<void> {
71
- Logger.info("###turboModule setHidden");
72
- let windowInstance: window.Window | undefined = undefined;
73
- windowInstance = await window.getLastWindow(this.context);
74
- let names: Array<'status' | 'navigation'> = ['navigation'];
75
- hidden && names.push('status');
76
- try {
77
- let promise = windowInstance.setWindowSystemBarEnable(names);
78
- promise.then(() => {
79
- Logger.info('Succeeded in setting the system bar to be invisible.');
80
- }).catch((err: BusinessError) => {
81
- Logger.error(`Failed to set the system bar to be invisible. Cause code: ${err.code}, message: ${err.message}`);
82
- });
83
- } catch (exception) {
84
- Logger.error(`Failed to set the system bar to be invisible. Cause code: ${exception.code}, message: ${exception.message}`);
85
- }
86
- }
87
-
88
- async setColor(color: number, animated: boolean): Promise<void> {
89
- Logger.info("###turboModule setColor");
90
- let newSystemBarProperty: window.SystemBarProperties = {
91
- statusBarColor: color.toString(),
92
- enableStatusBarAnimation:animated
93
- };
94
- this.setWindowSystemBarProperties(newSystemBarProperty)
95
- }
96
-
97
- async setTranslucent(translucent: boolean): Promise<void> {
98
- Logger.info("###turboModule setTranslucent");
99
- let windowInstance: window.Window | undefined = undefined;
100
- windowInstance = await window.getLastWindow(this.context);
101
- let systemBarProperty = windowInstance.getWindowSystemBarProperties();
102
- let newSystemBarProperty: window.SystemBarProperties = {
103
- statusBarColor:translucent?'#00000000':systemBarProperty.statusBarColor,
104
- };
105
- this.setWindowSystemBarProperties(newSystemBarProperty)
106
- }
107
-
108
- setStyle(style: 'dark-content'|'light-content'): void {
109
- Logger.info("###turboModule setStyle");
110
- let themeFlag= style == "dark-content"
111
- let newSystemBarProperty: window.SystemBarProperties = {
112
- statusBarContentColor:themeFlag?"#000000":"#ffffff",
113
- };
114
- this.setWindowSystemBarProperties(newSystemBarProperty)
115
- }
116
-
117
- }
118
-
119
-
1
+ /*
2
+ * Copyright (c) 2024 Huawei Device Co., Ltd. All rights reserved
3
+ * Use of this source code is governed by a MIT license that can be
4
+ * found in the LICENSE file.
5
+ */
6
+
7
+ import { TurboModule } from "@rnoh/react-native-openharmony/ts";
8
+ import window from '@ohos.window';
9
+ import common from '@ohos.app.ability.common';
10
+ import { BusinessError } from '@kit.BasicServicesKit';
11
+ import Logger from './Logger';
12
+
13
+
14
+ interface StatusBarManagerCompatSpec {
15
+ getConstants(): {};
16
+ setHidden(hidden: boolean): void;
17
+ setColor(color: number, animated: boolean): void;
18
+ setTranslucent(translucent: boolean): void;
19
+ setStyle(style: string): void;
20
+
21
+ }
22
+ export class RNStatusBarManagerCompatTurboModule extends TurboModule implements StatusBarManagerCompatSpec{
23
+ private context: common.UIAbilityContext;
24
+ constructor(ctx) {
25
+ super(ctx);
26
+ this.context = this.ctx.uiAbilityContext;
27
+ }
28
+ private async setWindowSystemBarProperties(properties:window.SystemBarProperties){
29
+ let windowInstance: window.Window | undefined = undefined;
30
+ windowInstance = await window.getLastWindow(this.context);
31
+ let systemBarProperty = windowInstance.getWindowSystemBarProperties();
32
+ let newSystemBarProperty: window.SystemBarProperties = {
33
+ ...systemBarProperty,
34
+ ...properties
35
+ };
36
+ try {
37
+ let promise = windowInstance.setWindowSystemBarProperties(newSystemBarProperty);
38
+ promise.then(() => {
39
+ Logger.info('Succeeded in setting the system bar properties.');
40
+ }).catch((err: BusinessError) => {
41
+ Logger.error(`Failed to set the system bar properties. Cause code: ${err.code}, message: ${err.message}`);
42
+ });
43
+ } catch (exception) {
44
+ Logger.error(`Failed to set the system bar properties. Cause code: ${exception.code}, message: ${exception.message}`);
45
+ }
46
+ }
47
+ readonly getConstants:()=>{};
48
+ // set mode
49
+ async setHidden(hidden: boolean): Promise<void> {
50
+ Logger.info("###turboModule setHidden");
51
+ let windowInstance: window.Window | undefined = undefined;
52
+ windowInstance = await window.getLastWindow(this.context);
53
+ let names: Array<'status' | 'navigation'> = ['navigation'];
54
+ hidden && names.push('status');
55
+ try {
56
+ let promise = windowInstance.setWindowSystemBarEnable(names);
57
+ promise.then(() => {
58
+ Logger.info('Succeeded in setting the system bar to be invisible.');
59
+ }).catch((err: BusinessError) => {
60
+ Logger.error(`Failed to set the system bar to be invisible. Cause code: ${err.code}, message: ${err.message}`);
61
+ });
62
+ } catch (exception) {
63
+ Logger.error(`Failed to set the system bar to be invisible. Cause code: ${exception.code}, message: ${exception.message}`);
64
+ }
65
+ }
66
+
67
+ async setColor(color: number, animated: boolean): Promise<void> {
68
+ Logger.info("###turboModule setColor");
69
+ let newSystemBarProperty: window.SystemBarProperties = {
70
+ statusBarColor: this.toHarmonyColor(color),
71
+ enableStatusBarAnimation:animated
72
+ };
73
+ this.setWindowSystemBarProperties(newSystemBarProperty)
74
+ }
75
+
76
+ async setTranslucent(translucent: boolean): Promise<void> {
77
+ Logger.info("###turboModule setTranslucent");
78
+ let windowInstance: window.Window | undefined = undefined;
79
+ windowInstance = await window.getLastWindow(this.context);
80
+ let systemBarProperty = windowInstance.getWindowSystemBarProperties();
81
+ let newSystemBarProperty: window.SystemBarProperties = {
82
+ statusBarColor:translucent?'#00000000':systemBarProperty.statusBarColor,
83
+ };
84
+ this.setWindowSystemBarProperties(newSystemBarProperty)
85
+ }
86
+
87
+ setStyle(style: 'dark-content'|'light-content'): void {
88
+ Logger.info("###turboModule setStyle");
89
+ let themeFlag= style == "dark-content"
90
+ let newSystemBarProperty: window.SystemBarProperties = {
91
+ statusBarContentColor:themeFlag?"#000000":"#ffffff",
92
+ };
93
+ this.setWindowSystemBarProperties(newSystemBarProperty)
94
+ }
95
+
96
+ private toHarmonyColor(color: number): string {
97
+ const unsignedColor = color >>> 0;
98
+ const hex = unsignedColor > 0xffffff
99
+ ? unsignedColor.toString(16).padStart(8, '0')
100
+ : unsignedColor.toString(16).padStart(6, '0');
101
+
102
+ return `#${hex}`;
103
+ }
104
+
105
+ }
106
+
107
+
@@ -1,62 +1,41 @@
1
- /*
2
- * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved.
3
- */
4
- /**
5
- * MIT License
6
- *
7
- * Copyright (C) 2024 Huawei Device Co., Ltd.
8
- *
9
- * Permission is hereby granted, free of charge, to any person obtaining a copy
10
- * of this software and associated documentation files (the "Software"), to deal
11
- * in the Software without restriction, including without limitation the rights
12
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
- * copies of the Software, and to permit persons to whom the Software is
14
- * furnished to do so, subject to the following conditions:
15
- *
16
- * The above copyright notice and this permission notice shall be included in all
17
- * copies or substantial portions of the Software.
18
- *
19
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
- * SOFTWARE.
26
- */
27
-
28
- export enum KeyboardControllerEventName {
29
- KEYBOARD_WILL_SHOW="KeyboardController::keyboardWillShow",
30
- KEYBOARD_DID_SHOW="KeyboardController::keyboardDidShow",
31
- KEYBOARD_WILL_HIDE="KeyboardController::keyboardWillHide",
32
- KEYBOARD_DID_HIDE="KeyboardController::keyboardDidHide",
33
- FOCUS_DID_SET="KeyboardController::focusDidSet"
34
- }
35
- export type KeyboardChangeResult = {
36
- code:number;
37
- message:string;
38
- data:number | undefined
39
- }
40
- export type KeyboardEvent ={
41
- height:number;
42
- duration:number;
43
- timestamp:number;
44
- target:number;
45
- }
46
- export enum KeyboardStatusType {
47
- HIDE = 0,
48
- SHOW = 1
49
- };
50
- export type RawTouchPoint={
51
- pointerId: number;
52
- windowX: number;
53
- windowY: number;
54
- }
55
- export type RawTouchEvent = {
56
- action: number;
57
- actionTouch: RawTouchPoint;
58
- touchPoints: RawTouchPoint[];
59
- sourceType: number;
60
- timestamp: number;
61
- rootTag:number;
62
- };
1
+ /*
2
+ * Copyright (c) 2024 Huawei Device Co., Ltd. All rights reserved
3
+ * Use of this source code is governed by a MIT license that can be
4
+ * found in the LICENSE file.
5
+ */
6
+
7
+ export enum KeyboardControllerEventName {
8
+ KEYBOARD_WILL_SHOW="KeyboardController::keyboardWillShow",
9
+ KEYBOARD_DID_SHOW="KeyboardController::keyboardDidShow",
10
+ KEYBOARD_WILL_HIDE="KeyboardController::keyboardWillHide",
11
+ KEYBOARD_DID_HIDE="KeyboardController::keyboardDidHide",
12
+ FOCUS_DID_SET="KeyboardController::focusDidSet"
13
+ }
14
+ export type KeyboardChangeResult = {
15
+ code:number;
16
+ message:string;
17
+ data:number | undefined
18
+ }
19
+ export type KeyboardEvent ={
20
+ height:number;
21
+ duration:number;
22
+ timestamp:number;
23
+ target:number;
24
+ }
25
+ export enum KeyboardStatusType {
26
+ HIDE = 0,
27
+ SHOW = 1
28
+ };
29
+ export type RawTouchPoint={
30
+ pointerId: number;
31
+ windowX: number;
32
+ windowY: number;
33
+ }
34
+ export type RawTouchEvent = {
35
+ action: number;
36
+ actionTouch: RawTouchPoint;
37
+ touchPoints: RawTouchPoint[];
38
+ sourceType: number;
39
+ timestamp: number;
40
+ rootTag:number;
41
+ };
@@ -1,29 +1,29 @@
1
- {
2
- "app": {
3
- "bundleName": "com.rnoh.lhg.test",
4
- "debug": true,
5
- "versionCode": 1000000,
6
- "versionName": "1.0.0",
7
- "minAPIVersion": 50000012,
8
- "targetAPIVersion": 50000012,
9
- "apiReleaseType": "Beta5",
10
- "compileSdkVersion": "5.0.0.60",
11
- "compileSdkType": "HarmonyOS",
12
- "appEnvironments": [],
13
- "bundleType": "app"
14
- },
15
- "module": {
16
- "name": "keyboard_controller",
17
- "type": "har",
18
- "deviceTypes": [
19
- "default",
20
- "tablet",
21
- "2in1"
22
- ],
23
- "packageName": "@react-native-oh-tpl/react-native-keyboard-controller",
24
- "installationFree": false,
25
- "virtualMachine": "ark12.0.2.0",
26
- "compileMode": "esmodule",
27
- "dependencies": []
28
- }
29
- }
1
+ {
2
+ "app": {
3
+ "bundleName": "com.rnoh.lhg.test",
4
+ "debug": true,
5
+ "versionCode": 1000000,
6
+ "versionName": "1.0.0",
7
+ "minAPIVersion": 50000012,
8
+ "targetAPIVersion": 50000012,
9
+ "apiReleaseType": "Beta5",
10
+ "compileSdkVersion": "5.0.0.60",
11
+ "compileSdkType": "HarmonyOS",
12
+ "appEnvironments": [],
13
+ "bundleType": "app"
14
+ },
15
+ "module": {
16
+ "name": "keyboard_controller",
17
+ "type": "har",
18
+ "deviceTypes": [
19
+ "default",
20
+ "tablet",
21
+ "2in1"
22
+ ],
23
+ "packageName": "@react-native-oh-tpl/react-native-keyboard-controller",
24
+ "installationFree": false,
25
+ "virtualMachine": "ark12.0.2.0",
26
+ "compileMode": "esmodule",
27
+ "dependencies": []
28
+ }
29
+ }
@@ -1,11 +1,11 @@
1
- {
2
- "module": {
3
- "name": "keyboard_controller",
4
- "type": "har",
5
- "deviceTypes": [
6
- "default",
7
- "tablet",
8
- "2in1"
9
- ]
10
- }
11
- }
1
+ {
2
+ "module": {
3
+ "name": "keyboard_controller",
4
+ "type": "har",
5
+ "deviceTypes": [
6
+ "default",
7
+ "tablet",
8
+ "2in1"
9
+ ]
10
+ }
11
+ }
@@ -1,8 +1,8 @@
1
- {
2
- "string": [
3
- {
4
- "name": "page_show",
5
- "value": "page from package"
6
- }
7
- ]
8
- }
1
+ {
2
+ "string": [
3
+ {
4
+ "name": "page_show",
5
+ "value": "page from package"
6
+ }
7
+ ]
8
+ }
@@ -1,8 +1,8 @@
1
- {
2
- "string": [
3
- {
4
- "name": "page_show",
5
- "value": "page from package"
6
- }
7
- ]
8
- }
1
+ {
2
+ "string": [
3
+ {
4
+ "name": "page_show",
5
+ "value": "page from package"
6
+ }
7
+ ]
8
+ }
@@ -1,8 +1,8 @@
1
- {
2
- "string": [
3
- {
4
- "name": "page_show",
5
- "value": "page from package"
6
- }
7
- ]
8
- }
1
+ {
2
+ "string": [
3
+ {
4
+ "name": "page_show",
5
+ "value": "page from package"
6
+ }
7
+ ]
8
+ }
@@ -1,30 +1,9 @@
1
- /*
2
- * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved.
3
- */
4
- /**
5
- * MIT License
6
- *
7
- * Copyright (C) 2024 Huawei Device Co., Ltd.
8
- *
9
- * Permission is hereby granted, free of charge, to any person obtaining a copy
10
- * of this software and associated documentation files (the "Software"), to deal
11
- * in the Software without restriction, including without limitation the rights
12
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
- * copies of the Software, and to permit persons to whom the Software is
14
- * furnished to do so, subject to the following conditions:
15
- *
16
- * The above copyright notice and this permission notice shall be included in all
17
- * copies or substantial portions of the Software.
18
- *
19
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
- * SOFTWARE.
26
- */
27
-
28
- export * from './src/main/ets/RNKeyboardControllerPackage';
29
- export * from './src/main/ets/RNKeyboardControllerTurboModule';
1
+ /*
2
+ * Copyright (c) 2024 Huawei Device Co., Ltd. All rights reserved
3
+ * Use of this source code is governed by a MIT license that can be
4
+ * found in the LICENSE file.
5
+ */
6
+
7
+ export * from './src/main/ets/RNKeyboardControllerPackage';
8
+ export * from './src/main/ets/RNKeyboardControllerTurboModule';
30
9
  export * from './src/main/ets/RNStatusBarManagerCompatTurboModule';
Binary file
@@ -80,20 +80,8 @@ const KeyboardProvider = ({
80
80
 
81
81
  if (platforms.includes(OS)) {
82
82
  // eslint-disable-next-line react-compiler/react-compiler
83
- if (_reactNative.Platform.OS == 'harmony') {
84
- const dur = 460;
85
- progressSV.value = (0, _reactNativeReanimated.withTiming)(event.progress, {
86
- duration: dur,
87
- easing: _reactNativeReanimated.Easing.out(_reactNativeReanimated.Easing.exp)
88
- });
89
- heightSV.value = (0, _reactNativeReanimated.withTiming)(-event.height, {
90
- duration: dur,
91
- easing: _reactNativeReanimated.Easing.out(_reactNativeReanimated.Easing.exp)
92
- });
93
- } else {
94
- progressSV.value = event.progress;
95
- heightSV.value = -event.height;
96
- }
83
+ progressSV.value = event.progress;
84
+ heightSV.value = -event.height;
97
85
  }
98
86
  };
99
87
  const keyboardHandler = (0, _reanimated.useAnimatedKeyboardHandler)({
@@ -107,13 +95,13 @@ const KeyboardProvider = ({
107
95
  "worklet";
108
96
 
109
97
  broadcastKeyboardEvents("onMove", event);
110
- updateSharedValues(event, ["android"]);
98
+ updateSharedValues(event, ["android", "harmony"]);
111
99
  },
112
100
  onKeyboardMoveEnd: event => {
113
101
  "worklet";
114
102
 
115
103
  broadcastKeyboardEvents("onEnd", event);
116
- updateSharedValues(event, ['harmony']);
104
+ updateSharedValues(event, ["android", "harmony"]);
117
105
  },
118
106
  onKeyboardMoveInteractive: event => {
119
107
  "worklet";
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeReanimated","_bindings","_context","_internal","_monkeyPatch","_reanimated","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","KeyboardControllerViewAnimated","Reanimated","createAnimatedComponent","Animated","KeyboardControllerView","styles","StyleSheet","create","container","flex","hidden","display","position","OS","Platform","KeyboardProvider","children","statusBarTranslucent","navigationBarTranslucent","enabled","initiallyEnabled","setEnabled","useState","progress","useAnimatedValue","height","progressSV","useSharedValue","heightSV","layout","setKeyboardHandlers","broadcastKeyboardEvents","useSharedHandlers","setInputHandlers","broadcastInputEvents","context","useMemo","animated","multiply","reanimated","style","transform","translateX","translateY","onKeyboardMove","event","nativeEvent","useNativeDriver","updateSharedValues","platforms","includes","dur","value","withTiming","duration","easing","Easing","out","exp","keyboardHandler","useAnimatedKeyboardHandler","onKeyboardMoveStart","onKeyboardMoveEnd","onKeyboardMoveInteractive","inputLayoutHandler","useFocusedInputLayoutHandler","onFocusedInputLayoutChanged","target","inputTextHandler","useFocusedInputTextHandler","onFocusedInputTextChanged","inputSelectionHandler","useFocusedInputSelectionHandler","onFocusedInputSelectionChanged","useEffect","applyMonkeyPatch","revertMonkeyPatch","createElement","KeyboardContext","Provider","onKeyboardMoveReanimated","undefined","onFocusedInputLayoutChangedReanimated","onFocusedInputTextChangedReanimated","onFocusedInputSelectionChangedReanimated","View","exports"],"sources":["animated.tsx"],"sourcesContent":["import React, { useEffect, useMemo, useState } from \"react\";\r\nimport { Animated, Platform, StyleSheet } from \"react-native\";\r\nimport Reanimated, { useSharedValue, Easing, withTiming } from \"react-native-reanimated\";\r\n\r\nimport { KeyboardControllerView } from \"./bindings\";\r\nimport { KeyboardContext } from \"./context\";\r\nimport { useAnimatedValue, useSharedHandlers } from \"./internal\";\r\nimport { applyMonkeyPatch, revertMonkeyPatch } from \"./monkey-patch\";\r\nimport {\r\n useAnimatedKeyboardHandler,\r\n useFocusedInputLayoutHandler,\r\n useFocusedInputSelectionHandler,\r\n useFocusedInputTextHandler,\r\n} from \"./reanimated\";\r\n\r\nimport type { KeyboardAnimationContext } from \"./context\";\r\nimport type {\r\n FocusedInputHandler,\r\n FocusedInputLayoutChangedEvent,\r\n KeyboardControllerProps,\r\n KeyboardHandler,\r\n NativeEvent,\r\n} from \"./types\";\r\nimport type { ViewStyle } from \"react-native\";\r\n\r\nconst KeyboardControllerViewAnimated = Reanimated.createAnimatedComponent(\r\n Animated.createAnimatedComponent(\r\n KeyboardControllerView,\r\n ) as React.FC<KeyboardControllerProps>,\r\n);\r\n\r\ntype Styles = {\r\n container: ViewStyle;\r\n hidden: ViewStyle;\r\n};\r\n\r\nconst styles = StyleSheet.create<Styles>({\r\n container: {\r\n flex: 1,\r\n },\r\n hidden: {\r\n display: \"none\",\r\n position: \"absolute\",\r\n },\r\n});\r\n\r\ntype KeyboardProviderProps = {\r\n children: React.ReactNode;\r\n /**\r\n * Set the value to `true`, if you use translucent status bar on Android.\r\n * If you already control status bar translucency via `react-native-screens`\r\n * or `StatusBar` component from `react-native`, you can ignore it.\r\n * Defaults to `false`.\r\n *\r\n * @see https://github.com/kirillzyusko/react-native-keyboard-controller/issues/14\r\n * @platform android\r\n */\r\n statusBarTranslucent?: boolean;\r\n /**\r\n * Set the value to `true`, if you use translucent navigation bar on Android.\r\n * Defaults to `false`.\r\n *\r\n * @see https://github.com/kirillzyusko/react-native-keyboard-controller/issues/119\r\n * @platform android\r\n */\r\n navigationBarTranslucent?: boolean;\r\n /**\r\n * A boolean prop indicating whether the module is enabled. It indicate only initial state,\r\n * i. e. if you try to change this prop after component mount it will not have any effect.\r\n * To change the property in runtime use `useKeyboardController` hook and `setEnabled` method.\r\n * Defaults to `true`.\r\n */\r\n enabled?: boolean;\r\n};\r\n\r\n// capture `Platform.OS` in separate variable to avoid deep workletization of entire RN package\r\n// see https://github.com/kirillzyusko/react-native-keyboard-controller/issues/393 and https://github.com/kirillzyusko/react-native-keyboard-controller/issues/294 for more details\r\nconst OS = Platform.OS;\r\n\r\nexport const KeyboardProvider = ({\r\n children,\r\n statusBarTranslucent,\r\n navigationBarTranslucent,\r\n enabled: initiallyEnabled = true,\r\n}: KeyboardProviderProps) => {\r\n // state\r\n const [enabled, setEnabled] = useState(initiallyEnabled);\r\n // animated values\r\n const progress = useAnimatedValue(0);\r\n const height = useAnimatedValue(0);\r\n // shared values\r\n const progressSV = useSharedValue(0);\r\n const heightSV = useSharedValue(0);\r\n const layout = useSharedValue<FocusedInputLayoutChangedEvent | null>(null);\r\n const [setKeyboardHandlers, broadcastKeyboardEvents] =\r\n useSharedHandlers<KeyboardHandler>();\r\n const [setInputHandlers, broadcastInputEvents] =\r\n useSharedHandlers<FocusedInputHandler>();\r\n // memo\r\n const context = useMemo<KeyboardAnimationContext>(\r\n () => ({\r\n enabled,\r\n animated: { progress: progress, height: Animated.multiply(height, -1) },\r\n reanimated: { progress: progressSV, height: heightSV },\r\n layout,\r\n setKeyboardHandlers,\r\n setInputHandlers,\r\n setEnabled,\r\n }),\r\n [enabled],\r\n );\r\n const style = useMemo(\r\n () => [\r\n styles.hidden,\r\n { transform: [{ translateX: height }, { translateY: progress }] },\r\n ],\r\n [],\r\n );\r\n const onKeyboardMove = useMemo(\r\n () =>\r\n Animated.event(\r\n [\r\n {\r\n nativeEvent: {\r\n progress,\r\n height,\r\n },\r\n },\r\n ],\r\n { useNativeDriver: Platform.OS as string == 'harmony' ? false : true },\r\n ),\r\n [],\r\n );\r\n // handlers\r\n const updateSharedValues = (event: NativeEvent, platforms: string[]) => {\r\n \"worklet\";\r\n\r\n if (platforms.includes(OS)) {\r\n // eslint-disable-next-line react-compiler/react-compiler\r\n if (Platform.OS as string == 'harmony') {\r\n const dur = 460\r\n progressSV.value = withTiming(event.progress, { duration: dur, easing: Easing.out(Easing.exp) });\r\n heightSV.value = withTiming(-event.height, { duration: dur, easing: Easing.out(Easing.exp) });\r\n } else {\r\n progressSV.value = event.progress;\r\n heightSV.value = -event.height;\r\n\r\n }\r\n }\r\n };\r\n const keyboardHandler = useAnimatedKeyboardHandler(\r\n {\r\n onKeyboardMoveStart: (event: NativeEvent) => {\r\n \"worklet\";\r\n\r\n broadcastKeyboardEvents(\"onStart\", event);\r\n updateSharedValues(event, [\"ios\"]);\r\n },\r\n onKeyboardMove: (event: NativeEvent) => {\r\n \"worklet\";\r\n\r\n broadcastKeyboardEvents(\"onMove\", event);\r\n updateSharedValues(event, [\"android\"]);\r\n },\r\n onKeyboardMoveEnd: (event: NativeEvent) => {\r\n \"worklet\";\r\n broadcastKeyboardEvents(\"onEnd\", event);\r\n updateSharedValues(event, ['harmony']);\r\n },\r\n onKeyboardMoveInteractive: (event: NativeEvent) => {\r\n \"worklet\";\r\n\r\n updateSharedValues(event, [\"android\", \"ios\"]);\r\n broadcastKeyboardEvents(\"onInteractive\", event);\r\n },\r\n },\r\n [],\r\n );\r\n const inputLayoutHandler = useFocusedInputLayoutHandler(\r\n {\r\n onFocusedInputLayoutChanged: (e) => {\r\n \"worklet\";\r\n\r\n if (e.target !== -1) {\r\n layout.value = e;\r\n } else {\r\n layout.value = null;\r\n }\r\n },\r\n },\r\n [],\r\n );\r\n const inputTextHandler = useFocusedInputTextHandler(\r\n {\r\n onFocusedInputTextChanged: (e) => {\r\n \"worklet\";\r\n\r\n broadcastInputEvents(\"onChangeText\", e);\r\n },\r\n },\r\n [],\r\n );\r\n const inputSelectionHandler = useFocusedInputSelectionHandler(\r\n {\r\n onFocusedInputSelectionChanged: (e) => {\r\n \"worklet\";\r\n broadcastInputEvents(\"onSelectionChange\", e);\r\n },\r\n },\r\n [],\r\n );\r\n // effects\r\n useEffect(() => {\r\n if (enabled) {\r\n applyMonkeyPatch();\r\n } else {\r\n revertMonkeyPatch();\r\n }\r\n }, [enabled]);\r\n\r\n return (\r\n <KeyboardContext.Provider value={context}>\r\n <KeyboardControllerViewAnimated\r\n enabled={enabled}\r\n onKeyboardMoveReanimated={keyboardHandler}\r\n onKeyboardMoveStart={OS === \"ios\" ? onKeyboardMove : undefined}\r\n onKeyboardMove={OS === \"android\" ? onKeyboardMove : undefined}\r\n onKeyboardMoveInteractive={onKeyboardMove}\r\n onKeyboardMoveEnd={OS as string === \"harmony\" ? onKeyboardMove : undefined}\r\n onFocusedInputLayoutChangedReanimated={inputLayoutHandler}\r\n onFocusedInputTextChangedReanimated={inputTextHandler}\r\n onFocusedInputSelectionChangedReanimated={inputSelectionHandler}\r\n navigationBarTranslucent={navigationBarTranslucent}\r\n statusBarTranslucent={statusBarTranslucent}\r\n style={styles.container}\r\n >\r\n <Reanimated.View style={styles.container}>{children}</Reanimated.View>\r\n {/* {children} */}\r\n </KeyboardControllerViewAnimated>\r\n <Animated.View\r\n // we are using this small hack, because if the component (where\r\n // animated value has been used) is unmounted, then animation will\r\n // stop receiving events (seems like it's react-native optimization).\r\n // So we need to keep a reference to the animated value, to keep it's\r\n // always mounted (keep a reference to an animated value).\r\n //\r\n // To test why it's needed, try to open screen which consumes Animated.Value\r\n // then close it and open it again (for example 'Animated transition').\r\n style={style}\r\n />\r\n </KeyboardContext.Provider>\r\n );\r\n};\r\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAH,uBAAA,CAAAC,OAAA;AAEA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AAKsB,SAAAD,wBAAAS,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAX,uBAAA,YAAAA,CAAAS,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA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B,wCAAwC,EAAEb,qBAAsB;IAChErD,wBAAwB,EAAEA,wBAAyB;IACnDD,oBAAoB,EAAEA,oBAAqB;IAC3CuB,KAAK,EAAEnC,MAAM,CAACG;EAAU,gBAExBrC,MAAA,CAAAoB,OAAA,CAAAsF,aAAA,CAACtG,sBAAA,CAAAgB,OAAU,CAAC8F,IAAI;IAAC7C,KAAK,EAAEnC,MAAM,CAACG;EAAU,GAAEQ,QAA0B,CAEvC,CAAC,eACjC7C,MAAA,CAAAoB,OAAA,CAAAsF,aAAA,CAACvG,YAAA,CAAA6B,QAAQ,CAACkF,IAAI;IACZ;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA7C,KAAK,EAAEA;EAAM,CACd,CACuB,CAAC;AAE/B,CAAC;AAAC8C,OAAA,CAAAvE,gBAAA,GAAAA,gBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeReanimated","_bindings","_context","_internal","_monkeyPatch","_reanimated","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","KeyboardControllerViewAnimated","Reanimated","createAnimatedComponent","Animated","KeyboardControllerView","styles","StyleSheet","create","container","flex","hidden","display","position","OS","Platform","KeyboardProvider","children","statusBarTranslucent","navigationBarTranslucent","enabled","initiallyEnabled","setEnabled","useState","progress","useAnimatedValue","height","progressSV","useSharedValue","heightSV","layout","setKeyboardHandlers","broadcastKeyboardEvents","useSharedHandlers","setInputHandlers","broadcastInputEvents","context","useMemo","animated","multiply","reanimated","style","transform","translateX","translateY","onKeyboardMove","event","nativeEvent","useNativeDriver","updateSharedValues","platforms","includes","value","keyboardHandler","useAnimatedKeyboardHandler","onKeyboardMoveStart","onKeyboardMoveEnd","onKeyboardMoveInteractive","inputLayoutHandler","useFocusedInputLayoutHandler","onFocusedInputLayoutChanged","target","inputTextHandler","useFocusedInputTextHandler","onFocusedInputTextChanged","inputSelectionHandler","useFocusedInputSelectionHandler","onFocusedInputSelectionChanged","useEffect","applyMonkeyPatch","revertMonkeyPatch","createElement","KeyboardContext","Provider","onKeyboardMoveReanimated","undefined","onFocusedInputLayoutChangedReanimated","onFocusedInputTextChangedReanimated","onFocusedInputSelectionChangedReanimated","View","exports"],"sources":["animated.tsx"],"sourcesContent":["import React, { useEffect, useMemo, useState } from \"react\";\nimport { Animated, Platform, StyleSheet } from \"react-native\";\nimport Reanimated, { useSharedValue } from \"react-native-reanimated\";\n\nimport { KeyboardControllerView } from \"./bindings\";\nimport { KeyboardContext } from \"./context\";\nimport { useAnimatedValue, useSharedHandlers } from \"./internal\";\nimport { applyMonkeyPatch, revertMonkeyPatch } from \"./monkey-patch\";\nimport {\n useAnimatedKeyboardHandler,\n useFocusedInputLayoutHandler,\n useFocusedInputSelectionHandler,\n useFocusedInputTextHandler,\n} from \"./reanimated\";\n\nimport type { KeyboardAnimationContext } from \"./context\";\nimport type {\n FocusedInputHandler,\n FocusedInputLayoutChangedEvent,\n KeyboardControllerProps,\n KeyboardHandler,\n NativeEvent,\n} from \"./types\";\nimport type { ViewStyle } from \"react-native\";\n\nconst KeyboardControllerViewAnimated = Reanimated.createAnimatedComponent(\n Animated.createAnimatedComponent(\n KeyboardControllerView,\n ) as React.FC<KeyboardControllerProps>,\n);\n\ntype Styles = {\n container: ViewStyle;\n hidden: ViewStyle;\n};\n\nconst styles = StyleSheet.create<Styles>({\n container: {\n flex: 1,\n },\n hidden: {\n display: \"none\",\n position: \"absolute\",\n },\n});\n\ntype KeyboardProviderProps = {\n children: React.ReactNode;\n /**\n * Set the value to `true`, if you use translucent status bar on Android.\n * If you already control status bar translucency via `react-native-screens`\n * or `StatusBar` component from `react-native`, you can ignore it.\n * Defaults to `false`.\n *\n * @see https://github.com/kirillzyusko/react-native-keyboard-controller/issues/14\n * @platform android\n */\n statusBarTranslucent?: boolean;\n /**\n * Set the value to `true`, if you use translucent navigation bar on Android.\n * Defaults to `false`.\n *\n * @see https://github.com/kirillzyusko/react-native-keyboard-controller/issues/119\n * @platform android\n */\n navigationBarTranslucent?: boolean;\n /**\n * A boolean prop indicating whether the module is enabled. It indicate only initial state,\n * i. e. if you try to change this prop after component mount it will not have any effect.\n * To change the property in runtime use `useKeyboardController` hook and `setEnabled` method.\n * Defaults to `true`.\n */\n enabled?: boolean;\n};\n\n// capture `Platform.OS` in separate variable to avoid deep workletization of entire RN package\n// see https://github.com/kirillzyusko/react-native-keyboard-controller/issues/393 and https://github.com/kirillzyusko/react-native-keyboard-controller/issues/294 for more details\nconst OS = Platform.OS;\n\nexport const KeyboardProvider = ({\n children,\n statusBarTranslucent,\n navigationBarTranslucent,\n enabled: initiallyEnabled = true,\n}: KeyboardProviderProps) => {\n // state\n const [enabled, setEnabled] = useState(initiallyEnabled);\n // animated values\n const progress = useAnimatedValue(0);\n const height = useAnimatedValue(0);\n // shared values\n const progressSV = useSharedValue(0);\n const heightSV = useSharedValue(0);\n const layout = useSharedValue<FocusedInputLayoutChangedEvent | null>(null);\n const [setKeyboardHandlers, broadcastKeyboardEvents] =\n useSharedHandlers<KeyboardHandler>();\n const [setInputHandlers, broadcastInputEvents] =\n useSharedHandlers<FocusedInputHandler>();\n // memo\n const context = useMemo<KeyboardAnimationContext>(\n () => ({\n enabled,\n animated: { progress: progress, height: Animated.multiply(height, -1) },\n reanimated: { progress: progressSV, height: heightSV },\n layout,\n setKeyboardHandlers,\n setInputHandlers,\n setEnabled,\n }),\n [enabled],\n );\n const style = useMemo(\n () => [\n styles.hidden,\n { transform: [{ translateX: height }, { translateY: progress }] },\n ],\n [],\n );\n const onKeyboardMove = useMemo(\n () =>\n Animated.event(\n [\n {\n nativeEvent: {\n progress,\n height,\n },\n },\n ],\n { useNativeDriver: Platform.OS as string == 'harmony' ? false : true },\n ),\n [],\n );\n // handlers\n const updateSharedValues = (event: NativeEvent, platforms: string[]) => {\n \"worklet\";\n\n if (platforms.includes(OS)) {\n // eslint-disable-next-line react-compiler/react-compiler\n progressSV.value = event.progress;\n heightSV.value = -event.height;\n }\n };\n const keyboardHandler = useAnimatedKeyboardHandler(\n {\n onKeyboardMoveStart: (event: NativeEvent) => {\n \"worklet\";\n\n broadcastKeyboardEvents(\"onStart\", event);\n updateSharedValues(event, [\"ios\"]);\n },\n onKeyboardMove: (event: NativeEvent) => {\n \"worklet\";\n\n broadcastKeyboardEvents(\"onMove\", event);\n updateSharedValues(event, [\"android\", \"harmony\"]);\n },\n onKeyboardMoveEnd: (event: NativeEvent) => {\n \"worklet\";\n broadcastKeyboardEvents(\"onEnd\", event);\n updateSharedValues(event, [\"android\", \"harmony\"]);\n },\n onKeyboardMoveInteractive: (event: NativeEvent) => {\n \"worklet\";\n\n updateSharedValues(event, [\"android\", \"ios\"]);\n broadcastKeyboardEvents(\"onInteractive\", event);\n },\n },\n [],\n );\n const inputLayoutHandler = useFocusedInputLayoutHandler(\n {\n onFocusedInputLayoutChanged: (e) => {\n \"worklet\";\n\n if (e.target !== -1) {\n layout.value = e;\n } else {\n layout.value = null;\n }\n },\n },\n [],\n );\n const inputTextHandler = useFocusedInputTextHandler(\n {\n onFocusedInputTextChanged: (e) => {\n \"worklet\";\n\n broadcastInputEvents(\"onChangeText\", e);\n },\n },\n [],\n );\n const inputSelectionHandler = useFocusedInputSelectionHandler(\n {\n onFocusedInputSelectionChanged: (e) => {\n \"worklet\";\n broadcastInputEvents(\"onSelectionChange\", e);\n },\n },\n [],\n );\n // effects\n useEffect(() => {\n if (enabled) {\n applyMonkeyPatch();\n } else {\n revertMonkeyPatch();\n }\n }, [enabled]);\n\n return (\n <KeyboardContext.Provider value={context}>\n <KeyboardControllerViewAnimated\n enabled={enabled}\n onKeyboardMoveReanimated={keyboardHandler}\n onKeyboardMoveStart={OS === \"ios\" ? onKeyboardMove : undefined}\n onKeyboardMove={OS === \"android\" ? onKeyboardMove : undefined}\n onKeyboardMoveInteractive={onKeyboardMove}\n onKeyboardMoveEnd={OS as string === \"harmony\" ? onKeyboardMove : undefined}\n onFocusedInputLayoutChangedReanimated={inputLayoutHandler}\n onFocusedInputTextChangedReanimated={inputTextHandler}\n onFocusedInputSelectionChangedReanimated={inputSelectionHandler}\n navigationBarTranslucent={navigationBarTranslucent}\n statusBarTranslucent={statusBarTranslucent}\n style={styles.container}\n >\n <Reanimated.View style={styles.container}>{children}</Reanimated.View>\n {/* {children} */}\n </KeyboardControllerViewAnimated>\n <Animated.View\n // we are using this small hack, because if the component (where\n // animated value has been used) is unmounted, then animation will\n // stop receiving events (seems like it's react-native optimization).\n // So we need to keep a reference to the animated value, to keep it's\n // always mounted (keep a reference to an animated value).\n //\n // To test why it's needed, try to open screen which consumes Animated.Value\n // then close it and open it again (for example 'Animated transition').\n style={style}\n />\n </KeyboardContext.Provider>\n );\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAH,uBAAA,CAAAC,OAAA;AAEA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AAKsB,SAAAD,wBAAAS,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAX,uBAAA,YAAAA,CAAAS,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CA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