react-native-keyboard-controller 1.21.13 → 1.22.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.
- package/android/src/fabric/java/com/reactnativekeyboardcontroller/KeyboardControllerModule.kt +4 -0
- package/android/src/main/java/com/reactnativekeyboardcontroller/interactive/KeyboardAnimationController.kt +6 -0
- package/android/src/main/java/com/reactnativekeyboardcontroller/modules/KeyboardControllerModuleImpl.kt +5 -0
- package/android/src/main/java/com/reactnativekeyboardcontroller/views/ClippingScrollViewDecoratorView.kt +12 -7
- package/android/src/paper/java/com/reactnativekeyboardcontroller/KeyboardControllerModule.kt +5 -0
- package/ios/KeyboardBackdropController.swift +64 -0
- package/ios/KeyboardControllerModule.mm +11 -0
- package/ios/KeyboardControllerModuleImpl.swift +5 -0
- package/ios/extensions/UIWindow.swift +5 -1
- package/jest/index.js +1 -0
- package/lib/commonjs/bindings.js +1 -0
- package/lib/commonjs/bindings.js.map +1 -1
- package/lib/commonjs/components/KeyboardChatScrollView/index.js +6 -0
- package/lib/commonjs/components/KeyboardChatScrollView/index.js.map +1 -1
- package/lib/commonjs/components/KeyboardChatScrollView/useFrozenPadding/index.js +62 -0
- package/lib/commonjs/components/KeyboardChatScrollView/useFrozenPadding/index.js.map +1 -0
- package/lib/commonjs/components/KeyboardEffects/index.js +92 -0
- package/lib/commonjs/components/KeyboardEffects/index.js.map +1 -0
- package/lib/commonjs/components/KeyboardToolbar/constants.js +2 -3
- package/lib/commonjs/components/KeyboardToolbar/constants.js.map +1 -1
- package/lib/commonjs/components/KeyboardToolbar/index.js +8 -7
- package/lib/commonjs/components/KeyboardToolbar/index.js.map +1 -1
- package/lib/commonjs/components/index.js +7 -0
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/constants.js +2 -1
- package/lib/commonjs/constants.js.map +1 -1
- package/lib/commonjs/index.js +7 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/module.js +1 -0
- package/lib/commonjs/module.js.map +1 -1
- package/lib/commonjs/specs/NativeKeyboardController.js.map +1 -1
- package/lib/commonjs/types/module.js.map +1 -1
- package/lib/module/bindings.js +1 -0
- package/lib/module/bindings.js.map +1 -1
- package/lib/module/components/KeyboardChatScrollView/index.js +6 -0
- package/lib/module/components/KeyboardChatScrollView/index.js.map +1 -1
- package/lib/module/components/KeyboardChatScrollView/useFrozenPadding/index.js +57 -0
- package/lib/module/components/KeyboardChatScrollView/useFrozenPadding/index.js.map +1 -0
- package/lib/module/components/KeyboardEffects/index.js +84 -0
- package/lib/module/components/KeyboardEffects/index.js.map +1 -0
- package/lib/module/components/KeyboardToolbar/constants.js +1 -2
- package/lib/module/components/KeyboardToolbar/constants.js.map +1 -1
- package/lib/module/components/KeyboardToolbar/index.js +2 -1
- package/lib/module/components/KeyboardToolbar/index.js.map +1 -1
- package/lib/module/components/index.js +1 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/constants.js +1 -0
- package/lib/module/constants.js.map +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/module.js +1 -0
- package/lib/module/module.js.map +1 -1
- package/lib/module/specs/NativeKeyboardController.js.map +1 -1
- package/lib/module/types/module.js.map +1 -1
- package/lib/typescript/components/KeyboardChatScrollView/useFrozenPadding/index.d.ts +30 -0
- package/lib/typescript/components/KeyboardEffects/index.d.ts +44 -0
- package/lib/typescript/components/KeyboardToolbar/constants.d.ts +0 -1
- package/lib/typescript/components/index.d.ts +2 -0
- package/lib/typescript/constants.d.ts +1 -0
- package/lib/typescript/index.d.ts +2 -2
- package/lib/typescript/specs/NativeKeyboardController.d.ts +1 -0
- package/lib/typescript/types/module.d.ts +7 -0
- package/package.json +1 -1
- package/src/bindings.ts +1 -0
- package/src/components/KeyboardChatScrollView/index.tsx +7 -0
- package/src/components/KeyboardChatScrollView/useFrozenPadding/index.ts +83 -0
- package/src/components/KeyboardEffects/index.tsx +121 -0
- package/src/components/KeyboardToolbar/constants.ts +1 -2
- package/src/components/KeyboardToolbar/index.tsx +1 -1
- package/src/components/index.ts +2 -0
- package/src/constants.ts +1 -0
- package/src/index.ts +2 -0
- package/src/module.ts +1 -0
- package/src/specs/NativeKeyboardController.ts +1 -0
- package/src/types/module.ts +7 -0
|
@@ -13,6 +13,7 @@ exports.default = void 0;
|
|
|
13
13
|
var _react = _interopRequireWildcard(require("react"));
|
|
14
14
|
var _reactNative = require("react-native");
|
|
15
15
|
var _bindings = require("../../bindings");
|
|
16
|
+
var _constants = require("../../constants");
|
|
16
17
|
var _hooks = require("../../hooks");
|
|
17
18
|
var _KeyboardStickyView = _interopRequireDefault(require("../KeyboardStickyView"));
|
|
18
19
|
var _Arrow = _interopRequireDefault(require("./Arrow"));
|
|
@@ -20,7 +21,7 @@ var _Button = _interopRequireDefault(require("./Button"));
|
|
|
20
21
|
var _colors = require("./colors");
|
|
21
22
|
var _components = require("./compound/components");
|
|
22
23
|
var _context = require("./compound/context");
|
|
23
|
-
var
|
|
24
|
+
var _constants2 = require("./constants");
|
|
24
25
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
25
26
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
26
27
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
@@ -51,7 +52,7 @@ const KeyboardToolbar = props => {
|
|
|
51
52
|
onPrevCallback,
|
|
52
53
|
onDoneCallback,
|
|
53
54
|
blur = null,
|
|
54
|
-
opacity =
|
|
55
|
+
opacity = _constants2.DEFAULT_OPACITY,
|
|
55
56
|
offset: {
|
|
56
57
|
closed = 0,
|
|
57
58
|
opened = 0
|
|
@@ -88,8 +89,8 @@ const KeyboardToolbar = props => {
|
|
|
88
89
|
right: ((insets === null || insets === void 0 ? void 0 : insets.right) ?? 0) + 16
|
|
89
90
|
} : null], [insets]);
|
|
90
91
|
const offset = (0, _react.useMemo)(() => ({
|
|
91
|
-
closed: closed +
|
|
92
|
-
opened: opened +
|
|
92
|
+
closed: closed + _constants2.KEYBOARD_TOOLBAR_HEIGHT,
|
|
93
|
+
opened: opened + _constants2.OPENED_OFFSET
|
|
93
94
|
}), [closed, opened]);
|
|
94
95
|
let backgroundElement = null;
|
|
95
96
|
let arrowsElement = null;
|
|
@@ -157,7 +158,7 @@ const KeyboardToolbar = props => {
|
|
|
157
158
|
style: containerStyle
|
|
158
159
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, _extends({}, rest, {
|
|
159
160
|
style: toolbarStyle,
|
|
160
|
-
testID:
|
|
161
|
+
testID: _constants2.TEST_ID_KEYBOARD_TOOLBAR
|
|
161
162
|
}), backgroundElement, arrowsElement, contentContainer, doneElement)));
|
|
162
163
|
};
|
|
163
164
|
const styles = _reactNative.StyleSheet.create({
|
|
@@ -166,7 +167,7 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
166
167
|
left: 0,
|
|
167
168
|
right: 0,
|
|
168
169
|
bottom: 0,
|
|
169
|
-
height:
|
|
170
|
+
height: _constants2.KEYBOARD_TOOLBAR_HEIGHT
|
|
170
171
|
},
|
|
171
172
|
toolbar: {
|
|
172
173
|
position: "absolute",
|
|
@@ -174,7 +175,7 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
174
175
|
alignItems: "center",
|
|
175
176
|
width: "100%",
|
|
176
177
|
flexDirection: "row",
|
|
177
|
-
height:
|
|
178
|
+
height: _constants2.KEYBOARD_TOOLBAR_HEIGHT
|
|
178
179
|
},
|
|
179
180
|
arrows: {
|
|
180
181
|
flexDirection: "row",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_bindings","_hooks","_KeyboardStickyView","_interopRequireDefault","_Arrow","_Button","_colors","_components","_context","_constants","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_extends","assign","bind","arguments","length","apply","KeyboardToolbar","props","children","content","theme","colors","doneText","button","icon","showArrows","onNextCallback","onPrevCallback","onDoneCallback","blur","opacity","DEFAULT_OPACITY","offset","closed","opened","enabled","insets","rest","colorScheme","useKeyboardState","state","appearance","inputs","setInputs","useState","current","count","isPrevDisabled","isNextDisabled","buttonContainer","Button","iconContainer","Arrow","useEffect","subscription","FocusedInputEvents","addListener","remove","toolbarStyle","useMemo","styles","toolbar","backgroundColor","background","KEYBOARD_HAS_ROUNDED_CORNERS","paddingLeft","left","paddingRight","right","floating","containerStyle","sticky","KEYBOARD_TOOLBAR_HEIGHT","OPENED_OFFSET","backgroundElement","arrowsElement","contentContainer","doneElement","prevChild","nextChild","contentChild","doneChild","backgroundChild","React","Children","forEach","child","isValidElement","type","Background","Content","Prev","Next","Done","createElement","View","style","arrows","onPress","text","contextValue","ToolbarContext","Provider","value","testID","TEST_ID_KEYBOARD_TOOLBAR","StyleSheet","create","position","bottom","height","alignItems","width","flexDirection","alignSelf","borderRadius","overflow","Group","RCTKeyboardToolbarGroupView","_default","exports"],"sources":["index.tsx"],"sourcesContent":["import React, { useEffect, useMemo, useState } from \"react\";\nimport { StyleSheet, View } from \"react-native\";\n\nimport {\n FocusedInputEvents,\n RCTKeyboardToolbarGroupView,\n} from \"../../bindings\";\nimport { useKeyboardState } from \"../../hooks\";\nimport KeyboardStickyView from \"../KeyboardStickyView\";\n\nimport Arrow from \"./Arrow\";\nimport Button from \"./Button\";\nimport { colors } from \"./colors\";\nimport { Background, Content, Done, Next, Prev } from \"./compound/components\";\nimport { ToolbarContext } from \"./compound/context\";\nimport {\n DEFAULT_OPACITY,\n KEYBOARD_HAS_ROUNDED_CORNERS,\n KEYBOARD_TOOLBAR_HEIGHT,\n OPENED_OFFSET,\n TEST_ID_KEYBOARD_TOOLBAR,\n} from \"./constants\";\n\nimport type { KeyboardToolbarProps } from \"./types\";\nimport type { ReactNode } from \"react\";\n\n/**\n * `KeyboardToolbar` is a component that is shown above the keyboard with `Prev`/`Next` buttons from left and\n * `Done` button from the right (to dismiss the keyboard). Allows to add customizable content (yours UI elements) in the middle.\n *\n * @param props - Component props.\n * @returns A component that is shown above the keyboard with `Prev`/`Next` and `Done` buttons.\n * @see {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/components/keyboard-toolbar|Documentation} page for more details.\n * @example\n * ```tsx\n * <KeyboardToolbar>\n * <KeyboardToolbar.Done text=\"Close\" />\n * </KeyboardToolbar>\n * ```\n */\nconst KeyboardToolbar: React.FC<KeyboardToolbarProps> & {\n Background: typeof Background;\n Content: typeof Content;\n Prev: typeof Prev;\n Next: typeof Next;\n Done: typeof Done;\n Group: typeof RCTKeyboardToolbarGroupView;\n} = (props) => {\n const {\n children,\n content,\n theme = colors,\n doneText = \"Done\",\n button,\n icon,\n showArrows = true,\n onNextCallback,\n onPrevCallback,\n onDoneCallback,\n blur = null,\n opacity = DEFAULT_OPACITY,\n offset: { closed = 0, opened = 0 } = {},\n enabled = true,\n insets,\n ...rest\n } = props;\n const colorScheme = useKeyboardState((state) => state.appearance);\n const [inputs, setInputs] = useState({\n current: 0,\n count: 0,\n });\n const isPrevDisabled = inputs.current === 0;\n const isNextDisabled = inputs.current === inputs.count - 1;\n const buttonContainer = button ?? Button;\n const iconContainer = icon ?? Arrow;\n\n useEffect(() => {\n const subscription = FocusedInputEvents.addListener(\"focusDidSet\", (e) => {\n setInputs(e);\n });\n\n return subscription.remove;\n }, []);\n const toolbarStyle = useMemo(\n () => [\n styles.toolbar,\n {\n backgroundColor: `${theme[colorScheme].background}${opacity}`,\n },\n !KEYBOARD_HAS_ROUNDED_CORNERS\n ? {\n paddingLeft: insets?.left,\n paddingRight: insets?.right,\n }\n : null,\n KEYBOARD_HAS_ROUNDED_CORNERS ? styles.floating : null,\n ],\n [colorScheme, opacity, theme, insets],\n );\n const containerStyle = useMemo(\n () => [\n // CRUCIAL: gives the native view real bounds\n styles.sticky,\n KEYBOARD_HAS_ROUNDED_CORNERS\n ? ({\n left: (insets?.left ?? 0) + 16,\n right: (insets?.right ?? 0) + 16,\n } as const)\n : null,\n ],\n [insets],\n );\n const offset = useMemo(\n () => ({\n closed: closed + KEYBOARD_TOOLBAR_HEIGHT,\n opened: opened + OPENED_OFFSET,\n }),\n [closed, opened],\n );\n\n let backgroundElement: ReactNode = null;\n let arrowsElement: ReactNode = null;\n let contentContainer: ReactNode = null;\n let doneElement: ReactNode = null;\n\n if (children) {\n let prevChild: ReactNode = null;\n let nextChild: ReactNode = null;\n let contentChild: ReactNode = null;\n let doneChild: ReactNode = null;\n let backgroundChild: ReactNode = null;\n\n React.Children.forEach(children, (child) => {\n if (!React.isValidElement(child)) {\n return;\n }\n const type = child.type;\n\n if (type === Background) {\n backgroundChild = child;\n } else if (type === Content) {\n contentChild = child;\n } else if (type === Prev) {\n prevChild = child;\n } else if (type === Next) {\n nextChild = child;\n } else if (type === Done) {\n doneChild = child;\n }\n });\n\n backgroundElement = backgroundChild;\n doneElement = doneChild;\n arrowsElement =\n prevChild || nextChild ? (\n <View style={styles.arrows}>\n {prevChild}\n {nextChild}\n </View>\n ) : null;\n contentContainer = contentChild ?? <Content>{contentChild}</Content>;\n } else {\n backgroundElement = blur;\n arrowsElement = showArrows ? (\n <View style={styles.arrows}>\n <Prev\n button={buttonContainer}\n icon={iconContainer}\n onPress={onPrevCallback}\n />\n <Next\n button={buttonContainer}\n icon={iconContainer}\n onPress={onNextCallback}\n />\n </View>\n ) : null;\n contentContainer = <Content>{content}</Content>;\n doneElement = doneText ? (\n <Done button={buttonContainer} text={doneText} onPress={onDoneCallback} />\n ) : null;\n }\n\n const contextValue = useMemo(\n () => ({\n theme,\n isPrevDisabled,\n isNextDisabled,\n }),\n [theme, isPrevDisabled, isNextDisabled],\n );\n\n return (\n <ToolbarContext.Provider value={contextValue}>\n <KeyboardStickyView\n enabled={enabled}\n offset={offset}\n style={containerStyle}\n >\n <View {...rest} style={toolbarStyle} testID={TEST_ID_KEYBOARD_TOOLBAR}>\n {backgroundElement}\n {arrowsElement}\n {contentContainer}\n {doneElement}\n </View>\n </KeyboardStickyView>\n </ToolbarContext.Provider>\n );\n};\n\nconst styles = StyleSheet.create({\n sticky: {\n position: \"absolute\",\n left: 0,\n right: 0,\n bottom: 0,\n height: KEYBOARD_TOOLBAR_HEIGHT,\n },\n toolbar: {\n position: \"absolute\",\n bottom: 0,\n alignItems: \"center\",\n width: \"100%\",\n flexDirection: \"row\",\n height: KEYBOARD_TOOLBAR_HEIGHT,\n },\n arrows: {\n flexDirection: \"row\",\n paddingLeft: 8,\n },\n floating: {\n alignSelf: \"center\",\n borderRadius: 20,\n overflow: \"hidden\",\n },\n});\n\nKeyboardToolbar.Background = Background;\nKeyboardToolbar.Content = Content;\nKeyboardToolbar.Prev = Prev;\nKeyboardToolbar.Next = Next;\nKeyboardToolbar.Done = Done;\nKeyboardToolbar.Group = RCTKeyboardToolbarGroupView;\n\nexport { colors as DefaultKeyboardToolbarTheme, KeyboardToolbarProps };\nexport default KeyboardToolbar;\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,SAAA,GAAAF,OAAA;AAIA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,mBAAA,GAAAC,sBAAA,CAAAL,OAAA;AAEA,IAAAM,MAAA,GAAAD,sBAAA,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C2E,IAAI,GAAGA,gBAAI;AAC3B3E,eAAe,CAAC4E,IAAI,GAAGA,gBAAI;AAC3B5E,eAAe,CAAC6E,IAAI,GAAGA,gBAAI;AAC3B7E,eAAe,CAACqG,KAAK,GAAGC,qCAA2B;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAA/H,OAAA,GAGrCuB,eAAe","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_bindings","_constants","_hooks","_KeyboardStickyView","_interopRequireDefault","_Arrow","_Button","_colors","_components","_context","_constants2","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_extends","assign","bind","arguments","length","apply","KeyboardToolbar","props","children","content","theme","colors","doneText","button","icon","showArrows","onNextCallback","onPrevCallback","onDoneCallback","blur","opacity","DEFAULT_OPACITY","offset","closed","opened","enabled","insets","rest","colorScheme","useKeyboardState","state","appearance","inputs","setInputs","useState","current","count","isPrevDisabled","isNextDisabled","buttonContainer","Button","iconContainer","Arrow","useEffect","subscription","FocusedInputEvents","addListener","remove","toolbarStyle","useMemo","styles","toolbar","backgroundColor","background","KEYBOARD_HAS_ROUNDED_CORNERS","paddingLeft","left","paddingRight","right","floating","containerStyle","sticky","KEYBOARD_TOOLBAR_HEIGHT","OPENED_OFFSET","backgroundElement","arrowsElement","contentContainer","doneElement","prevChild","nextChild","contentChild","doneChild","backgroundChild","React","Children","forEach","child","isValidElement","type","Background","Content","Prev","Next","Done","createElement","View","style","arrows","onPress","text","contextValue","ToolbarContext","Provider","value","testID","TEST_ID_KEYBOARD_TOOLBAR","StyleSheet","create","position","bottom","height","alignItems","width","flexDirection","alignSelf","borderRadius","overflow","Group","RCTKeyboardToolbarGroupView","_default","exports"],"sources":["index.tsx"],"sourcesContent":["import React, { useEffect, useMemo, useState } from \"react\";\nimport { StyleSheet, View } from \"react-native\";\n\nimport {\n FocusedInputEvents,\n RCTKeyboardToolbarGroupView,\n} from \"../../bindings\";\nimport { KEYBOARD_HAS_ROUNDED_CORNERS } from \"../../constants\";\nimport { useKeyboardState } from \"../../hooks\";\nimport KeyboardStickyView from \"../KeyboardStickyView\";\n\nimport Arrow from \"./Arrow\";\nimport Button from \"./Button\";\nimport { colors } from \"./colors\";\nimport { Background, Content, Done, Next, Prev } from \"./compound/components\";\nimport { ToolbarContext } from \"./compound/context\";\nimport {\n DEFAULT_OPACITY,\n KEYBOARD_TOOLBAR_HEIGHT,\n OPENED_OFFSET,\n TEST_ID_KEYBOARD_TOOLBAR,\n} from \"./constants\";\n\nimport type { KeyboardToolbarProps } from \"./types\";\nimport type { ReactNode } from \"react\";\n\n/**\n * `KeyboardToolbar` is a component that is shown above the keyboard with `Prev`/`Next` buttons from left and\n * `Done` button from the right (to dismiss the keyboard). Allows to add customizable content (yours UI elements) in the middle.\n *\n * @param props - Component props.\n * @returns A component that is shown above the keyboard with `Prev`/`Next` and `Done` buttons.\n * @see {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/components/keyboard-toolbar|Documentation} page for more details.\n * @example\n * ```tsx\n * <KeyboardToolbar>\n * <KeyboardToolbar.Done text=\"Close\" />\n * </KeyboardToolbar>\n * ```\n */\nconst KeyboardToolbar: React.FC<KeyboardToolbarProps> & {\n Background: typeof Background;\n Content: typeof Content;\n Prev: typeof Prev;\n Next: typeof Next;\n Done: typeof Done;\n Group: typeof RCTKeyboardToolbarGroupView;\n} = (props) => {\n const {\n children,\n content,\n theme = colors,\n doneText = \"Done\",\n button,\n icon,\n showArrows = true,\n onNextCallback,\n onPrevCallback,\n onDoneCallback,\n blur = null,\n opacity = DEFAULT_OPACITY,\n offset: { closed = 0, opened = 0 } = {},\n enabled = true,\n insets,\n ...rest\n } = props;\n const colorScheme = useKeyboardState((state) => state.appearance);\n const [inputs, setInputs] = useState({\n current: 0,\n count: 0,\n });\n const isPrevDisabled = inputs.current === 0;\n const isNextDisabled = inputs.current === inputs.count - 1;\n const buttonContainer = button ?? Button;\n const iconContainer = icon ?? Arrow;\n\n useEffect(() => {\n const subscription = FocusedInputEvents.addListener(\"focusDidSet\", (e) => {\n setInputs(e);\n });\n\n return subscription.remove;\n }, []);\n const toolbarStyle = useMemo(\n () => [\n styles.toolbar,\n {\n backgroundColor: `${theme[colorScheme].background}${opacity}`,\n },\n !KEYBOARD_HAS_ROUNDED_CORNERS\n ? {\n paddingLeft: insets?.left,\n paddingRight: insets?.right,\n }\n : null,\n KEYBOARD_HAS_ROUNDED_CORNERS ? styles.floating : null,\n ],\n [colorScheme, opacity, theme, insets],\n );\n const containerStyle = useMemo(\n () => [\n // CRUCIAL: gives the native view real bounds\n styles.sticky,\n KEYBOARD_HAS_ROUNDED_CORNERS\n ? ({\n left: (insets?.left ?? 0) + 16,\n right: (insets?.right ?? 0) + 16,\n } as const)\n : null,\n ],\n [insets],\n );\n const offset = useMemo(\n () => ({\n closed: closed + KEYBOARD_TOOLBAR_HEIGHT,\n opened: opened + OPENED_OFFSET,\n }),\n [closed, opened],\n );\n\n let backgroundElement: ReactNode = null;\n let arrowsElement: ReactNode = null;\n let contentContainer: ReactNode = null;\n let doneElement: ReactNode = null;\n\n if (children) {\n let prevChild: ReactNode = null;\n let nextChild: ReactNode = null;\n let contentChild: ReactNode = null;\n let doneChild: ReactNode = null;\n let backgroundChild: ReactNode = null;\n\n React.Children.forEach(children, (child) => {\n if (!React.isValidElement(child)) {\n return;\n }\n const type = child.type;\n\n if (type === Background) {\n backgroundChild = child;\n } else if (type === Content) {\n contentChild = child;\n } else if (type === Prev) {\n prevChild = child;\n } else if (type === Next) {\n nextChild = child;\n } else if (type === Done) {\n doneChild = child;\n }\n });\n\n backgroundElement = backgroundChild;\n doneElement = doneChild;\n arrowsElement =\n prevChild || nextChild ? (\n <View style={styles.arrows}>\n {prevChild}\n {nextChild}\n </View>\n ) : null;\n contentContainer = contentChild ?? <Content>{contentChild}</Content>;\n } else {\n backgroundElement = blur;\n arrowsElement = showArrows ? (\n <View style={styles.arrows}>\n <Prev\n button={buttonContainer}\n icon={iconContainer}\n onPress={onPrevCallback}\n />\n <Next\n button={buttonContainer}\n icon={iconContainer}\n onPress={onNextCallback}\n />\n </View>\n ) : null;\n contentContainer = <Content>{content}</Content>;\n doneElement = doneText ? (\n <Done button={buttonContainer} text={doneText} onPress={onDoneCallback} />\n ) : null;\n }\n\n const contextValue = useMemo(\n () => ({\n theme,\n isPrevDisabled,\n isNextDisabled,\n }),\n [theme, isPrevDisabled, isNextDisabled],\n );\n\n return (\n <ToolbarContext.Provider value={contextValue}>\n <KeyboardStickyView\n enabled={enabled}\n offset={offset}\n style={containerStyle}\n >\n <View {...rest} style={toolbarStyle} testID={TEST_ID_KEYBOARD_TOOLBAR}>\n {backgroundElement}\n {arrowsElement}\n {contentContainer}\n {doneElement}\n </View>\n </KeyboardStickyView>\n </ToolbarContext.Provider>\n );\n};\n\nconst styles = StyleSheet.create({\n sticky: {\n position: \"absolute\",\n left: 0,\n right: 0,\n bottom: 0,\n height: KEYBOARD_TOOLBAR_HEIGHT,\n },\n toolbar: {\n position: \"absolute\",\n bottom: 0,\n alignItems: \"center\",\n width: \"100%\",\n flexDirection: \"row\",\n height: KEYBOARD_TOOLBAR_HEIGHT,\n },\n arrows: {\n flexDirection: \"row\",\n paddingLeft: 8,\n },\n floating: {\n alignSelf: \"center\",\n borderRadius: 20,\n overflow: \"hidden\",\n },\n});\n\nKeyboardToolbar.Background = Background;\nKeyboardToolbar.Content = Content;\nKeyboardToolbar.Prev = Prev;\nKeyboardToolbar.Next = Next;\nKeyboardToolbar.Done = Done;\nKeyboardToolbar.Group = RCTKeyboardToolbarGroupView;\n\nexport { colors as DefaultKeyboardToolbarTheme, KeyboardToolbarProps };\nexport default KeyboardToolbar;\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,SAAA,GAAAF,OAAA;AAIA,IAAAG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,EAAE;EACZ;AACF,CAAC,CAAC;AAEFpG,eAAe,CAACyE,UAAU,GAAGA,sBAAU;AACvCzE,eAAe,CAAC0E,OAAO,GAAGA,mBAAO;AACjC1E,eAAe,CAAC2E,IAAI,GAAGA,gBAAI;AAC3B3E,eAAe,CAAC4E,IAAI,GAAGA,gBAAI;AAC3B5E,eAAe,CAAC6E,IAAI,GAAGA,gBAAI;AAC3B7E,eAAe,CAACqG,KAAK,GAAGC,qCAA2B;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAA/H,OAAA,GAGrCuB,eAAe","ignoreList":[]}
|
|
@@ -27,6 +27,12 @@ Object.defineProperty(exports, "KeyboardChatScrollView", {
|
|
|
27
27
|
return _KeyboardChatScrollView.default;
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
|
+
Object.defineProperty(exports, "KeyboardEffects", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _KeyboardEffects.default;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
30
36
|
Object.defineProperty(exports, "KeyboardStickyView", {
|
|
31
37
|
enumerable: true,
|
|
32
38
|
get: function () {
|
|
@@ -44,6 +50,7 @@ var _KeyboardStickyView = _interopRequireDefault(require("./KeyboardStickyView")
|
|
|
44
50
|
var _KeyboardAwareScrollView = _interopRequireDefault(require("./KeyboardAwareScrollView"));
|
|
45
51
|
var _KeyboardToolbar = _interopRequireWildcard(require("./KeyboardToolbar"));
|
|
46
52
|
var _KeyboardChatScrollView = _interopRequireDefault(require("./KeyboardChatScrollView"));
|
|
53
|
+
var _KeyboardEffects = _interopRequireDefault(require("./KeyboardEffects"));
|
|
47
54
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
48
55
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
49
56
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_KeyboardAvoidingView","_interopRequireDefault","require","_KeyboardStickyView","_KeyboardAwareScrollView","_KeyboardToolbar","_interopRequireWildcard","_KeyboardChatScrollView","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor"],"sources":["index.ts"],"sourcesContent":["export { default as KeyboardAvoidingView } from \"./KeyboardAvoidingView\";\nexport { default as KeyboardStickyView } from \"./KeyboardStickyView\";\nexport { default as KeyboardAwareScrollView } from \"./KeyboardAwareScrollView\";\nexport {\n default as KeyboardToolbar,\n DefaultKeyboardToolbarTheme,\n} from \"./KeyboardToolbar\";\nexport { default as KeyboardChatScrollView } from \"./KeyboardChatScrollView\";\nexport type { KeyboardAvoidingViewProps } from \"./KeyboardAvoidingView\";\nexport type { KeyboardStickyViewProps } from \"./KeyboardStickyView\";\nexport type {\n KeyboardAwareScrollViewMode,\n KeyboardAwareScrollViewProps,\n KeyboardAwareScrollViewRef,\n} from \"./KeyboardAwareScrollView/types\";\nexport type { KeyboardToolbarProps } from \"./KeyboardToolbar\";\nexport type { KeyboardChatScrollViewProps } from \"./KeyboardChatScrollView/types\";\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_KeyboardAvoidingView","_interopRequireDefault","require","_KeyboardStickyView","_KeyboardAwareScrollView","_KeyboardToolbar","_interopRequireWildcard","_KeyboardChatScrollView","_KeyboardEffects","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor"],"sources":["index.ts"],"sourcesContent":["export { default as KeyboardAvoidingView } from \"./KeyboardAvoidingView\";\nexport { default as KeyboardStickyView } from \"./KeyboardStickyView\";\nexport { default as KeyboardAwareScrollView } from \"./KeyboardAwareScrollView\";\nexport {\n default as KeyboardToolbar,\n DefaultKeyboardToolbarTheme,\n} from \"./KeyboardToolbar\";\nexport { default as KeyboardChatScrollView } from \"./KeyboardChatScrollView\";\nexport { default as KeyboardEffects } from \"./KeyboardEffects\";\nexport type { KeyboardAvoidingViewProps } from \"./KeyboardAvoidingView\";\nexport type { KeyboardStickyViewProps } from \"./KeyboardStickyView\";\nexport type { KeyboardEffectsProps } from \"./KeyboardEffects\";\nexport type {\n KeyboardAwareScrollViewMode,\n KeyboardAwareScrollViewProps,\n KeyboardAwareScrollViewRef,\n} from \"./KeyboardAwareScrollView/types\";\nexport type { KeyboardToolbarProps } from \"./KeyboardToolbar\";\nexport type { KeyboardChatScrollViewProps } from \"./KeyboardChatScrollView/types\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,qBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,wBAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,gBAAA,GAAAC,uBAAA,CAAAJ,OAAA;AAIA,IAAAK,uBAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,gBAAA,GAAAP,sBAAA,CAAAC,OAAA;AAA+D,SAAAI,wBAAAG,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAL,uBAAA,YAAAA,CAAAG,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,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,CAAA,EAAAC,CAAA;AAAA,SAAAT,uBAAAQ,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAK,UAAA,GAAAL,CAAA,KAAAU,OAAA,EAAAV,CAAA","ignoreList":[]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.KEYBOARD_BORDER_RADIUS = exports.AndroidSoftInputModes = void 0;
|
|
6
|
+
exports.KEYBOARD_HAS_ROUNDED_CORNERS = exports.KEYBOARD_BORDER_RADIUS = exports.AndroidSoftInputModes = void 0;
|
|
7
7
|
var _bindings = require("./bindings");
|
|
8
8
|
// copied from `android.view.WindowManager.LayoutParams`
|
|
9
9
|
let AndroidSoftInputModes = exports.AndroidSoftInputModes = /*#__PURE__*/function (AndroidSoftInputModes) {
|
|
@@ -26,4 +26,5 @@ let AndroidSoftInputModes = exports.AndroidSoftInputModes = /*#__PURE__*/functio
|
|
|
26
26
|
return AndroidSoftInputModes;
|
|
27
27
|
}({});
|
|
28
28
|
const KEYBOARD_BORDER_RADIUS = exports.KEYBOARD_BORDER_RADIUS = _bindings.KeyboardControllerNative.getConstants().keyboardBorderRadius;
|
|
29
|
+
const KEYBOARD_HAS_ROUNDED_CORNERS = exports.KEYBOARD_HAS_ROUNDED_CORNERS = KEYBOARD_BORDER_RADIUS > 0;
|
|
29
30
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_bindings","require","AndroidSoftInputModes","exports","KEYBOARD_BORDER_RADIUS","KeyboardControllerNative","getConstants","keyboardBorderRadius"],"sources":["constants.ts"],"sourcesContent":["import { KeyboardControllerNative } from \"./bindings\";\n\n// copied from `android.view.WindowManager.LayoutParams`\nexport enum AndroidSoftInputModes {\n SOFT_INPUT_ADJUST_NOTHING = 48,\n SOFT_INPUT_ADJUST_PAN = 32,\n SOFT_INPUT_ADJUST_RESIZE = 16,\n SOFT_INPUT_ADJUST_UNSPECIFIED = 0,\n SOFT_INPUT_IS_FORWARD_NAVIGATION = 256,\n SOFT_INPUT_MASK_ADJUST = 240,\n SOFT_INPUT_MASK_STATE = 15,\n SOFT_INPUT_MODE_CHANGED = 512,\n SOFT_INPUT_STATE_ALWAYS_HIDDEN = 3,\n SOFT_INPUT_STATE_ALWAYS_VISIBLE = 5,\n SOFT_INPUT_STATE_HIDDEN = 2,\n SOFT_INPUT_STATE_UNCHANGED = 1,\n // temporarily disable this rule to avoid breaking changes.\n // eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values\n SOFT_INPUT_STATE_UNSPECIFIED = 0,\n SOFT_INPUT_STATE_VISIBLE = 4,\n}\nexport const KEYBOARD_BORDER_RADIUS =\n KeyboardControllerNative.getConstants().keyboardBorderRadius;\n"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AAEA;AAAA,IACYC,qBAAqB,GAAAC,OAAA,CAAAD,qBAAA,0BAArBA,qBAAqB;EAArBA,qBAAqB,CAArBA,qBAAqB;EAArBA,qBAAqB,CAArBA,qBAAqB;EAArBA,qBAAqB,CAArBA,qBAAqB;EAArBA,qBAAqB,CAArBA,qBAAqB;EAArBA,qBAAqB,CAArBA,qBAAqB;EAArBA,qBAAqB,CAArBA,qBAAqB;EAArBA,qBAAqB,CAArBA,qBAAqB;EAArBA,qBAAqB,CAArBA,qBAAqB;EAArBA,qBAAqB,CAArBA,qBAAqB;EAArBA,qBAAqB,CAArBA,qBAAqB;EAArBA,qBAAqB,CAArBA,qBAAqB;EAArBA,qBAAqB,CAArBA,qBAAqB;EAa/B;EACA;EAdUA,qBAAqB,CAArBA,qBAAqB;EAArBA,qBAAqB,CAArBA,qBAAqB;EAAA,OAArBA,qBAAqB;AAAA;AAkB1B,MAAME,sBAAsB,GAAAD,OAAA,CAAAC,sBAAA,GACjCC,kCAAwB,CAACC,YAAY,CAAC,CAAC,CAACC,oBAAoB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_bindings","require","AndroidSoftInputModes","exports","KEYBOARD_BORDER_RADIUS","KeyboardControllerNative","getConstants","keyboardBorderRadius","KEYBOARD_HAS_ROUNDED_CORNERS"],"sources":["constants.ts"],"sourcesContent":["import { KeyboardControllerNative } from \"./bindings\";\n\n// copied from `android.view.WindowManager.LayoutParams`\nexport enum AndroidSoftInputModes {\n SOFT_INPUT_ADJUST_NOTHING = 48,\n SOFT_INPUT_ADJUST_PAN = 32,\n SOFT_INPUT_ADJUST_RESIZE = 16,\n SOFT_INPUT_ADJUST_UNSPECIFIED = 0,\n SOFT_INPUT_IS_FORWARD_NAVIGATION = 256,\n SOFT_INPUT_MASK_ADJUST = 240,\n SOFT_INPUT_MASK_STATE = 15,\n SOFT_INPUT_MODE_CHANGED = 512,\n SOFT_INPUT_STATE_ALWAYS_HIDDEN = 3,\n SOFT_INPUT_STATE_ALWAYS_VISIBLE = 5,\n SOFT_INPUT_STATE_HIDDEN = 2,\n SOFT_INPUT_STATE_UNCHANGED = 1,\n // temporarily disable this rule to avoid breaking changes.\n // eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values\n SOFT_INPUT_STATE_UNSPECIFIED = 0,\n SOFT_INPUT_STATE_VISIBLE = 4,\n}\nexport const KEYBOARD_BORDER_RADIUS =\n KeyboardControllerNative.getConstants().keyboardBorderRadius;\nexport const KEYBOARD_HAS_ROUNDED_CORNERS = KEYBOARD_BORDER_RADIUS > 0;\n"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AAEA;AAAA,IACYC,qBAAqB,GAAAC,OAAA,CAAAD,qBAAA,0BAArBA,qBAAqB;EAArBA,qBAAqB,CAArBA,qBAAqB;EAArBA,qBAAqB,CAArBA,qBAAqB;EAArBA,qBAAqB,CAArBA,qBAAqB;EAArBA,qBAAqB,CAArBA,qBAAqB;EAArBA,qBAAqB,CAArBA,qBAAqB;EAArBA,qBAAqB,CAArBA,qBAAqB;EAArBA,qBAAqB,CAArBA,qBAAqB;EAArBA,qBAAqB,CAArBA,qBAAqB;EAArBA,qBAAqB,CAArBA,qBAAqB;EAArBA,qBAAqB,CAArBA,qBAAqB;EAArBA,qBAAqB,CAArBA,qBAAqB;EAArBA,qBAAqB,CAArBA,qBAAqB;EAa/B;EACA;EAdUA,qBAAqB,CAArBA,qBAAqB;EAArBA,qBAAqB,CAArBA,qBAAqB;EAAA,OAArBA,qBAAqB;AAAA;AAkB1B,MAAME,sBAAsB,GAAAD,OAAA,CAAAC,sBAAA,GACjCC,kCAAwB,CAACC,YAAY,CAAC,CAAC,CAACC,oBAAoB;AACvD,MAAMC,4BAA4B,GAAAL,OAAA,CAAAK,4BAAA,GAAGJ,sBAAsB,GAAG,CAAC","ignoreList":[]}
|
package/lib/commonjs/index.js
CHANGED
|
@@ -10,6 +10,7 @@ var _exportNames = {
|
|
|
10
10
|
KeyboardAwareScrollView: true,
|
|
11
11
|
KeyboardToolbar: true,
|
|
12
12
|
DefaultKeyboardToolbarTheme: true,
|
|
13
|
+
KeyboardEffects: true,
|
|
13
14
|
OverKeyboardView: true,
|
|
14
15
|
KeyboardExtender: true
|
|
15
16
|
};
|
|
@@ -37,6 +38,12 @@ Object.defineProperty(exports, "KeyboardChatScrollView", {
|
|
|
37
38
|
return _components.KeyboardChatScrollView;
|
|
38
39
|
}
|
|
39
40
|
});
|
|
41
|
+
Object.defineProperty(exports, "KeyboardEffects", {
|
|
42
|
+
enumerable: true,
|
|
43
|
+
get: function () {
|
|
44
|
+
return _components.KeyboardEffects;
|
|
45
|
+
}
|
|
46
|
+
});
|
|
40
47
|
Object.defineProperty(exports, "KeyboardExtender", {
|
|
41
48
|
enumerable: true,
|
|
42
49
|
get: function () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_bindings","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_animated","_context","_hooks","_constants","_module","_types","_compat","_components","_views"],"sources":["index.ts"],"sourcesContent":["export * from \"./bindings\";\nexport * from \"./animated\";\nexport * from \"./context\";\nexport * from \"./hooks\";\nexport * from \"./constants\";\nexport * from \"./module\";\nexport * from \"./types\";\nexport * from \"./compat\";\n\nexport {\n KeyboardChatScrollView,\n KeyboardAvoidingView,\n KeyboardStickyView,\n KeyboardAwareScrollView,\n // keyboard toolbar\n KeyboardToolbar,\n DefaultKeyboardToolbarTheme,\n} from \"./components\";\nexport type {\n KeyboardChatScrollViewProps,\n KeyboardAvoidingViewProps,\n KeyboardStickyViewProps,\n KeyboardAwareScrollViewMode,\n KeyboardAwareScrollViewProps,\n KeyboardAwareScrollViewRef,\n KeyboardToolbarProps,\n} from \"./components\";\nexport { OverKeyboardView, KeyboardExtender } from \"./views\";\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_bindings","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_animated","_context","_hooks","_constants","_module","_types","_compat","_components","_views"],"sources":["index.ts"],"sourcesContent":["export * from \"./bindings\";\nexport * from \"./animated\";\nexport * from \"./context\";\nexport * from \"./hooks\";\nexport * from \"./constants\";\nexport * from \"./module\";\nexport * from \"./types\";\nexport * from \"./compat\";\n\nexport {\n KeyboardChatScrollView,\n KeyboardAvoidingView,\n KeyboardStickyView,\n KeyboardAwareScrollView,\n // keyboard toolbar\n KeyboardToolbar,\n DefaultKeyboardToolbarTheme,\n KeyboardEffects,\n} from \"./components\";\nexport type {\n KeyboardChatScrollViewProps,\n KeyboardAvoidingViewProps,\n KeyboardStickyViewProps,\n KeyboardAwareScrollViewMode,\n KeyboardAwareScrollViewProps,\n KeyboardAwareScrollViewRef,\n KeyboardToolbarProps,\n KeyboardEffectsProps,\n} from \"./components\";\nexport { OverKeyboardView, KeyboardExtender } from \"./views\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,SAAA,EAAAI,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,MAAAL,SAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAb,SAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAS,SAAA,GAAAb,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAW,SAAA,EAAAV,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SA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AAAA,CAAA;MAAA,OAAAM,MAAA,CAAAd,GAAA;IAAA;EAAA;AAAA;AACA,IAAAe,OAAA,GAAAnB,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAiB,OAAA,EAAAhB,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,MAAAe,OAAA,CAAAf,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAO,OAAA,CAAAf,GAAA;IAAA;EAAA;AAAA;AAEA,IAAAgB,WAAA,GAAApB,OAAA;AAoBA,IAAAqB,MAAA,GAAArB,OAAA","ignoreList":[]}
|
package/lib/commonjs/module.js
CHANGED
|
@@ -48,6 +48,7 @@ const KeyboardController = exports.KeyboardController = {
|
|
|
48
48
|
setInputMode: _bindings.KeyboardControllerNative.setInputMode,
|
|
49
49
|
setFocusTo: _bindings.KeyboardControllerNative.setFocusTo,
|
|
50
50
|
preload: _bindings.KeyboardControllerNative.preload,
|
|
51
|
+
setTranslucent: _bindings.KeyboardControllerNative.setTranslucent,
|
|
51
52
|
dismiss,
|
|
52
53
|
isVisible,
|
|
53
54
|
state
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_bindings","require","isClosed","lastState","height","duration","timestamp","Date","getTime","target","type","appearance","KeyboardEvents","addListener","e","dismiss","options","keepFocus","animated","Promise","resolve","subscription","undefined","remove","KeyboardControllerNative","isVisible","state","KeyboardController","exports","setDefaultMode","setInputMode","setFocusTo","preload"],"sources":["module.ts"],"sourcesContent":["import { KeyboardControllerNative, KeyboardEvents } from \"./bindings\";\n\nimport type {\n DismissOptions,\n KeyboardControllerModule,\n KeyboardEventData,\n} from \"./types\";\n\nlet isClosed = true;\nlet lastState: KeyboardEventData = {\n height: 0,\n duration: 0,\n timestamp: new Date().getTime(),\n target: -1,\n type: \"default\",\n appearance: \"light\",\n};\n\nKeyboardEvents.addListener(\"keyboardDidHide\", (e) => {\n isClosed = true;\n lastState = e;\n});\n\nKeyboardEvents.addListener(\"keyboardWillShow\", (e) => {\n isClosed = false;\n lastState = e;\n});\n\nconst dismiss = async (options?: Partial<DismissOptions>): Promise<void> => {\n const keepFocus = options?.keepFocus ?? false;\n const animated = options?.animated ?? true;\n\n return new Promise((resolve) => {\n if (isClosed) {\n resolve();\n\n return;\n }\n\n const subscription = KeyboardEvents.addListener(\"keyboardDidHide\", () => {\n resolve(undefined);\n subscription.remove();\n });\n\n KeyboardControllerNative.dismiss(keepFocus, animated);\n });\n};\nconst isVisible = () => !isClosed;\nconst state = () => lastState;\n\n/**\n * KeyboardController module. Helps to perform imperative actions/checks with keyboard.\n */\nexport const KeyboardController: KeyboardControllerModule = {\n setDefaultMode: KeyboardControllerNative.setDefaultMode,\n setInputMode: KeyboardControllerNative.setInputMode,\n setFocusTo: KeyboardControllerNative.setFocusTo,\n preload: KeyboardControllerNative.preload,\n dismiss,\n isVisible,\n state,\n};\n"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AAQA,IAAIC,QAAQ,GAAG,IAAI;AACnB,IAAIC,SAA4B,GAAG;EACjCC,MAAM,EAAE,CAAC;EACTC,QAAQ,EAAE,CAAC;EACXC,SAAS,EAAE,IAAIC,IAAI,CAAC,CAAC,CAACC,OAAO,CAAC,CAAC;EAC/BC,MAAM,EAAE,CAAC,CAAC;EACVC,IAAI,EAAE,SAAS;EACfC,UAAU,EAAE;AACd,CAAC;AAEDC,wBAAc,CAACC,WAAW,CAAC,iBAAiB,EAAGC,CAAC,IAAK;EACnDZ,QAAQ,GAAG,IAAI;EACfC,SAAS,GAAGW,CAAC;AACf,CAAC,CAAC;AAEFF,wBAAc,CAACC,WAAW,CAAC,kBAAkB,EAAGC,CAAC,IAAK;EACpDZ,QAAQ,GAAG,KAAK;EAChBC,SAAS,GAAGW,CAAC;AACf,CAAC,CAAC;AAEF,MAAMC,OAAO,GAAG,MAAOC,OAAiC,IAAoB;EAC1E,MAAMC,SAAS,GAAG,CAAAD,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEC,SAAS,KAAI,KAAK;EAC7C,MAAMC,QAAQ,GAAG,CAAAF,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEE,QAAQ,KAAI,IAAI;EAE1C,OAAO,IAAIC,OAAO,CAAEC,OAAO,IAAK;IAC9B,IAAIlB,QAAQ,EAAE;MACZkB,OAAO,CAAC,CAAC;MAET;IACF;IAEA,MAAMC,YAAY,GAAGT,wBAAc,CAACC,WAAW,CAAC,iBAAiB,EAAE,MAAM;MACvEO,OAAO,CAACE,SAAS,CAAC;MAClBD,YAAY,CAACE,MAAM,CAAC,CAAC;IACvB,CAAC,CAAC;IAEFC,kCAAwB,CAACT,OAAO,CAACE,SAAS,EAAEC,QAAQ,CAAC;EACvD,CAAC,CAAC;AACJ,CAAC;AACD,MAAMO,SAAS,GAAGA,CAAA,KAAM,CAACvB,QAAQ;AACjC,MAAMwB,KAAK,GAAGA,CAAA,KAAMvB,SAAS;;AAE7B;AACA;AACA;AACO,MAAMwB,kBAA4C,GAAAC,OAAA,CAAAD,kBAAA,GAAG;EAC1DE,cAAc,EAAEL,kCAAwB,CAACK,cAAc;EACvDC,YAAY,EAAEN,kCAAwB,CAACM,YAAY;EACnDC,UAAU,EAAEP,kCAAwB,CAACO,UAAU;EAC/CC,OAAO,EAAER,kCAAwB,CAACQ,OAAO;
|
|
1
|
+
{"version":3,"names":["_bindings","require","isClosed","lastState","height","duration","timestamp","Date","getTime","target","type","appearance","KeyboardEvents","addListener","e","dismiss","options","keepFocus","animated","Promise","resolve","subscription","undefined","remove","KeyboardControllerNative","isVisible","state","KeyboardController","exports","setDefaultMode","setInputMode","setFocusTo","preload","setTranslucent"],"sources":["module.ts"],"sourcesContent":["import { KeyboardControllerNative, KeyboardEvents } from \"./bindings\";\n\nimport type {\n DismissOptions,\n KeyboardControllerModule,\n KeyboardEventData,\n} from \"./types\";\n\nlet isClosed = true;\nlet lastState: KeyboardEventData = {\n height: 0,\n duration: 0,\n timestamp: new Date().getTime(),\n target: -1,\n type: \"default\",\n appearance: \"light\",\n};\n\nKeyboardEvents.addListener(\"keyboardDidHide\", (e) => {\n isClosed = true;\n lastState = e;\n});\n\nKeyboardEvents.addListener(\"keyboardWillShow\", (e) => {\n isClosed = false;\n lastState = e;\n});\n\nconst dismiss = async (options?: Partial<DismissOptions>): Promise<void> => {\n const keepFocus = options?.keepFocus ?? false;\n const animated = options?.animated ?? true;\n\n return new Promise((resolve) => {\n if (isClosed) {\n resolve();\n\n return;\n }\n\n const subscription = KeyboardEvents.addListener(\"keyboardDidHide\", () => {\n resolve(undefined);\n subscription.remove();\n });\n\n KeyboardControllerNative.dismiss(keepFocus, animated);\n });\n};\nconst isVisible = () => !isClosed;\nconst state = () => lastState;\n\n/**\n * KeyboardController module. Helps to perform imperative actions/checks with keyboard.\n */\nexport const KeyboardController: KeyboardControllerModule = {\n setDefaultMode: KeyboardControllerNative.setDefaultMode,\n setInputMode: KeyboardControllerNative.setInputMode,\n setFocusTo: KeyboardControllerNative.setFocusTo,\n preload: KeyboardControllerNative.preload,\n setTranslucent: KeyboardControllerNative.setTranslucent,\n dismiss,\n isVisible,\n state,\n};\n"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AAQA,IAAIC,QAAQ,GAAG,IAAI;AACnB,IAAIC,SAA4B,GAAG;EACjCC,MAAM,EAAE,CAAC;EACTC,QAAQ,EAAE,CAAC;EACXC,SAAS,EAAE,IAAIC,IAAI,CAAC,CAAC,CAACC,OAAO,CAAC,CAAC;EAC/BC,MAAM,EAAE,CAAC,CAAC;EACVC,IAAI,EAAE,SAAS;EACfC,UAAU,EAAE;AACd,CAAC;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;EACvDlB,OAAO;EACPU,SAAS;EACTC;AACF,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_default","exports","default","TurboModuleRegistry","get"],"sources":["NativeKeyboardController.ts"],"sourcesContent":["import { TurboModuleRegistry } from \"react-native\";\n\nimport type { TurboModule } from \"react-native\";\n\nexport interface Spec extends TurboModule {\n readonly getConstants: () => {\n keyboardBorderRadius: number;\n };\n\n // methods\n setInputMode(mode: number): void;\n setDefaultMode(): void;\n preload(): void;\n dismiss(keepFocus: boolean, animated: boolean): void;\n setFocusTo(direction: string): void;\n viewPositionInWindow(viewTag: number): Promise<object>;\n\n // event emitter\n addListener: (eventName: string) => void;\n removeListeners: (count: number) => void;\n}\n\nexport default TurboModuleRegistry.get<Spec>(\"KeyboardController\");\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAAmD,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_default","exports","default","TurboModuleRegistry","get"],"sources":["NativeKeyboardController.ts"],"sourcesContent":["import { TurboModuleRegistry } from \"react-native\";\n\nimport type { TurboModule } from \"react-native\";\n\nexport interface Spec extends TurboModule {\n readonly getConstants: () => {\n keyboardBorderRadius: number;\n };\n\n // methods\n setInputMode(mode: number): void;\n setDefaultMode(): void;\n preload(): void;\n setTranslucent(translucent: boolean): void;\n dismiss(keepFocus: boolean, animated: boolean): void;\n setFocusTo(direction: string): void;\n viewPositionInWindow(viewTag: number): Promise<object>;\n\n // event emitter\n addListener: (eventName: string) => void;\n removeListeners: (count: number) => void;\n}\n\nexport default TurboModuleRegistry.get<Spec>(\"KeyboardController\");\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAAmD,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAuBpCC,gCAAmB,CAACC,GAAG,CAAO,oBAAoB,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["module.ts"],"sourcesContent":["import type { EmitterSubscription, TextInputProps } from \"react-native\";\n\n// Event module declarations\nexport type KeyboardControllerEvents =\n | \"keyboardWillShow\"\n | \"keyboardDidShow\"\n | \"keyboardWillHide\"\n | \"keyboardDidHide\";\nexport type KeyboardEventData = {\n /** Height of the keyboard. */\n height: number;\n /** Duration of the keyboard animation. */\n duration: number;\n /** Timestamp of the last keyboard event. */\n timestamp: number;\n /** Tag of the focused `TextInput`. */\n target: number;\n /** `keyboardType` property from focused `TextInput`. */\n type: NonNullable<TextInputProps[\"keyboardType\"]>;\n /** Keyboard appearance. Can be one of `dark` or `light`. */\n appearance: \"dark\" | \"light\";\n};\n/**\n * An object that represent current keyboard state.\n */\nexport type IKeyboardState = {\n /** Whether the keyboard is currently visible. */\n isVisible: boolean;\n} & KeyboardEventData;\nexport type KeyboardEventsModule = {\n /**\n * The `addListener` function connects a JavaScript function to an identified native\n * keyboard notification event.\n *\n * This function then returns the reference to the listener.\n *\n * `name` is the string that identifies the event you're listening for. This\n * can be any of the following:\n *\n * - `keyboardWillShow`;\n * - `keyboardDidShow`;\n * - `keyboardWillHide`;\n * - `keyboardDidHide`.\n */\n addListener: (\n name: KeyboardControllerEvents,\n cb: (e: KeyboardEventData) => void,\n ) => EmitterSubscription;\n};\nexport type Direction = \"next\" | \"prev\" | \"current\";\nexport type DismissOptions = {\n /**\n * A boolean property indicating whether focus should be kept on the input after dismissing the keyboard. Default is `false`.\n */\n keepFocus: boolean;\n /**\n * A boolean property controlling whether dismissal should be animated. Default is `true`.\n */\n animated: boolean;\n};\nexport type KeyboardControllerModule = {\n // android only\n /**\n * Sets default `windowSoftInputMode` (the one that declared in `AndroidManifest.xml`).\n *\n * @platform android\n * @see {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/keyboard-controller#setdefaultmode-|docs} page for more details.\n */\n setDefaultMode: () => void;\n /**\n * Changes `windowSoftInputMode` on Android.\n *\n * @platform android\n * @see AndroidSoftInputModes for all possible values and {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/keyboard-controller#setinputmode-|docs} page for more details.\n */\n setInputMode: (mode: number) => void;\n // ios only\n /**\n * A method that preloads the keyboard. It's useful when you want to avoid a delay when the user focuses the first input.\n *\n * @platform ios\n * @see {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/keyboard-controller#preload-|docs} page for more details.\n */\n preload: () => void;\n // all platforms\n /**\n * Dismisses the active keyboard. Removes a focus by default, but allows to pass `{keepFocus: true}` to keep focus.\n * If you want to close keyboard immediately pass `{animated: false}`.\n *\n * @see {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/keyboard-controller#dismiss|docs} page for more details.\n */\n dismiss: (options?: Partial<DismissOptions>) => Promise<void>;\n /**\n * Moves focus to the specified direction (`next`, `prev` or `current` to restore a focus).\n *\n * @see {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/keyboard-controller#setfocusto|docs} page for more details.\n */\n setFocusTo: (direction: Direction) => void;\n /**\n * Whether the keyboard is fully visible.\n *\n * @see {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/keyboard-controller#isvisible|docs} page for more details.\n */\n isVisible: () => boolean;\n /**\n * Method that returns current keyboard state.\n *\n * @see {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/keyboard-controller#state|docs} page for more details.\n */\n state: () => KeyboardEventData;\n};\nexport type ViewPositionInWindowResult = {\n x: number;\n y: number;\n width: number;\n height: number;\n};\nexport type KeyboardControllerNativeModule = {\n // android only\n setDefaultMode: () => void;\n setInputMode: (mode: number) => void;\n // ios only\n preload: () => void;\n // all platforms\n dismiss: (keepFocus: boolean, animated: boolean) => void;\n setFocusTo: (direction: Direction) => void;\n viewPositionInWindow: (\n viewTag: number,\n ) => Promise<ViewPositionInWindowResult>;\n // native event module stuff\n addListener: (eventName: string) => void;\n removeListeners: (count: number) => void;\n // constants\n getConstants: () => {\n keyboardBorderRadius: number;\n };\n};\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["module.ts"],"sourcesContent":["import type { EmitterSubscription, TextInputProps } from \"react-native\";\n\n// Event module declarations\nexport type KeyboardControllerEvents =\n | \"keyboardWillShow\"\n | \"keyboardDidShow\"\n | \"keyboardWillHide\"\n | \"keyboardDidHide\";\nexport type KeyboardEventData = {\n /** Height of the keyboard. */\n height: number;\n /** Duration of the keyboard animation. */\n duration: number;\n /** Timestamp of the last keyboard event. */\n timestamp: number;\n /** Tag of the focused `TextInput`. */\n target: number;\n /** `keyboardType` property from focused `TextInput`. */\n type: NonNullable<TextInputProps[\"keyboardType\"]>;\n /** Keyboard appearance. Can be one of `dark` or `light`. */\n appearance: \"dark\" | \"light\";\n};\n/**\n * An object that represent current keyboard state.\n */\nexport type IKeyboardState = {\n /** Whether the keyboard is currently visible. */\n isVisible: boolean;\n} & KeyboardEventData;\nexport type KeyboardEventsModule = {\n /**\n * The `addListener` function connects a JavaScript function to an identified native\n * keyboard notification event.\n *\n * This function then returns the reference to the listener.\n *\n * `name` is the string that identifies the event you're listening for. This\n * can be any of the following:\n *\n * - `keyboardWillShow`;\n * - `keyboardDidShow`;\n * - `keyboardWillHide`;\n * - `keyboardDidHide`.\n */\n addListener: (\n name: KeyboardControllerEvents,\n cb: (e: KeyboardEventData) => void,\n ) => EmitterSubscription;\n};\nexport type Direction = \"next\" | \"prev\" | \"current\";\nexport type DismissOptions = {\n /**\n * A boolean property indicating whether focus should be kept on the input after dismissing the keyboard. Default is `false`.\n */\n keepFocus: boolean;\n /**\n * A boolean property controlling whether dismissal should be animated. Default is `true`.\n */\n animated: boolean;\n};\nexport type KeyboardControllerModule = {\n // android only\n /**\n * Sets default `windowSoftInputMode` (the one that declared in `AndroidManifest.xml`).\n *\n * @platform android\n * @see {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/keyboard-controller#setdefaultmode-|docs} page for more details.\n */\n setDefaultMode: () => void;\n /**\n * Changes `windowSoftInputMode` on Android.\n *\n * @platform android\n * @see AndroidSoftInputModes for all possible values and {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/keyboard-controller#setinputmode-|docs} page for more details.\n */\n setInputMode: (mode: number) => void;\n // ios only\n /**\n * A method that preloads the keyboard. It's useful when you want to avoid a delay when the user focuses the first input.\n *\n * @platform ios\n * @see {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/keyboard-controller#preload-|docs} page for more details.\n */\n preload: () => void;\n /**\n * Sets the keyboard backdrop translucency.\n *\n * @platform ios\n */\n setTranslucent: (translucent: boolean) => void;\n // all platforms\n /**\n * Dismisses the active keyboard. Removes a focus by default, but allows to pass `{keepFocus: true}` to keep focus.\n * If you want to close keyboard immediately pass `{animated: false}`.\n *\n * @see {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/keyboard-controller#dismiss|docs} page for more details.\n */\n dismiss: (options?: Partial<DismissOptions>) => Promise<void>;\n /**\n * Moves focus to the specified direction (`next`, `prev` or `current` to restore a focus).\n *\n * @see {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/keyboard-controller#setfocusto|docs} page for more details.\n */\n setFocusTo: (direction: Direction) => void;\n /**\n * Whether the keyboard is fully visible.\n *\n * @see {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/keyboard-controller#isvisible|docs} page for more details.\n */\n isVisible: () => boolean;\n /**\n * Method that returns current keyboard state.\n *\n * @see {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/keyboard-controller#state|docs} page for more details.\n */\n state: () => KeyboardEventData;\n};\nexport type ViewPositionInWindowResult = {\n x: number;\n y: number;\n width: number;\n height: number;\n};\nexport type KeyboardControllerNativeModule = {\n // android only\n setDefaultMode: () => void;\n setInputMode: (mode: number) => void;\n // ios only\n preload: () => void;\n setTranslucent: (translucent: boolean) => void;\n // all platforms\n dismiss: (keepFocus: boolean, animated: boolean) => void;\n setFocusTo: (direction: Direction) => void;\n viewPositionInWindow: (\n viewTag: number,\n ) => Promise<ViewPositionInWindowResult>;\n // native event module stuff\n addListener: (eventName: string) => void;\n removeListeners: (count: number) => void;\n // constants\n getConstants: () => {\n keyboardBorderRadius: number;\n };\n};\n"],"mappings":"","ignoreList":[]}
|
package/lib/module/bindings.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["View","NOOP","KeyboardControllerNative","setDefaultMode","setInputMode","preload","dismiss","setFocusTo","viewPositionInWindow","Promise","resolve","x","y","width","height","addListener","removeListeners","getConstants","keyboardBorderRadius","KeyboardEvents","remove","FocusedInputEvents","WindowDimensionsEvents","KeyboardControllerView","KeyboardControllerViewCommands","synchronizeFocusedInputLayout","_ref","KeyboardGestureArea","RCTOverKeyboardView","KeyboardBackgroundView","RCTKeyboardExtender","ClippingScrollView","RCTKeyboardToolbarGroupView"],"sources":["bindings.ts"],"sourcesContent":["import { View } from \"react-native\";\n\nimport type {\n ClippingScrollViewProps,\n FocusedInputEventsModule,\n KeyboardBackgroundViewProps,\n KeyboardControllerNativeModule,\n KeyboardControllerProps,\n KeyboardEventsModule,\n KeyboardExtenderProps,\n KeyboardGestureAreaProps,\n KeyboardToolbarGroupViewProps,\n OverKeyboardViewProps,\n WindowDimensionsEventsModule,\n} from \"./types\";\nimport type { EmitterSubscription } from \"react-native\";\n\nconst NOOP = () => {};\n\nexport const KeyboardControllerNative: KeyboardControllerNativeModule = {\n setDefaultMode: NOOP,\n setInputMode: NOOP,\n preload: NOOP,\n dismiss: NOOP,\n setFocusTo: NOOP,\n viewPositionInWindow: () =>\n Promise.resolve({ x: 0, y: 0, width: 0, height: 0 }),\n addListener: NOOP,\n removeListeners: NOOP,\n getConstants: () => ({\n keyboardBorderRadius: 0,\n }),\n};\n/**\n * An event emitter that provides a way to subscribe to next keyboard events:\n * - `keyboardWillShow`;\n * - `keyboardDidShow`;\n * - `keyboardWillHide`;\n * - `keyboardDidHide`.\n *\n * Use `addListener` function to add your event listener for a specific keyboard event.\n */\nexport const KeyboardEvents: KeyboardEventsModule = {\n addListener: () => ({ remove: NOOP } as EmitterSubscription),\n};\n/**\n * This API is not documented, it's for internal usage only (for now), and is a subject to potential breaking changes in future.\n * Use it with cautious.\n */\nexport const FocusedInputEvents: FocusedInputEventsModule = {\n addListener: () => ({ remove: NOOP } as EmitterSubscription),\n};\nexport const WindowDimensionsEvents: WindowDimensionsEventsModule = {\n addListener: () => ({ remove: NOOP } as EmitterSubscription),\n};\n/**\n * A view that sends events whenever keyboard or focused events are happening.\n *\n * @see {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/keyboard-controller-view|Documentation} page for more details.\n */\nexport const KeyboardControllerView =\n View as unknown as React.FC<KeyboardControllerProps>;\nexport const KeyboardControllerViewCommands = {\n synchronizeFocusedInputLayout: (\n _ref: React.Component<KeyboardControllerProps> | null,\n ) => {},\n};\n/**\n * A view that defines a region on the screen, where gestures will control the keyboard position.\n *\n * @see {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/keyboard-gesture-area|Documentation} page for more details.\n */\nexport const KeyboardGestureArea =\n View as unknown as React.FC<KeyboardGestureAreaProps>;\nexport const RCTOverKeyboardView =\n View as unknown as React.FC<OverKeyboardViewProps>;\n/**\n * A view that matches keyboard background.\n *\n * @see {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/keyboard-background-view|Documentation} page for more details.\n */\nexport const KeyboardBackgroundView =\n View as unknown as React.FC<KeyboardBackgroundViewProps>;\n/**\n * A container that will embed its children into the keyboard\n * and will always show them above the keyboard.\n *\n * @see {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/keyboard-extender|Documentation} page for more details.\n */\nexport const RCTKeyboardExtender =\n View as unknown as React.FC<KeyboardExtenderProps>;\n/**\n * A decorator that will clip the content of the `ScrollView`. It helps to simulate `contentInset` behavior on Android\n * Supports only `bottom` property (`paddingBottom` is not supported property of `ScrollView.style`).\n * Using this component we can modify bottom inset without having a fake view.\n *\n * On iOS we use swizzling to apply runtime patches to fix some broken internal methods.\n * Ideally this component shouldn't exist and all its fixes/polyfills must be added directly to react-native and\n * we will port features/fixes back to upstream, but at the moment we use this view to\n * deliver desired functionality regardless of react-native version used.\n */\nexport const ClippingScrollView =\n View as unknown as React.FC<ClippingScrollViewProps>;\n/**\n * A View that defines a group of `TextInput`s.\n * Used in toolbar navigation to assure that you can navigate only between inputs withing the same group.\n */\nexport const RCTKeyboardToolbarGroupView =\n View as unknown as React.FC<KeyboardToolbarGroupViewProps>;\n"],"mappings":"AAAA,SAASA,IAAI,QAAQ,cAAc;AAiBnC,MAAMC,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AAErB,OAAO,MAAMC,wBAAwD,GAAG;EACtEC,cAAc,EAAEF,IAAI;EACpBG,YAAY,EAAEH,IAAI;EAClBI,OAAO,EAAEJ,IAAI;EACbK,
|
|
1
|
+
{"version":3,"names":["View","NOOP","KeyboardControllerNative","setDefaultMode","setInputMode","preload","setTranslucent","dismiss","setFocusTo","viewPositionInWindow","Promise","resolve","x","y","width","height","addListener","removeListeners","getConstants","keyboardBorderRadius","KeyboardEvents","remove","FocusedInputEvents","WindowDimensionsEvents","KeyboardControllerView","KeyboardControllerViewCommands","synchronizeFocusedInputLayout","_ref","KeyboardGestureArea","RCTOverKeyboardView","KeyboardBackgroundView","RCTKeyboardExtender","ClippingScrollView","RCTKeyboardToolbarGroupView"],"sources":["bindings.ts"],"sourcesContent":["import { View } from \"react-native\";\n\nimport type {\n ClippingScrollViewProps,\n FocusedInputEventsModule,\n KeyboardBackgroundViewProps,\n KeyboardControllerNativeModule,\n KeyboardControllerProps,\n KeyboardEventsModule,\n KeyboardExtenderProps,\n KeyboardGestureAreaProps,\n KeyboardToolbarGroupViewProps,\n OverKeyboardViewProps,\n WindowDimensionsEventsModule,\n} from \"./types\";\nimport type { EmitterSubscription } from \"react-native\";\n\nconst NOOP = () => {};\n\nexport const KeyboardControllerNative: KeyboardControllerNativeModule = {\n setDefaultMode: NOOP,\n setInputMode: NOOP,\n preload: NOOP,\n setTranslucent: NOOP,\n dismiss: NOOP,\n setFocusTo: NOOP,\n viewPositionInWindow: () =>\n Promise.resolve({ x: 0, y: 0, width: 0, height: 0 }),\n addListener: NOOP,\n removeListeners: NOOP,\n getConstants: () => ({\n keyboardBorderRadius: 0,\n }),\n};\n/**\n * An event emitter that provides a way to subscribe to next keyboard events:\n * - `keyboardWillShow`;\n * - `keyboardDidShow`;\n * - `keyboardWillHide`;\n * - `keyboardDidHide`.\n *\n * Use `addListener` function to add your event listener for a specific keyboard event.\n */\nexport const KeyboardEvents: KeyboardEventsModule = {\n addListener: () => ({ remove: NOOP } as EmitterSubscription),\n};\n/**\n * This API is not documented, it's for internal usage only (for now), and is a subject to potential breaking changes in future.\n * Use it with cautious.\n */\nexport const FocusedInputEvents: FocusedInputEventsModule = {\n addListener: () => ({ remove: NOOP } as EmitterSubscription),\n};\nexport const WindowDimensionsEvents: WindowDimensionsEventsModule = {\n addListener: () => ({ remove: NOOP } as EmitterSubscription),\n};\n/**\n * A view that sends events whenever keyboard or focused events are happening.\n *\n * @see {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/keyboard-controller-view|Documentation} page for more details.\n */\nexport const KeyboardControllerView =\n View as unknown as React.FC<KeyboardControllerProps>;\nexport const KeyboardControllerViewCommands = {\n synchronizeFocusedInputLayout: (\n _ref: React.Component<KeyboardControllerProps> | null,\n ) => {},\n};\n/**\n * A view that defines a region on the screen, where gestures will control the keyboard position.\n *\n * @see {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/keyboard-gesture-area|Documentation} page for more details.\n */\nexport const KeyboardGestureArea =\n View as unknown as React.FC<KeyboardGestureAreaProps>;\nexport const RCTOverKeyboardView =\n View as unknown as React.FC<OverKeyboardViewProps>;\n/**\n * A view that matches keyboard background.\n *\n * @see {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/keyboard-background-view|Documentation} page for more details.\n */\nexport const KeyboardBackgroundView =\n View as unknown as React.FC<KeyboardBackgroundViewProps>;\n/**\n * A container that will embed its children into the keyboard\n * and will always show them above the keyboard.\n *\n * @see {@link https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/keyboard-extender|Documentation} page for more details.\n */\nexport const RCTKeyboardExtender =\n View as unknown as React.FC<KeyboardExtenderProps>;\n/**\n * A decorator that will clip the content of the `ScrollView`. It helps to simulate `contentInset` behavior on Android\n * Supports only `bottom` property (`paddingBottom` is not supported property of `ScrollView.style`).\n * Using this component we can modify bottom inset without having a fake view.\n *\n * On iOS we use swizzling to apply runtime patches to fix some broken internal methods.\n * Ideally this component shouldn't exist and all its fixes/polyfills must be added directly to react-native and\n * we will port features/fixes back to upstream, but at the moment we use this view to\n * deliver desired functionality regardless of react-native version used.\n */\nexport const ClippingScrollView =\n View as unknown as React.FC<ClippingScrollViewProps>;\n/**\n * A View that defines a group of `TextInput`s.\n * Used in toolbar navigation to assure that you can navigate only between inputs withing the same group.\n */\nexport const RCTKeyboardToolbarGroupView =\n View as unknown as React.FC<KeyboardToolbarGroupViewProps>;\n"],"mappings":"AAAA,SAASA,IAAI,QAAQ,cAAc;AAiBnC,MAAMC,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AAErB,OAAO,MAAMC,wBAAwD,GAAG;EACtEC,cAAc,EAAEF,IAAI;EACpBG,YAAY,EAAEH,IAAI;EAClBI,OAAO,EAAEJ,IAAI;EACbK,cAAc,EAAEL,IAAI;EACpBM,OAAO,EAAEN,IAAI;EACbO,UAAU,EAAEP,IAAI;EAChBQ,oBAAoB,EAAEA,CAAA,KACpBC,OAAO,CAACC,OAAO,CAAC;IAAEC,CAAC,EAAE,CAAC;IAAEC,CAAC,EAAE,CAAC;IAAEC,KAAK,EAAE,CAAC;IAAEC,MAAM,EAAE;EAAE,CAAC,CAAC;EACtDC,WAAW,EAAEf,IAAI;EACjBgB,eAAe,EAAEhB,IAAI;EACrBiB,YAAY,EAAEA,CAAA,MAAO;IACnBC,oBAAoB,EAAE;EACxB,CAAC;AACH,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,cAAoC,GAAG;EAClDJ,WAAW,EAAEA,CAAA,MAAO;IAAEK,MAAM,EAAEpB;EAAK,CAAC;AACtC,CAAC;AACD;AACA;AACA;AACA;AACA,OAAO,MAAMqB,kBAA4C,GAAG;EAC1DN,WAAW,EAAEA,CAAA,MAAO;IAAEK,MAAM,EAAEpB;EAAK,CAAC;AACtC,CAAC;AACD,OAAO,MAAMsB,sBAAoD,GAAG;EAClEP,WAAW,EAAEA,CAAA,MAAO;IAAEK,MAAM,EAAEpB;EAAK,CAAC;AACtC,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMuB,sBAAsB,GACjCxB,IAAoD;AACtD,OAAO,MAAMyB,8BAA8B,GAAG;EAC5CC,6BAA6B,EAC3BC,IAAqD,IAClD,CAAC;AACR,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,mBAAmB,GAC9B5B,IAAqD;AACvD,OAAO,MAAM6B,mBAAmB,GAC9B7B,IAAkD;AACpD;AACA;AACA;AACA;AACA;AACA,OAAO,MAAM8B,sBAAsB,GACjC9B,IAAwD;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAM+B,mBAAmB,GAC9B/B,IAAkD;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMgC,kBAAkB,GAC7BhC,IAAoD;AACtD;AACA;AACA;AACA;AACA,OAAO,MAAMiC,2BAA2B,GACtCjC,IAA0D","ignoreList":[]}
|
|
@@ -8,6 +8,7 @@ import ScrollViewWithBottomPadding from "../ScrollViewWithBottomPadding";
|
|
|
8
8
|
import { useChatKeyboard } from "./useChatKeyboard";
|
|
9
9
|
import { useEndVisible } from "./useEndVisible";
|
|
10
10
|
import { useExtraContentPadding } from "./useExtraContentPadding";
|
|
11
|
+
import { useFrozenPadding } from "./useFrozenPadding";
|
|
11
12
|
const ZERO_CONTENT_PADDING = makeMutable(0);
|
|
12
13
|
const ZERO_BLANK_SPACE = makeMutable(0);
|
|
13
14
|
const KeyboardChatScrollView = /*#__PURE__*/forwardRef(({
|
|
@@ -58,6 +59,11 @@ const KeyboardChatScrollView = /*#__PURE__*/forwardRef(({
|
|
|
58
59
|
keyboardLiftBehavior,
|
|
59
60
|
freeze: freezeSV
|
|
60
61
|
});
|
|
62
|
+
useFrozenPadding({
|
|
63
|
+
freeze: freezeSV,
|
|
64
|
+
offset,
|
|
65
|
+
padding
|
|
66
|
+
});
|
|
61
67
|
useEndVisible({
|
|
62
68
|
scroll,
|
|
63
69
|
layout,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","forwardRef","useCallback","useMemo","StyleSheet","makeMutable","useAnimatedRef","useAnimatedStyle","useDerivedValue","Reanimated","useCombinedRef","ScrollViewWithBottomPadding","useChatKeyboard","useEndVisible","useExtraContentPadding","ZERO_CONTENT_PADDING","ZERO_BLANK_SPACE","KeyboardChatScrollView","children","ScrollViewComponent","ScrollView","inverted","keyboardLiftBehavior","freeze","offset","extraContentPadding","blankSpace","applyWorkaroundForContentInsetHitTestBug","onLayout","onLayoutProp","onContentSizeChange","onContentSizeChangeProp","onEndVisible","rest","ref","scrollViewRef","onRef","freezeSV","value","padding","currentHeight","contentOffsetY","scroll","layout","size","onLayoutInternal","onContentSizeChangeInternal","keyboardPadding","totalPadding","Math","min","height","max","indicatorPadding","e","w","h","commitStyle","transform","translateY","commit","styles","commitView","createElement","Fragment","_extends","bottomPadding","scrollIndicatorPadding","View","style","create","display","position"],"sources":["index.tsx"],"sourcesContent":["import React, { forwardRef, useCallback, useMemo } from \"react\";\nimport { StyleSheet } from \"react-native\";\nimport {\n makeMutable,\n useAnimatedRef,\n useAnimatedStyle,\n useDerivedValue,\n} from \"react-native-reanimated\";\nimport Reanimated from \"react-native-reanimated\";\n\nimport useCombinedRef from \"../hooks/useCombinedRef\";\nimport ScrollViewWithBottomPadding from \"../ScrollViewWithBottomPadding\";\n\nimport { useChatKeyboard } from \"./useChatKeyboard\";\nimport { useEndVisible } from \"./useEndVisible\";\nimport { useExtraContentPadding } from \"./useExtraContentPadding\";\n\nimport type { KeyboardChatScrollViewProps } from \"./types\";\nimport type { LayoutChangeEvent } from \"react-native\";\n\nconst ZERO_CONTENT_PADDING = makeMutable(0);\nconst ZERO_BLANK_SPACE = makeMutable(0);\n\nconst KeyboardChatScrollView = forwardRef<\n Reanimated.ScrollView,\n React.PropsWithChildren<KeyboardChatScrollViewProps>\n>(\n (\n {\n children,\n ScrollViewComponent = Reanimated.ScrollView,\n inverted = false,\n keyboardLiftBehavior = \"always\",\n freeze = false,\n offset = 0,\n extraContentPadding = ZERO_CONTENT_PADDING,\n blankSpace = ZERO_BLANK_SPACE,\n applyWorkaroundForContentInsetHitTestBug = false,\n onLayout: onLayoutProp,\n onContentSizeChange: onContentSizeChangeProp,\n onEndVisible,\n ...rest\n },\n ref,\n ) => {\n const scrollViewRef = useAnimatedRef<Reanimated.ScrollView>();\n const onRef = useCombinedRef(ref, scrollViewRef);\n const freezeSV = useDerivedValue(() =>\n typeof freeze === \"boolean\" ? freeze : freeze.value,\n );\n const {\n padding,\n currentHeight,\n contentOffsetY,\n scroll,\n layout,\n size,\n onLayout: onLayoutInternal,\n onContentSizeChange: onContentSizeChangeInternal,\n } = useChatKeyboard(scrollViewRef, {\n inverted,\n keyboardLiftBehavior,\n freeze: freezeSV,\n offset,\n blankSpace,\n extraContentPadding,\n });\n\n useExtraContentPadding({\n scrollViewRef,\n extraContentPadding,\n keyboardPadding: padding,\n blankSpace,\n scroll,\n layout,\n size,\n contentOffsetY,\n inverted,\n keyboardLiftBehavior,\n freeze: freezeSV,\n });\n\n useEndVisible({\n scroll,\n layout,\n size,\n inverted,\n onEndVisible,\n });\n\n // intentionally clamp `blankSpace` at one ScrollView viewport. The Android\n // `ClippingScrollView` workaround temporarily substitutes padding/range\n // during touch handling, and oversized blank ranges can de-sync during fast\n // momentum gestures. One viewport is enough for the short-content case;\n // larger values only allow scrolling to a fully blank screen which is not\n // the use case for this library. If you found this comment and it causes\n // a bug for you, please open an issue.\n const totalPadding = useDerivedValue(() =>\n Math.min(\n layout.value.height,\n Math.max(blankSpace.value, padding.value + extraContentPadding.value),\n ),\n );\n\n // Scroll indicator inset = keyboard + extraContentPadding (excludes blankSpace).\n // Apps that render into the unsafe area can supply a negative\n // scrollIndicatorInsets adjustment at the application layer.\n const indicatorPadding = useDerivedValue(\n () => padding.value + extraContentPadding.value,\n );\n\n const onLayout = useCallback(\n (e: LayoutChangeEvent) => {\n onLayoutInternal(e);\n onLayoutProp?.(e);\n },\n [onLayoutInternal, onLayoutProp],\n );\n\n const onContentSizeChange = useCallback(\n (w: number, h: number) => {\n onContentSizeChangeInternal(w, h);\n onContentSizeChangeProp?.(w, h);\n },\n [onContentSizeChangeInternal, onContentSizeChangeProp],\n );\n\n // Invisible view whose animated style changes every frame during keyboard\n // animation. On Fabric, this forces Reanimated to schedule a commit,\n // which flushes the scrollTo call in the same frame (fixing de-synchronization).\n // see https://github.com/software-mansion/react-native-reanimated/issues/9000\n const commitStyle = useAnimatedStyle(\n () => ({\n transform: [{ translateY: -currentHeight.value }],\n }),\n [],\n );\n const commit = useMemo(\n () => [styles.commitView, commitStyle],\n [commitStyle],\n );\n\n return (\n <>\n <ScrollViewWithBottomPadding\n ref={onRef}\n {...rest}\n applyWorkaroundForContentInsetHitTestBug={\n applyWorkaroundForContentInsetHitTestBug\n }\n bottomPadding={totalPadding}\n contentOffsetY={contentOffsetY}\n inverted={inverted}\n scrollIndicatorPadding={indicatorPadding}\n ScrollViewComponent={ScrollViewComponent}\n onContentSizeChange={onContentSizeChange}\n onLayout={onLayout}\n >\n {children}\n </ScrollViewWithBottomPadding>\n <Reanimated.View style={commit} />\n </>\n );\n },\n);\n\nconst styles = StyleSheet.create({\n commitView: {\n display: \"none\",\n position: \"absolute\",\n },\n});\n\nexport default KeyboardChatScrollView;\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,UAAU,EAAEC,WAAW,EAAEC,OAAO,QAAQ,OAAO;AAC/D,SAASC,UAAU,QAAQ,cAAc;AACzC,SACEC,WAAW,EACXC,cAAc,EACdC,gBAAgB,EAChBC,eAAe,QACV,yBAAyB;AAChC,OAAOC,UAAU,MAAM,yBAAyB;AAEhD,OAAOC,cAAc,MAAM,yBAAyB;AACpD,OAAOC,2BAA2B,MAAM,gCAAgC;AAExE,SAASC,eAAe,QAAQ,mBAAmB;AACnD,SAASC,aAAa,QAAQ,iBAAiB;AAC/C,SAASC,sBAAsB,QAAQ,0BAA0B;
|
|
1
|
+
{"version":3,"names":["React","forwardRef","useCallback","useMemo","StyleSheet","makeMutable","useAnimatedRef","useAnimatedStyle","useDerivedValue","Reanimated","useCombinedRef","ScrollViewWithBottomPadding","useChatKeyboard","useEndVisible","useExtraContentPadding","useFrozenPadding","ZERO_CONTENT_PADDING","ZERO_BLANK_SPACE","KeyboardChatScrollView","children","ScrollViewComponent","ScrollView","inverted","keyboardLiftBehavior","freeze","offset","extraContentPadding","blankSpace","applyWorkaroundForContentInsetHitTestBug","onLayout","onLayoutProp","onContentSizeChange","onContentSizeChangeProp","onEndVisible","rest","ref","scrollViewRef","onRef","freezeSV","value","padding","currentHeight","contentOffsetY","scroll","layout","size","onLayoutInternal","onContentSizeChangeInternal","keyboardPadding","totalPadding","Math","min","height","max","indicatorPadding","e","w","h","commitStyle","transform","translateY","commit","styles","commitView","createElement","Fragment","_extends","bottomPadding","scrollIndicatorPadding","View","style","create","display","position"],"sources":["index.tsx"],"sourcesContent":["import React, { forwardRef, useCallback, useMemo } from \"react\";\nimport { StyleSheet } from \"react-native\";\nimport {\n makeMutable,\n useAnimatedRef,\n useAnimatedStyle,\n useDerivedValue,\n} from \"react-native-reanimated\";\nimport Reanimated from \"react-native-reanimated\";\n\nimport useCombinedRef from \"../hooks/useCombinedRef\";\nimport ScrollViewWithBottomPadding from \"../ScrollViewWithBottomPadding\";\n\nimport { useChatKeyboard } from \"./useChatKeyboard\";\nimport { useEndVisible } from \"./useEndVisible\";\nimport { useExtraContentPadding } from \"./useExtraContentPadding\";\nimport { useFrozenPadding } from \"./useFrozenPadding\";\n\nimport type { KeyboardChatScrollViewProps } from \"./types\";\nimport type { LayoutChangeEvent } from \"react-native\";\n\nconst ZERO_CONTENT_PADDING = makeMutable(0);\nconst ZERO_BLANK_SPACE = makeMutable(0);\n\nconst KeyboardChatScrollView = forwardRef<\n Reanimated.ScrollView,\n React.PropsWithChildren<KeyboardChatScrollViewProps>\n>(\n (\n {\n children,\n ScrollViewComponent = Reanimated.ScrollView,\n inverted = false,\n keyboardLiftBehavior = \"always\",\n freeze = false,\n offset = 0,\n extraContentPadding = ZERO_CONTENT_PADDING,\n blankSpace = ZERO_BLANK_SPACE,\n applyWorkaroundForContentInsetHitTestBug = false,\n onLayout: onLayoutProp,\n onContentSizeChange: onContentSizeChangeProp,\n onEndVisible,\n ...rest\n },\n ref,\n ) => {\n const scrollViewRef = useAnimatedRef<Reanimated.ScrollView>();\n const onRef = useCombinedRef(ref, scrollViewRef);\n const freezeSV = useDerivedValue(() =>\n typeof freeze === \"boolean\" ? freeze : freeze.value,\n );\n const {\n padding,\n currentHeight,\n contentOffsetY,\n scroll,\n layout,\n size,\n onLayout: onLayoutInternal,\n onContentSizeChange: onContentSizeChangeInternal,\n } = useChatKeyboard(scrollViewRef, {\n inverted,\n keyboardLiftBehavior,\n freeze: freezeSV,\n offset,\n blankSpace,\n extraContentPadding,\n });\n\n useExtraContentPadding({\n scrollViewRef,\n extraContentPadding,\n keyboardPadding: padding,\n blankSpace,\n scroll,\n layout,\n size,\n contentOffsetY,\n inverted,\n keyboardLiftBehavior,\n freeze: freezeSV,\n });\n\n useFrozenPadding({\n freeze: freezeSV,\n offset,\n padding,\n });\n\n useEndVisible({\n scroll,\n layout,\n size,\n inverted,\n onEndVisible,\n });\n\n // intentionally clamp `blankSpace` at one ScrollView viewport. The Android\n // `ClippingScrollView` workaround temporarily substitutes padding/range\n // during touch handling, and oversized blank ranges can de-sync during fast\n // momentum gestures. One viewport is enough for the short-content case;\n // larger values only allow scrolling to a fully blank screen which is not\n // the use case for this library. If you found this comment and it causes\n // a bug for you, please open an issue.\n const totalPadding = useDerivedValue(() =>\n Math.min(\n layout.value.height,\n Math.max(blankSpace.value, padding.value + extraContentPadding.value),\n ),\n );\n\n // Scroll indicator inset = keyboard + extraContentPadding (excludes blankSpace).\n // Apps that render into the unsafe area can supply a negative\n // scrollIndicatorInsets adjustment at the application layer.\n const indicatorPadding = useDerivedValue(\n () => padding.value + extraContentPadding.value,\n );\n\n const onLayout = useCallback(\n (e: LayoutChangeEvent) => {\n onLayoutInternal(e);\n onLayoutProp?.(e);\n },\n [onLayoutInternal, onLayoutProp],\n );\n\n const onContentSizeChange = useCallback(\n (w: number, h: number) => {\n onContentSizeChangeInternal(w, h);\n onContentSizeChangeProp?.(w, h);\n },\n [onContentSizeChangeInternal, onContentSizeChangeProp],\n );\n\n // Invisible view whose animated style changes every frame during keyboard\n // animation. On Fabric, this forces Reanimated to schedule a commit,\n // which flushes the scrollTo call in the same frame (fixing de-synchronization).\n // see https://github.com/software-mansion/react-native-reanimated/issues/9000\n const commitStyle = useAnimatedStyle(\n () => ({\n transform: [{ translateY: -currentHeight.value }],\n }),\n [],\n );\n const commit = useMemo(\n () => [styles.commitView, commitStyle],\n [commitStyle],\n );\n\n return (\n <>\n <ScrollViewWithBottomPadding\n ref={onRef}\n {...rest}\n applyWorkaroundForContentInsetHitTestBug={\n applyWorkaroundForContentInsetHitTestBug\n }\n bottomPadding={totalPadding}\n contentOffsetY={contentOffsetY}\n inverted={inverted}\n scrollIndicatorPadding={indicatorPadding}\n ScrollViewComponent={ScrollViewComponent}\n onContentSizeChange={onContentSizeChange}\n onLayout={onLayout}\n >\n {children}\n </ScrollViewWithBottomPadding>\n <Reanimated.View style={commit} />\n </>\n );\n },\n);\n\nconst styles = StyleSheet.create({\n commit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AE,MAAM;IACfC,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC;AAEF,eAAevD,sBAAsB","ignoreList":[]}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { useAnimatedReaction, useSharedValue } from "react-native-reanimated";
|
|
2
|
+
import { useKeyboardHandler } from "../../../hooks";
|
|
3
|
+
import { getEffectiveHeight } from "../useChatKeyboard/helpers";
|
|
4
|
+
/**
|
|
5
|
+
* Hook that reconciles keyboard padding after a frozen interval.
|
|
6
|
+
*
|
|
7
|
+
* `useChatKeyboard` handlers skip all writes while `freeze` is enabled, so if
|
|
8
|
+
* the keyboard opens or closes during the frozen interval `padding` keeps a
|
|
9
|
+
* stale value (e.g. the open-keyboard height after a frozen dismissal). This
|
|
10
|
+
* hook observes keyboard events independently of `freeze` and recomputes the
|
|
11
|
+
* padding from the latest observed keyboard height as soon as `freeze`
|
|
12
|
+
* transitions back to `false`.
|
|
13
|
+
*
|
|
14
|
+
* @param options - Keyboard padding shared values plus the scroll view `offset`.
|
|
15
|
+
* @param options.freeze - When `true`, keyboard-driven layout writes are skipped.
|
|
16
|
+
* @param options.offset - The distance between the bottom of the screen and the `ScrollView`.
|
|
17
|
+
* @param options.padding - Keyboard-driven padding managed by `useChatKeyboard`.
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* useFrozenPadding({ freeze, offset, padding });
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
function useFrozenPadding({
|
|
24
|
+
freeze,
|
|
25
|
+
offset,
|
|
26
|
+
padding
|
|
27
|
+
}) {
|
|
28
|
+
const lastHeight = useSharedValue(0);
|
|
29
|
+
const targetKeyboardHeight = useSharedValue(0);
|
|
30
|
+
useKeyboardHandler({
|
|
31
|
+
onStart: e => {
|
|
32
|
+
"worklet";
|
|
33
|
+
|
|
34
|
+
if (e.height > 0) {
|
|
35
|
+
// eslint-disable-next-line react-compiler/react-compiler
|
|
36
|
+
targetKeyboardHeight.value = e.height;
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
onMove: e => {
|
|
40
|
+
"worklet";
|
|
41
|
+
|
|
42
|
+
lastHeight.value = e.height;
|
|
43
|
+
},
|
|
44
|
+
onEnd: e => {
|
|
45
|
+
"worklet";
|
|
46
|
+
|
|
47
|
+
lastHeight.value = e.height;
|
|
48
|
+
}
|
|
49
|
+
}, []);
|
|
50
|
+
useAnimatedReaction(() => freeze.value, (isFrozen, wasFrozen) => {
|
|
51
|
+
if (!isFrozen && wasFrozen === true) {
|
|
52
|
+
padding.value = getEffectiveHeight(lastHeight.value, targetKeyboardHeight.value, offset);
|
|
53
|
+
}
|
|
54
|
+
}, [offset]);
|
|
55
|
+
}
|
|
56
|
+
export { useFrozenPadding };
|
|
57
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useAnimatedReaction","useSharedValue","useKeyboardHandler","getEffectiveHeight","useFrozenPadding","freeze","offset","padding","lastHeight","targetKeyboardHeight","onStart","e","height","value","onMove","onEnd","isFrozen","wasFrozen"],"sources":["index.ts"],"sourcesContent":["import { useAnimatedReaction, useSharedValue } from \"react-native-reanimated\";\n\nimport { useKeyboardHandler } from \"../../../hooks\";\nimport { getEffectiveHeight } from \"../useChatKeyboard/helpers\";\n\nimport type { SharedValue } from \"react-native-reanimated\";\n\ntype UseFrozenPaddingOptions = {\n /** When `true`, keyboard-driven layout writes are skipped. */\n freeze: SharedValue<boolean>;\n /** The distance between the bottom of the screen and the `ScrollView`. */\n offset: number;\n /** Keyboard-driven padding managed by `useChatKeyboard`. */\n padding: SharedValue<number>;\n};\n\n/**\n * Hook that reconciles keyboard padding after a frozen interval.\n *\n * `useChatKeyboard` handlers skip all writes while `freeze` is enabled, so if\n * the keyboard opens or closes during the frozen interval `padding` keeps a\n * stale value (e.g. the open-keyboard height after a frozen dismissal). This\n * hook observes keyboard events independently of `freeze` and recomputes the\n * padding from the latest observed keyboard height as soon as `freeze`\n * transitions back to `false`.\n *\n * @param options - Keyboard padding shared values plus the scroll view `offset`.\n * @param options.freeze - When `true`, keyboard-driven layout writes are skipped.\n * @param options.offset - The distance between the bottom of the screen and the `ScrollView`.\n * @param options.padding - Keyboard-driven padding managed by `useChatKeyboard`.\n * @example\n * ```ts\n * useFrozenPadding({ freeze, offset, padding });\n * ```\n */\nfunction useFrozenPadding({\n freeze,\n offset,\n padding,\n}: UseFrozenPaddingOptions): void {\n const lastHeight = useSharedValue(0);\n const targetKeyboardHeight = useSharedValue(0);\n\n useKeyboardHandler(\n {\n onStart: (e) => {\n \"worklet\";\n\n if (e.height > 0) {\n // eslint-disable-next-line react-compiler/react-compiler\n targetKeyboardHeight.value = e.height;\n }\n },\n onMove: (e) => {\n \"worklet\";\n\n lastHeight.value = e.height;\n },\n onEnd: (e) => {\n \"worklet\";\n\n lastHeight.value = e.height;\n },\n },\n [],\n );\n\n useAnimatedReaction(\n () => freeze.value,\n (isFrozen, wasFrozen) => {\n if (!isFrozen && wasFrozen === true) {\n padding.value = getEffectiveHeight(\n lastHeight.value,\n targetKeyboardHeight.value,\n offset,\n );\n }\n },\n [offset],\n );\n}\n\nexport { useFrozenPadding };\n"],"mappings":"AAAA,SAASA,mBAAmB,EAAEC,cAAc,QAAQ,yBAAyB;AAE7E,SAASC,kBAAkB,QAAQ,gBAAgB;AACnD,SAASC,kBAAkB,QAAQ,4BAA4B;AAa/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,gBAAgBA,CAAC;EACxBC,MAAM;EACNC,MAAM;EACNC;AACuB,CAAC,EAAQ;EAChC,MAAMC,UAAU,GAAGP,cAAc,CAAC,CAAC,CAAC;EACpC,MAAMQ,oBAAoB,GAAGR,cAAc,CAAC,CAAC,CAAC;EAE9CC,kBAAkB,CAChB;IACEQ,OAAO,EAAGC,CAAC,IAAK;MACd,SAAS;;MAET,IAAIA,CAAC,CAACC,MAAM,GAAG,CAAC,EAAE;QAChB;QACAH,oBAAoB,CAACI,KAAK,GAAGF,CAAC,CAACC,MAAM;MACvC;IACF,CAAC;IACDE,MAAM,EAAGH,CAAC,IAAK;MACb,SAAS;;MAETH,UAAU,CAACK,KAAK,GAAGF,CAAC,CAACC,MAAM;IAC7B,CAAC;IACDG,KAAK,EAAGJ,CAAC,IAAK;MACZ,SAAS;;MAETH,UAAU,CAACK,KAAK,GAAGF,CAAC,CAACC,MAAM;IAC7B;EACF,CAAC,EACD,EACF,CAAC;EAEDZ,mBAAmB,CACjB,MAAMK,MAAM,CAACQ,KAAK,EAClB,CAACG,QAAQ,EAAEC,SAAS,KAAK;IACvB,IAAI,CAACD,QAAQ,IAAIC,SAAS,KAAK,IAAI,EAAE;MACnCV,OAAO,CAACM,KAAK,GAAGV,kBAAkB,CAChCK,UAAU,CAACK,KAAK,EAChBJ,oBAAoB,CAACI,KAAK,EAC1BP,MACF,CAAC;IACH;EACF,CAAC,EACD,CAACA,MAAM,CACT,CAAC;AACH;AAEA,SAASF,gBAAgB","ignoreList":[]}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
+
import React, { forwardRef, useEffect, useMemo, useRef } from "react";
|
|
3
|
+
import { StyleSheet, View } from "react-native";
|
|
4
|
+
import { KEYBOARD_BORDER_RADIUS, KEYBOARD_HAS_ROUNDED_CORNERS } from "../../constants";
|
|
5
|
+
import { KeyboardController } from "../../module";
|
|
6
|
+
import KeyboardStickyView from "../KeyboardStickyView";
|
|
7
|
+
const translucentStack = [];
|
|
8
|
+
let currentTranslucent = false;
|
|
9
|
+
const applyTranslucent = () => {
|
|
10
|
+
const next = translucentStack.length > 0 ? translucentStack[translucentStack.length - 1].translucent : false;
|
|
11
|
+
if (next !== currentTranslucent) {
|
|
12
|
+
currentTranslucent = next;
|
|
13
|
+
KeyboardController.setTranslucent(next);
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
const pushTranslucentEntry = entry => {
|
|
17
|
+
translucentStack.push(entry);
|
|
18
|
+
applyTranslucent();
|
|
19
|
+
};
|
|
20
|
+
const removeTranslucentEntry = entry => {
|
|
21
|
+
const index = translucentStack.indexOf(entry);
|
|
22
|
+
if (index !== -1) {
|
|
23
|
+
translucentStack.splice(index, 1);
|
|
24
|
+
}
|
|
25
|
+
applyTranslucent();
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* A component that renders content behind the keyboard. Since the keyboard
|
|
29
|
+
* is translucent, the content (colors, gradients, animations) will blend
|
|
30
|
+
* through and create visual effects on the keyboard.
|
|
31
|
+
*
|
|
32
|
+
* On iOS 26+ the keyboard has rounded corners, and the effect view
|
|
33
|
+
* automatically matches that shape.
|
|
34
|
+
*
|
|
35
|
+
* @returns A view component positioned behind the keyboard.
|
|
36
|
+
* @example
|
|
37
|
+
* ```tsx
|
|
38
|
+
* <KeyboardEffects>
|
|
39
|
+
* <View style={{ flex: 1, backgroundColor: "purple" }} />
|
|
40
|
+
* </KeyboardEffects>
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
const KeyboardEffects = /*#__PURE__*/forwardRef(({
|
|
44
|
+
translucent,
|
|
45
|
+
children,
|
|
46
|
+
...props
|
|
47
|
+
}, ref) => {
|
|
48
|
+
const stackEntry = useRef({
|
|
49
|
+
translucent: Boolean(translucent)
|
|
50
|
+
}).current;
|
|
51
|
+
const containerStyle = useMemo(() => [styles.container, KEYBOARD_HAS_ROUNDED_CORNERS && !translucent && styles.rounded], [translucent]);
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
pushTranslucentEntry(stackEntry);
|
|
54
|
+
return () => {
|
|
55
|
+
removeTranslucentEntry(stackEntry);
|
|
56
|
+
};
|
|
57
|
+
}, [stackEntry]);
|
|
58
|
+
useEffect(() => {
|
|
59
|
+
stackEntry.translucent = Boolean(translucent);
|
|
60
|
+
applyTranslucent();
|
|
61
|
+
}, [stackEntry, translucent]);
|
|
62
|
+
return /*#__PURE__*/React.createElement(KeyboardStickyView, _extends({
|
|
63
|
+
ref: ref
|
|
64
|
+
}, props), /*#__PURE__*/React.createElement(View, {
|
|
65
|
+
style: containerStyle
|
|
66
|
+
}, children));
|
|
67
|
+
});
|
|
68
|
+
const styles = StyleSheet.create({
|
|
69
|
+
container: {
|
|
70
|
+
position: "absolute",
|
|
71
|
+
bottom: 0,
|
|
72
|
+
top: 0,
|
|
73
|
+
left: 0,
|
|
74
|
+
right: 0,
|
|
75
|
+
height: 999
|
|
76
|
+
},
|
|
77
|
+
rounded: {
|
|
78
|
+
borderTopLeftRadius: KEYBOARD_BORDER_RADIUS,
|
|
79
|
+
borderTopRightRadius: KEYBOARD_BORDER_RADIUS,
|
|
80
|
+
overflow: "hidden"
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
export default KeyboardEffects;
|
|
84
|
+
//# sourceMappingURL=index.js.map
|