@tamagui/native 2.0.0-1769546410712 → 2.0.0-1769573246601

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/dist/cjs/index.cjs +5 -1
  2. package/dist/cjs/index.js +5 -2
  3. package/dist/cjs/index.js.map +1 -1
  4. package/dist/cjs/index.native.js +5 -1
  5. package/dist/cjs/index.native.js.map +1 -1
  6. package/dist/cjs/keyboardControllerState.cjs +51 -0
  7. package/dist/cjs/keyboardControllerState.js +46 -0
  8. package/dist/cjs/keyboardControllerState.js.map +6 -0
  9. package/dist/cjs/keyboardControllerState.native.js +54 -0
  10. package/dist/cjs/keyboardControllerState.native.js.map +1 -0
  11. package/dist/cjs/setup-keyboard-controller.cjs +0 -0
  12. package/dist/cjs/setup-keyboard-controller.js +1 -0
  13. package/dist/cjs/setup-keyboard-controller.js.map +6 -0
  14. package/dist/cjs/setup-keyboard-controller.native.js +33 -0
  15. package/dist/cjs/setup-keyboard-controller.native.js.map +1 -0
  16. package/dist/esm/index.js +9 -1
  17. package/dist/esm/index.js.map +1 -1
  18. package/dist/esm/index.mjs +2 -1
  19. package/dist/esm/index.mjs.map +1 -1
  20. package/dist/esm/index.native.js +2 -1
  21. package/dist/esm/index.native.js.map +1 -1
  22. package/dist/esm/keyboardControllerState.js +30 -0
  23. package/dist/esm/keyboardControllerState.js.map +6 -0
  24. package/dist/esm/keyboardControllerState.mjs +26 -0
  25. package/dist/esm/keyboardControllerState.mjs.map +1 -0
  26. package/dist/esm/keyboardControllerState.native.js +26 -0
  27. package/dist/esm/keyboardControllerState.native.js.map +1 -0
  28. package/dist/esm/setup-keyboard-controller.js +1 -0
  29. package/dist/esm/setup-keyboard-controller.js.map +6 -0
  30. package/dist/esm/setup-keyboard-controller.mjs +2 -0
  31. package/dist/esm/setup-keyboard-controller.mjs.map +1 -0
  32. package/dist/esm/setup-keyboard-controller.native.js +31 -0
  33. package/dist/esm/setup-keyboard-controller.native.js.map +1 -0
  34. package/package.json +22 -2
  35. package/src/index.ts +9 -0
  36. package/src/keyboardControllerState.ts +44 -0
  37. package/src/setup-keyboard-controller.ts +60 -0
  38. package/src/setup-keyboard-controller.web.ts +6 -0
  39. package/types/index.d.ts +3 -0
  40. package/types/index.d.ts.map +2 -2
  41. package/types/keyboardControllerState.d.ts +15 -0
  42. package/types/keyboardControllerState.d.ts.map +11 -0
  43. package/types/setup-keyboard-controller.d.ts +3 -0
  44. package/types/setup-keyboard-controller.d.ts.map +11 -0
  45. package/types/setup-keyboard-controller.web.d.ts +2 -0
  46. package/types/setup-keyboard-controller.web.d.ts.map +11 -0
@@ -24,10 +24,13 @@ __export(index_exports, {
24
24
  NativePortalHost: () => import_components.NativePortalHost,
25
25
  NativePortalProvider: () => import_components.NativePortalProvider,
26
26
  getGestureHandler: () => import_gestureState.getGestureHandler,
27
+ getKeyboardControllerState: () => import_keyboardControllerState.getKeyboardControllerState,
27
28
  getLinearGradient: () => import_linearGradientState.getLinearGradient,
28
29
  getPortal: () => import_portalState.getPortal,
29
30
  getSafeArea: () => import_safeAreaState.getSafeArea,
30
- getWorklets: () => import_workletsState.getWorklets
31
+ getWorklets: () => import_workletsState.getWorklets,
32
+ isKeyboardControllerEnabled: () => import_keyboardControllerState.isKeyboardControllerEnabled,
33
+ setKeyboardControllerState: () => import_keyboardControllerState.setKeyboardControllerState
31
34
  });
32
35
  module.exports = __toCommonJS(index_exports);
33
36
  var import_portalState = require("./portalState.cjs"),
@@ -35,4 +38,5 @@ var import_portalState = require("./portalState.cjs"),
35
38
  import_workletsState = require("./workletsState.cjs"),
36
39
  import_safeAreaState = require("./safeAreaState.cjs"),
37
40
  import_linearGradientState = require("./linearGradientState.cjs"),
41
+ import_keyboardControllerState = require("./keyboardControllerState.cjs"),
38
42
  import_components = require("./components.cjs");
package/dist/cjs/index.js CHANGED
@@ -18,11 +18,14 @@ __export(index_exports, {
18
18
  NativePortalHost: () => import_components.NativePortalHost,
19
19
  NativePortalProvider: () => import_components.NativePortalProvider,
20
20
  getGestureHandler: () => import_gestureState.getGestureHandler,
21
+ getKeyboardControllerState: () => import_keyboardControllerState.getKeyboardControllerState,
21
22
  getLinearGradient: () => import_linearGradientState.getLinearGradient,
22
23
  getPortal: () => import_portalState.getPortal,
23
24
  getSafeArea: () => import_safeAreaState.getSafeArea,
24
- getWorklets: () => import_workletsState.getWorklets
25
+ getWorklets: () => import_workletsState.getWorklets,
26
+ isKeyboardControllerEnabled: () => import_keyboardControllerState.isKeyboardControllerEnabled,
27
+ setKeyboardControllerState: () => import_keyboardControllerState.setKeyboardControllerState
25
28
  });
26
29
  module.exports = __toCommonJS(index_exports);
27
- var import_portalState = require("./portalState"), import_gestureState = require("./gestureState"), import_workletsState = require("./workletsState"), import_safeAreaState = require("./safeAreaState"), import_linearGradientState = require("./linearGradientState"), import_components = require("./components");
30
+ var import_portalState = require("./portalState"), import_gestureState = require("./gestureState"), import_workletsState = require("./workletsState"), import_safeAreaState = require("./safeAreaState"), import_linearGradientState = require("./linearGradientState"), import_keyboardControllerState = require("./keyboardControllerState"), import_components = require("./components");
28
31
  //# sourceMappingURL=index.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts"],
4
- "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAoCA,yBAA0B,0BAI1B,sBAAkC,2BAIlC,uBAA4B,4BAI5B,uBAA4B,4BAI5B,6BAAkC,kCAIlC,oBAAqE;",
4
+ "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAqCA,yBAA0B,0BAI1B,sBAAkC,2BAIlC,uBAA4B,4BAI5B,uBAA4B,4BAI5B,6BAAkC,kCAIlC,iCAIO,sCAIP,oBAAqE;",
5
5
  "names": []
6
6
  }
