@hanzogui/native 4.3.1 → 4.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/dist/cjs/PressBoundary.cjs +92 -0
  2. package/dist/cjs/PressBoundary.native.js +105 -0
  3. package/dist/cjs/PressBoundary.native.js.map +1 -0
  4. package/dist/cjs/gesture-handler.cjs +36 -0
  5. package/dist/cjs/gesture-handler.native.js +39 -0
  6. package/dist/cjs/gesture-handler.native.js.map +1 -0
  7. package/dist/cjs/gestureState.cjs +94 -5
  8. package/dist/cjs/gestureState.native.js +98 -13
  9. package/dist/cjs/gestureState.native.js.map +1 -1
  10. package/dist/cjs/index.cjs +4 -1
  11. package/dist/cjs/index.native.js +4 -1
  12. package/dist/cjs/index.native.js.map +1 -1
  13. package/dist/cjs/setup-gesture-handler.cjs +44 -8
  14. package/dist/cjs/setup-gesture-handler.native.js +44 -8
  15. package/dist/cjs/setup-gesture-handler.native.js.map +1 -1
  16. package/dist/esm/PressBoundary.mjs +56 -0
  17. package/dist/esm/PressBoundary.mjs.map +1 -0
  18. package/dist/esm/PressBoundary.native.js +66 -0
  19. package/dist/esm/PressBoundary.native.js.map +1 -0
  20. package/dist/esm/gesture-handler.mjs +6 -0
  21. package/dist/esm/gesture-handler.mjs.map +1 -0
  22. package/dist/esm/gesture-handler.native.js +6 -0
  23. package/dist/esm/gesture-handler.native.js.map +1 -0
  24. package/dist/esm/gestureState.mjs +92 -5
  25. package/dist/esm/gestureState.mjs.map +1 -1
  26. package/dist/esm/gestureState.native.js +96 -13
  27. package/dist/esm/gestureState.native.js.map +1 -1
  28. package/dist/esm/index.js +2 -1
  29. package/dist/esm/index.js.map +1 -1
  30. package/dist/esm/index.mjs +2 -1
  31. package/dist/esm/index.mjs.map +1 -1
  32. package/dist/esm/index.native.js +2 -1
  33. package/dist/esm/index.native.js.map +1 -1
  34. package/dist/esm/setup-gesture-handler.mjs +17 -8
  35. package/dist/esm/setup-gesture-handler.mjs.map +1 -1
  36. package/dist/esm/setup-gesture-handler.native.js +17 -8
  37. package/dist/esm/setup-gesture-handler.native.js.map +1 -1
  38. package/gesture-handler/index.cjs +1 -0
  39. package/gesture-handler/index.js +1 -0
  40. package/gesture-handler/index.native.cjs +1 -0
  41. package/gesture-handler/index.native.js +1 -0
  42. package/gesture-handler.cjs +1 -0
  43. package/package.json +16 -3
  44. package/src/PressBoundary.tsx +81 -0
  45. package/src/gesture-handler.ts +17 -0
  46. package/src/gestureState.ts +137 -6
  47. package/src/index.ts +12 -1
  48. package/src/setup-gesture-handler.ts +38 -11
  49. package/types/PressBoundary.d.ts +14 -0
  50. package/types/gesture-handler.d.ts +8 -0
  51. package/types/gestureState.d.ts +4 -0
  52. package/types/index.d.ts +3 -1
  53. package/types/setup-gesture-handler.d.ts +8 -1
  54. package/.turbo/turbo-build.log +0 -2
  55. package/types/burntState.d.ts.map +0 -11
  56. package/types/components.d.ts.map +0 -11
  57. package/types/gestureState.d.ts.map +0 -11
  58. package/types/globalState.d.ts.map +0 -11
  59. package/types/index.d.ts.map +0 -11
  60. package/types/keyboardControllerState.d.ts.map +0 -11
  61. package/types/linearGradientState.d.ts.map +0 -11
  62. package/types/nativeMenuContext.d.ts.map +0 -11
  63. package/types/portalState.d.ts.map +0 -11
  64. package/types/safeAreaState.d.ts.map +0 -11
  65. package/types/setup-burnt.d.ts.map +0 -11
  66. package/types/setup-expo-linear-gradient.d.ts.map +0 -11
  67. package/types/setup-gesture-handler.d.ts.map +0 -11
  68. package/types/setup-keyboard-controller.d.ts.map +0 -11
  69. package/types/setup-keyboard-controller.web.d.ts.map +0 -11
  70. package/types/setup-safe-area.d.ts.map +0 -11
  71. package/types/setup-teleport.d.ts.map +0 -11
  72. package/types/setup-worklets.d.ts.map +0 -11
  73. package/types/setup-zeego.d.ts.map +0 -11
  74. package/types/types.d.ts.map +0 -11
  75. package/types/workletsState.d.ts.map +0 -11
  76. package/types/zeegoState.d.ts.map +0 -11
