react-native-keyboard-controller 1.12.7 → 1.13.0

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 (145) hide show
  1. package/android/src/fabric/java/com/reactnativekeyboardcontroller/KeyboardGestureAreaViewManager.kt +5 -0
  2. package/android/src/main/java/com/reactnativekeyboardcontroller/extensions/ReactContext.kt +13 -0
  3. package/android/src/main/java/com/reactnativekeyboardcontroller/extensions/ThemedReactContext.kt +0 -10
  4. package/android/src/main/java/com/reactnativekeyboardcontroller/interactive/interpolators/Interpolator.kt +2 -1
  5. package/android/src/main/java/com/reactnativekeyboardcontroller/interactive/interpolators/IosInterpolator.kt +2 -1
  6. package/android/src/main/java/com/reactnativekeyboardcontroller/interactive/interpolators/LinearInterpolator.kt +1 -0
  7. package/android/src/main/java/com/reactnativekeyboardcontroller/listeners/FocusedInputObserver.kt +13 -8
  8. package/android/src/main/java/com/reactnativekeyboardcontroller/listeners/KeyboardAnimationCallback.kt +71 -59
  9. package/android/src/main/java/com/reactnativekeyboardcontroller/managers/KeyboardGestureAreaViewManagerImpl.kt +4 -0
  10. package/android/src/main/java/com/reactnativekeyboardcontroller/modal/ModalAttachedWatcher.kt +80 -0
  11. package/android/src/main/java/com/reactnativekeyboardcontroller/modules/StatusBarManagerCompatModuleImpl.kt +6 -12
  12. package/android/src/main/java/com/reactnativekeyboardcontroller/views/EdgeToEdgeReactViewGroup.kt +31 -4
  13. package/android/src/main/java/com/reactnativekeyboardcontroller/views/KeyboardGestureAreaReactViewGroup.kt +7 -0
  14. package/android/src/paper/java/com/reactnativekeyboardcontroller/KeyboardGestureAreaViewManager.kt +5 -0
  15. package/ios/extensions/UIView.swift +10 -0
  16. package/ios/observers/KeyboardMovementObserver.swift +7 -5
  17. package/ios/views/KeyboardControllerView.mm +30 -39
  18. package/lib/commonjs/animated.js +15 -30
  19. package/lib/commonjs/animated.js.map +1 -1
  20. package/lib/commonjs/bindings.js.map +1 -1
  21. package/lib/commonjs/bindings.native.js.map +1 -1
  22. package/lib/commonjs/components/KeyboardAvoidingView/hooks.js +2 -14
  23. package/lib/commonjs/components/KeyboardAvoidingView/hooks.js.map +1 -1
  24. package/lib/commonjs/components/KeyboardAvoidingView/index.js +4 -4
  25. package/lib/commonjs/components/KeyboardAvoidingView/index.js.map +1 -1
  26. package/lib/commonjs/components/KeyboardAwareScrollView/index.js +7 -6
  27. package/lib/commonjs/components/KeyboardAwareScrollView/index.js.map +1 -1
  28. package/lib/commonjs/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.js.map +1 -1
  29. package/lib/commonjs/components/KeyboardAwareScrollView/utils.js.map +1 -1
  30. package/lib/commonjs/components/KeyboardStickyView/index.js +2 -2
  31. package/lib/commonjs/components/KeyboardStickyView/index.js.map +1 -1
  32. package/lib/commonjs/components/KeyboardToolbar/Arrow.js +2 -2
  33. package/lib/commonjs/components/KeyboardToolbar/Arrow.js.map +1 -1
  34. package/lib/commonjs/components/KeyboardToolbar/Button.js +12 -12
  35. package/lib/commonjs/components/KeyboardToolbar/Button.js.map +1 -1
  36. package/lib/commonjs/components/KeyboardToolbar/index.js +33 -27
  37. package/lib/commonjs/components/KeyboardToolbar/index.js.map +1 -1
  38. package/lib/commonjs/components/index.js +2 -2
  39. package/lib/commonjs/components/index.js.map +1 -1
  40. package/lib/commonjs/context.js +3 -2
  41. package/lib/commonjs/context.js.map +1 -1
  42. package/lib/commonjs/event-handler.js +19 -0
  43. package/lib/commonjs/event-handler.js.map +1 -0
  44. package/lib/commonjs/event-handler.web.js +10 -0
  45. package/lib/commonjs/event-handler.web.js.map +1 -0
  46. package/lib/commonjs/event-mappings.js +9 -0
  47. package/lib/commonjs/event-mappings.js.map +1 -0
  48. package/lib/commonjs/hooks/index.js +8 -21
  49. package/lib/commonjs/hooks/index.js.map +1 -1
  50. package/lib/commonjs/hooks/useSyncEffect/index.js +37 -0
  51. package/lib/commonjs/hooks/useSyncEffect/index.js.map +1 -0
  52. package/lib/commonjs/internal.js +20 -44
  53. package/lib/commonjs/internal.js.map +1 -1
  54. package/lib/commonjs/monkey-patch.android.js +1 -1
  55. package/lib/commonjs/monkey-patch.android.js.map +1 -1
  56. package/lib/commonjs/monkey-patch.js.map +1 -1
  57. package/lib/commonjs/reanimated.js +1 -3
  58. package/lib/commonjs/reanimated.js.map +1 -1
  59. package/lib/commonjs/reanimated.native.js +1 -35
  60. package/lib/commonjs/reanimated.native.js.map +1 -1
  61. package/lib/commonjs/specs/KeyboardControllerViewNativeComponent.js +1 -1
  62. package/lib/commonjs/specs/KeyboardControllerViewNativeComponent.js.map +1 -1
  63. package/lib/commonjs/specs/KeyboardGestureAreaNativeComponent.js +1 -1
  64. package/lib/commonjs/specs/KeyboardGestureAreaNativeComponent.js.map +1 -1
  65. package/lib/commonjs/types.js.map +1 -1
  66. package/lib/module/animated.js +16 -32
  67. package/lib/module/animated.js.map +1 -1
  68. package/lib/module/bindings.js.map +1 -1
  69. package/lib/module/bindings.native.js.map +1 -1
  70. package/lib/module/components/KeyboardAvoidingView/hooks.js +2 -14
  71. package/lib/module/components/KeyboardAvoidingView/hooks.js.map +1 -1
  72. package/lib/module/components/KeyboardAvoidingView/index.js +3 -3
  73. package/lib/module/components/KeyboardAvoidingView/index.js.map +1 -1
  74. package/lib/module/components/KeyboardAwareScrollView/index.js +6 -5
  75. package/lib/module/components/KeyboardAwareScrollView/index.js.map +1 -1
  76. package/lib/module/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.js.map +1 -1
  77. package/lib/module/components/KeyboardAwareScrollView/utils.js.map +1 -1
  78. package/lib/module/components/KeyboardStickyView/index.js +1 -1
  79. package/lib/module/components/KeyboardToolbar/Button.js +10 -10
  80. package/lib/module/components/KeyboardToolbar/Button.js.map +1 -1
  81. package/lib/module/components/KeyboardToolbar/index.js +31 -25
  82. package/lib/module/components/KeyboardToolbar/index.js.map +1 -1
  83. package/lib/module/context.js +3 -2
  84. package/lib/module/context.js.map +1 -1
  85. package/lib/module/event-handler.js +13 -0
  86. package/lib/module/event-handler.js.map +1 -0
  87. package/lib/module/event-handler.web.js +5 -0
  88. package/lib/module/event-handler.web.js.map +1 -0
  89. package/lib/module/event-mappings.js +3 -0
  90. package/lib/module/event-mappings.js.map +1 -0
  91. package/lib/module/hooks/index.js +7 -21
  92. package/lib/module/hooks/index.js.map +1 -1
  93. package/lib/module/hooks/useSyncEffect/index.js +31 -0
  94. package/lib/module/hooks/useSyncEffect/index.js.map +1 -0
  95. package/lib/module/internal.js +21 -45
  96. package/lib/module/internal.js.map +1 -1
  97. package/lib/module/monkey-patch.js.map +1 -1
  98. package/lib/module/reanimated.js +0 -2
  99. package/lib/module/reanimated.js.map +1 -1
  100. package/lib/module/reanimated.native.js +0 -32
  101. package/lib/module/reanimated.native.js.map +1 -1
  102. package/lib/module/specs/KeyboardGestureAreaNativeComponent.js.map +1 -1
  103. package/lib/module/types.js.map +1 -1
  104. package/lib/typescript/components/KeyboardToolbar/Button.d.ts +2 -2
  105. package/lib/typescript/components/KeyboardToolbar/index.d.ts +4 -3
  106. package/lib/typescript/context.d.ts +3 -3
  107. package/lib/typescript/event-handler.d.ts +3 -0
  108. package/lib/typescript/event-mappings.d.ts +2 -0
  109. package/lib/typescript/hooks/index.d.ts +1 -1
  110. package/lib/typescript/hooks/useSyncEffect/index.d.ts +14 -0
  111. package/lib/typescript/internal.d.ts +5 -19
  112. package/lib/typescript/reanimated.d.ts +1 -3
  113. package/lib/typescript/reanimated.native.d.ts +1 -3
  114. package/lib/typescript/specs/KeyboardGestureAreaNativeComponent.d.ts +2 -1
  115. package/lib/typescript/types.d.ts +6 -0
  116. package/package.json +11 -7
  117. package/src/animated.tsx +20 -43
  118. package/src/bindings.native.ts +1 -0
  119. package/src/bindings.ts +1 -0
  120. package/src/components/KeyboardAvoidingView/hooks.ts +2 -13
  121. package/src/components/KeyboardAvoidingView/index.tsx +1 -1
  122. package/src/components/KeyboardAwareScrollView/index.tsx +8 -3
  123. package/src/components/KeyboardAwareScrollView/useSmoothKeyboardHandler.ts +1 -0
  124. package/src/components/KeyboardAwareScrollView/utils.ts +1 -0
  125. package/src/components/KeyboardToolbar/Button.tsx +11 -11
  126. package/src/components/KeyboardToolbar/index.tsx +45 -25
  127. package/src/context.ts +8 -6
  128. package/src/event-handler.js +15 -0
  129. package/src/event-handler.ts +8 -0
  130. package/src/event-handler.web.js +5 -0
  131. package/src/event-mappings.ts +14 -0
  132. package/src/hooks/index.ts +9 -16
  133. package/src/hooks/useSyncEffect/index.ts +36 -0
  134. package/src/internal.ts +34 -54
  135. package/src/monkey-patch.ts +1 -0
  136. package/src/reanimated.native.ts +0 -50
  137. package/src/reanimated.ts +1 -12
  138. package/src/specs/KeyboardGestureAreaNativeComponent.ts +5 -1
  139. package/src/types.ts +6 -0
  140. package/lib/commonjs/utils.js +0 -9
  141. package/lib/commonjs/utils.js.map +0 -1
  142. package/lib/module/utils.js +0 -2
  143. package/lib/module/utils.js.map +0 -1
  144. package/lib/typescript/utils.d.ts +0 -1
  145. package/src/utils.ts +0 -1
@@ -7,6 +7,7 @@ exports.useKeyboardContext = exports.KeyboardContext = void 0;
7
7
  var _react = require("react");
8
8
  var _reactNative = require("react-native");
9
9
  const NOOP = () => {};