@@ -26,10 +26,13 @@ __export(index_exports, {
26
26
  NativePortalHost: () => import_components.NativePortalHost,
27
27
  NativePortalProvider: () => import_components.NativePortalProvider,
28
28
  getGestureHandler: () => import_gestureState.getGestureHandler,
29
+ getKeyboardControllerState: () => import_keyboardControllerState.getKeyboardControllerState,
29
30
  getLinearGradient: () => import_linearGradientState.getLinearGradient,
30
31
  getPortal: () => import_portalState.getPortal,
31
32
  getSafeArea: () => import_safeAreaState.getSafeArea,
32
- getWorklets: () => import_workletsState.getWorklets
33
+ getWorklets: () => import_workletsState.getWorklets,
34
+ isKeyboardControllerEnabled: () => import_keyboardControllerState.isKeyboardControllerEnabled,
35
+ setKeyboardControllerState: () => import_keyboardControllerState.setKeyboardControllerState
33
36
  });
34
37
  module.exports = __toCommonJS(index_exports);
35
38
  var import_portalState = require("./portalState.native.js"),
@@ -37,5 +40,6 @@ var import_portalState = require("./portalState.native.js"),
37
40
  import_workletsState = require("./workletsState.native.js"),
38
41
  import_safeAreaState = require("./safeAreaState.native.js"),
39
42
  import_linearGradientState = require("./linearGradientState.native.js"),
43
+ import_keyboardControllerState = require("./keyboardControllerState.native.js"),
40
44
  import_components = require("./components.native.js");
41
45
  //# sourceMappingURL=index.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","index_exports","__export","NativePortal","import_components","NativePortalHost","NativePortalProvider","getGestureHandler","import_gestureState","getLinearGradient","import_linearGradientState","getPortal","import_portalState","getSafeArea","import_safeAreaState","getWorklets","import_workletsState","module","exports"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,aAAA;AAAAC,QAAA,CAAAD,aAAA;EAAAE,YAAA,EAAAA,CAAA,KAAAC,iBAAA,CAAAD,YAAA;EAAAE,gBAAA,EAAAA,CAAA,KAAAD,iBAAA,CAAAC,gBAAA;EAAAC,oBAAA,EAAAA,CAAA,KAAAF,iBAAA,CAAAE,oBAAA;EAAAC,iBAAA,EAAAA,CAAA,KAAAC,mBAAA,CAAAD,iBAAA;EAAAE,iBAAA,EAAAA,CAAA,KAAAC,0BAAA,CAAAD,iBAAA;EAAAE,SAAA,EAAAA,CAAA,KAAAC,kBAAA,CAAAD,SAAA;EAAAE,WAAA,EAAAA,CAAA,KAAAC,oBAAA,CAAAD,WAAA;EAAAE,WAAA,EAAAA,CAAA,KAAAC,oBAAA,CAAAD;AAAA;AAoCAE,MAAA,CAAAC,OAAA,GAAAtB,YAA0B,CAAAK,aAAA","ignoreList":[]}