package/types/index.d.ts CHANGED
@@ -22,7 +22,9 @@ export type { NativePortalState, GestureState, WorkletsState, SafeAreaState, Saf
22
22
  export { getPortal } from "./portalState";
23
23
  export type { PortalAccessor } from "./portalState";
24
24
  export { getGestureHandler } from "./gestureState";
25
- export type { GestureHandlerAccessor, PressGestureConfig } from "./gestureState";
25
+ export { claimExternalPressOwnership as unstable_claimExternalPressOwnership, releaseExternalPressOwnership as unstable_releaseExternalPressOwnership } from "./gestureState";
26
+ export type { ExternalPressOwnershipToken, GestureHandlerAccessor, PressGestureConfig } from "./gestureState";
27
+ export type { GestureHandlerConfig } from "./setup-gesture-handler";
26
28
  export { getWorklets } from "./workletsState";
27
29
  export type { WorkletsAccessor } from "./workletsState";
28
30
  export { getSafeArea } from "./safeAreaState";
@@ -1,3 +1,10 @@
1
- export {};
1
+ export interface GestureHandlerConfig {
2
+ /** use RNGH for press events on Tamagui components (default: true) */
3
+ pressEvents?: boolean;
4
+ /** use RNGH for Sheet drag gestures (default: true) */
5
+ sheet?: boolean;
6
+ }
7
+ export declare function getGestureHandlerConfig(): GestureHandlerConfig;
8
+ export declare function setupGestureHandler(config?: GestureHandlerConfig): void;
2
9
 
3
10
  //# sourceMappingURL=setup-gesture-handler.d.ts.map
@@ -1,2 +0,0 @@
1
- $ hanzo-gui-build
2
- built @hanzogui/native in 1008 ms
@@ -1,11 +0,0 @@
1
- {
2
- "mappings": "AACA,cAAc,kBAAkB;AAQhC,iBAAiB,cAAc;UACpB;UACA,OAAO;CAChB,IAAI,UAAU;;AAGhB,OAAO,iBAAS,YAAY",
3
- "names": [],
4
- "sources": [
5
- "src/burntState.ts"
6
- ],
7
- "version": 3,
8
- "sourcesContent": [
9
- "import { createGlobalState } from './globalState'\nimport type { BurntState } from './types'\n\nconst state = createGlobalState<BurntState>(`burnt`, {\n enabled: false,\n toast: null,\n dismissAllAlerts: null,\n})\n\nexport interface BurntAccessor {\n readonly isEnabled: boolean\n readonly state: BurntState\n set(newState: BurntState): void\n}\n\nexport function getBurnt(): BurntAccessor {\n return {\n get isEnabled(): boolean {\n return state.get().enabled\n },\n get state(): BurntState {\n return state.get()\n },\n set(newState: BurntState): void {\n state.set(newState)\n },\n }\n}\n"
10
- ]
11
- }
@@ -1,11 +0,0 @@
1
- {
2
- "mappings": "AAAA,cAAc,iBAAiB;AAE/B,cACE,mBACA,uBACA,iCACK;AAEP,cAAc,mBAAmB,uBAAuB;;;;;AAMxD,OAAO,iBAAS,aAAa,EAC3B,UACA,YACC,oBAAoB;;;;;AAYvB,OAAO,iBAAS,iBAAiB,EAAE,QAAQ,wBAAwB;;;;;AAYnE,OAAO,iBAAS,qBAAqB,EAAE,YAAY,4BAA4B",
3
- "names": [],
4
- "sources": [
5
- "src/components.tsx"
6
- ],
7
- "version": 3,
8
- "sourcesContent": [
9
- "import type { ReactNode } from 'react'\nimport { getPortal } from './portalState'\nimport type {\n NativePortalProps,\n NativePortalHostProps,\n NativePortalProviderProps,\n} from './types'\n\nexport type { NativePortalProps, NativePortalHostProps, NativePortalProviderProps }\n\n/**\n * Renders children into a teleport Portal when available.\n * Returns null when teleport is not set up (allows fallback handling by caller).\n */\nexport function NativePortal({\n hostName = 'root',\n children,\n}: NativePortalProps): ReactNode {\n const state = getPortal().state\n if (state.type !== 'teleport') return null\n\n const { Portal } = (globalThis as any).__gui_teleport\n return <Portal hostName={hostName}>{children}</Portal>\n}\n\n/**\n * Renders a teleport PortalHost when available.\n * Returns null when teleport is not set up.\n */\nexport function NativePortalHost({ name }: NativePortalHostProps): ReactNode {\n const state = getPortal().state\n if (state.type !== 'teleport') return null\n\n const { PortalHost } = (globalThis as any).__gui_teleport\n return <PortalHost name={name} />\n}\n\n/**\n * Wraps children with teleport PortalProvider when available.\n * Returns children as-is when teleport is not set up.\n */\nexport function NativePortalProvider({ children }: NativePortalProviderProps): ReactNode {\n const state = getPortal().state\n if (state.type !== 'teleport') return <>{children}</>\n\n const { PortalProvider } = (globalThis as any).__gui_teleport\n return <PortalProvider>{children}</PortalProvider>\n}\n"
10
- ]
11
- }
@@ -1,11 +0,0 @@
1
- {
2
- "mappings": "AACA,cAAc,oBAAoB;AASlC,iBAAiB,OAAO;CACtB;CACA;CACA;CACA;;AAGF,YAAY,qBAAqB;CAC/B,aAAa;CACb,cAAc;CACd,WAAW;CACX,eAAe;CACf;CACA,mBAAmB;;AAGrB,iBAAiB,uBAAuB;UAC7B;UACA,OAAO;CAChB,IAAI,SAAS,QAAQ;CACrB;CACA,mBAAmB,QAAQ;;AAG7B,OAAO,iBAAS,qBAAqB",
3
- "names": [],
4
- "sources": [
5
- "src/gestureState.ts"
6
- ],
7
- "version": 3,
8
- "sourcesContent": [
9
- "import { createGlobalState } from './globalState'\nimport type { GestureState } from './types'\n\nconst state = createGlobalState<GestureState>(`gesture`, {\n enabled: false,\n Gesture: null,\n GestureDetector: null,\n ScrollView: null,\n})\n\nexport interface Insets {\n top?: number\n left?: number\n bottom?: number\n right?: number\n}\n\nexport type PressGestureConfig = {\n onPressIn?: (e: any) => void\n onPressOut?: (e: any) => void\n onPress?: (e: any) => void\n onLongPress?: (e: any) => void\n delayLongPress?: number\n hitSlop?: number | Insets | null\n}\n\nexport interface GestureHandlerAccessor {\n readonly isEnabled: boolean\n readonly state: GestureState\n set(updates: Partial<GestureState>): void\n disable(): void\n createPressGesture(config: PressGestureConfig): any\n}\n\nexport function getGestureHandler(): GestureHandlerAccessor {\n return {\n get isEnabled(): boolean {\n return state.get().enabled\n },\n get state(): GestureState {\n return state.get()\n },\n set(updates: Partial<GestureState>): void {\n Object.assign(state.get(), updates)\n },\n\n disable(): void {\n state.get().enabled = false\n },\n\n createPressGesture(config: PressGestureConfig): any {\n const { Gesture } = state.get()\n if (!Gesture) return null\n\n const longPressDuration = config.delayLongPress ?? 500\n\n // Tap gesture for regular presses\n // Use long maxDuration to not cancel during long presses\n const tap = Gesture.Tap()\n .runOnJS(true)\n .maxDuration(10000) // allow very long presses\n .onBegin((e: any) => {\n config.onPressIn?.(e)\n })\n .onEnd((e: any) => {\n config.onPress?.(e)\n })\n .onFinalize((e: any) => {\n config.onPressOut?.(e)\n })\n\n if (config.hitSlop) tap.hitSlop(config.hitSlop)\n\n // if no long press handler, just use tap\n if (!config.onLongPress) return tap\n\n // LongPress gesture for long press handling\n const longPress = Gesture.LongPress()\n .runOnJS(true)\n .minDuration(longPressDuration)\n .onBegin((e: any) => config.onPressIn?.(e))\n .onStart((e: any) => config.onLongPress?.(e))\n .onFinalize((e: any) => config.onPressOut?.(e))\n\n if (config.hitSlop) longPress.hitSlop(config.hitSlop)\n\n // exclusive: longPress has priority, tap is fallback for quick presses\n return Gesture.Exclusive(longPress, tap)\n },\n }\n}\n"
10
- ]
11
- }
@@ -1,11 +0,0 @@
1
- {
2
- "mappings": "AAAA,OAAO,iBAAS,kBAAkB,UAAU;CAAE;GAC5C,aACA,cAAc,IACb;CACD,WAAW;CACX,MAAM,MAAM",
3
- "names": [],
4
- "sources": [
5
- "src/globalState.ts"
6
- ],
7
- "version": 3,
8
- "sourcesContent": [
9
- "export function createGlobalState<T extends { enabled: boolean }>(\n key: string,\n defaultValue: T\n): {\n get: () => T\n set: (next: T) => void\n} {\n const GLOBAL_KEY = `__gui_${key}__`\n\n type GuiGlobal = typeof globalThis & {\n [GLOBAL_KEY]?: T\n }\n\n function getGlobalState(): T {\n const g = globalThis as GuiGlobal\n if (!g[GLOBAL_KEY]) {\n // reset on module load so reloadReactNative gets a clean state\n // (globalThis persists across reloads but module scope re-evaluates)\n g[GLOBAL_KEY] = defaultValue\n }\n return g[GLOBAL_KEY]!\n }\n\n function setGlobalState(newState: T): void {\n ;(globalThis as GuiGlobal)[GLOBAL_KEY] = newState\n }\n\n return {\n get: getGlobalState,\n set: setGlobalState,\n }\n}\n"
10
- ]
11
- }
@@ -1,11 +0,0 @@
1
- {
2
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAsBA,cACE,mBACA,cACA,eACA,eACA,gBACA,eACA,iBACA,qBACA,YACA,YACA,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,gBAAgB;AACzB,cAAc,qBAAqB;AACnC,SAAS,yBAAyB;AAGlC,SAAS,gBAAgB;AACzB,cAAc,qBAAqB;AAGnC,SAAS,cAAc,kBAAkB,4BAA4B",
3
- "names": [],
4
- "sources": [
5
- "src/index.ts"
6
- ],
7
- "version": 3,
8
- "sourcesContent": [
9
- "/**\n * @hanzogui/native\n *\n * Native setup modules for Gui. 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 '@hanzogui/native/setup-teleport'\n * import '@hanzogui/native/setup-gesture-handler'\n * import '@hanzogui/native/setup-worklets'\n * import '@hanzogui/native/setup-safe-area'\n * import '@hanzogui/native/expo-linear-gradient'\n * import '@hanzogui/native/setup-keyboard-controller'\n *\n * // Then use GUI 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 ZeegoState,\n BurntState,\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// zeego (native menus)\nexport { getZeego } from './zeegoState'\nexport type { ZeegoAccessor } from './zeegoState'\nexport { NativeMenuContext } from './nativeMenuContext'\n\n// burnt (native toasts)\nexport { getBurnt } from './burntState'\nexport type { BurntAccessor } from './burntState'\n\n// components\nexport { NativePortal, NativePortalHost, NativePortalProvider } from './components'\n"
10
- ]
11
- }
@@ -1,11 +0,0 @@
1
- {
2
- "mappings": "AACA,cAAc,+BAA+B;AAE7C,cAAc;AAad,OAAO,iBAAS;AAIhB,OAAO,iBAAS,8BAA8B;AAI9C,OAAO,iBAAS,2BACd,SAAS,QAAQ",
3
- "names": [],
4
- "sources": [
5
- "src/keyboardControllerState.ts"
6
- ],
7
- "version": 3,
8
- "sourcesContent": [
9
- "import { createGlobalState } from './globalState'\nimport type { KeyboardControllerState } from './types'\n\nexport type { KeyboardControllerState }\n\nconst state = createGlobalState<KeyboardControllerState>(`keyboard_controller`, {\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\nexport function isKeyboardControllerEnabled(): boolean {\n return state.get().enabled\n}\n\nexport function getKeyboardControllerState(): KeyboardControllerState {\n return state.get()\n}\n\nexport function setKeyboardControllerState(\n updates: Partial<KeyboardControllerState>\n): void {\n Object.assign(state.get(), updates)\n}\n"
10
- ]
11
- }
@@ -1,11 +0,0 @@
1
- {
2
- "mappings": "AACA,cAAc,2BAA2B;AAOzC,iBAAiB,uBAAuB;UAC7B;UACA,OAAO;CAChB,IAAI,UAAU;;AAGhB,OAAO,iBAAS,qBAAqB",
3
- "names": [],
4
- "sources": [
5
- "src/linearGradientState.ts"
6
- ],
7
- "version": 3,
8
- "sourcesContent": [
9
- "import { createGlobalState } from './globalState'\nimport type { LinearGradientState } from './types'\n\nconst state = createGlobalState<LinearGradientState>(`linear_gradient`, {\n enabled: false,\n Component: null,\n})\n\nexport interface LinearGradientAccessor {\n readonly isEnabled: boolean\n readonly state: LinearGradientState\n set(newState: LinearGradientState): void\n}\n\nexport function getLinearGradient(): LinearGradientAccessor {\n return {\n get isEnabled(): boolean {\n return state.get().enabled\n },\n get state(): LinearGradientState {\n return state.get()\n },\n set(newState: LinearGradientState): void {\n state.set(newState)\n },\n }\n}\n"
10
- ]
11
- }
@@ -1,11 +0,0 @@
1
- {
2
- "mappings": "AAAA,YAAY,WAAW;AAGvB,OAAO,cAAM,mBAAmB,MAAM",
3
- "names": [],
4
- "sources": [
5
- "src/nativeMenuContext.ts"
6
- ],
7
- "version": 3,
8
- "sourcesContent": [
9
- "import type React from 'react'\nimport { createContext } from 'react'\n\nexport const NativeMenuContext: React.Context<boolean> = createContext(false)\n"
10
- ]
11
- }
@@ -1,11 +0,0 @@
1
- {
2
- "mappings": "AACA,cAAc,yBAAyB;AAOvC,iBAAiB,eAAe;UACrB;UACA,OAAO;CAChB,IAAI,UAAU;;AAGhB,OAAO,iBAAS,aAAa",
3
- "names": [],
4
- "sources": [
5
- "src/portalState.ts"
6
- ],
7
- "version": 3,
8
- "sourcesContent": [
9
- "import { createGlobalState } from './globalState'\nimport type { NativePortalState } from './types'\n\nconst state = createGlobalState<NativePortalState>(`portal`, {\n enabled: false,\n type: null,\n})\n\nexport interface PortalAccessor {\n readonly isEnabled: boolean\n readonly state: NativePortalState\n set(newState: NativePortalState): void\n}\n\nexport function getPortal(): PortalAccessor {\n return {\n get isEnabled(): boolean {\n return state.get().enabled\n },\n get state(): NativePortalState {\n return state.get()\n },\n set(newState: NativePortalState): void {\n state.set(newState)\n },\n }\n}\n"
10
- ]
11
- }
@@ -1,11 +0,0 @@
1
- {
2
- "mappings": "AACA,cAAc,eAAe,gBAAgB,qBAAqB;AAYlE,iBAAiB,iBAAiB;UACvB;UACA,OAAO;CAChB,IAAI,SAAS,QAAQ;;CAErB,aAAa;;CAEb,YAAY;;AAGd,OAAO,iBAAS,eAAe",
3
- "names": [],
4
- "sources": [
5
- "src/safeAreaState.ts"
6
- ],
7
- "version": 3,
8
- "sourcesContent": [
9
- "import { createGlobalState } from './globalState'\nimport type { SafeAreaState, SafeAreaInsets, SafeAreaFrame } from './types'\n\nconst state = createGlobalState<SafeAreaState>(`safe_area`, {\n enabled: false,\n useSafeAreaInsets: null,\n useSafeAreaFrame: null,\n initialMetrics: null,\n})\n\nconst defaultInsets: SafeAreaInsets = { top: 0, right: 0, bottom: 0, left: 0 }\nconst defaultFrame: SafeAreaFrame = { x: 0, y: 0, width: 0, height: 0 }\n\nexport interface SafeAreaAccessor {\n readonly isEnabled: boolean\n readonly state: SafeAreaState\n set(updates: Partial<SafeAreaState>): void\n /** Get initial insets (non-reactive, for style resolution) */\n getInsets(): SafeAreaInsets\n /** Get initial frame (non-reactive) */\n getFrame(): SafeAreaFrame\n}\n\nexport function getSafeArea(): SafeAreaAccessor {\n return {\n get isEnabled() {\n return state.get().enabled\n },\n get state() {\n return state.get()\n },\n set(updates: Partial<SafeAreaState>) {\n Object.assign(state.get(), updates)\n },\n getInsets() {\n const s = state.get()\n if (!s.enabled || !s.initialMetrics) {\n return defaultInsets\n }\n return s.initialMetrics.insets\n },\n getFrame() {\n const s = state.get()\n if (!s.enabled || !s.initialMetrics) {\n return defaultFrame\n }\n return s.initialMetrics.frame\n },\n }\n}\n"
10
- ]
11
- }
@@ -1,11 +0,0 @@
1
- {
2
- "mappings": "",
3
- "names": [],
4
- "sources": [
5
- "src/setup-burnt.ts"
6
- ],
7
- "version": 3,
8
- "sourcesContent": [
9
- "/**\n * Setup burnt for GUI native toasts.\n *\n * Simply import this module at the top of your app entry point:\n *\n * @example\n * ```tsx\n * import '@hanzogui/native/setup-burnt'\n * ```\n *\n * This automatically detects and configures burnt for use with\n * native Toast functionality.\n */\n\nimport { getBurnt } from './burntState'\n\nfunction setup(): void {\n const g = globalThis as any\n if (g.__gui_native_burnt_setup) return\n g.__gui_native_burnt_setup = true\n\n try {\n const Burnt = require('burnt') as typeof import('burnt')\n\n if (Burnt) {\n getBurnt().set({\n enabled: true,\n toast: Burnt.toast,\n dismissAllAlerts: Burnt.dismissAllAlerts,\n })\n }\n } catch {\n // burnt not installed\n }\n}\n\n// run setup immediately on import\nsetup()\n"
10
- ]
11
- }
@@ -1,11 +0,0 @@
1
- {
2
- "mappings": "",
3
- "names": [],
4
- "sources": [
5
- "src/setup-expo-linear-gradient.ts"
6
- ],
7
- "version": 3,
8
- "sourcesContent": [
9
- "/**\n * Setup expo-linear-gradient for Gui.\n *\n * Simply import this module at the top of your app entry point:\n *\n * @example\n * ```tsx\n * import '@hanzogui/native/setup-expo-linear-gradient'\n * ```\n *\n * This automatically detects and configures expo-linear-gradient.\n * If not installed, LinearGradient will log a warning on native.\n */\n\nimport { getLinearGradient } from './linearGradientState'\n\nfunction setup(): void {\n const g = globalThis as any\n if (g.__gui_native_linear_gradient_setup) return\n g.__gui_native_linear_gradient_setup = true\n\n try {\n const expoLinearGradient = require('expo-linear-gradient')\n if (expoLinearGradient?.LinearGradient) {\n getLinearGradient().set({\n enabled: true,\n Component: expoLinearGradient.LinearGradient,\n })\n }\n } catch {\n // expo-linear-gradient not installed, will use CSS fallback\n }\n}\n\n// run setup immediately on import\nsetup()\n"
10
- ]
11
- }
@@ -1,11 +0,0 @@
1
- {
2
- "mappings": "",
3
- "names": [],
4
- "sources": [
5
- "src/setup-gesture-handler.ts"
6
- ],
7
- "version": 3,
8
- "sourcesContent": [
9
- "/**\n * Setup gesture handler for GUI native components.\n *\n * Simply import this module at the top of your app entry point:\n *\n * @example\n * ```tsx\n * import '@hanzogui/native/setup-gesture-handler'\n * ```\n *\n * This automatically detects and configures react-native-gesture-handler\n * for use with Sheet and other gesture-aware components.\n */\n\nimport { getGestureHandler } from './gestureState'\n\nfunction setup() {\n const g = globalThis as any\n if (g.__gui_native_gesture_setup_complete) {\n return\n }\n g.__gui_native_gesture_setup_complete = true\n\n try {\n // dynamically require RNGH - it should already be imported by the app\n const rngh = require('react-native-gesture-handler')\n const { Gesture, GestureDetector, ScrollView } = rngh\n\n if (Gesture && GestureDetector) {\n getGestureHandler().set({\n enabled: true,\n Gesture,\n GestureDetector,\n ScrollView: ScrollView || null,\n })\n\n // also set on the legacy key for backward compat with @hanzogui/sheet\n g.__gui_sheet_gesture_state__ = {\n enabled: true,\n Gesture,\n GestureDetector,\n ScrollView: ScrollView || null,\n }\n }\n } catch {\n // RNGH not available, that's fine\n }\n}\n\n// run setup immediately on import\nsetup()\n"
10
- ]
11
- }
@@ -1,11 +0,0 @@
1
- {
2
- "mappings": "",
3
- "names": [],
4
- "sources": [
5
- "src/setup-keyboard-controller.ts"
6
- ],
7
- "version": 3,
8
- "sourcesContent": [
9
- "/**\n * Setup keyboard controller for GUI native components.\n *\n * Simply import this module at the top of your app entry point:\n *\n * @example\n * ```tsx\n * import '@hanzogui/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.__gui_native_keyboard_controller_setup_complete) {\n return\n }\n g.__gui_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"
10
- ]
11
- }
@@ -1,11 +0,0 @@
1
- {
2
- "mappings": "",
3
- "names": [],
4
- "sources": [
5
- "src/setup-keyboard-controller.web.ts"
6
- ],
7
- "version": 3,
8
- "sourcesContent": [
9
- "/**\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"
10
- ]
11
- }
@@ -1,11 +0,0 @@
1
- {
2
- "mappings": "",
3
- "names": [],
4
- "sources": [
5
- "src/setup-safe-area.ts"
6
- ],
7
- "version": 3,
8
- "sourcesContent": [
9
- "/**\n * Setup react-native-safe-area-context for GUI native components.\n *\n * Simply import this module at the top of your app entry point:\n *\n * @example\n * ```tsx\n * import '@hanzogui/native/setup-safe-area'\n * ```\n *\n * This automatically detects and configures react-native-safe-area-context\n * for use with GUI components that need safe area awareness.\n *\n * Note: You must still wrap your app with SafeAreaProvider yourself:\n * ```tsx\n * import { SafeAreaProvider } from 'react-native-safe-area-context'\n * <SafeAreaProvider>\n * <App />\n * </SafeAreaProvider>\n * ```\n *\n * On web, this is a no-op since CSS env(safe-area-inset-*) values work natively.\n */\n\nimport { getSafeArea } from './safeAreaState'\n\nfunction setup() {\n // only run on native\n if (process.env.GUI_TARGET !== 'native') {\n return\n }\n\n const g = globalThis as any\n if (g.__gui_native_safe_area_setup_complete) {\n return\n }\n g.__gui_native_safe_area_setup_complete = true\n\n try {\n const safeAreaContext = require('react-native-safe-area-context')\n const { useSafeAreaInsets, useSafeAreaFrame, initialWindowMetrics } = safeAreaContext\n\n if (useSafeAreaInsets) {\n getSafeArea().set({\n enabled: true,\n useSafeAreaInsets,\n useSafeAreaFrame: useSafeAreaFrame || null,\n initialMetrics: initialWindowMetrics || null,\n })\n }\n } catch {\n // react-native-safe-area-context not available\n }\n}\n\nsetup()\n"
10
- ]
11
- }
@@ -1,11 +0,0 @@
1
- {
2
- "mappings": "",
3
- "names": [],
4
- "sources": [
5
- "src/setup-teleport.ts"
6
- ],
7
- "version": 3,
8
- "sourcesContent": [
9
- "/**\n * Setup native portal support for Gui.\n *\n * Simply import this module at the top of your app entry point:\n *\n * @example\n * ```tsx\n * import '@hanzogui/native/setup-teleport'\n * ```\n *\n * This automatically detects and configures react-native-teleport for portals.\n * Falls back to legacy RN shims if teleport is not installed.\n */\n\nimport { getPortal } from './portalState'\n\nfunction setup(): void {\n const g = globalThis as any\n if (g.__gui_native_portal_setup) return\n g.__gui_native_portal_setup = true\n\n // try teleport first (preferred)\n try {\n const teleport = require('react-native-teleport')\n if (teleport?.Portal && teleport?.PortalHost && teleport?.PortalProvider) {\n g.__gui_teleport = teleport\n getPortal().set({ enabled: true, type: 'teleport' })\n return\n }\n } catch {\n // react-native-teleport not installed, that's ok\n }\n}\n\n// run setup immediately on import\nsetup()\n"
10
- ]
11
- }
@@ -1,11 +0,0 @@
1
- {
2
- "mappings": "",
3
- "names": [],
4
- "sources": [
5
- "src/setup-worklets.ts"
6
- ],
7
- "version": 3,
8
- "sourcesContent": [
9
- "/**\n * Setup worklets for GUI native components.\n *\n * Simply import this module at the top of your app entry point:\n *\n * @example\n * ```tsx\n * import '@hanzogui/native/setup-worklets'\n * ```\n *\n * This automatically detects and configures react-native-worklets-core\n * for use with Sheet and other components that benefit from synchronous\n * native-thread execution.\n *\n * When combined with setup-gesture-handler, Sheet gets native-quality\n * gesture coordination between sheet dragging and scroll views.\n *\n * @see https://docs.swmansion.com/react-native-worklets/docs/\n */\n\nimport { getWorklets } from './workletsState'\n\nfunction setup() {\n const g = globalThis as any\n if (g.__gui_native_worklets_setup_complete) {\n return\n }\n g.__gui_native_worklets_setup_complete = true\n\n try {\n // dynamically require worklets-core\n const worklets = require('react-native-worklets-core')\n\n if (worklets) {\n getWorklets().set({\n enabled: true,\n Worklets: worklets.Worklets,\n useRunOnJS: worklets.useRunOnJS,\n useWorklet: worklets.useWorklet,\n createWorkletContextValue: worklets.createWorkletContextValue,\n })\n }\n } catch {\n // worklets not available, that's fine - will fall back to JS thread\n }\n}\n\n// run setup immediately on import\nsetup()\n"
10
- ]
11
- }
@@ -1,11 +0,0 @@
1
- {
2
- "mappings": "",
3
- "names": [],
4
- "sources": [
5
- "src/setup-zeego.ts"
6
- ],
7
- "version": 3,
8
- "sourcesContent": [
9
- "/**\n * Setup zeego for GUI native menus.\n *\n * Simply import this module at the top of your app entry point:\n *\n * @example\n * ```tsx\n * import '@hanzogui/native/setup-zeego'\n * ```\n *\n * This automatically detects and configures zeego for use with\n * Menu and ContextMenu native mode.\n */\n\nimport { getZeego } from './zeegoState'\n\nfunction setup(): void {\n const g = globalThis as any\n if (g.__gui_native_zeego_setup) return\n g.__gui_native_zeego_setup = true\n\n try {\n const DropdownMenu = require('zeego/dropdown-menu')\n const ContextMenu = require('zeego/context-menu')\n\n if (DropdownMenu && ContextMenu) {\n getZeego().set({\n enabled: true,\n DropdownMenu,\n ContextMenu,\n })\n }\n } catch (err) {\n if (process.env.NODE_ENV === 'development') {\n console.warn(`Error setting up Zeego`, err)\n }\n // zeego not installed\n }\n}\n\n// run setup immediately on import\nsetup()\n"
10
- ]
11
- }
@@ -1,11 +0,0 @@
1
- {
2
- "mappings": "AAAA,cAAc,iBAAiB;AAE/B,YAAY,oBAAoB;CAC9B;CACA,MAAM,aAAa;;AAGrB,iBAAiB,aAAa;CAC5B;CACA;CACA;CACA;;AAGF,iBAAiB,cAAc;CAC7B;CACA;CACA;CACA;CACA;;AAGF,iBAAiB,eAAe;CAC9B;CACA;CACA;CACA;;AAGF,iBAAiB,cAAc;CAC7B;CACA;CACA;CACA;;AAGF,iBAAiB,gBAAgB;CAC/B,QAAQ;CACR,OAAO;;AAGT,iBAAiB,cAAc;CAC7B;CACA,0BAA0B;CAC1B,yBAAyB;CACzB,gBAAgB;;AAGlB,YAAY,oBAAoB;CAC9B;CACA,UAAU;;AAGZ,YAAY,wBAAwB;CAClC;;AAGF,YAAY,4BAA4B;CACtC,UAAU;;AAGZ,iBAAiB,oBAAoB;CACnC;CACA;;AAGF,iBAAiB,WAAW;CAC1B;CACA;CACA;;AAGF,iBAAiB,WAAW;CAC1B;CACA,SAAS;CACT;;AAGF,iBAAiB,wBAAwB;CACvC;CACA;CACA;CACA;CACA;CACA;CACA;CACA",
3
- "names": [],
4
- "sources": [
5
- "src/types.ts"
6
- ],
7
- "version": 3,
8
- "sourcesContent": [
9
- "import type { ReactNode } from 'react'\n\nexport type NativePortalState = {\n enabled: boolean\n type: 'teleport' | 'legacy' | null\n}\n\nexport interface GestureState {\n enabled: boolean\n Gesture: any\n GestureDetector: any\n ScrollView: any\n}\n\nexport interface WorkletsState {\n enabled: boolean\n Worklets: any\n useRunOnJS: any\n useWorklet: any\n createWorkletContextValue: any\n}\n\nexport interface SafeAreaInsets {\n top: number\n right: number\n bottom: number\n left: number\n}\n\nexport interface SafeAreaFrame {\n x: number\n y: number\n width: number\n height: number\n}\n\nexport interface SafeAreaMetrics {\n insets: SafeAreaInsets\n frame: SafeAreaFrame\n}\n\nexport interface SafeAreaState {\n enabled: boolean\n useSafeAreaInsets: (() => SafeAreaInsets) | null\n useSafeAreaFrame: (() => SafeAreaFrame) | null\n initialMetrics: SafeAreaMetrics | null\n}\n\nexport type NativePortalProps = {\n hostName?: string\n children: ReactNode\n}\n\nexport type NativePortalHostProps = {\n name: string\n}\n\nexport type NativePortalProviderProps = {\n children: ReactNode\n}\n\nexport interface LinearGradientState {\n enabled: boolean\n Component: any\n}\n\nexport interface ZeegoState {\n enabled: boolean\n DropdownMenu: any\n ContextMenu: any\n}\n\nexport interface BurntState {\n enabled: boolean\n toast: ((options: any) => void) | null\n dismissAllAlerts: (() => void) | null\n}\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"
10
- ]
11
- }
@@ -1,11 +0,0 @@
1
- {
2
- "mappings": "AACA,cAAc,qBAAqB;AAUnC,iBAAiB,iBAAiB;UACvB;UACA,OAAO;CAChB,IAAI,SAAS,QAAQ;;AAGvB,OAAO,iBAAS,eAAe",
3
- "names": [],
4
- "sources": [
5
- "src/workletsState.ts"
6
- ],
7
- "version": 3,
8
- "sourcesContent": [
9
- "import { createGlobalState } from './globalState'\nimport type { WorkletsState } from './types'\n\nconst state = createGlobalState<WorkletsState>(`worklets`, {\n enabled: false,\n Worklets: null,\n useRunOnJS: null,\n useWorklet: null,\n createWorkletContextValue: null,\n})\n\nexport interface WorkletsAccessor {\n readonly isEnabled: boolean\n readonly state: WorkletsState\n set(updates: Partial<WorkletsState>): void\n}\n\nexport function getWorklets(): WorkletsAccessor {\n return {\n get isEnabled(): boolean {\n return state.get().enabled\n },\n get state(): WorkletsState {\n return state.get()\n },\n set(updates: Partial<WorkletsState>): void {\n Object.assign(state.get(), updates)\n },\n }\n}\n"
10
- ]
11
- }
@@ -1,11 +0,0 @@
1
- {
2
- "mappings": "AACA,cAAc,kBAAkB;AAQhC,iBAAiB,cAAc;UACpB;UACA,OAAO;CAChB,IAAI,UAAU;;AAGhB,OAAO,iBAAS,YAAY",
3
- "names": [],
4
- "sources": [
5
- "src/zeegoState.ts"
6
- ],
7
- "version": 3,
8
- "sourcesContent": [
9
- "import { createGlobalState } from './globalState'\nimport type { ZeegoState } from './types'\n\nconst state = createGlobalState<ZeegoState>(`zeego`, {\n enabled: false,\n DropdownMenu: null,\n ContextMenu: null,\n})\n\nexport interface ZeegoAccessor {\n readonly isEnabled: boolean\n readonly state: ZeegoState\n set(newState: ZeegoState): void\n}\n\nexport function getZeego(): ZeegoAccessor {\n return {\n get isEnabled(): boolean {\n return state.get().enabled\n },\n get state(): ZeegoState {\n return state.get()\n },\n set(newState: ZeegoState): void {\n state.set(newState)\n },\n }\n}\n"
10
- ]
11
- }