10
+ const NESTED_NOOP = () => NOOP;
10
11
  const withSharedValue = value => ({
11
12
  value,
12
13
  addListener: NOOP,
@@ -26,8 +27,8 @@ const defaultContext = {
26
27
  height: DEFAULT_SHARED_VALUE
27
28
  },
28
29
  layout: DEFAULT_LAYOUT,
29
- setKeyboardHandlers: NOOP,
30
- setInputHandlers: NOOP,
30
+ setKeyboardHandlers: NESTED_NOOP,
31
+ setInputHandlers: NESTED_NOOP,
31
32
  setEnabled: NOOP
32
33
  };
33
34
  const KeyboardContext = exports.KeyboardContext = /*#__PURE__*/(0, _react.createContext)(defaultContext);
@@ -1 +1 @@
1
- {"version":3,"names":["_react","require","_reactNative","NOOP","withSharedValue","value","addListener","removeListener","modify","DEFAULT_SHARED_VALUE","DEFAULT_LAYOUT","defaultContext","enabled","animated","progress","Animated","Value","height","reanimated","layout","setKeyboardHandlers","setInputHandlers","setEnabled","KeyboardContext","exports","createContext","useKeyboardContext","context","useContext","__DEV__","console","warn"],"sources":["context.ts"],"sourcesContent":["import { createContext, useContext } from \"react\";\nimport { Animated } from \"react-native\";\n\nimport type {\n FocusedInputHandlers,\n FocusedInputLayoutChangedEvent,\n KeyboardHandlers,\n} from \"./types\";\nimport type React from \"react\";\nimport type { SharedValue } from \"react-native-reanimated\";\n\nexport type AnimatedContext = {\n progress: Animated.Value;\n height: Animated.AnimatedMultiplication<number>;\n};\nexport type ReanimatedContext = {\n progress: SharedValue<number>;\n height: SharedValue<number>;\n};\nexport type KeyboardAnimationContext = {\n enabled: boolean;\n animated: AnimatedContext;\n reanimated: ReanimatedContext;\n layout: SharedValue<FocusedInputLayoutChangedEvent | null>;\n setKeyboardHandlers: (handlers: KeyboardHandlers) => void;\n setInputHandlers: (handlers: FocusedInputHandlers) => void;\n setEnabled: React.Dispatch<React.SetStateAction<boolean>>;\n};\nconst NOOP = () => {};\nconst withSharedValue = <T>(value: T): SharedValue<T> => ({\n value,\n addListener: NOOP,\n removeListener: NOOP,\n modify: NOOP,\n});\nconst DEFAULT_SHARED_VALUE = withSharedValue(0);\nconst DEFAULT_LAYOUT = withSharedValue<FocusedInputLayoutChangedEvent | null>(\n null,\n);\nconst defaultContext: KeyboardAnimationContext = {\n enabled: true,\n animated: {\n progress: new Animated.Value(0),\n height: new Animated.Value(0),\n },\n reanimated: {\n progress: DEFAULT_SHARED_VALUE,\n height: DEFAULT_SHARED_VALUE,\n },\n layout: DEFAULT_LAYOUT,\n setKeyboardHandlers: NOOP,\n setInputHandlers: NOOP,\n setEnabled: NOOP,\n};\nexport const KeyboardContext = createContext(defaultContext);\nexport const useKeyboardContext = () => {\n const context = useContext(KeyboardContext);\n\n if (__DEV__ && context === defaultContext) {\n console.warn(\n \"Couldn't find real values for `KeyboardContext`. Please make sure you're inside of `KeyboardProvider` - otherwise functionality of `react-native-keyboard-controller` will not work.\",\n );\n }\n\n return context;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AA2BA,MAAME,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AACrB,MAAMC,eAAe,GAAOC,KAAQ,KAAsB;EACxDA,KAAK;EACLC,WAAW,EAAEH,IAAI;EACjBI,cAAc,EAAEJ,IAAI;EACpBK,MAAM,EAAEL;AACV,CAAC,CAAC;AACF,MAAMM,oBAAoB,GAAGL,eAAe,CAAC,CAAC,CAAC;AAC/C,MAAMM,cAAc,GAAGN,eAAe,CACpC,IACF,CAAC;AACD,MAAMO,cAAwC,GAAG;EAC/CC,OAAO,EAAE,IAAI;EACbC,QAAQ,EAAE;IACRC,QAAQ,EAAE,IAAIC,qBAAQ,CAACC,KAAK,CAAC,CAAC,CAAC;IAC/BC,MAAM,EAAE,IAAIF,qBAAQ,CAACC,KAAK,CAAC,CAAC;EAC9B,CAAC;EACDE,UAAU,EAAE;IACVJ,QAAQ,EAAEL,oBAAoB;IAC9BQ,MAAM,EAAER;EACV,CAAC;EACDU,MAAM,EAAET,cAAc;EACtBU,mBAAmB,EAAEjB,IAAI;EACzBkB,gBAAgB,EAAElB,IAAI;EACtBmB,UAAU,EAAEnB;AACd,CAAC;AACM,MAAMoB,eAAe,GAAAC,OAAA,CAAAD,eAAA,gBAAG,IAAAE,oBAAa,EAACd,cAAc,CAAC;AACrD,MAAMe,kBAAkB,GAAGA,CAAA,KAAM;EACtC,MAAMC,OAAO,GAAG,IAAAC,iBAAU,EAACL,eAAe,CAAC;EAE3C,IAAIM,OAAO,IAAIF,OAAO,KAAKhB,cAAc,EAAE;IACzCmB,OAAO,CAACC,IAAI,CACV,sLACF,CAAC;EACH;EAEA,OAAOJ,OAAO;AAChB,CAAC;AAACH,OAAA,CAAAE,kBAAA,GAAAA,kBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_react","require","_reactNative","NOOP","NESTED_NOOP","withSharedValue","value","addListener","removeListener","modify","DEFAULT_SHARED_VALUE","DEFAULT_LAYOUT","defaultContext","enabled","animated","progress","Animated","Value","height","reanimated","layout","setKeyboardHandlers","setInputHandlers","setEnabled","KeyboardContext","exports","createContext","useKeyboardContext","context","useContext","__DEV__","console","warn"],"sources":["context.ts"],"sourcesContent":["import { createContext, useContext } from \"react\";\nimport { Animated } from \"react-native\";\n\nimport type {\n FocusedInputHandler,\n FocusedInputLayoutChangedEvent,\n KeyboardHandler,\n} from \"./types\";\nimport type React from \"react\";\nimport type { SharedValue } from \"react-native-reanimated\";\n\nexport type AnimatedContext = {\n progress: Animated.Value;\n height: Animated.AnimatedMultiplication<number>;\n};\nexport type ReanimatedContext = {\n progress: SharedValue<number>;\n height: SharedValue<number>;\n};\nexport type KeyboardAnimationContext = {\n enabled: boolean;\n animated: AnimatedContext;\n reanimated: ReanimatedContext;\n layout: SharedValue<FocusedInputLayoutChangedEvent | null>;\n setKeyboardHandlers: (handlers: KeyboardHandler) => () => void;\n setInputHandlers: (handlers: FocusedInputHandler) => () => void;\n setEnabled: React.Dispatch<React.SetStateAction<boolean>>;\n};\nconst NOOP = () => {};\nconst NESTED_NOOP = () => NOOP;\nconst withSharedValue = <T>(value: T): SharedValue<T> => ({\n value,\n addListener: NOOP,\n removeListener: NOOP,\n modify: NOOP,\n});\nconst DEFAULT_SHARED_VALUE = withSharedValue(0);\nconst DEFAULT_LAYOUT = withSharedValue<FocusedInputLayoutChangedEvent | null>(\n null,\n);\nconst defaultContext: KeyboardAnimationContext = {\n enabled: true,\n animated: {\n progress: new Animated.Value(0),\n height: new Animated.Value(0),\n },\n reanimated: {\n progress: DEFAULT_SHARED_VALUE,\n height: DEFAULT_SHARED_VALUE,\n },\n layout: DEFAULT_LAYOUT,\n setKeyboardHandlers: NESTED_NOOP,\n setInputHandlers: NESTED_NOOP,\n setEnabled: NOOP,\n};\n\nexport const KeyboardContext = createContext(defaultContext);\nexport const useKeyboardContext = () => {\n const context = useContext(KeyboardContext);\n\n if (__DEV__ && context === defaultContext) {\n console.warn(\n \"Couldn't find real values for `KeyboardContext`. Please make sure you're inside of `KeyboardProvider` - otherwise functionality of `react-native-keyboard-controller` will not work.\",\n );\n }\n\n return context;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AA2BA,MAAME,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AACrB,MAAMC,WAAW,GAAGA,CAAA,KAAMD,IAAI;AAC9B,MAAME,eAAe,GAAOC,KAAQ,KAAsB;EACxDA,KAAK;EACLC,WAAW,EAAEJ,IAAI;EACjBK,cAAc,EAAEL,IAAI;EACpBM,MAAM,EAAEN;AACV,CAAC,CAAC;AACF,MAAMO,oBAAoB,GAAGL,eAAe,CAAC,CAAC,CAAC;AAC/C,MAAMM,cAAc,GAAGN,eAAe,CACpC,IACF,CAAC;AACD,MAAMO,cAAwC,GAAG;EAC/CC,OAAO,EAAE,IAAI;EACbC,QAAQ,EAAE;IACRC,QAAQ,EAAE,IAAIC,qBAAQ,CAACC,KAAK,CAAC,CAAC,CAAC;IAC/BC,MAAM,EAAE,IAAIF,qBAAQ,CAACC,KAAK,CAAC,CAAC;EAC9B,CAAC;EACDE,UAAU,EAAE;IACVJ,QAAQ,EAAEL,oBAAoB;IAC9BQ,MAAM,EAAER;EACV,CAAC;EACDU,MAAM,EAAET,cAAc;EACtBU,mBAAmB,EAAEjB,WAAW;EAChCkB,gBAAgB,EAAElB,WAAW;EAC7BmB,UAAU,EAAEpB;AACd,CAAC;AAEM,MAAMqB,eAAe,GAAAC,OAAA,CAAAD,eAAA,gBAAG,IAAAE,oBAAa,EAACd,cAAc,CAAC;AACrD,MAAMe,kBAAkB,GAAGA,CAAA,KAAM;EACtC,MAAMC,OAAO,GAAG,IAAAC,iBAAU,EAACL,eAAe,CAAC;EAE3C,IAAIM,OAAO,IAAIF,OAAO,KAAKhB,cAAc,EAAE;IACzCmB,OAAO,CAACC,IAAI,CACV,sLACF,CAAC;EACH;EAEA,OAAOJ,OAAO;AAChB,CAAC;AAACH,OAAA,CAAAE,kBAAA,GAAAA,kBAAA","ignoreList":[]}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.unregisterEventHandler = exports.registerEventHandler = void 0;
7
+ let REACore = null;
8
+ try {
9
+ REACore = require("react-native-reanimated/src/core");
10
+ } catch (e1) {
11
+ try {
12
+ REACore = require("react-native-reanimated/src/reanimated2/core");
13
+ } catch (e2) {
14
+ console.warn("Failed to load REACore from both paths");
15
+ }
16
+ }
17
+ const registerEventHandler = exports.registerEventHandler = REACore.registerEventHandler;
18
+ const unregisterEventHandler = exports.unregisterEventHandler = REACore.unregisterEventHandler;
19
+ //# sourceMappingURL=event-handler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["REACore","require","e1","e2","console","warn","registerEventHandler","exports","unregisterEventHandler"],"sources":["event-handler.js"],"sourcesContent":["let REACore = null;\n\ntry {\n REACore = require(\"react-native-reanimated/src/core\");\n} catch (e1) {\n try {\n REACore = require(\"react-native-reanimated/src/reanimated2/core\");\n } catch (e2) {\n console.warn(\"Failed to load REACore from both paths\");\n }\n}\nconst registerEventHandler = REACore.registerEventHandler;\nconst unregisterEventHandler = REACore.unregisterEventHandler;\n\nexport { registerEventHandler, unregisterEventHandler };\n"],"mappings":";;;;;;AAAA,IAAIA,OAAO,GAAG,IAAI;AAElB,IAAI;EACFA,OAAO,GAAGC,OAAO,CAAC,kCAAkC,CAAC;AACvD,CAAC,CAAC,OAAOC,EAAE,EAAE;EACX,IAAI;IACFF,OAAO,GAAGC,OAAO,CAAC,8CAA8C,CAAC;EACnE,CAAC,CAAC,OAAOE,EAAE,EAAE;IACXC,OAAO,CAACC,IAAI,CAAC,wCAAwC,CAAC;EACxD;AACF;AACA,MAAMC,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,GAAGN,OAAO,CAACM,oBAAoB;AACzD,MAAME,sBAAsB,GAAAD,OAAA,CAAAC,sBAAA,GAAGR,OAAO,CAACQ,sBAAsB","ignoreList":[]}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.unregisterEventHandler = exports.registerEventHandler = void 0;
7
+ const NOOP = () => {};
8
+ const registerEventHandler = exports.registerEventHandler = NOOP;
9
+ const unregisterEventHandler = exports.unregisterEventHandler = NOOP;
10
+ //# sourceMappingURL=event-handler.web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["NOOP","registerEventHandler","exports","unregisterEventHandler"],"sources":["event-handler.web.js"],"sourcesContent":["const NOOP = () => {};\nconst registerEventHandler = NOOP;\nconst unregisterEventHandler = NOOP;\n\nexport { registerEventHandler, unregisterEventHandler };\n"],"mappings":";;;;;;AAAA,MAAMA,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AACrB,MAAMC,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,GAAGD,IAAI;AACjC,MAAMG,sBAAsB,GAAAD,OAAA,CAAAC,sBAAA,GAAGH,IAAI","ignoreList":[]}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.keyboardEventsMap = exports.focusedInputEventsMap = void 0;
7
+ const keyboardEventsMap = exports.keyboardEventsMap = new Map([["onStart", "onKeyboardMoveStart"], ["onMove", "onKeyboardMove"], ["onEnd", "onKeyboardMoveEnd"], ["onInteractive", "onKeyboardMoveInteractive"]]);
8
+ const focusedInputEventsMap = exports.focusedInputEventsMap = new Map([["onChangeText", "onFocusedInputTextChanged"], ["onSelectionChange", "onFocusedInputSelectionChanged"]]);
9
+ //# sourceMappingURL=event-mappings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["keyboardEventsMap","exports","Map","focusedInputEventsMap"],"sources":["event-mappings.ts"],"sourcesContent":["import type { FocusedInputHandler, KeyboardHandler } from \"./types\";\n\nexport const keyboardEventsMap = new Map<keyof KeyboardHandler, string>([\n [\"onStart\", \"onKeyboardMoveStart\"],\n [\"onMove\", \"onKeyboardMove\"],\n [\"onEnd\", \"onKeyboardMoveEnd\"],\n [\"onInteractive\", \"onKeyboardMoveInteractive\"],\n]);\nexport const focusedInputEventsMap = new Map<keyof FocusedInputHandler, string>(\n [\n [\"onChangeText\", \"onFocusedInputTextChanged\"],\n [\"onSelectionChange\", \"onFocusedInputSelectionChanged\"],\n ],\n);\n"],"mappings":";;;;;;AAEO,MAAMA,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAG,IAAIE,GAAG,CAAgC,CACtE,CAAC,SAAS,EAAE,qBAAqB,CAAC,EAClC,CAAC,QAAQ,EAAE,gBAAgB,CAAC,EAC5B,CAAC,OAAO,EAAE,mBAAmB,CAAC,EAC9B,CAAC,eAAe,EAAE,2BAA2B,CAAC,CAC/C,CAAC;AACK,MAAMC,qBAAqB,GAAAF,OAAA,CAAAE,qBAAA,GAAG,IAAID,GAAG,CAC1C,CACE,CAAC,cAAc,EAAE,2BAA2B,CAAC,EAC7C,CAAC,mBAAmB,EAAE,gCAAgC,CAAC,CAE3D,CAAC","ignoreList":[]}
@@ -24,7 +24,7 @@ var _react = require("react");
24
24
  var _bindings = require("../bindings");
25
25
  var _constants = require("../constants");
26
26
  var _context = require("../context");
27
- var _utils = require("../utils");
27
+ var _useSyncEffect = _interopRequireDefault(require("./useSyncEffect"));
28
28
  var _useWindowDimensions = require("./useWindowDimensions");
29
29
  Object.keys(_useWindowDimensions).forEach(function (key) {
30
30
  if (key === "default" || key === "__esModule") return;
@@ -37,6 +37,7 @@ Object.keys(_useWindowDimensions).forEach(function (key) {
37
37
  }
38
38
  });
39
39
  });
40
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
40
41
  const useResizeMode = () => {
41
42
  (0, _react.useEffect)(() => {
42
43
  _bindings.KeyboardController.setInputMode(_constants.AndroidSoftInputModes.SOFT_INPUT_ADJUST_RESIZE);
@@ -58,16 +59,9 @@ const useReanimatedKeyboardAnimation = () => {
58
59
  exports.useReanimatedKeyboardAnimation = useReanimatedKeyboardAnimation;
59
60
  function useGenericKeyboardHandler(handler, deps) {
60
61
  const context = (0, _context.useKeyboardContext)();
61
- (0, _react.useEffect)(() => {
62
- const key = (0, _utils.uuid)();
63
- context.setKeyboardHandlers({
64
- [key]: handler
65
- });
66
- return () => {
67
- context.setKeyboardHandlers({
68
- [key]: undefined
69
- });
70
- };
62
+ (0, _useSyncEffect.default)(() => {
63
+ const cleanup = context.setKeyboardHandlers(handler);
64
+ return () => cleanup();
71
65
  }, deps);
72
66
  }
73
67
  function useKeyboardHandler(handler, deps) {
@@ -89,16 +83,9 @@ function useReanimatedFocusedInput() {
89
83
  }
90
84
  function useFocusedInputHandler(handler, deps) {
91
85
  const context = (0, _context.useKeyboardContext)();
92
- (0, _react.useEffect)(() => {
93
- const key = (0, _utils.uuid)();
94
- context.setInputHandlers({
95
- [key]: handler
96
- });
97
- return () => {
98
- context.setInputHandlers({
99
- [key]: undefined
100
- });
101
- };
86
+ (0, _useSyncEffect.default)(() => {
87
+ const cleanup = context.setInputHandlers(handler);
88
+ return () => cleanup();
102
89
  }, deps);
103
90
  }
104
91
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_react","require","_bindings","_constants","_context","_utils","_useWindowDimensions","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","useResizeMode","useEffect","KeyboardController","setInputMode","AndroidSoftInputModes","SOFT_INPUT_ADJUST_RESIZE","setDefaultMode","useKeyboardAnimation","context","useKeyboardContext","animated","useReanimatedKeyboardAnimation","reanimated","useGenericKeyboardHandler","handler","deps","uuid","setKeyboardHandlers","undefined","useKeyboardHandler","useKeyboardController","setEnabled","enabled","useReanimatedFocusedInput","input","layout","useFocusedInputHandler","setInputHandlers"],"sources":["index.ts"],"sourcesContent":["import { useEffect } from \"react\";\n\nimport { KeyboardController } from \"../bindings\";\nimport { AndroidSoftInputModes } from \"../constants\";\nimport { useKeyboardContext } from \"../context\";\nimport { uuid } from \"../utils\";\n\nimport type { AnimatedContext, ReanimatedContext } from \"../context\";\nimport type { FocusedInputHandler, KeyboardHandler } from \"../types\";\nimport type { DependencyList } from \"react\";\n\nexport const useResizeMode = () => {\n useEffect(() => {\n KeyboardController.setInputMode(\n AndroidSoftInputModes.SOFT_INPUT_ADJUST_RESIZE,\n );\n\n return () => KeyboardController.setDefaultMode();\n }, []);\n};\n\nexport const useKeyboardAnimation = (): AnimatedContext => {\n useResizeMode();\n const context = useKeyboardContext();\n\n return context.animated;\n};\n\nexport const useReanimatedKeyboardAnimation = (): ReanimatedContext => {\n useResizeMode();\n const context = useKeyboardContext();\n\n return context.reanimated;\n};\n\nexport function useGenericKeyboardHandler(\n handler: KeyboardHandler,\n deps?: DependencyList,\n) {\n const context = useKeyboardContext();\n\n useEffect(() => {\n const key = uuid();\n\n context.setKeyboardHandlers({ [key]: handler });\n\n return () => {\n context.setKeyboardHandlers({ [key]: undefined });\n };\n }, deps);\n}\n\nexport function useKeyboardHandler(\n handler: KeyboardHandler,\n deps?: DependencyList,\n) {\n useResizeMode();\n useGenericKeyboardHandler(handler, deps);\n}\n\nexport function useKeyboardController() {\n const context = useKeyboardContext();\n\n return { setEnabled: context.setEnabled, enabled: context.enabled };\n}\n\nexport function useReanimatedFocusedInput() {\n const context = useKeyboardContext();\n\n return { input: context.layout };\n}\n\nexport function useFocusedInputHandler(\n handler?: FocusedInputHandler,\n deps?: DependencyList,\n) {\n const context = useKeyboardContext();\n\n useEffect(() => {\n const key = uuid();\n\n context.setInputHandlers({ [key]: handler });\n\n return () => {\n context.setInputHandlers({ [key]: undefined });\n };\n }, deps);\n}\n\nexport * from \"./useWindowDimensions\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MA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AAO,MAAM;MACXN,OAAO,CAACmB,gBAAgB,CAAC;QAAE,CAACpC,GAAG,GAAG2B;MAAU,CAAC,CAAC;IAChD,CAAC;EACH,CAAC,EAAEH,IAAI,CAAC;AACV","ignoreList":[]}
1
+ {"version":3,"names":["_react","require","_bindings","_constants","_context","_useSyncEffect","_interopRequireDefault","_useWindowDimensions","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","e","__esModule","default","useResizeMode","useEffect","KeyboardController","setInputMode","AndroidSoftInputModes","SOFT_INPUT_ADJUST_RESIZE","setDefaultMode","useKeyboardAnimation","context","useKeyboardContext","animated","useReanimatedKeyboardAnimation","reanimated","useGenericKeyboardHandler","handler","deps","useSyncEffect","cleanup","setKeyboardHandlers","useKeyboardHandler","useKeyboardController","setEnabled","enabled","useReanimatedFocusedInput","input","layout","useFocusedInputHandler","setInputHandlers"],"sources":["index.ts"],"sourcesContent":["import { useEffect } from \"react\";\n\nimport { KeyboardController } from \"../bindings\";\nimport { AndroidSoftInputModes } from \"../constants\";\nimport { useKeyboardContext } from \"../context\";\n\nimport useSyncEffect from \"./useSyncEffect\";\n\nimport type { AnimatedContext, ReanimatedContext } from \"../context\";\nimport type { FocusedInputHandler, KeyboardHandler } from \"../types\";\nimport type { DependencyList } from \"react\";\n\nexport const useResizeMode = () => {\n useEffect(() => {\n KeyboardController.setInputMode(\n AndroidSoftInputModes.SOFT_INPUT_ADJUST_RESIZE,\n );\n\n return () => KeyboardController.setDefaultMode();\n }, []);\n};\n\nexport const useKeyboardAnimation = (): AnimatedContext => {\n useResizeMode();\n const context = useKeyboardContext();\n\n return context.animated;\n};\n\nexport const useReanimatedKeyboardAnimation = (): ReanimatedContext => {\n useResizeMode();\n const context = useKeyboardContext();\n\n return context.reanimated;\n};\n\nexport function useGenericKeyboardHandler(\n handler: KeyboardHandler,\n deps?: DependencyList,\n) {\n const context = useKeyboardContext();\n\n useSyncEffect(() => {\n const cleanup = context.setKeyboardHandlers(handler);\n\n return () => cleanup();\n }, deps);\n}\n\nexport function useKeyboardHandler(\n handler: KeyboardHandler,\n deps?: DependencyList,\n) {\n useResizeMode();\n useGenericKeyboardHandler(handler, deps);\n}\n\nexport function useKeyboardController() {\n const context = useKeyboardContext();\n\n return { setEnabled: context.setEnabled, enabled: context.enabled };\n}\n\nexport function useReanimatedFocusedInput() {\n const context = useKeyboardContext();\n\n return { input: context.layout };\n}\n\nexport function useFocusedInputHandler(\n handler: FocusedInputHandler,\n deps?: DependencyList,\n) {\n const context = useKeyboardContext();\n\n useSyncEffect(() => {\n const cleanup = context.setInputHandlers(handler);\n\n return () => cleanup();\n }, deps);\n}\n\nexport * from \"./useWindowDimensions\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAEA,IAAAI,cAAA,GAAAC,sBAAA,CAAAL,OAAA;AA4EA,IAAAM,oBAAA,GAAAN,OAAA;AAAAO,MAAA,CAAAC,IAAA,CAAAF,oBAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,oBAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAZ,oBAAA,CAAAI,GAAA;IAAA;EAAA;AAAA;AAAsC,SAAAL,uBAAAc,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAtE/B,MAAMG,aAAa,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AAEd,OAAO,CAACc;EAAQ,CAAC;AACrE;AAEO,SAASC,yBAAyBA,CAAA,EAAG;EAC1C,MAAMf,OAAO,GAAG,IAAAC,2BAAkB,EAAC,CAAC;EAEpC,OAAO;IAAEe,KAAK,EAAEhB,OAAO,CAACiB;EAAO,CAAC;AAClC;AAEO,SAASC,sBAAsBA,CACpCZ,OAA4B,EAC5BC,IAAqB,EACrB;EACA,MAAMP,OAAO,GAAG,IAAAC,2BAAkB,EAAC,CAAC;EAEpC,IAAAO,sBAAa,EAAC,MAAM;IAClB,MAAMC,OAAO,GAAGT,OAAO,CAACmB,gBAAgB,CAACb,OAAO,CAAC;IAEjD,OAAO,MAAMG,OAAO,CAAC,CAAC;EACxB,CAAC,EAAEF,IAAI,CAAC;AACV","ignoreList":[]}
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = require("react");
8
+ /**
9
+ * @description
10
+ * Equivalent to `useEffect` but will run the effect synchronously, i. e. before render.
11
+ *
12
+ * @param {effect} - imperative function
13
+ * @param {deps} - if present, effect will only activate if the values in the list change
14
+ *
15
+ * @author Kiryl Ziusko
16
+ * @since 1.13.0
17
+ * @version 1.0.0
18
+ */
19
+ const useSyncEffect = (effect, deps) => {
20
+ const cachedDeps = (0, _react.useRef)(null);
21
+ const areDepsEqual = deps === null || deps === void 0 ? void 0 : deps.every((el, index) => cachedDeps.current && el === cachedDeps.current[index]);
22
+ const cleanupRef = (0, _react.useRef)();
23
+ if (!areDepsEqual || !cachedDeps.current) {
24
+ var _cleanupRef$current;
25
+ (_cleanupRef$current = cleanupRef.current) === null || _cleanupRef$current === void 0 || _cleanupRef$current.call(cleanupRef);
26
+ cleanupRef.current = effect();
27
+ cachedDeps.current = deps;
28
+ }
29
+ (0, _react.useEffect)(() => {
30
+ return () => {
31
+ var _cleanupRef$current2;
32
+ (_cleanupRef$current2 = cleanupRef.current) === null || _cleanupRef$current2 === void 0 || _cleanupRef$current2.call(cleanupRef);
33
+ };
34
+ }, []);
35
+ };
36
+ var _default = exports.default = useSyncEffect;
37
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","useSyncEffect","effect","deps","cachedDeps","useRef","areDepsEqual","every","el","index","current","cleanupRef","_cleanupRef$current","call","useEffect","_cleanupRef$current2","_default","exports","default"],"sources":["index.ts"],"sourcesContent":["import { useEffect, useRef } from \"react\";\n\nimport type { DependencyList } from \"react\";\n\n/**\n * @description\n * Equivalent to `useEffect` but will run the effect synchronously, i. e. before render.\n *\n * @param {effect} - imperative function\n * @param {deps} - if present, effect will only activate if the values in the list change\n *\n * @author Kiryl Ziusko\n * @since 1.13.0\n * @version 1.0.0\n */\nconst useSyncEffect: typeof useEffect = (effect, deps) => {\n const cachedDeps = useRef<DependencyList | undefined | null>(null);\n const areDepsEqual = deps?.every(\n (el, index) => cachedDeps.current && el === cachedDeps.current[index],\n );\n const cleanupRef = useRef<(() => void) | void>();\n\n if (!areDepsEqual || !cachedDeps.current) {\n cleanupRef.current?.();\n cleanupRef.current = effect();\n cachedDeps.current = deps;\n }\n\n useEffect(() => {\n return () => {\n cleanupRef.current?.();\n };\n }, []);\n};\n\nexport default useSyncEffect;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,aAA+B,GAAGA,CAACC,MAAM,EAAEC,IAAI,KAAK;EACxD,MAAMC,UAAU,GAAG,IAAAC,aAAM,EAAoC,IAAI,CAAC;EAClE,MAAMC,YAAY,GAAGH,IAAI,aAAJA,IAAI,uBAAJA,IAAI,CAAEI,KAAK,CAC9B,CAACC,EAAE,EAAEC,KAAK,KAAKL,UAAU,CAACM,OAAO,IAAIF,EAAE,KAAKJ,UAAU,CAACM,OAAO,CAACD,KAAK,CACtE,CAAC;EACD,MAAME,UAAU,GAAG,IAAAN,aAAM,EAAsB,CAAC;EAEhD,IAAI,CAACC,YAAY,IAAI,CAACF,UAAU,CAACM,OAAO,EAAE;IAAA,IAAAE,mBAAA;IACxC,CAAAA,mBAAA,GAAAD,UAAU,CAACD,OAAO,cAAAE,mBAAA,eAAlBA,mBAAA,CAAAC,IAAA,CAAAF,UAAqB,CAAC;IACtBA,UAAU,CAACD,OAAO,GAAGR,MAAM,CAAC,CAAC;IAC7BE,UAAU,CAACM,OAAO,GAAGP,IAAI;EAC3B;EAEA,IAAAW,gBAAS,EAAC,MAAM;IACd,OAAO,MAAM;MAAA,IAAAC,oBAAA;MACX,CAAAA,oBAAA,GAAAJ,UAAU,CAACD,OAAO,cAAAK,oBAAA,eAAlBA,oBAAA,CAAAF,IAAA,CAAAF,UAAqB,CAAC;IACxB,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;AACR,CAAC;AAAC,IAAAK,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEajB,aAAa","ignoreList":[]}
@@ -4,54 +4,30 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.useAnimatedValue = useAnimatedValue;
7
- exports.useSharedHandlers = useSharedHandlers;
7
+ exports.useEventHandlerRegistration = useEventHandlerRegistration;
8
8
  var _react = require("react");
9
9
  var _reactNative = require("react-native");
10
- var _reactNativeReanimated = require("react-native-reanimated");
11
- /**
12
- * Hook for storing worklet handlers (objects with keys, where values are worklets).
13
- * Returns methods for setting handlers and broadcasting events in them.
14
- *
15
- * T is a generic that looks like:
16
- * @example
17
- * {
18
- * onEvent: () => {},
19
- * onEvent2: () => {},
20
- * }
21
- */
22
- function useSharedHandlers() {
23
- const handlers = (0, _reactNativeReanimated.useSharedValue)({});
24
- const jsHandlers = (0, _react.useRef)({});
10
+ var _eventHandler = require("./event-handler");
11
+ function useEventHandlerRegistration(map, viewTagRef) {
12
+ const onRegisterHandler = handler => {
13
+ const viewTag = (0, _reactNative.findNodeHandle)(viewTagRef.current);
14
+ const ids = Object.keys(handler).map(handlerName => {
15
+ const eventName = map.get(handlerName);
16
+ const functionToCall = handler[handlerName];
17
+ if (eventName && viewTag) {
18
+ return (0, _eventHandler.registerEventHandler)(event => {
19
+ "worklet";
25
20
 
26
- // since js -> worklet -> js call is asynchronous, we can not write handlers
27
- // straight into shared variable (using current shared value as a previous result),
28
- // since there may be a race condition in a call, and closure may have out-of-dated
29
- // values. As a result, some of handlers may be not written to "all handlers" object.
30
- // Below we are writing all handlers to `ref` and afterwards synchronize them with
31
- // shared value (since `refs` are not referring to actual value in worklets).
32
- // This approach allow us to update synchronously handlers in js thread (and it assures,
33
- // that it will have all of them) and then update them in worklet thread (calls are
34
- // happening in FIFO order, so we will always have actual value).
35
- const updateSharedHandlers = () => {
36
- // eslint-disable-next-line react-compiler/react-compiler
37
- handlers.value = jsHandlers.current;
38
- };
39
- const setHandlers = (0, _react.useCallback)(handler => {
40
- jsHandlers.current = {
41
- ...jsHandlers.current,
42
- ...handler
43
- };
44
- updateSharedHandlers();
45
- }, []);
46
- const broadcast = (type, event) => {
47
- "worklet";
48
-
49
- Object.keys(handlers.value).forEach(key => {
50
- var _handlers$value$key, _handlers$value$key$t;
51
- (_handlers$value$key = handlers.value[key]) === null || _handlers$value$key === void 0 || (_handlers$value$key$t = _handlers$value$key[type]) === null || _handlers$value$key$t === void 0 || _handlers$value$key$t.call(_handlers$value$key, event);
21
+ functionToCall === null || functionToCall === void 0 || functionToCall(event);
22
+ }, eventName, viewTag);
23
+ }
24
+ return null;
52
25
  });
26
+ return () => {
27
+ ids.forEach(id => id ? (0, _eventHandler.unregisterEventHandler)(id) : null);
28
+ };
53
29
  };
54
- return [setHandlers, broadcast];
30
+ return onRegisterHandler;
55
31
  }
56
32
 
57
33
  /**
@@ -65,7 +41,7 @@ function useSharedHandlers() {
65
41
  */
66
42
  function useAnimatedValue(initialValue, config) {
67
43
  const ref = (0, _react.useRef)(null);
68
- if (ref.current == null) {
44
+ if (ref.current === null) {
69
45
  ref.current = new _reactNative.Animated.Value(initialValue, config);
70
46
  }
71
47
  return ref.current;
@@ -1 +1 @@
1
- {"version":3,"names":["_react","require","_reactNative","_reactNativeReanimated","useSharedHandlers","handlers","useSharedValue","jsHandlers","useRef","updateSharedHandlers","value","current","setHandlers","useCallback","handler","broadcast","type","event","Object","keys","forEach","key","_handlers$value$key","_handlers$value$key$t","call","useAnimatedValue","initialValue","config","ref","Animated","Value"],"sources":["internal.ts"],"sourcesContent":["import { useCallback, useRef } from \"react\";\nimport { Animated } from \"react-native\";\nimport { useSharedValue } from \"react-native-reanimated\";\n\nimport type { Handlers } from \"./types\";\n\ntype UntypedHandler = Record<string, (event: never) => void>;\ntype SharedHandlersReturnType<T extends UntypedHandler> = [\n (handler: Handlers<T>) => void,\n <K extends keyof T>(type: K, event: Parameters<T[K]>[0]) => void,\n];\n\n/**\n * Hook for storing worklet handlers (objects with keys, where values are worklets).\n * Returns methods for setting handlers and broadcasting events in them.\n *\n * T is a generic that looks like:\n * @example\n * {\n * onEvent: () => {},\n * onEvent2: () => {},\n * }\n */\nexport function useSharedHandlers<\n T extends UntypedHandler,\n>(): SharedHandlersReturnType<T> {\n const handlers = useSharedValue<Handlers<T>>({});\n const jsHandlers = useRef<Handlers<T>>({});\n\n // since js -> worklet -> js call is asynchronous, we can not write handlers\n // straight into shared variable (using current shared value as a previous result),\n // since there may be a race condition in a call, and closure may have out-of-dated\n // values. As a result, some of handlers may be not written to \"all handlers\" object.\n // Below we are writing all handlers to `ref` and afterwards synchronize them with\n // shared value (since `refs` are not referring to actual value in worklets).\n // This approach allow us to update synchronously handlers in js thread (and it assures,\n // that it will have all of them) and then update them in worklet thread (calls are\n // happening in FIFO order, so we will always have actual value).\n const updateSharedHandlers = () => {\n // eslint-disable-next-line react-compiler/react-compiler\n handlers.value = jsHandlers.current;\n };\n const setHandlers = useCallback((handler: Handlers<T>) => {\n jsHandlers.current = {\n ...jsHandlers.current,\n ...handler,\n };\n updateSharedHandlers();\n }, []);\n const broadcast = <K extends keyof T>(\n type: K,\n event: Parameters<T[K]>[0],\n ) => {\n \"worklet\";\n\n Object.keys(handlers.value).forEach((key) => {\n handlers.value[key]?.[type]?.(event);\n });\n };\n\n return [setHandlers, broadcast];\n}\n\n/**\n * TS variant of `useAnimatedValue` hook which is added in RN 0.71\n * A better alternative of storing animated values in refs, since\n * it doesn't recreate a new `Animated.Value` object on every re-render\n * and therefore consumes less memory. We can not use a variant from\n * RN, since this library supports earlier versions of RN.\n *\n * @see https://github.com/facebook/react-native/commit/e22217fe8b9455e32695f88ca835e11442b0a937\n */\nexport function useAnimatedValue(\n initialValue: number,\n config?: Animated.AnimatedConfig,\n): Animated.Value {\n const ref = useRef<Animated.Value | null>(null);\n\n if (ref.current == null) {\n ref.current = new Animated.Value(initialValue, config);\n }\n\n return ref.current;\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAF,OAAA;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASG,iBAAiBA,CAAA,EAEA;EAC/B,MAAMC,QAAQ,GAAG,IAAAC,qCAAc,EAAc,CAAC,CAAC,CAAC;EAChD,MAAMC,UAAU,GAAG,IAAAC,aAAM,EAAc,CAAC,CAAC,CAAC;;EAE1C;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,MAAMC,oBAAoB,GAAGA,CAAA,KAAM;IACjC;IACAJ,QAAQ,CAACK,KAAK,GAAGH,UAAU,CAACI,OAAO;EACrC,CAAC;EACD,MAAMC,WAAW,GAAG,IAAAC,kBAAW,EAAEC,OAAoB,IAAK;IACxDP,UAAU,CAACI,OAAO,GAAG;MACnB,GAAGJ,UAAU,CAACI,OAAO;MACrB,GAAGG;IACL,CAAC;IACDL,oBAAoB,CAAC,CAAC;EACxB,CAAC,EAAE,EAAE,CAAC;EACN,MAAMM,SAAS,GAAGA,CAChBC,IAAO,EACPC,KAA0B,KACvB;IACH,SAAS;;IAETC,MAAM,CAACC,IAAI,CAACd,QAAQ,CAACK,KAAK,CAAC,CAACU,OAAO,CAAEC,GAAG,IAAK;MAAA,IAAAC,mBAAA,EAAAC,qBAAA;MAC3C,CAAAD,mBAAA,GAAAjB,QAAQ,CAACK,KAAK,CAACW,GAAG,CAAC,cAAAC,mBAAA,gBAAAC,qBAAA,GAAnBD,mBAAA,CAAsBN,IAAI,CAAC,cAAAO,qBAAA,eAA3BA,qBAAA,CAAAC,IAAA,CAAAF,mBAAA,EAA8BL,KAAK,CAAC;IACtC,CAAC,CAAC;EACJ,CAAC;EAED,OAAO,CAACL,WAAW,EAAEG,SAAS,CAAC;AACjC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASU,gBAAgBA,CAC9BC,YAAoB,EACpBC,MAAgC,EAChB;EAChB,MAAMC,GAAG,GAAG,IAAApB,aAAM,EAAwB,IAAI,CAAC;EAE/C,IAAIoB,GAAG,CAACjB,OAAO,IAAI,IAAI,EAAE;IACvBiB,GAAG,CAACjB,OAAO,GAAG,IAAIkB,qBAAQ,CAACC,KAAK,CAACJ,YAAY,EAAEC,MAAM,CAAC;EACxD;EAEA,OAAOC,GAAG,CAACjB,OAAO;AACpB","ignoreList":[]}
1
+ {"version":3,"names":["_react","require","_reactNative","_eventHandler","useEventHandlerRegistration","map","viewTagRef","onRegisterHandler","handler","viewTag","findNodeHandle","current","ids","Object","keys","handlerName","eventName","get","functionToCall","registerEventHandler","event","forEach","id","unregisterEventHandler","useAnimatedValue","initialValue","config","ref","useRef","Animated","Value"],"sources":["internal.ts"],"sourcesContent":["import { useRef } from \"react\";\nimport { Animated, findNodeHandle } from \"react-native\";\n\nimport { registerEventHandler, unregisterEventHandler } from \"./event-handler\";\n\ntype EventHandler = (event: never) => void;\ntype ComponentOrHandle = Parameters<typeof findNodeHandle>[0];\n\nexport function useEventHandlerRegistration<\n H extends Partial<Record<string, EventHandler>>,\n>(\n map: Map<keyof H, string>,\n viewTagRef: React.MutableRefObject<ComponentOrHandle>,\n) {\n const onRegisterHandler = (handler: H) => {\n const viewTag = findNodeHandle(viewTagRef.current);\n const ids = Object.keys(handler).map((handlerName) => {\n const eventName = map.get(handlerName as keyof H);\n const functionToCall = handler[handlerName as keyof H];\n\n if (eventName && viewTag) {\n return registerEventHandler(\n (event: Parameters<NonNullable<H[keyof H]>>[0]) => {\n \"worklet\";\n\n functionToCall?.(event);\n },\n eventName,\n viewTag,\n );\n }\n\n return null;\n });\n\n return () => {\n ids.forEach((id) => (id ? unregisterEventHandler(id) : null));\n };\n };\n\n return onRegisterHandler;\n}\n\n/**\n * TS variant of `useAnimatedValue` hook which is added in RN 0.71\n * A better alternative of storing animated values in refs, since\n * it doesn't recreate a new `Animated.Value` object on every re-render\n * and therefore consumes less memory. We can not use a variant from\n * RN, since this library supports earlier versions of RN.\n *\n * @see https://github.com/facebook/react-native/commit/e22217fe8b9455e32695f88ca835e11442b0a937\n */\nexport function useAnimatedValue(\n initialValue: number,\n config?: Animated.AnimatedConfig,\n): Animated.Value {\n const ref = useRef<Animated.Value | null>(null);\n\n if (ref.current === null) {\n ref.current = new Animated.Value(initialValue, config);\n }\n\n return ref.current;\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,aAAA,GAAAF,OAAA;AAKO,SAASG,2BAA2BA,CAGzCC,GAAyB,EACzBC,UAAqD,EACrD;EACA,MAAMC,iBAAiB,GAAIC,OAAU,IAAK;IACxC,MAAMC,OAAO,GAAG,IAAAC,2BAAc,EAACJ,UAAU,CAACK,OAAO,CAAC;IAClD,MAAMC,GAAG,GAAGC,MAAM,CAACC,IAAI,CAACN,OAAO,CAAC,CAACH,GAAG,CAAEU,WAAW,IAAK;MACpD,MAAMC,SAAS,GAAGX,GAAG,CAACY,GAAG,CAACF,WAAsB,CAAC;MACjD,MAAMG,cAAc,GAAGV,OAAO,CAACO,WAAW,CAAY;MAEtD,IAAIC,SAAS,IAAIP,OAAO,EAAE;QACxB,OAAO,IAAAU,kCAAoB,EACxBC,KAA6C,IAAK;UACjD,SAAS;;UAETF,cAAc,aAAdA,cAAc,eAAdA,cAAc,CAAGE,KAAK,CAAC;QACzB,CAAC,EACDJ,SAAS,EACTP,OACF,CAAC;MACH;MAEA,OAAO,IAAI;IACb,CAAC,CAAC;IAEF,OAAO,MAAM;MACXG,GAAG,CAACS,OAAO,CAAEC,EAAE,IAAMA,EAAE,GAAG,IAAAC,oCAAsB,EAACD,EAAE,CAAC,GAAG,IAAK,CAAC;IAC/D,CAAC;EACH,CAAC;EAED,OAAOf,iBAAiB;AAC1B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASiB,gBAAgBA,CAC9BC,YAAoB,EACpBC,MAAgC,EAChB;EAChB,MAAMC,GAAG,GAAG,IAAAC,aAAM,EAAwB,IAAI,CAAC;EAE/C,IAAID,GAAG,CAAChB,OAAO,KAAK,IAAI,EAAE;IACxBgB,GAAG,CAAChB,OAAO,GAAG,IAAIkB,qBAAQ,CAACC,KAAK,CAACL,YAAY,EAAEC,MAAM,CAAC;EACxD;EAEA,OAAOC,GAAG,CAAChB,OAAO;AACpB","ignoreList":[]}
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.revertMonkeyPatch = exports.applyMonkeyPatch = void 0;
7
7
  var NativeAndroidManager = _interopRequireWildcard(require("react-native/Libraries/Components/StatusBar/NativeStatusBarManagerAndroid"));
8
8
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
9
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
9
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
10
10
  // @ts-expect-error because there is no corresponding type definition
11
11
 
12
12
  const RCTStatusBarManagerCompat =
@@ -1 +1 @@
1
- {"version":3,"names":["NativeAndroidManager","_interopRequireWildcard","require","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","RCTStatusBarManagerCompat","OriginalNativeAndroidManager","ModifiedNativeAndroidManager","setColor","color","animated","setTranslucent","translucent","setStyle","statusBarStyle","setHidden","hidden","applyMonkeyPatch","assign","exports","revertMonkeyPatch"],"sources":["monkey-patch.android.ts"],"sourcesContent":["// @ts-expect-error because there is no corresponding type definition\nimport * as NativeAndroidManager from \"react-native/Libraries/Components/StatusBar/NativeStatusBarManagerAndroid\";\n\nconst RCTStatusBarManagerCompat =\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n require(\"./specs/NativeStatusBarManagerCompat\").default;\n\n// Copy original default manager to keep its original state and methods\nconst OriginalNativeAndroidManager = { ...NativeAndroidManager.default };\n\n// Create a new object that modifies the necessary methods\n// On Android < 11 RN uses legacy API which breaks EdgeToEdge mode in RN, so\n// in order to use library on all available platforms we have to monkey patch\n// default RN implementation and use modern `WindowInsetsControllerCompat`.\nconst ModifiedNativeAndroidManager = {\n ...NativeAndroidManager.default, // Spread original properties to keep existing functionality\n setColor: (color: number, animated: boolean): void => {\n RCTStatusBarManagerCompat.setColor(color, animated);\n },\n setTranslucent: (translucent: boolean): void => {\n RCTStatusBarManagerCompat.setTranslucent(translucent);\n },\n /**\n * - statusBarStyles can be:\n * - 'default'\n * - 'dark-content'\n */\n setStyle: (statusBarStyle?: string): void => {\n RCTStatusBarManagerCompat.setStyle(statusBarStyle);\n },\n setHidden: (hidden: boolean): void => {\n RCTStatusBarManagerCompat.setHidden(hidden);\n },\n};\n\n// Define a function to apply the monkey patch\nexport const applyMonkeyPatch = () => {\n Object.assign(NativeAndroidManager.default, ModifiedNativeAndroidManager);\n};\n\n// Define a function to revert changes back to the original state\nexport const revertMonkeyPatch = () => {\n Object.assign(NativeAndroidManager.default, OriginalNativeAndroidManager);\n};\n"],"mappings":";;;;;;AACA,IAAAA,oBAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAkH,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAH,wBAAAG,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAA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AAMC,gBAAgB,GAAGA,CAAA,KAAM;EACpCrB,MAAM,CAACsB,MAAM,CAACrC,oBAAoB,CAACS,OAAO,EAAEiB,4BAA4B,CAAC;AAC3E,CAAC;;AAED;AAAAY,OAAA,CAAAF,gBAAA,GAAAA,gBAAA;AACO,MAAMG,iBAAiB,GAAGA,CAAA,KAAM;EACrCxB,MAAM,CAACsB,MAAM,CAACrC,oBAAoB,CAACS,OAAO,EAAEgB,4BAA4B,CAAC;AAC3E,CAAC;AAACa,OAAA,CAAAC,iBAAA,GAAAA,iBAAA","ignoreList":[]}
1
+ {"version":3,"names":["NativeAndroidManager","_interopRequireWildcard","require","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","RCTStatusBarManagerCompat","OriginalNativeAndroidManager","ModifiedNativeAndroidManager","setColor","color","animated","setTranslucent","translucent","setStyle","statusBarStyle","setHidden","hidden","applyMonkeyPatch","assign","exports","revertMonkeyPatch"],"sources":["monkey-patch.android.ts"],"sourcesContent":["// @ts-expect-error because there is no corresponding type definition\nimport * as NativeAndroidManager from \"react-native/Libraries/Components/StatusBar/NativeStatusBarManagerAndroid\";\n\nconst RCTStatusBarManagerCompat =\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n require(\"./specs/NativeStatusBarManagerCompat\").default;\n\n// Copy original default manager to keep its original state and methods\nconst OriginalNativeAndroidManager = { ...NativeAndroidManager.default };\n\n// Create a new object that modifies the necessary methods\n// On Android < 11 RN uses legacy API which breaks EdgeToEdge mode in RN, so\n// in order to use library on all available platforms we have to monkey patch\n// default RN implementation and use modern `WindowInsetsControllerCompat`.\nconst ModifiedNativeAndroidManager = {\n ...NativeAndroidManager.default, // Spread original properties to keep existing functionality\n setColor: (color: number, animated: boolean): void => {\n RCTStatusBarManagerCompat.setColor(color, animated);\n },\n setTranslucent: (translucent: boolean): void => {\n RCTStatusBarManagerCompat.setTranslucent(translucent);\n },\n /**\n * - statusBarStyles can be:\n * - 'default'\n * - 'dark-content'\n */\n setStyle: (statusBarStyle?: string): void => {\n RCTStatusBarManagerCompat.setStyle(statusBarStyle);\n },\n setHidden: (hidden: boolean): void => {\n RCTStatusBarManagerCompat.setHidden(hidden);\n },\n};\n\n// Define a function to apply the monkey patch\nexport const applyMonkeyPatch = () => {\n Object.assign(NativeAndroidManager.default, ModifiedNativeAndroidManager);\n};\n\n// Define a function to revert changes back to the original state\nexport const revertMonkeyPatch = () => {\n Object.assign(NativeAndroidManager.default, OriginalNativeAndroidManager);\n};\n"],"mappings":";;;;;;AACA,IAAAA,oBAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAkH,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAH,wBAAAG,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,GAAA,IA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Ee,4BAA4B,CAAC;AAC3E,CAAC;AAACa,OAAA,CAAAC,iBAAA,GAAAA,iBAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["NOOP","applyMonkeyPatch","exports","revertMonkeyPatch"],"sources":["monkey-patch.ts"],"sourcesContent":["// stub for all platforms\nconst NOOP = () => {};\nexport const applyMonkeyPatch = NOOP;\nexport const revertMonkeyPatch = NOOP;\n"],"mappings":";;;;;;AAAA;AACA,MAAMA,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AACd,MAAMC,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,GAAGD,IAAI;AAC7B,MAAMG,iBAAiB,GAAAD,OAAA,CAAAC,iBAAA,GAAGH,IAAI","ignoreList":[]}
1
+ {"version":3,"names":["NOOP","applyMonkeyPatch","exports","revertMonkeyPatch"],"sources":["monkey-patch.ts"],"sourcesContent":["// stub for all platforms\nconst NOOP = () => {};\n\nexport const applyMonkeyPatch = NOOP;\nexport const revertMonkeyPatch = NOOP;\n"],"mappings":";;;;;;AAAA;AACA,MAAMA,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AAEd,MAAMC,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,GAAGD,IAAI;AAC7B,MAAMG,iBAAiB,GAAAD,OAAA,CAAAC,iBAAA,GAAGH,IAAI","ignoreList":[]}
@@ -3,10 +3,8 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.useFocusedInputTextHandler = exports.useFocusedInputSelectionHandler = exports.useFocusedInputLayoutHandler = exports.useAnimatedKeyboardHandler = void 0;
6
+ exports.useFocusedInputLayoutHandler = exports.useAnimatedKeyboardHandler = void 0;
7
7
  const NOOP = () => () => {};
8
8
  const useAnimatedKeyboardHandler = exports.useAnimatedKeyboardHandler = NOOP;
9
9
  const useFocusedInputLayoutHandler = exports.useFocusedInputLayoutHandler = NOOP;
10
- const useFocusedInputTextHandler = exports.useFocusedInputTextHandler = NOOP;
11
- const useFocusedInputSelectionHandler = exports.useFocusedInputSelectionHandler = NOOP;
12
10
  //# sourceMappingURL=reanimated.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["NOOP","useAnimatedKeyboardHandler","exports","useFocusedInputLayoutHandler","useFocusedInputTextHandler","useFocusedInputSelectionHandler"],"sources":["reanimated.ts"],"sourcesContent":["import type {\n EventWithName,\n FocusedInputLayoutChangedEvent,\n FocusedInputLayoutHandlerHook,\n FocusedInputSelectionChangedEvent,\n FocusedInputSelectionHandlerHook,\n FocusedInputTextChangedEvent,\n FocusedInputTextHandlerHook,\n KeyboardHandlerHook,\n NativeEvent,\n} from \"./types\";\n\nconst NOOP = () => () => {};\nexport const useAnimatedKeyboardHandler: KeyboardHandlerHook<\n Record<string, unknown>,\n EventWithName<NativeEvent>\n> = NOOP;\nexport const useFocusedInputLayoutHandler: FocusedInputLayoutHandlerHook<\n Record<string, unknown>,\n EventWithName<FocusedInputLayoutChangedEvent>\n> = NOOP;\nexport const useFocusedInputTextHandler: FocusedInputTextHandlerHook<\n Record<string, unknown>,\n EventWithName<FocusedInputTextChangedEvent>\n> = NOOP;\nexport const useFocusedInputSelectionHandler: FocusedInputSelectionHandlerHook<\n Record<string, unknown>,\n EventWithName<FocusedInputSelectionChangedEvent>\n> = NOOP;\n"],"mappings":";;;;;;AAYA,MAAMA,IAAI,GAAGA,CAAA,KAAM,MAAM,CAAC,CAAC;AACpB,MAAMC,0BAGZ,GAAAC,OAAA,CAAAD,0BAAA,GAAGD,IAAI;AACD,MAAMG,4BAGZ,GAAAD,OAAA,CAAAC,4BAAA,GAAGH,IAAI;AACD,MAAMI,0BAGZ,GAAAF,OAAA,CAAAE,0BAAA,GAAGJ,IAAI;AACD,MAAMK,+BAGZ,GAAAH,OAAA,CAAAG,+BAAA,GAAGL,IAAI","ignoreList":[]}
1
+ {"version":3,"names":["NOOP","useAnimatedKeyboardHandler","exports","useFocusedInputLayoutHandler"],"sources":["reanimated.ts"],"sourcesContent":["import type {\n EventWithName,\n FocusedInputLayoutChangedEvent,\n FocusedInputLayoutHandlerHook,\n KeyboardHandlerHook,\n NativeEvent,\n} from \"./types\";\n\nconst NOOP = () => () => {};\n\nexport const useAnimatedKeyboardHandler: KeyboardHandlerHook<\n Record<string, unknown>,\n EventWithName<NativeEvent>\n> = NOOP;\nexport const useFocusedInputLayoutHandler: FocusedInputLayoutHandlerHook<\n Record<string, unknown>,\n EventWithName<FocusedInputLayoutChangedEvent>\n> = NOOP;\n"],"mappings":";;;;;;AAQA,MAAMA,IAAI,GAAGA,CAAA,KAAM,MAAM,CAAC,CAAC;AAEpB,MAAMC,0BAGZ,GAAAC,OAAA,CAAAD,0BAAA,GAAGD,IAAI;AACD,MAAMG,4BAGZ,GAAAD,OAAA,CAAAC,4BAAA,GAAGH,IAAI","ignoreList":[]}
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.useFocusedInputTextHandler = exports.useFocusedInputSelectionHandler = exports.useFocusedInputLayoutHandler = exports.useAnimatedKeyboardHandler = void 0;
6
+ exports.useFocusedInputLayoutHandler = exports.useAnimatedKeyboardHandler = void 0;
7
7
  var _reactNativeReanimated = require("react-native-reanimated");
8
8
  const useAnimatedKeyboardHandler = (handlers, dependencies) => {
9
9
  const {
@@ -51,38 +51,4 @@ const useFocusedInputLayoutHandler = (handlers, dependencies) => {
51
51
  }, ["onFocusedInputLayoutChanged"], doDependenciesDiffer);
52
52
  };
53
53
  exports.useFocusedInputLayoutHandler = useFocusedInputLayoutHandler;
54
- const useFocusedInputTextHandler = (handlers, dependencies) => {
55
- const {
56
- context,
57
- doDependenciesDiffer
58
- } = (0, _reactNativeReanimated.useHandler)(handlers, dependencies);
59
- return (0, _reactNativeReanimated.useEvent)(event => {
60
- "worklet";
61
-
62
- const {
63
- onFocusedInputTextChanged
64
- } = handlers;
65
- if (onFocusedInputTextChanged && event.eventName.endsWith("onFocusedInputTextChanged")) {
66
- onFocusedInputTextChanged(event, context);
67
- }
68
- }, ["onFocusedInputTextChanged"], doDependenciesDiffer);
69
- };
70
- exports.useFocusedInputTextHandler = useFocusedInputTextHandler;
71
- const useFocusedInputSelectionHandler = (handlers, dependencies) => {
72
- const {
73
- context,
74
- doDependenciesDiffer
75
- } = (0, _reactNativeReanimated.useHandler)(handlers, dependencies);
76
- return (0, _reactNativeReanimated.useEvent)(event => {
77
- "worklet";
78
-
79
- const {
80
- onFocusedInputSelectionChanged
81
- } = handlers;
82
- if (onFocusedInputSelectionChanged && event.eventName.endsWith("onFocusedInputSelectionChanged")) {
83
- onFocusedInputSelectionChanged(event, context);
84
- }
85
- }, ["onFocusedInputSelectionChanged"], doDependenciesDiffer);
86
- };
87
- exports.useFocusedInputSelectionHandler = useFocusedInputSelectionHandler;
88
54
  //# sourceMappingURL=reanimated.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNativeReanimated","require","useAnimatedKeyboardHandler","handlers","dependencies","context","doDependenciesDiffer","useHandler","useEvent","event","onKeyboardMoveStart","onKeyboardMove","onKeyboardMoveEnd","onKeyboardMoveInteractive","eventName","endsWith","exports","useFocusedInputLayoutHandler","onFocusedInputLayoutChanged","useFocusedInputTextHandler","onFocusedInputTextChanged","useFocusedInputSelectionHandler","onFocusedInputSelectionChanged"],"sources":["reanimated.native.ts"],"sourcesContent":["import { useEvent, useHandler } from \"react-native-reanimated\";\n\nimport type {\n EventWithName,\n FocusedInputLayoutChangedEvent,\n FocusedInputLayoutHandlerHook,\n FocusedInputSelectionChangedEvent,\n FocusedInputSelectionHandlerHook,\n FocusedInputTextChangedEvent,\n FocusedInputTextHandlerHook,\n KeyboardHandlerHook,\n NativeEvent,\n} from \"./types\";\n\ntype EventContext = Record<string, unknown>;\n\nexport const useAnimatedKeyboardHandler: KeyboardHandlerHook<\n EventContext,\n EventWithName<NativeEvent>\n> = (handlers, dependencies) => {\n const { context, doDependenciesDiffer } = useHandler(handlers, dependencies);\n\n return useEvent(\n (event) => {\n \"worklet\";\n const {\n onKeyboardMoveStart,\n onKeyboardMove,\n onKeyboardMoveEnd,\n onKeyboardMoveInteractive,\n } = handlers;\n\n if (\n onKeyboardMoveStart &&\n event.eventName.endsWith(\"onKeyboardMoveStart\")\n ) {\n onKeyboardMoveStart(event, context);\n }\n\n if (onKeyboardMove && event.eventName.endsWith(\"onKeyboardMove\")) {\n onKeyboardMove(event, context);\n }\n\n if (onKeyboardMoveEnd && event.eventName.endsWith(\"onKeyboardMoveEnd\")) {\n onKeyboardMoveEnd(event, context);\n }\n\n if (\n onKeyboardMoveInteractive &&\n event.eventName.endsWith(\"onKeyboardMoveInteractive\")\n ) {\n onKeyboardMoveInteractive(event, context);\n }\n },\n [\n \"onKeyboardMoveStart\",\n \"onKeyboardMove\",\n \"onKeyboardMoveEnd\",\n \"onKeyboardMoveInteractive\",\n ],\n doDependenciesDiffer,\n );\n};\n\nexport const useFocusedInputLayoutHandler: FocusedInputLayoutHandlerHook<\n EventContext,\n EventWithName<FocusedInputLayoutChangedEvent>\n> = (handlers, dependencies) => {\n const { context, doDependenciesDiffer } = useHandler(handlers, dependencies);\n\n return useEvent(\n (event) => {\n \"worklet\";\n const { onFocusedInputLayoutChanged } = handlers;\n\n if (\n onFocusedInputLayoutChanged &&\n event.eventName.endsWith(\"onFocusedInputLayoutChanged\")\n ) {\n onFocusedInputLayoutChanged(event, context);\n }\n },\n [\"onFocusedInputLayoutChanged\"],\n doDependenciesDiffer,\n );\n};\n\nexport const useFocusedInputTextHandler: FocusedInputTextHandlerHook<\n EventContext,\n EventWithName<FocusedInputTextChangedEvent>\n> = (handlers, dependencies) => {\n const { context, doDependenciesDiffer } = useHandler(handlers, dependencies);\n\n return useEvent(\n (event) => {\n \"worklet\";\n const { onFocusedInputTextChanged } = handlers;\n\n if (\n onFocusedInputTextChanged &&\n event.eventName.endsWith(\"onFocusedInputTextChanged\")\n ) {\n onFocusedInputTextChanged(event, context);\n }\n },\n [\"onFocusedInputTextChanged\"],\n doDependenciesDiffer,\n );\n};\n\nexport const useFocusedInputSelectionHandler: FocusedInputSelectionHandlerHook<\n EventContext,\n EventWithName<FocusedInputSelectionChangedEvent>\n> = (handlers, dependencies) => {\n const { context, doDependenciesDiffer } = useHandler(handlers, dependencies);\n\n return useEvent(\n (event) => {\n \"worklet\";\n const { onFocusedInputSelectionChanged } = handlers;\n\n if (\n onFocusedInputSelectionChanged &&\n event.eventName.endsWith(\"onFocusedInputSelectionChanged\")\n ) {\n onFocusedInputSelectionChanged(event, context);\n }\n },\n [\"onFocusedInputSelectionChanged\"],\n doDependenciesDiffer,\n );\n};\n"],"mappings":";;;;;;AAAA,IAAAA,sBAAA,GAAAC,OAAA;AAgBO,MAAMC,0BAGZ,GAAGA,CAACC,QAAQ,EAAEC,YAAY,KAAK;EAC9B,MAAM;IAAEC,OAAO;IAAEC;EAAqB,CAAC,GAAG,IAAAC,iCAAU,EAACJ,QAAQ,EAAEC,YAAY,CAAC;EAE5E,OAAO,IAAAI,+BAAQ,EACZC,KAAK,IAAK;IACT,SAAS;;IACT,MAAM;MACJC,mBAAmB;MACnBC,cAAc;MACdC,iBAAiB;MACjBC;IACF,CAAC,GAAGV,QAAQ;IAEZ,IACEO,mBAAmB,IACnBD,KAAK,CAACK,SAAS,CAACC,QAAQ,CAAC,qBAAqB,CAAC,EAC/C;MACAL,mBAAmB,CAACD,KAAK,EAAEJ,OAAO,CAAC;IACrC;IAEA,IAAIM,cAAc,IAAIF,KAAK,CAACK,SAAS,CAACC,QAAQ,CAAC,gBAAgB,CAAC,EAAE;MAChEJ,cAAc,CAACF,KAAK,EAAEJ,OAAO,CAAC;IAChC;IAEA,IAAIO,iBAAiB,IAAIH,KAAK,CAACK,SAAS,CAACC,QAAQ,CAAC,mBAAmB,CAAC,EAAE;MACtEH,iBAAiB,CAACH,KAAK,EAAEJ,OAAO,CAAC;IACnC;IAEA,IACEQ,yBAAyB,IACzBJ,KAAK,CAACK,SAAS,CAACC,QAAQ,CAAC,2BAA2B,CAAC,EACr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A,0BAAA;AAEK,MAAME,+BAGZ,GAAGA,CAAClB,QAAQ,EAAEC,YAAY,KAAK;EAC9B,MAAM;IAAEC,OAAO;IAAEC;EAAqB,CAAC,GAAG,IAAAC,iCAAU,EAACJ,QAAQ,EAAEC,YAAY,CAAC;EAE5E,OAAO,IAAAI,+BAAQ,EACZC,KAAK,IAAK;IACT,SAAS;;IACT,MAAM;MAAEa;IAA+B,CAAC,GAAGnB,QAAQ;IAEnD,IACEmB,8BAA8B,IAC9Bb,KAAK,CAACK,SAAS,CAACC,QAAQ,CAAC,gCAAgC,CAAC,EAC1D;MACAO,8BAA8B,CAACb,KAAK,EAAEJ,OAAO,CAAC;IAChD;EACF,CAAC,EACD,CAAC,gCAAgC,CAAC,EAClCC,oBACF,CAAC;AACH,CAAC;AAACU,OAAA,CAAAK,+BAAA,GAAAA,+BAAA","ignoreList":[]}
1
+ {"version":3,"names":["_reactNativeReanimated","require","useAnimatedKeyboardHandler","handlers","dependencies","context","doDependenciesDiffer","useHandler","useEvent","event","onKeyboardMoveStart","onKeyboardMove","onKeyboardMoveEnd","onKeyboardMoveInteractive","eventName","endsWith","exports","useFocusedInputLayoutHandler","onFocusedInputLayoutChanged"],"sources":["reanimated.native.ts"],"sourcesContent":["import { useEvent, useHandler } from \"react-native-reanimated\";\n\nimport type {\n EventWithName,\n FocusedInputLayoutChangedEvent,\n FocusedInputLayoutHandlerHook,\n KeyboardHandlerHook,\n NativeEvent,\n} from \"./types\";\n\ntype EventContext = Record<string, unknown>;\n\nexport const useAnimatedKeyboardHandler: KeyboardHandlerHook<\n EventContext,\n EventWithName<NativeEvent>\n> = (handlers, dependencies) => {\n const { context, doDependenciesDiffer } = useHandler(handlers, dependencies);\n\n return useEvent(\n (event) => {\n \"worklet\";\n const {\n onKeyboardMoveStart,\n onKeyboardMove,\n onKeyboardMoveEnd,\n onKeyboardMoveInteractive,\n } = handlers;\n\n if (\n onKeyboardMoveStart &&\n event.eventName.endsWith(\"onKeyboardMoveStart\")\n ) {\n onKeyboardMoveStart(event, context);\n }\n\n if (onKeyboardMove && event.eventName.endsWith(\"onKeyboardMove\")) {\n onKeyboardMove(event, context);\n }\n\n if (onKeyboardMoveEnd && event.eventName.endsWith(\"onKeyboardMoveEnd\")) {\n onKeyboardMoveEnd(event, context);\n }\n\n if (\n onKeyboardMoveInteractive &&\n event.eventName.endsWith(\"onKeyboardMoveInteractive\")\n ) {\n onKeyboardMoveInteractive(event, context);\n }\n },\n [\n \"onKeyboardMoveStart\",\n \"onKeyboardMove\",\n \"onKeyboardMoveEnd\",\n \"onKeyboardMoveInteractive\",\n ],\n doDependenciesDiffer,\n );\n};\n\nexport const useFocusedInputLayoutHandler: FocusedInputLayoutHandlerHook<\n EventContext,\n EventWithName<FocusedInputLayoutChangedEvent>\n> = (handlers, dependencies) => {\n const { context, doDependenciesDiffer } = useHandler(handlers, dependencies);\n\n return useEvent(\n (event) => {\n \"worklet\";\n const { onFocusedInputLayoutChanged } = handlers;\n\n if (\n onFocusedInputLayoutChanged &&\n event.eventName.endsWith(\"onFocusedInputLayoutChanged\")\n ) {\n onFocusedInputLayoutChanged(event, context);\n }\n },\n [\"onFocusedInputLayoutChanged\"],\n doDependenciesDiffer,\n );\n};\n"],"mappings":";;;;;;AAAA,IAAAA,sBAAA,GAAAC,OAAA;AAYO,MAAMC,0BAGZ,GAAGA,CAACC,QAAQ,EAAEC,YAAY,KAAK;EAC9B,MAAM;IAAEC,OAAO;IAAEC;EAAqB,CAAC,GAAG,IAAAC,iCAAU,EAACJ,QAAQ,EAAEC,YAAY,CAAC;EAE5E,OAAO,IAAAI,+BAAQ,EACZC,KAAK,IAAK;IACT,SAAS;;IACT,MAAM;MACJC,mBAAmB;MACnBC,cAAc;MACdC,iBAAiB;MACjBC;IACF,CAAC,GAAGV,QAAQ;IAEZ,IACEO,mBAAmB,IACnBD,KAAK,CAACK,SAAS,CAACC,QAAQ,CAAC,qBAAqB,CAAC,EAC/C;MACAL,mBAAmB,CAACD,KAAK,EAAEJ,OAAO,CAAC;IACrC;IAEA,IAAIM,cAAc,IAAIF,KAAK,CAACK,SAAS,CAACC,QAAQ,CAAC,gBAAgB,CAAC,EAAE;MAChEJ,cAAc,CAACF,KAAK,EAAEJ,OAAO,CAAC;IAChC;IAEA,IAAIO,iBAAiB,IAAIH,KAAK,CAACK,SAAS,CAACC,QAAQ,CAAC,mBAAmB,CAAC,EAAE;MACtEH,iBAAiB,CAACH,KAAK,EAAEJ,OAAO,CAAC;IACnC;IAEA,IACEQ,yBAAyB,IACzBJ,KAAK,CAACK,SAAS,CAACC,QAAQ,CAAC,2BAA2B,CAAC,EACrD;MACAF,yBAAyB,CAACJ,KAAK,EAAEJ,OAAO,CAAC;IAC3C;EACF,CAAC,EACD,CACE,qBAAqB,EACrB,gBAAgB,EAChB,mBAAmB,EACnB,2BAA2B,CAC5B,EACDC,oBACF,CAAC;AACH,CAAC;AAACU,OAAA,CAAAd,0BAAA,GAAAA,0BAAA;AAEK,MAAMe,4BAGZ,GAAGA,CAACd,QAAQ,EAAEC,YAAY,KAAK;EAC9B,MAAM;IAAEC,OAAO;IAAEC;EAAqB,CAAC,GAAG,IAAAC,iCAAU,EAACJ,QAAQ,EAAEC,YAAY,CAAC;EAE5E,OAAO,IAAAI,+BAAQ,EACZC,KAAK,IAAK;IACT,SAAS;;IACT,MAAM;MAAES;IAA4B,CAAC,GAAGf,QAAQ;IAEhD,IACEe,2BAA2B,IAC3BT,KAAK,CAACK,SAAS,CAACC,QAAQ,CAAC,6BAA6B,CAAC,EACvD;MACAG,2BAA2B,CAACT,KAAK,EAAEJ,OAAO,CAAC;IAC7C;EACF,CAAC,EACD,CAAC,6BAA6B,CAAC,EAC/BC,oBACF,CAAC;AACH,CAAC;AAACU,OAAA,CAAAC,4BAAA,GAAAA,4BAAA","ignoreList":[]}
@@ -5,6 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  var _codegenNativeComponent = _interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeComponent"));
8
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
9
  var _default = exports.default = (0, _codegenNativeComponent.default)("KeyboardControllerView");
10
10
  //# sourceMappingURL=KeyboardControllerViewNativeComponent.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_codegenNativeComponent","_interopRequireDefault","require","obj","__esModule","default","_default","exports","codegenNativeComponent"],"sources":["KeyboardControllerViewNativeComponent.ts"],"sourcesContent":["import codegenNativeComponent from \"react-native/Libraries/Utilities/codegenNativeComponent\";\n\nimport type { HostComponent } from \"react-native\";\nimport type { ViewProps } from \"react-native/Libraries/Components/View/ViewPropTypes\";\nimport type {\n DirectEventHandler,\n Double,\n Int32,\n} from \"react-native/Libraries/Types/CodegenTypes\";\n\ntype KeyboardMoveEvent = Readonly<{\n height: Double;\n progress: Double;\n duration: Int32;\n target: Int32;\n}>;\n\ntype FocusedInputLayoutChangedEvent = Readonly<{\n target: Int32;\n parentScrollViewTarget: Int32;\n layout: {\n x: Double;\n y: Double;\n width: Double;\n height: Double;\n absoluteX: Double;\n absoluteY: Double;\n };\n}>;\n\ntype FocusedInputTextChangedEvent = Readonly<{\n text: string;\n}>;\n\ntype FocusedInputSelectionChangedEvent = Readonly<{\n target: Int32;\n selection: {\n start: {\n x: Double;\n y: Double;\n position: Int32;\n };\n end: {\n x: Double;\n y: Double;\n position: Int32;\n };\n };\n}>;\n\nexport interface NativeProps extends ViewProps {\n // props\n enabled?: boolean;\n statusBarTranslucent?: boolean;\n navigationBarTranslucent?: boolean;\n // callbacks\n /// keyboard\n onKeyboardMoveStart?: DirectEventHandler<KeyboardMoveEvent>;\n onKeyboardMove?: DirectEventHandler<KeyboardMoveEvent>;\n onKeyboardMoveEnd?: DirectEventHandler<KeyboardMoveEvent>;\n onKeyboardMoveInteractive?: DirectEventHandler<KeyboardMoveEvent>;\n /// focused input\n onFocusedInputLayoutChanged?: DirectEventHandler<FocusedInputLayoutChangedEvent>;\n onFocusedInputTextChanged?: DirectEventHandler<FocusedInputTextChangedEvent>;\n onFocusedInputSelectionChanged?: DirectEventHandler<FocusedInputSelectionChangedEvent>;\n}\n\nexport default codegenNativeComponent<NativeProps>(\n \"KeyboardControllerView\",\n) as HostComponent<NativeProps>;\n"],"mappings":";;;;;;AAAA,IAAAA,uBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA6F,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,IAAAG,QAAA,GAAAC,OAAA,CAAAF,OAAA,GAmE9E,IAAAG,+BAAsB,EACnC,wBACF,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_codegenNativeComponent","_interopRequireDefault","require","e","__esModule","default","_default","exports","codegenNativeComponent"],"sources":["KeyboardControllerViewNativeComponent.ts"],"sourcesContent":["import codegenNativeComponent from \"react-native/Libraries/Utilities/codegenNativeComponent\";\n\nimport type { HostComponent } from \"react-native\";\nimport type { ViewProps } from \"react-native/Libraries/Components/View/ViewPropTypes\";\nimport type {\n DirectEventHandler,\n Double,\n Int32,\n} from \"react-native/Libraries/Types/CodegenTypes\";\n\ntype KeyboardMoveEvent = Readonly<{\n height: Double;\n progress: Double;\n duration: Int32;\n target: Int32;\n}>;\n\ntype FocusedInputLayoutChangedEvent = Readonly<{\n target: Int32;\n parentScrollViewTarget: Int32;\n layout: {\n x: Double;\n y: Double;\n width: Double;\n height: Double;\n absoluteX: Double;\n absoluteY: Double;\n };\n}>;\n\ntype FocusedInputTextChangedEvent = Readonly<{\n text: string;\n}>;\n\ntype FocusedInputSelectionChangedEvent = Readonly<{\n target: Int32;\n selection: {\n start: {\n x: Double;\n y: Double;\n position: Int32;\n };\n end: {\n x: Double;\n y: Double;\n position: Int32;\n };\n };\n}>;\n\nexport interface NativeProps extends ViewProps {\n // props\n enabled?: boolean;\n statusBarTranslucent?: boolean;\n navigationBarTranslucent?: boolean;\n // callbacks\n /// keyboard\n onKeyboardMoveStart?: DirectEventHandler<KeyboardMoveEvent>;\n onKeyboardMove?: DirectEventHandler<KeyboardMoveEvent>;\n onKeyboardMoveEnd?: DirectEventHandler<KeyboardMoveEvent>;\n onKeyboardMoveInteractive?: DirectEventHandler<KeyboardMoveEvent>;\n /// focused input\n onFocusedInputLayoutChanged?: DirectEventHandler<FocusedInputLayoutChangedEvent>;\n onFocusedInputTextChanged?: DirectEventHandler<FocusedInputTextChangedEvent>;\n onFocusedInputSelectionChanged?: DirectEventHandler<FocusedInputSelectionChangedEvent>;\n}\n\nexport default codegenNativeComponent<NativeProps>(\n \"KeyboardControllerView\",\n) as HostComponent<NativeProps>;\n"],"mappings":";;;;;;AAAA,IAAAA,uBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA6F,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,IAAAG,QAAA,GAAAC,OAAA,CAAAF,OAAA,GAmE9E,IAAAG,+BAAsB,EACnC,wBACF,CAAC","ignoreList":[]}
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  var _codegenNativeComponent = _interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeComponent"));
8
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
9
  var _default = exports.default = (0, _codegenNativeComponent.default)("KeyboardGestureArea", {
10
10
  excludedPlatforms: ["iOS"]
11
11
  });
@@ -1 +1 @@
1
- {"version":3,"names":["_codegenNativeComponent","_interopRequireDefault","require","obj","__esModule","default","_default","exports","codegenNativeComponent","excludedPlatforms"],"sources":["KeyboardGestureAreaNativeComponent.ts"],"sourcesContent":["import codegenNativeComponent from \"react-native/Libraries/Utilities/codegenNativeComponent\";\n\nimport type { HostComponent } from \"react-native\";\nimport type { ViewProps } from \"react-native/Libraries/Components/View/ViewPropTypes\";\nimport type { WithDefault } from \"react-native/Libraries/Types/CodegenTypes\";\n\nexport interface NativeProps extends ViewProps {\n interpolator?: WithDefault<\"linear\" | \"ios\", \"linear\">;\n showOnSwipeUp?: boolean;\n enableSwipeToDismiss?: boolean;\n}\n\nexport default codegenNativeComponent<NativeProps>(\"KeyboardGestureArea\", {\n excludedPlatforms: [\"iOS\"],\n}) as HostComponent<NativeProps>;\n"],"mappings":";;;;;;AAAA,IAAAA,uBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA6F,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,IAAAG,QAAA,GAAAC,OAAA,CAAAF,OAAA,GAY9E,IAAAG,+BAAsB,EAAc,qBAAqB,EAAE;EACxEC,iBAAiB,EAAE,CAAC,KAAK;AAC3B,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_codegenNativeComponent","_interopRequireDefault","require","e","__esModule","default","_default","exports","codegenNativeComponent","excludedPlatforms"],"sources":["KeyboardGestureAreaNativeComponent.ts"],"sourcesContent":["import codegenNativeComponent from \"react-native/Libraries/Utilities/codegenNativeComponent\";\n\nimport type { HostComponent } from \"react-native\";\nimport type { ViewProps } from \"react-native/Libraries/Components/View/ViewPropTypes\";\nimport type {\n Double,\n WithDefault,\n} from \"react-native/Libraries/Types/CodegenTypes\";\n\nexport interface NativeProps extends ViewProps {\n interpolator?: WithDefault<\"linear\" | \"ios\", \"linear\">;\n showOnSwipeUp?: boolean;\n enableSwipeToDismiss?: boolean;\n offset?: Double;\n}\n\nexport default codegenNativeComponent<NativeProps>(\"KeyboardGestureArea\", {\n excludedPlatforms: [\"iOS\"],\n}) as HostComponent<NativeProps>;\n"],"mappings":";;;;;;AAAA,IAAAA,uBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA6F,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,IAAAG,QAAA,GAAAC,OAAA,CAAAF,OAAA,GAgB9E,IAAAG,+BAAsB,EAAc,qBAAqB,EAAE;EACxEC,iBAAiB,EAAE,CAAC,KAAK;AAC3B,CAAC,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type {\n EmitterSubscription,\n NativeSyntheticEvent,\n ViewProps,\n} from \"react-native\";\n\n// DirectEventHandler events declaration\nexport type NativeEvent = {\n progress: number;\n height: number;\n duration: number;\n target: number;\n};\nexport type FocusedInputLayoutChangedEvent = {\n target: number;\n parentScrollViewTarget: number;\n layout: {\n x: number;\n y: number;\n width: number;\n height: number;\n absoluteX: number;\n absoluteY: number;\n };\n};\nexport type FocusedInputTextChangedEvent = {\n text: string;\n};\nexport type FocusedInputSelectionChangedEvent = {\n target: number;\n selection: {\n start: {\n x: number;\n y: number;\n position: number;\n };\n end: {\n x: number;\n y: number;\n position: number;\n };\n };\n};\nexport type EventWithName<T> = {\n eventName: string;\n} & T;\n\n// native View/Module declarations\nexport type KeyboardControllerProps = {\n // callback props\n onKeyboardMoveStart?: (\n e: NativeSyntheticEvent<EventWithName<NativeEvent>>,\n ) => void;\n onKeyboardMove?: (\n e: NativeSyntheticEvent<EventWithName<NativeEvent>>,\n ) => void;\n onKeyboardMoveEnd?: (\n e: NativeSyntheticEvent<EventWithName<NativeEvent>>,\n ) => void;\n onKeyboardMoveInteractive?: (\n e: NativeSyntheticEvent<EventWithName<NativeEvent>>,\n ) => void;\n onFocusedInputLayoutChanged?: (\n e: NativeSyntheticEvent<EventWithName<FocusedInputLayoutChangedEvent>>,\n ) => void;\n onFocusedInputTextChanged?: (\n e: NativeSyntheticEvent<EventWithName<FocusedInputTextChangedEvent>>,\n ) => void;\n onFocusedInputSelectionChanged?: (\n e: NativeSyntheticEvent<EventWithName<FocusedInputSelectionChangedEvent>>,\n ) => void;\n // fake props used to activate reanimated bindings\n onKeyboardMoveReanimated?: (\n e: NativeSyntheticEvent<EventWithName<NativeEvent>>,\n ) => void;\n onFocusedInputLayoutChangedReanimated?: (\n e: NativeSyntheticEvent<EventWithName<FocusedInputLayoutChangedEvent>>,\n ) => void;\n onFocusedInputTextChangedReanimated?: (\n e: NativeSyntheticEvent<EventWithName<FocusedInputTextChangedEvent>>,\n ) => void;\n onFocusedInputSelectionChangedReanimated?: (\n e: NativeSyntheticEvent<EventWithName<FocusedInputSelectionChangedEvent>>,\n ) => void;\n // props\n statusBarTranslucent?: boolean;\n navigationBarTranslucent?: boolean;\n enabled?: boolean;\n} & ViewProps;\n\nexport type KeyboardGestureAreaProps = {\n interpolator: \"ios\" | \"linear\";\n /**\n * Whether to allow to show a keyboard from dismissed state by swipe up.\n * Default to `false`.\n */\n showOnSwipeUp?: boolean;\n /**\n * Whether to allow to control a keyboard by gestures. The strategy how\n * it should be controlled is determined by `interpolator` property.\n * Defaults to `true`.\n */\n enableSwipeToDismiss?: boolean;\n} & ViewProps;\n\nexport type Direction = \"next\" | \"prev\" | \"current\";\nexport type KeyboardControllerModule = {\n // android only\n setDefaultMode: () => void;\n setInputMode: (mode: number) => void;\n // all platforms\n dismiss: () => void;\n setFocusTo: (direction: Direction) => void;\n // native event module stuff\n addListener: (eventName: string) => void;\n removeListeners: (count: number) => void;\n};\n\n// Event module declarations\nexport type KeyboardControllerEvents =\n | \"keyboardWillShow\"\n | \"keyboardDidShow\"\n | \"keyboardWillHide\"\n | \"keyboardDidHide\";\nexport type KeyboardEventData = {\n height: number;\n duration: number;\n timestamp: number;\n target: number;\n};\nexport type KeyboardEventsModule = {\n addListener: (\n name: KeyboardControllerEvents,\n cb: (e: KeyboardEventData) => void,\n ) => EmitterSubscription;\n};\nexport type FocusedInputAvailableEvents = \"focusDidSet\";\nexport type FocusedInputEventData = {\n current: number;\n count: number;\n};\nexport type FocusedInputEventsModule = {\n addListener: (\n name: FocusedInputAvailableEvents,\n cb: (e: FocusedInputEventData) => void,\n ) => EmitterSubscription;\n};\nexport type WindowDimensionsAvailableEvents = \"windowDidResize\";\nexport type WindowDimensionsEventData = {\n width: number;\n height: number;\n};\nexport type WindowDimensionsEventsModule = {\n addListener: (\n name: WindowDimensionsAvailableEvents,\n cb: (e: WindowDimensionsEventData) => void,\n ) => EmitterSubscription;\n};\n\n// reanimated hook declaration\nexport type KeyboardHandlerHook<TContext, Event> = (\n handlers: {\n onKeyboardMoveStart?: (e: NativeEvent, context: TContext) => void;\n onKeyboardMove?: (e: NativeEvent, context: TContext) => void;\n onKeyboardMoveEnd?: (e: NativeEvent, context: TContext) => void;\n onKeyboardMoveInteractive?: (e: NativeEvent, context: TContext) => void;\n },\n dependencies?: unknown[],\n) => (e: NativeSyntheticEvent<Event>) => void;\nexport type FocusedInputLayoutHandlerHook<TContext, Event> = (\n handlers: {\n onFocusedInputLayoutChanged?: (\n e: FocusedInputLayoutChangedEvent,\n context: TContext,\n ) => void;\n },\n dependencies?: unknown[],\n) => (e: NativeSyntheticEvent<Event>) => void;\nexport type FocusedInputTextHandlerHook<TContext, Event> = (\n handlers: {\n onFocusedInputTextChanged?: (\n e: FocusedInputTextChangedEvent,\n context: TContext,\n ) => void;\n },\n dependencies?: unknown[],\n) => (e: NativeSyntheticEvent<Event>) => void;\nexport type FocusedInputSelectionHandlerHook<TContext, Event> = (\n handlers: {\n onFocusedInputSelectionChanged?: (\n e: FocusedInputSelectionChangedEvent,\n context: TContext,\n ) => void;\n },\n dependencies?: unknown[],\n) => (e: NativeSyntheticEvent<Event>) => void;\n\n// package types\nexport type Handlers<T> = Record<string, T | undefined>;\nexport type KeyboardHandler = Partial<{\n onStart: (e: NativeEvent) => void;\n onMove: (e: NativeEvent) => void;\n onEnd: (e: NativeEvent) => void;\n onInteractive: (e: NativeEvent) => void;\n}>;\nexport type KeyboardHandlers = Handlers<KeyboardHandler>;\nexport type FocusedInputHandler = Partial<{\n onChangeText: (e: FocusedInputTextChangedEvent) => void;\n onSelectionChange: (e: FocusedInputSelectionChangedEvent) => void;\n}>;\nexport type FocusedInputHandlers = Handlers<FocusedInputHandler>;\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type {\n EmitterSubscription,\n NativeSyntheticEvent,\n ViewProps,\n} from \"react-native\";\n\n// DirectEventHandler events declaration\nexport type NativeEvent = {\n progress: number;\n height: number;\n duration: number;\n target: number;\n};\nexport type FocusedInputLayoutChangedEvent = {\n target: number;\n parentScrollViewTarget: number;\n layout: {\n x: number;\n y: number;\n width: number;\n height: number;\n absoluteX: number;\n absoluteY: number;\n };\n};\nexport type FocusedInputTextChangedEvent = {\n text: string;\n};\nexport type FocusedInputSelectionChangedEvent = {\n target: number;\n selection: {\n start: {\n x: number;\n y: number;\n position: number;\n };\n end: {\n x: number;\n y: number;\n position: number;\n };\n };\n};\nexport type EventWithName<T> = {\n eventName: string;\n} & T;\n\n// native View/Module declarations\nexport type KeyboardControllerProps = {\n //ref prop\n ref?: React.Ref<React.Component<KeyboardControllerProps>>;\n // callback props\n onKeyboardMoveStart?: (\n e: NativeSyntheticEvent<EventWithName<NativeEvent>>,\n ) => void;\n onKeyboardMove?: (\n e: NativeSyntheticEvent<EventWithName<NativeEvent>>,\n ) => void;\n onKeyboardMoveEnd?: (\n e: NativeSyntheticEvent<EventWithName<NativeEvent>>,\n ) => void;\n onKeyboardMoveInteractive?: (\n e: NativeSyntheticEvent<EventWithName<NativeEvent>>,\n ) => void;\n onFocusedInputLayoutChanged?: (\n e: NativeSyntheticEvent<EventWithName<FocusedInputLayoutChangedEvent>>,\n ) => void;\n onFocusedInputTextChanged?: (\n e: NativeSyntheticEvent<EventWithName<FocusedInputTextChangedEvent>>,\n ) => void;\n onFocusedInputSelectionChanged?: (\n e: NativeSyntheticEvent<EventWithName<FocusedInputSelectionChangedEvent>>,\n ) => void;\n // fake props used to activate reanimated bindings\n onKeyboardMoveReanimated?: (\n e: NativeSyntheticEvent<EventWithName<NativeEvent>>,\n ) => void;\n onFocusedInputLayoutChangedReanimated?: (\n e: NativeSyntheticEvent<EventWithName<FocusedInputLayoutChangedEvent>>,\n ) => void;\n onFocusedInputTextChangedReanimated?: (\n e: NativeSyntheticEvent<EventWithName<FocusedInputTextChangedEvent>>,\n ) => void;\n onFocusedInputSelectionChangedReanimated?: (\n e: NativeSyntheticEvent<EventWithName<FocusedInputSelectionChangedEvent>>,\n ) => void;\n // props\n statusBarTranslucent?: boolean;\n navigationBarTranslucent?: boolean;\n enabled?: boolean;\n} & ViewProps;\n\nexport type KeyboardGestureAreaProps = {\n interpolator: \"ios\" | \"linear\";\n /**\n * Whether to allow to show a keyboard from dismissed state by swipe up.\n * Default to `false`.\n */\n showOnSwipeUp?: boolean;\n /**\n * Whether to allow to control a keyboard by gestures. The strategy how\n * it should be controlled is determined by `interpolator` property.\n * Defaults to `true`.\n */\n enableSwipeToDismiss?: boolean;\n /**\n * Extra distance to the keyboard.\n */\n offset?: number;\n} & ViewProps;\n\nexport type Direction = \"next\" | \"prev\" | \"current\";\nexport type KeyboardControllerModule = {\n // android only\n setDefaultMode: () => void;\n setInputMode: (mode: number) => void;\n // all platforms\n dismiss: () => void;\n setFocusTo: (direction: Direction) => void;\n // native event module stuff\n addListener: (eventName: string) => void;\n removeListeners: (count: number) => void;\n};\n\n// Event module declarations\nexport type KeyboardControllerEvents =\n | \"keyboardWillShow\"\n | \"keyboardDidShow\"\n | \"keyboardWillHide\"\n | \"keyboardDidHide\";\nexport type KeyboardEventData = {\n height: number;\n duration: number;\n timestamp: number;\n target: number;\n};\nexport type KeyboardEventsModule = {\n addListener: (\n name: KeyboardControllerEvents,\n cb: (e: KeyboardEventData) => void,\n ) => EmitterSubscription;\n};\nexport type FocusedInputAvailableEvents = \"focusDidSet\";\nexport type FocusedInputEventData = {\n current: number;\n count: number;\n};\nexport type FocusedInputEventsModule = {\n addListener: (\n name: FocusedInputAvailableEvents,\n cb: (e: FocusedInputEventData) => void,\n ) => EmitterSubscription;\n};\nexport type WindowDimensionsAvailableEvents = \"windowDidResize\";\nexport type WindowDimensionsEventData = {\n width: number;\n height: number;\n};\nexport type WindowDimensionsEventsModule = {\n addListener: (\n name: WindowDimensionsAvailableEvents,\n cb: (e: WindowDimensionsEventData) => void,\n ) => EmitterSubscription;\n};\n\n// reanimated hook declaration\nexport type KeyboardHandlerHook<TContext, Event> = (\n handlers: {\n onKeyboardMoveStart?: (e: NativeEvent, context: TContext) => void;\n onKeyboardMove?: (e: NativeEvent, context: TContext) => void;\n onKeyboardMoveEnd?: (e: NativeEvent, context: TContext) => void;\n onKeyboardMoveInteractive?: (e: NativeEvent, context: TContext) => void;\n },\n dependencies?: unknown[],\n) => (e: NativeSyntheticEvent<Event>) => void;\nexport type FocusedInputLayoutHandlerHook<TContext, Event> = (\n handlers: {\n onFocusedInputLayoutChanged?: (\n e: FocusedInputLayoutChangedEvent,\n context: TContext,\n ) => void;\n },\n dependencies?: unknown[],\n) => (e: NativeSyntheticEvent<Event>) => void;\nexport type FocusedInputTextHandlerHook<TContext, Event> = (\n handlers: {\n onFocusedInputTextChanged?: (\n e: FocusedInputTextChangedEvent,\n context: TContext,\n ) => void;\n },\n dependencies?: unknown[],\n) => (e: NativeSyntheticEvent<Event>) => void;\nexport type FocusedInputSelectionHandlerHook<TContext, Event> = (\n handlers: {\n onFocusedInputSelectionChanged?: (\n e: FocusedInputSelectionChangedEvent,\n context: TContext,\n ) => void;\n },\n dependencies?: unknown[],\n) => (e: NativeSyntheticEvent<Event>) => void;\n\n// package types\nexport type Handlers<T> = Record<string, T | undefined>;\nexport type KeyboardHandler = Partial<{\n onStart: (e: NativeEvent) => void;\n onMove: (e: NativeEvent) => void;\n onEnd: (e: NativeEvent) => void;\n onInteractive: (e: NativeEvent) => void;\n}>;\nexport type KeyboardHandlers = Handlers<KeyboardHandler>;\nexport type FocusedInputHandler = Partial<{\n onChangeText: (e: FocusedInputTextChangedEvent) => void;\n onSelectionChange: (e: FocusedInputSelectionChangedEvent) => void;\n}>;\nexport type FocusedInputHandlers = Handlers<FocusedInputHandler>;\n"],"mappings":"","ignoreList":[]}