1
+ {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","index_exports","__export","NativePortal","import_components","NativePortalHost","NativePortalProvider","getGestureHandler","import_gestureState","getKeyboardControllerState","import_keyboardControllerState","getLinearGradient","import_linearGradientState","getPortal","import_portalState","getSafeArea","import_safeAreaState","getWorklets","import_workletsState","isKeyboardControllerEnabled","setKeyboardControllerState","module","exports"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,aAAA;AAAAC,QAAA,CAAAD,aAAA;EAAAE,YAAA,EAAAA,CAAA,KAAAC,iBAAA,CAAAD,YAAA;EAAAE,gBAAA,EAAAA,CAAA,KAAAD,iBAAA,CAAAC,gBAAA;EAAAC,oBAAA,EAAAA,CAAA,KAAAF,iBAAA,CAAAE,oBAAA;EAAAC,iBAAA,EAAAA,CAAA,KAAAC,mBAAA,CAAAD,iBAAA;EAAAE,0BAAA,EAAAA,CAAA,KAAAC,8BAAA,CAAAD,0BAAA;EAAAE,iBAAA,EAAAA,CAAA,KAAAC,0BAAA,CAAAD,iBAAA;EAAAE,SAAA,EAAAA,CAAA,KAAAC,kBAAA,CAAAD,SAAA;EAAAE,WAAA,EAAAA,CAAA,KAAAC,oBAAA,CAAAD,WAAA;EAAAE,WAAA,EAAAA,CAAA,KAAAC,oBAAA,CAAAD,WAAA;EAAAE,2BAAA,EAAAA,CAAA,KAAAT,8BAAA,CAAAS,2BAAA;EAAAC,0BAAA,EAAAA,CAAA,KAAAV,8BAAA,CAAAU;AAAA;AAqCAC,MAAA,CAAAC,OAAA,GAAA1B,YAA0B,CAAAK,aAAA","ignoreList":[]}
@@ -0,0 +1,51 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: !0
9
+ });
10
+ },
11
+ __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
13
+ get: () => from[key],
14
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
+ });
16
+ return to;
17
+ };
18
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
19
+ value: !0
20
+ }), mod);
21
+ var keyboardControllerState_exports = {};
22
+ __export(keyboardControllerState_exports, {
23
+ getKeyboardControllerState: () => getKeyboardControllerState,
24
+ isKeyboardControllerEnabled: () => isKeyboardControllerEnabled,
25
+ setKeyboardControllerState: () => setKeyboardControllerState
26
+ });
27
+ module.exports = __toCommonJS(keyboardControllerState_exports);
28
+ const GLOBAL_KEY = "__tamagui_native_keyboard_controller_state__";
29
+ function getGlobalState() {
30
+ const g = globalThis;
31
+ return g[GLOBAL_KEY] || (g[GLOBAL_KEY] = {
32
+ enabled: !1,
33
+ KeyboardProvider: null,
34
+ KeyboardAwareScrollView: null,
35
+ useKeyboardHandler: null,
36
+ useReanimatedKeyboardAnimation: null,
37
+ KeyboardController: null,
38
+ KeyboardEvents: null,
39
+ KeyboardStickyView: null
40
+ }), g[GLOBAL_KEY];
41
+ }
42
+ function isKeyboardControllerEnabled() {
43
+ return getGlobalState().enabled;
44
+ }
45
+ function getKeyboardControllerState() {
46
+ return getGlobalState();
47
+ }
48
+ function setKeyboardControllerState(updates) {
49
+ const state = getGlobalState();
50
+ Object.assign(state, updates);
51
+ }
@@ -0,0 +1,46 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: !0 });
8
+ }, __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from == "object" || typeof from == "function")
10
+ for (let key of __getOwnPropNames(from))
11
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
15
+ var keyboardControllerState_exports = {};
16
+ __export(keyboardControllerState_exports, {
17
+ getKeyboardControllerState: () => getKeyboardControllerState,
18
+ isKeyboardControllerEnabled: () => isKeyboardControllerEnabled,
19
+ setKeyboardControllerState: () => setKeyboardControllerState
20
+ });
21
+ module.exports = __toCommonJS(keyboardControllerState_exports);
22
+ const GLOBAL_KEY = "__tamagui_native_keyboard_controller_state__";
23
+ function getGlobalState() {
24
+ const g = globalThis;
25
+ return g[GLOBAL_KEY] || (g[GLOBAL_KEY] = {
26
+ enabled: !1,
27
+ KeyboardProvider: null,
28
+ KeyboardAwareScrollView: null,
29
+ useKeyboardHandler: null,
30
+ useReanimatedKeyboardAnimation: null,
31
+ KeyboardController: null,
32
+ KeyboardEvents: null,
33
+ KeyboardStickyView: null
34
+ }), g[GLOBAL_KEY];
35
+ }
36
+ function isKeyboardControllerEnabled() {
37
+ return getGlobalState().enabled;
38
+ }
39
+ function getKeyboardControllerState() {
40
+ return getGlobalState();
41
+ }
42
+ function setKeyboardControllerState(updates) {
43
+ const state = getGlobalState();
44
+ Object.assign(state, updates);
45
+ }
46
+ //# sourceMappingURL=keyboardControllerState.js.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/keyboardControllerState.ts"],
4
+ "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAAM,aAAa;AAanB,SAAS,iBAA0C;AACjD,QAAM,IAAI;AACV,SAAK,EAAE,UAAU,MACf,EAAE,UAAU,IAAI;AAAA,IACd,SAAS;AAAA,IACT,kBAAkB;AAAA,IAClB,yBAAyB;AAAA,IACzB,oBAAoB;AAAA,IACpB,gCAAgC;AAAA,IAChC,oBAAoB;AAAA,IACpB,gBAAgB;AAAA,IAChB,oBAAoB;AAAA,EACtB,IAEK,EAAE,UAAU;AACrB;AAEO,SAAS,8BAAuC;AACrD,SAAO,eAAe,EAAE;AAC1B;AAEO,SAAS,6BAAsD;AACpE,SAAO,eAAe;AACxB;AAEO,SAAS,2BACd,SACM;AACN,QAAM,QAAQ,eAAe;AAC7B,SAAO,OAAO,OAAO,OAAO;AAC9B;",
5
+ "names": []
6
+ }
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: !0
11
+ });
12
+ },
13
+ __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
15
+ get: () => from[key],
16
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
+ });
18
+ return to;
19
+ };
20
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
21
+ value: !0
22
+ }), mod);
23
+ var keyboardControllerState_exports = {};
24
+ __export(keyboardControllerState_exports, {
25
+ getKeyboardControllerState: () => getKeyboardControllerState,
26
+ isKeyboardControllerEnabled: () => isKeyboardControllerEnabled,
27
+ setKeyboardControllerState: () => setKeyboardControllerState
28
+ });
29
+ module.exports = __toCommonJS(keyboardControllerState_exports);
30
+ var GLOBAL_KEY = "__tamagui_native_keyboard_controller_state__";
31
+ function getGlobalState() {
32
+ var g = globalThis;
33
+ return g[GLOBAL_KEY] || (g[GLOBAL_KEY] = {
34
+ enabled: !1,
35
+ KeyboardProvider: null,
36
+ KeyboardAwareScrollView: null,
37
+ useKeyboardHandler: null,
38
+ useReanimatedKeyboardAnimation: null,
39
+ KeyboardController: null,
40
+ KeyboardEvents: null,
41
+ KeyboardStickyView: null
42
+ }), g[GLOBAL_KEY];
43
+ }
44
+ function isKeyboardControllerEnabled() {
45
+ return getGlobalState().enabled;
46
+ }
47
+ function getKeyboardControllerState() {
48
+ return getGlobalState();
49
+ }
50
+ function setKeyboardControllerState(updates) {
51
+ var state = getGlobalState();
52
+ Object.assign(state, updates);
53
+ }
54
+ //# sourceMappingURL=keyboardControllerState.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","keyboardControllerState_exports","__export","getKeyboardControllerState","isKeyboardControllerEnabled","setKeyboardControllerState","module","exports","GLOBAL_KEY","getGlobalState","g","globalThis","enabled","KeyboardProvider","KeyboardAwareScrollView","useKeyboardHandler","useReanimatedKeyboardAnimation","KeyboardController","KeyboardEvents","KeyboardStickyView","updates","state","Object","assign"],"sources":["../../src/keyboardControllerState.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,+BAAA;AAAAC,QAAA,CAAAD,+BAAA;EAAAE,0BAAA,EAAAA,CAAA,KAAAA,0BAAA;EAAAC,2BAAA,EAAAA,CAAA,KAAAA,2BAAA;EAAAC,0BAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAM,CAAAC,OAAA,GAAAX,YAAa,CAAAK,+BAAA;AAanB,IAAAO,UAAS,iDAA0C;AACjD,SAAMC,cAAIA,CAAA;EACV,IAAAC,CAAA,GAAKC,UAAE;EACW,OACdD,CAAA,CAAAF,UAAS,MAAAE,CAAA,CAAAF,UAAA;IACTI,OAAA;IACAC,gBAAA;IACAC,uBAAoB;IACpBC,kBAAA;IACAC,8BAAoB;IACpBC,kBAAgB;IAChBC,cAAA,MAAoB;IACtBC,kBAEiB;EACrB,IAAAT,CAAA,CAAAF,UAAA;AAEO;AACL,SAAOJ,2BAAiBA,CAAA;EAC1B,OAAAK,cAAA,GAAAG,OAAA;AAEO;AACL,SAAOT,0BAAeA,CAAA;EACxB,OAAAM,cAAA;AAEO;AAGL,SAAMJ,0BAAuBA,CAAAe,OAAA;EAC7B,IAAAC,KAAO,GAAAZ,cAAc,EAAO;EAC9Ba,MAAA,CAAAC,MAAA,CAAAF,KAAA,EAAAD,OAAA","ignoreList":[]}
File without changes
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=setup-keyboard-controller.web.js.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "mappings": "",
5
+ "names": []
6
+ }
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+
3
+ var import_keyboardControllerState = require("./keyboardControllerState.native.js");
4
+ function setup() {
5
+ var g = globalThis;
6
+ if (!g.__tamagui_native_keyboard_controller_setup_complete) {
7
+ g.__tamagui_native_keyboard_controller_setup_complete = !0;
8
+ try {
9
+ var rnkc = require("react-native-keyboard-controller"),
10
+ {
11
+ KeyboardProvider,
12
+ KeyboardAwareScrollView,
13
+ useKeyboardHandler,
14
+ useReanimatedKeyboardAnimation,
15
+ KeyboardController,
16
+ KeyboardEvents,
17
+ KeyboardStickyView
18
+ } = rnkc;
19
+ useKeyboardHandler && KeyboardProvider && (0, import_keyboardControllerState.setKeyboardControllerState)({
20
+ enabled: !0,
21
+ KeyboardProvider: KeyboardProvider || null,
22
+ KeyboardAwareScrollView: KeyboardAwareScrollView || null,
23
+ useKeyboardHandler: useKeyboardHandler || null,
24
+ useReanimatedKeyboardAnimation: useReanimatedKeyboardAnimation || null,
25
+ KeyboardController: KeyboardController || null,
26
+ KeyboardEvents: KeyboardEvents || null,
27
+ KeyboardStickyView: KeyboardStickyView || null
28
+ });
29
+ } catch {}
30
+ }
31
+ }
32
+ setup();
33
+ //# sourceMappingURL=setup-keyboard-controller.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":[],"sourcesContent":[],"mappings":"","ignoreList":[]}
package/dist/esm/index.js CHANGED
@@ -3,15 +3,23 @@ import { getGestureHandler } from "./gestureState";
3
3
  import { getWorklets } from "./workletsState";
4
4
  import { getSafeArea } from "./safeAreaState";
5
5
  import { getLinearGradient } from "./linearGradientState";
6
+ import {
7
+ isKeyboardControllerEnabled,
8
+ getKeyboardControllerState,
9
+ setKeyboardControllerState
10
+ } from "./keyboardControllerState";
6
11
  import { NativePortal, NativePortalHost, NativePortalProvider } from "./components";
7
12
  export {
8
13
  NativePortal,
9
14
  NativePortalHost,
10
15
  NativePortalProvider,
11
16
  getGestureHandler,
17
+ getKeyboardControllerState,
12
18
  getLinearGradient,
13
19
  getPortal,
14
20
  getSafeArea,
15
- getWorklets
21
+ getWorklets,
22
+ isKeyboardControllerEnabled,
23
+ setKeyboardControllerState
16
24
  };
17
25
  //# sourceMappingURL=index.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts"],
4
- "mappings": "AAoCA,SAAS,iBAAiB;AAI1B,SAAS,yBAAyB;AAIlC,SAAS,mBAAmB;AAI5B,SAAS,mBAAmB;AAI5B,SAAS,yBAAyB;AAIlC,SAAS,cAAc,kBAAkB,4BAA4B;",
4
+ "mappings": "AAqCA,SAAS,iBAAiB;AAI1B,SAAS,yBAAyB;AAIlC,SAAS,mBAAmB;AAI5B,SAAS,mBAAmB;AAI5B,SAAS,yBAAyB;AAIlC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAIP,SAAS,cAAc,kBAAkB,4BAA4B;",
5
5
  "names": []
6
6
  }
@@ -3,6 +3,7 @@ import { getGestureHandler } from "./gestureState.mjs";
3
3
  import { getWorklets } from "./workletsState.mjs";
4
4
  import { getSafeArea } from "./safeAreaState.mjs";
5
5
  import { getLinearGradient } from "./linearGradientState.mjs";
6
+ import { isKeyboardControllerEnabled, getKeyboardControllerState, setKeyboardControllerState } from "./keyboardControllerState.mjs";
6
7
  import { NativePortal, NativePortalHost, NativePortalProvider } from "./components.mjs";
7
- export { NativePortal, NativePortalHost, NativePortalProvider, getGestureHandler, getLinearGradient, getPortal, getSafeArea, getWorklets };
8
+ export { NativePortal, NativePortalHost, NativePortalProvider, getGestureHandler, getKeyboardControllerState, getLinearGradient, getPortal, getSafeArea, getWorklets, isKeyboardControllerEnabled, setKeyboardControllerState };
8
9
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"names":["getPortal","getGestureHandler","getWorklets","getSafeArea","getLinearGradient","NativePortal","NativePortalHost","NativePortalProvider"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAoCA,SAASA,SAAA,QAAiB;AAI1B,SAASC,iBAAA,QAAyB;AAIlC,SAASC,WAAA,QAAmB;AAI5B,SAASC,WAAA,QAAmB;AAI5B,SAASC,iBAAA,QAAyB;AAIlC,SAASC,YAAA,EAAcC,gBAAA,EAAkBC,oBAAA,QAA4B","ignoreList":[]}
1
+ {"version":3,"names":["getPortal","getGestureHandler","getWorklets","getSafeArea","getLinearGradient","isKeyboardControllerEnabled","getKeyboardControllerState","setKeyboardControllerState","NativePortal","NativePortalHost","NativePortalProvider"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAqCA,SAASA,SAAA,QAAiB;AAI1B,SAASC,iBAAA,QAAyB;AAIlC,SAASC,WAAA,QAAmB;AAI5B,SAASC,WAAA,QAAmB;AAI5B,SAASC,iBAAA,QAAyB;AAIlC,SACEC,2BAAA,EACAC,0BAAA,EACAC,0BAAA,QACK;AAIP,SAASC,YAAA,EAAcC,gBAAA,EAAkBC,oBAAA,QAA4B","ignoreList":[]}
@@ -3,6 +3,7 @@ import { getGestureHandler } from "./gestureState.native.js";
3
3
  import { getWorklets } from "./workletsState.native.js";
4
4
  import { getSafeArea } from "./safeAreaState.native.js";
5
5
  import { getLinearGradient } from "./linearGradientState.native.js";
6
+ import { isKeyboardControllerEnabled, getKeyboardControllerState, setKeyboardControllerState } from "./keyboardControllerState.native.js";
6
7
  import { NativePortal, NativePortalHost, NativePortalProvider } from "./components.native.js";
7
- export { NativePortal, NativePortalHost, NativePortalProvider, getGestureHandler, getLinearGradient, getPortal, getSafeArea, getWorklets };
8
+ export { NativePortal, NativePortalHost, NativePortalProvider, getGestureHandler, getKeyboardControllerState, getLinearGradient, getPortal, getSafeArea, getWorklets, isKeyboardControllerEnabled, setKeyboardControllerState };
8
9
  //# sourceMappingURL=index.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["getPortal","getGestureHandler","getWorklets","getSafeArea","getLinearGradient","NativePortal","NativePortalHost","NativePortalProvider"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAoCA,SAASA,SAAA,QAAiB;AAI1B,SAASC,iBAAA,QAAyB;AAIlC,SAASC,WAAA,QAAmB;AAI5B,SAASC,WAAA,QAAmB;AAI5B,SAASC,iBAAA,QAAyB;AAIlC,SAASC,YAAA,EAAcC,gBAAA,EAAkBC,oBAAA,QAA4B","ignoreList":[]}
1
+ {"version":3,"names":["getPortal","getGestureHandler","getWorklets","getSafeArea","getLinearGradient","isKeyboardControllerEnabled","getKeyboardControllerState","setKeyboardControllerState","NativePortal","NativePortalHost","NativePortalProvider"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAqCA,SAASA,SAAA,QAAiB;AAI1B,SAASC,iBAAA,QAAyB;AAIlC,SAASC,WAAA,QAAmB;AAI5B,SAASC,WAAA,QAAmB;AAI5B,SAASC,iBAAA,QAAyB;AAIlC,SAAAC,2BAAA,EAAAC,0BAAA,EAAAC,0BAAA;AAAA,SACEC,YAAA,EAAAC,gBAAA,EAAAC,oBAAA;AAAA,SAEAF,YAAA,EAAAC,gBACK,EAIPC,oBAAS,E","ignoreList":[]}
@@ -0,0 +1,30 @@
1
+ const GLOBAL_KEY = "__tamagui_native_keyboard_controller_state__";
2
+ function getGlobalState() {
3
+ const g = globalThis;
4
+ return g[GLOBAL_KEY] || (g[GLOBAL_KEY] = {
5
+ enabled: !1,
6
+ KeyboardProvider: null,
7
+ KeyboardAwareScrollView: null,
8
+ useKeyboardHandler: null,
9
+ useReanimatedKeyboardAnimation: null,
10
+ KeyboardController: null,
11
+ KeyboardEvents: null,
12
+ KeyboardStickyView: null
13
+ }), g[GLOBAL_KEY];
14
+ }
15
+ function isKeyboardControllerEnabled() {
16
+ return getGlobalState().enabled;
17
+ }
18
+ function getKeyboardControllerState() {
19
+ return getGlobalState();
20
+ }
21
+ function setKeyboardControllerState(updates) {
22
+ const state = getGlobalState();
23
+ Object.assign(state, updates);
24
+ }
25
+ export {
26
+ getKeyboardControllerState,
27
+ isKeyboardControllerEnabled,
28
+ setKeyboardControllerState
29
+ };
30
+ //# sourceMappingURL=keyboardControllerState.js.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/keyboardControllerState.ts"],
4
+ "mappings": "AAAA,MAAM,aAAa;AAanB,SAAS,iBAA0C;AACjD,QAAM,IAAI;AACV,SAAK,EAAE,UAAU,MACf,EAAE,UAAU,IAAI;AAAA,IACd,SAAS;AAAA,IACT,kBAAkB;AAAA,IAClB,yBAAyB;AAAA,IACzB,oBAAoB;AAAA,IACpB,gCAAgC;AAAA,IAChC,oBAAoB;AAAA,IACpB,gBAAgB;AAAA,IAChB,oBAAoB;AAAA,EACtB,IAEK,EAAE,UAAU;AACrB;AAEO,SAAS,8BAAuC;AACrD,SAAO,eAAe,EAAE;AAC1B;AAEO,SAAS,6BAAsD;AACpE,SAAO,eAAe;AACxB;AAEO,SAAS,2BACd,SACM;AACN,QAAM,QAAQ,eAAe;AAC7B,SAAO,OAAO,OAAO,OAAO;AAC9B;",
5
+ "names": []
6
+ }
@@ -0,0 +1,26 @@
1
+ const GLOBAL_KEY = "__tamagui_native_keyboard_controller_state__";
2
+ function getGlobalState() {
3
+ const g = globalThis;
4
+ return g[GLOBAL_KEY] || (g[GLOBAL_KEY] = {
5
+ enabled: !1,
6
+ KeyboardProvider: null,
7
+ KeyboardAwareScrollView: null,
8
+ useKeyboardHandler: null,
9
+ useReanimatedKeyboardAnimation: null,
10
+ KeyboardController: null,
11
+ KeyboardEvents: null,
12
+ KeyboardStickyView: null
13
+ }), g[GLOBAL_KEY];
14
+ }
15
+ function isKeyboardControllerEnabled() {
16
+ return getGlobalState().enabled;
17
+ }
18
+ function getKeyboardControllerState() {
19
+ return getGlobalState();
20
+ }
21
+ function setKeyboardControllerState(updates) {
22
+ const state = getGlobalState();
23
+ Object.assign(state, updates);
24
+ }
25
+ export { getKeyboardControllerState, isKeyboardControllerEnabled, setKeyboardControllerState };
26
+ //# sourceMappingURL=keyboardControllerState.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["GLOBAL_KEY","getGlobalState","g","globalThis","enabled","KeyboardProvider","KeyboardAwareScrollView","useKeyboardHandler","useReanimatedKeyboardAnimation","KeyboardController","KeyboardEvents","KeyboardStickyView","isKeyboardControllerEnabled","getKeyboardControllerState","setKeyboardControllerState","updates","state","Object","assign"],"sources":["../../src/keyboardControllerState.ts"],"sourcesContent":[null],"mappings":"AAAA,MAAMA,UAAA,GAAa;AAanB,SAASC,eAAA,EAA0C;EACjD,MAAMC,CAAA,GAAIC,UAAA;EACV,OAAKD,CAAA,CAAEF,UAAU,MACfE,CAAA,CAAEF,UAAU,IAAI;IACdI,OAAA,EAAS;IACTC,gBAAA,EAAkB;IAClBC,uBAAA,EAAyB;IACzBC,kBAAA,EAAoB;IACpBC,8BAAA,EAAgC;IAChCC,kBAAA,EAAoB;IACpBC,cAAA,EAAgB;IAChBC,kBAAA,EAAoB;EACtB,IAEKT,CAAA,CAAEF,UAAU;AACrB;AAEO,SAASY,4BAAA,EAAuC;EACrD,OAAOX,cAAA,CAAe,EAAEG,OAAA;AAC1B;AAEO,SAASS,2BAAA,EAAsD;EACpE,OAAOZ,cAAA,CAAe;AACxB;AAEO,SAASa,2BACdC,OAAA,EACM;EACN,MAAMC,KAAA,GAAQf,cAAA,CAAe;EAC7BgB,MAAA,CAAOC,MAAA,CAAOF,KAAA,EAAOD,OAAO;AAC9B","ignoreList":[]}
@@ -0,0 +1,26 @@
1
+ var GLOBAL_KEY = "__tamagui_native_keyboard_controller_state__";
2
+ function getGlobalState() {
3
+ var g = globalThis;
4
+ return g[GLOBAL_KEY] || (g[GLOBAL_KEY] = {
5
+ enabled: !1,
6
+ KeyboardProvider: null,
7
+ KeyboardAwareScrollView: null,
8
+ useKeyboardHandler: null,
9
+ useReanimatedKeyboardAnimation: null,
10
+ KeyboardController: null,
11
+ KeyboardEvents: null,
12
+ KeyboardStickyView: null
13
+ }), g[GLOBAL_KEY];
14
+ }
15
+ function isKeyboardControllerEnabled() {
16
+ return getGlobalState().enabled;
17
+ }
18
+ function getKeyboardControllerState() {
19
+ return getGlobalState();
20
+ }
21
+ function setKeyboardControllerState(updates) {
22
+ var state = getGlobalState();
23
+ Object.assign(state, updates);
24
+ }
25
+ export { getKeyboardControllerState, isKeyboardControllerEnabled, setKeyboardControllerState };
26
+ //# sourceMappingURL=keyboardControllerState.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["GLOBAL_KEY","getGlobalState","g","globalThis","enabled","KeyboardProvider","KeyboardAwareScrollView","useKeyboardHandler","useReanimatedKeyboardAnimation","KeyboardController","KeyboardEvents","KeyboardStickyView","isKeyboardControllerEnabled","getKeyboardControllerState","setKeyboardControllerState","updates","state","Object","assign"],"sources":["../../src/keyboardControllerState.ts"],"sourcesContent":[null],"mappings":"AAAA,IAAAA,UAAM,iDAAa;AAanB,SAASC,eAAA,EAA0C;EACjD,IAAAC,CAAA,GAAMC,UAAI;EACV,OAAKD,CAAA,CAAEF,UAAU,MACfE,CAAA,CAAEF,UAAU,IAAI;IACdI,OAAA,EAAS;IACTC,gBAAA,EAAkB;IAClBC,uBAAA,EAAyB;IACzBC,kBAAA,EAAoB;IACpBC,8BAAA,EAAgC;IAChCC,kBAAA,EAAoB;IACpBC,cAAA,EAAgB;IAChBC,kBAAA,EAAoB;EACtB,IAEKT,CAAA,CAAEF,UAAU;AACrB;AAEO,SAASY,4BAAA,EAAuC;EACrD,OAAOX,cAAA,CAAe,EAAEG,OAAA;AAC1B;AAEO,SAASS,2BAAA,EAAsD;EACpE,OAAOZ,cAAA,CAAe;AACxB;AAEO,SAASa,2BACdC,OAAA,EACM;EACN,IAAAC,KAAM,GAAAf,cAAQ;EACdgB,MAAA,CAAOC,MAAA,CAAOF,KAAA,EAAOD,OAAO;AAC9B","ignoreList":[]}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=setup-keyboard-controller.web.js.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "mappings": "",
5
+ "names": []
6
+ }
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=setup-keyboard-controller.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["setup-keyboard-controller.mjs"],"sourcesContent":["//# sourceMappingURL=setup-keyboard-controller.web.js.map\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,31 @@
1
+ import { setKeyboardControllerState } from "./keyboardControllerState.native.js";
2
+ function setup() {
3
+ var g = globalThis;
4
+ if (!g.__tamagui_native_keyboard_controller_setup_complete) {
5
+ g.__tamagui_native_keyboard_controller_setup_complete = !0;
6
+ try {
7
+ var rnkc = require("react-native-keyboard-controller"),
8
+ {
9
+ KeyboardProvider,
10
+ KeyboardAwareScrollView,
11
+ useKeyboardHandler,
12
+ useReanimatedKeyboardAnimation,
13
+ KeyboardController,
14
+ KeyboardEvents,
15
+ KeyboardStickyView
16
+ } = rnkc;
17
+ useKeyboardHandler && KeyboardProvider && setKeyboardControllerState({
18
+ enabled: !0,
19
+ KeyboardProvider: KeyboardProvider || null,
20
+ KeyboardAwareScrollView: KeyboardAwareScrollView || null,
21
+ useKeyboardHandler: useKeyboardHandler || null,
22
+ useReanimatedKeyboardAnimation: useReanimatedKeyboardAnimation || null,
23
+ KeyboardController: KeyboardController || null,
24
+ KeyboardEvents: KeyboardEvents || null,
25
+ KeyboardStickyView: KeyboardStickyView || null
26
+ });
27
+ } catch {}
28
+ }
29
+ }
30
+ setup();
31
+ //# sourceMappingURL=setup-keyboard-controller.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":[],"sourcesContent":[],"mappings":"","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/native",
3
- "version": "2.0.0-1769546410712",
3
+ "version": "2.0.0-1769573246601",
4
4
  "description": "Native setup modules for Tamagui - portals, gesture handler, worklets, and more",
5
5
  "type": "module",
6
6
  "sideEffects": [
@@ -38,6 +38,9 @@
38
38
  ],
39
39
  "setup-expo-linear-gradient": [
40
40
  "./types/setup-expo-linear-gradient.d.ts"
41
+ ],
42
+ "setup-keyboard-controller": [
43
+ "./types/setup-keyboard-controller.d.ts"
41
44
  ]
42
45
  }
43
46
  },
@@ -114,13 +117,26 @@
114
117
  "module": "./dist/esm/setup-expo-linear-gradient.mjs",
115
118
  "import": "./dist/esm/setup-expo-linear-gradient.mjs",
116
119
  "require": "./dist/cjs/setup-expo-linear-gradient.cjs"
120
+ },
121
+ "./setup-keyboard-controller": {
122
+ "react-native": {
123
+ "types": "./types/setup-keyboard-controller.d.ts",
124
+ "module": "./dist/esm/setup-keyboard-controller.native.js",
125
+ "import": "./dist/esm/setup-keyboard-controller.native.js",
126
+ "require": "./dist/cjs/setup-keyboard-controller.native.js"
127
+ },
128
+ "types": "./types/setup-keyboard-controller.d.ts",
129
+ "module": "./dist/esm/setup-keyboard-controller.mjs",
130
+ "import": "./dist/esm/setup-keyboard-controller.mjs",
131
+ "require": "./dist/cjs/setup-keyboard-controller.cjs"
117
132
  }
118
133
  },
119
134
  "devDependencies": {
120
- "@tamagui/build": "2.0.0-1769546410712",
135
+ "@tamagui/build": "2.0.0-1769573246601",
121
136
  "react": "*",
122
137
  "react-native": "0.81.5",
123
138
  "react-native-gesture-handler": "~2.28.0",
139
+ "react-native-keyboard-controller": "^1.16.0",
124
140
  "react-native-safe-area-context": "~5.6.0",
125
141
  "react-native-teleport": "^0.5.6",
126
142
  "react-native-worklets-core": "^1.0.0"
@@ -129,6 +145,7 @@
129
145
  "react": "*",
130
146
  "react-native": "*",
131
147
  "react-native-gesture-handler": ">=2.0.0",
148
+ "react-native-keyboard-controller": ">=1.0.0",
132
149
  "react-native-safe-area-context": ">=4.0.0",
133
150
  "react-native-teleport": ">=0.5.0",
134
151
  "react-native-worklets-core": ">=1.0.0"
@@ -137,6 +154,9 @@
137
154
  "react-native-gesture-handler": {
138
155
  "optional": true
139
156
  },
157
+ "react-native-keyboard-controller": {
158
+ "optional": true
159
+ },
140
160
  "react-native-safe-area-context": {
141
161
  "optional": true
142
162
  },
package/src/index.ts CHANGED
@@ -11,6 +11,7 @@
11
11
  * import '@tamagui/native/setup-worklets'
12
12
  * import '@tamagui/native/setup-safe-area'
13
13
  * import '@tamagui/native/expo-linear-gradient'
14
+ * import '@tamagui/native/setup-keyboard-controller'
14
15
  *
15
16
  * // Then use Tamagui components normally
16
17
  * // Sheet will automatically use native gestures when available
@@ -53,5 +54,13 @@ export type { SafeAreaAccessor } from './safeAreaState'
53
54
  export { getLinearGradient } from './linearGradientState'
54
55
  export type { LinearGradientAccessor } from './linearGradientState'
55
56
 
57
+ // keyboard controller state exports (safe - no side effects)
58
+ export {
59
+ isKeyboardControllerEnabled,
60
+ getKeyboardControllerState,
61
+ setKeyboardControllerState,
62
+ } from './keyboardControllerState'
63
+ export type { KeyboardControllerState } from './keyboardControllerState'
64
+
56
65
  // components
57
66
  export { NativePortal, NativePortalHost, NativePortalProvider } from './components'
@@ -0,0 +1,44 @@
1
+ const GLOBAL_KEY = '__tamagui_native_keyboard_controller_state__'
2
+
3
+ export interface KeyboardControllerState {
4
+ enabled: boolean
5
+ KeyboardProvider: any
6
+ KeyboardAwareScrollView: any
7
+ useKeyboardHandler: any
8
+ useReanimatedKeyboardAnimation: any
9
+ KeyboardController: any
10
+ KeyboardEvents: any
11
+ KeyboardStickyView: any
12
+ }
13
+
14
+ function getGlobalState(): KeyboardControllerState {
15
+ const g = globalThis as any
16
+ if (!g[GLOBAL_KEY]) {
17
+ g[GLOBAL_KEY] = {
18
+ enabled: false,
19
+ KeyboardProvider: null,
20
+ KeyboardAwareScrollView: null,
21
+ useKeyboardHandler: null,
22
+ useReanimatedKeyboardAnimation: null,
23
+ KeyboardController: null,
24
+ KeyboardEvents: null,
25
+ KeyboardStickyView: null,
26
+ }
27
+ }
28
+ return g[GLOBAL_KEY]
29
+ }
30
+
31
+ export function isKeyboardControllerEnabled(): boolean {
32
+ return getGlobalState().enabled
33
+ }
34
+
35
+ export function getKeyboardControllerState(): KeyboardControllerState {
36
+ return getGlobalState()
37
+ }
38
+
39
+ export function setKeyboardControllerState(
40
+ updates: Partial<KeyboardControllerState>
41
+ ): void {
42
+ const state = getGlobalState()
43
+ Object.assign(state, updates)
44
+ }
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Setup keyboard controller for Tamagui native components.
3
+ *
4
+ * Simply import this module at the top of your app entry point:
5
+ *
6
+ * @example
7
+ * ```tsx
8
+ * import '@tamagui/native/setup-keyboard-controller'
9
+ * ```
10
+ *
11
+ * This automatically detects and configures react-native-keyboard-controller
12
+ * for use with Sheet and other keyboard-aware components.
13
+ *
14
+ * When enabled, Sheet gains:
15
+ * - Frame-by-frame keyboard tracking (60/120 FPS)
16
+ * - Smooth gesture + keyboard handoff
17
+ * - Interactive keyboard dismiss on sheet drag
18
+ */
19
+
20
+ import { setKeyboardControllerState } from './keyboardControllerState'
21
+
22
+ function setup() {
23
+ const g = globalThis as any
24
+ if (g.__tamagui_native_keyboard_controller_setup_complete) {
25
+ return
26
+ }
27
+ g.__tamagui_native_keyboard_controller_setup_complete = true
28
+
29
+ try {
30
+ // dynamically require keyboard-controller - it should already be imported by the app
31
+ const rnkc = require('react-native-keyboard-controller')
32
+ const {
33
+ KeyboardProvider,
34
+ KeyboardAwareScrollView,
35
+ useKeyboardHandler,
36
+ useReanimatedKeyboardAnimation,
37
+ KeyboardController,
38
+ KeyboardEvents,
39
+ KeyboardStickyView,
40
+ } = rnkc
41
+
42
+ if (useKeyboardHandler && KeyboardProvider) {
43
+ setKeyboardControllerState({
44
+ enabled: true,
45
+ KeyboardProvider: KeyboardProvider || null,
46
+ KeyboardAwareScrollView: KeyboardAwareScrollView || null,
47
+ useKeyboardHandler: useKeyboardHandler || null,
48
+ useReanimatedKeyboardAnimation: useReanimatedKeyboardAnimation || null,
49
+ KeyboardController: KeyboardController || null,
50
+ KeyboardEvents: KeyboardEvents || null,
51
+ KeyboardStickyView: KeyboardStickyView || null,
52
+ })
53
+ }
54
+ } catch {
55
+ // keyboard-controller not available, that's fine
56
+ }
57
+ }
58
+
59
+ // run setup immediately on import
60
+ setup()
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Web stub for keyboard controller setup.
3
+ * No-op on web - keyboard-controller is native-only.
4
+ */
5
+
6
+ // intentionally empty - web doesn't need keyboard-controller
package/types/index.d.ts CHANGED
@@ -11,6 +11,7 @@
11
11
  * import '@tamagui/native/setup-worklets'
12
12
  * import '@tamagui/native/setup-safe-area'
13
13
  * import '@tamagui/native/expo-linear-gradient'
14
+ * import '@tamagui/native/setup-keyboard-controller'
14
15
  *
15
16
  * // Then use Tamagui components normally
16
17
  * // Sheet will automatically use native gestures when available
@@ -28,6 +29,8 @@ export { getSafeArea } from "./safeAreaState";
28
29
  export type { SafeAreaAccessor } from "./safeAreaState";
29
30
  export { getLinearGradient } from "./linearGradientState";
30
31
  export type { LinearGradientAccessor } from "./linearGradientState";
32
+ export { isKeyboardControllerEnabled, getKeyboardControllerState, setKeyboardControllerState } from "./keyboardControllerState";
33
+ export type { KeyboardControllerState } from "./keyboardControllerState";
31
34
  export { NativePortal, NativePortalHost, NativePortalProvider } from "./components";
32
35
 
33
36
  //# sourceMappingURL=index.d.ts.map
@@ -1,11 +1,11 @@
1
1
  {
2
- "mappings": ";;;;;;;;;;;;;;;;;;;AAqBA,cACE,mBACA,cACA,eACA,eACA,gBACA,eACA,iBACA,qBACA,mBACA,uBACA,iCACK;AAGP,SAAS,iBAAiB;AAC1B,cAAc,sBAAsB;AAGpC,SAAS,yBAAyB;AAClC,cAAc,wBAAwB,0BAA0B;AAGhE,SAAS,mBAAmB;AAC5B,cAAc,wBAAwB;AAGtC,SAAS,mBAAmB;AAC5B,cAAc,wBAAwB;AAGtC,SAAS,yBAAyB;AAClC,cAAc,8BAA8B;AAG5C,SAAS,cAAc,kBAAkB,4BAA4B",
2
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAsBA,cACE,mBACA,cACA,eACA,eACA,gBACA,eACA,iBACA,qBACA,mBACA,uBACA,iCACK;AAGP,SAAS,iBAAiB;AAC1B,cAAc,sBAAsB;AAGpC,SAAS,yBAAyB;AAClC,cAAc,wBAAwB,0BAA0B;AAGhE,SAAS,mBAAmB;AAC5B,cAAc,wBAAwB;AAGtC,SAAS,mBAAmB;AAC5B,cAAc,wBAAwB;AAGtC,SAAS,yBAAyB;AAClC,cAAc,8BAA8B;AAG5C,SACE,6BACA,4BACA,kCACK;AACP,cAAc,+BAA+B;AAG7C,SAAS,cAAc,kBAAkB,4BAA4B",
3
3
  "names": [],
4
4
  "sources": [
5
5
  "src/index.ts"
6
6
  ],
7
7
  "sourcesContent": [
8
- "/**\n * @tamagui/native\n *\n * Native setup modules for Tamagui. Import these at the top of your app entry point.\n *\n * @example\n * ```tsx\n * // In your app entry (index.js or App.tsx)\n * import '@tamagui/native/setup-teleport'\n * import '@tamagui/native/setup-gesture-handler'\n * import '@tamagui/native/setup-worklets'\n * import '@tamagui/native/setup-safe-area'\n * import '@tamagui/native/expo-linear-gradient'\n *\n * // Then use Tamagui components normally\n * // Sheet will automatically use native gestures when available\n * // LinearGradient will use expo-linear-gradient when installed\n * ```\n */\n\n// types\nexport type {\n NativePortalState,\n GestureState,\n WorkletsState,\n SafeAreaState,\n SafeAreaInsets,\n SafeAreaFrame,\n SafeAreaMetrics,\n LinearGradientState,\n NativePortalProps,\n NativePortalHostProps,\n NativePortalProviderProps,\n} from './types'\n\n// portal\nexport { getPortal } from './portalState'\nexport type { PortalAccessor } from './portalState'\n\n// gesture handler\nexport { getGestureHandler } from './gestureState'\nexport type { GestureHandlerAccessor, PressGestureConfig } from './gestureState'\n\n// worklets\nexport { getWorklets } from './workletsState'\nexport type { WorkletsAccessor } from './workletsState'\n\n// safe area\nexport { getSafeArea } from './safeAreaState'\nexport type { SafeAreaAccessor } from './safeAreaState'\n\n// linear gradient\nexport { getLinearGradient } from './linearGradientState'\nexport type { LinearGradientAccessor } from './linearGradientState'\n\n// components\nexport { NativePortal, NativePortalHost, NativePortalProvider } from './components'\n"
8
+ "/**\n * @tamagui/native\n *\n * Native setup modules for Tamagui. Import these at the top of your app entry point.\n *\n * @example\n * ```tsx\n * // In your app entry (index.js or App.tsx)\n * import '@tamagui/native/setup-teleport'\n * import '@tamagui/native/setup-gesture-handler'\n * import '@tamagui/native/setup-worklets'\n * import '@tamagui/native/setup-safe-area'\n * import '@tamagui/native/expo-linear-gradient'\n * import '@tamagui/native/setup-keyboard-controller'\n *\n * // Then use Tamagui components normally\n * // Sheet will automatically use native gestures when available\n * // LinearGradient will use expo-linear-gradient when installed\n * ```\n */\n\n// types\nexport type {\n NativePortalState,\n GestureState,\n WorkletsState,\n SafeAreaState,\n SafeAreaInsets,\n SafeAreaFrame,\n SafeAreaMetrics,\n LinearGradientState,\n NativePortalProps,\n NativePortalHostProps,\n NativePortalProviderProps,\n} from './types'\n\n// portal\nexport { getPortal } from './portalState'\nexport type { PortalAccessor } from './portalState'\n\n// gesture handler\nexport { getGestureHandler } from './gestureState'\nexport type { GestureHandlerAccessor, PressGestureConfig } from './gestureState'\n\n// worklets\nexport { getWorklets } from './workletsState'\nexport type { WorkletsAccessor } from './workletsState'\n\n// safe area\nexport { getSafeArea } from './safeAreaState'\nexport type { SafeAreaAccessor } from './safeAreaState'\n\n// linear gradient\nexport { getLinearGradient } from './linearGradientState'\nexport type { LinearGradientAccessor } from './linearGradientState'\n\n// keyboard controller state exports (safe - no side effects)\nexport {\n isKeyboardControllerEnabled,\n getKeyboardControllerState,\n setKeyboardControllerState,\n} from './keyboardControllerState'\nexport type { KeyboardControllerState } from './keyboardControllerState'\n\n// components\nexport { NativePortal, NativePortalHost, NativePortalProvider } from './components'\n"
9
9
  ],
10
10
  "version": 3
11
11
  }
@@ -0,0 +1,15 @@
1
+ export interface KeyboardControllerState {
2
+ enabled: boolean;
3
+ KeyboardProvider: any;
4
+ KeyboardAwareScrollView: any;
5
+ useKeyboardHandler: any;
6
+ useReanimatedKeyboardAnimation: any;
7
+ KeyboardController: any;
8
+ KeyboardEvents: any;
9
+ KeyboardStickyView: any;
10
+ }
11
+ export declare function isKeyboardControllerEnabled(): boolean;
12
+ export declare function getKeyboardControllerState(): KeyboardControllerState;
13
+ export declare function setKeyboardControllerState(updates: Partial<KeyboardControllerState>): void;
14
+
15
+ //# sourceMappingURL=keyboardControllerState.d.ts.map
@@ -0,0 +1,11 @@
1
+ {
2
+ "mappings": "AAEA,iBAAiB,wBAAwB;CACvC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;;AAoBF,OAAO,iBAAS;AAIhB,OAAO,iBAAS,8BAA8B;AAI9C,OAAO,iBAAS,2BACd,SAAS,QAAQ",
3
+ "names": [],
4
+ "sources": [
5
+ "src/keyboardControllerState.ts"
6
+ ],
7
+ "sourcesContent": [
8
+ "const GLOBAL_KEY = '__tamagui_native_keyboard_controller_state__'\n\nexport interface KeyboardControllerState {\n enabled: boolean\n KeyboardProvider: any\n KeyboardAwareScrollView: any\n useKeyboardHandler: any\n useReanimatedKeyboardAnimation: any\n KeyboardController: any\n KeyboardEvents: any\n KeyboardStickyView: any\n}\n\nfunction getGlobalState(): KeyboardControllerState {\n const g = globalThis as any\n if (!g[GLOBAL_KEY]) {\n g[GLOBAL_KEY] = {\n enabled: false,\n KeyboardProvider: null,\n KeyboardAwareScrollView: null,\n useKeyboardHandler: null,\n useReanimatedKeyboardAnimation: null,\n KeyboardController: null,\n KeyboardEvents: null,\n KeyboardStickyView: null,\n }\n }\n return g[GLOBAL_KEY]\n}\n\nexport function isKeyboardControllerEnabled(): boolean {\n return getGlobalState().enabled\n}\n\nexport function getKeyboardControllerState(): KeyboardControllerState {\n return getGlobalState()\n}\n\nexport function setKeyboardControllerState(\n updates: Partial<KeyboardControllerState>\n): void {\n const state = getGlobalState()\n Object.assign(state, updates)\n}\n"
9
+ ],
10
+ "version": 3
11
+ }
@@ -0,0 +1,3 @@
1
+ export {};
2
+
3
+ //# sourceMappingURL=setup-keyboard-controller.d.ts.map
@@ -0,0 +1,11 @@
1
+ {
2
+ "mappings": "",
3
+ "names": [],
4
+ "sources": [
5
+ "src/setup-keyboard-controller.ts"
6
+ ],
7
+ "sourcesContent": [
8
+ "/**\n * Setup keyboard controller for Tamagui native components.\n *\n * Simply import this module at the top of your app entry point:\n *\n * @example\n * ```tsx\n * import '@tamagui/native/setup-keyboard-controller'\n * ```\n *\n * This automatically detects and configures react-native-keyboard-controller\n * for use with Sheet and other keyboard-aware components.\n *\n * When enabled, Sheet gains:\n * - Frame-by-frame keyboard tracking (60/120 FPS)\n * - Smooth gesture + keyboard handoff\n * - Interactive keyboard dismiss on sheet drag\n */\n\nimport { setKeyboardControllerState } from './keyboardControllerState'\n\nfunction setup() {\n const g = globalThis as any\n if (g.__tamagui_native_keyboard_controller_setup_complete) {\n return\n }\n g.__tamagui_native_keyboard_controller_setup_complete = true\n\n try {\n // dynamically require keyboard-controller - it should already be imported by the app\n const rnkc = require('react-native-keyboard-controller')\n const {\n KeyboardProvider,\n KeyboardAwareScrollView,\n useKeyboardHandler,\n useReanimatedKeyboardAnimation,\n KeyboardController,\n KeyboardEvents,\n KeyboardStickyView,\n } = rnkc\n\n if (useKeyboardHandler && KeyboardProvider) {\n setKeyboardControllerState({\n enabled: true,\n KeyboardProvider: KeyboardProvider || null,\n KeyboardAwareScrollView: KeyboardAwareScrollView || null,\n useKeyboardHandler: useKeyboardHandler || null,\n useReanimatedKeyboardAnimation: useReanimatedKeyboardAnimation || null,\n KeyboardController: KeyboardController || null,\n KeyboardEvents: KeyboardEvents || null,\n KeyboardStickyView: KeyboardStickyView || null,\n })\n }\n } catch {\n // keyboard-controller not available, that's fine\n }\n}\n\n// run setup immediately on import\nsetup()\n"
9
+ ],
10
+ "version": 3
11
+ }
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=setup-keyboard-controller.web.d.ts.map
@@ -0,0 +1,11 @@
1
+ {
2
+ "mappings": "",
3
+ "names": [],
4
+ "sources": [
5
+ "src/setup-keyboard-controller.web.ts"
6
+ ],
7
+ "sourcesContent": [
8
+ "/**\n * Web stub for keyboard controller setup.\n * No-op on web - keyboard-controller is native-only.\n */\n\n// intentionally empty - web doesn't need keyboard-controller\n"
9
+ ],
10
+ "version": 3
11
+ }