@hanzogui/native 7.3.1 → 8.1.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/dist/cjs/components.cjs +3 -3
- package/dist/cjs/components.native.js +3 -3
- package/dist/cjs/components.native.js.map +1 -1
- package/dist/cjs/gesture-handler.cjs +1 -0
- package/dist/cjs/gesture-handler.native.js +1 -0
- package/dist/cjs/gesture-handler.native.js.map +1 -1
- package/dist/cjs/gestureState.cjs +91 -20
- package/dist/cjs/gestureState.native.js +97 -20
- package/dist/cjs/gestureState.native.js.map +1 -1
- package/dist/cjs/globalState.cjs +1 -1
- package/dist/cjs/globalState.native.js +1 -1
- package/dist/cjs/globalState.native.js.map +1 -1
- package/dist/cjs/index.cjs +1 -0
- package/dist/cjs/index.native.js +1 -0
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/setup-burnt.cjs +2 -2
- package/dist/cjs/setup-burnt.native.js +2 -2
- package/dist/cjs/setup-burnt.native.js.map +1 -1
- package/dist/cjs/setup-expo-linear-gradient.cjs +2 -2
- package/dist/cjs/setup-expo-linear-gradient.native.js +2 -2
- package/dist/cjs/setup-expo-linear-gradient.native.js.map +1 -1
- package/dist/cjs/setup-gesture-handler.cjs +15 -6
- package/dist/cjs/setup-gesture-handler.native.js +15 -6
- package/dist/cjs/setup-gesture-handler.native.js.map +1 -1
- package/dist/cjs/setup-keyboard-controller.native.js +2 -2
- package/dist/cjs/setup-safe-area.native.js +2 -2
- package/dist/cjs/setup-safe-area.native.js.map +1 -1
- package/dist/cjs/setup-teleport.cjs +3 -3
- package/dist/cjs/setup-teleport.native.js +3 -3
- package/dist/cjs/setup-teleport.native.js.map +1 -1
- package/dist/cjs/setup-worklets.cjs +2 -2
- package/dist/cjs/setup-worklets.native.js +2 -2
- package/dist/cjs/setup-worklets.native.js.map +1 -1
- package/dist/cjs/setup-zeego.cjs +2 -2
- package/dist/cjs/setup-zeego.native.js +2 -2
- package/dist/cjs/setup-zeego.native.js.map +1 -1
- package/dist/esm/components.mjs +3 -3
- package/dist/esm/components.mjs.map +1 -1
- package/dist/esm/components.native.js +3 -3
- package/dist/esm/components.native.js.map +1 -1
- package/dist/esm/gesture-handler.mjs +2 -2
- package/dist/esm/gesture-handler.mjs.map +1 -1
- package/dist/esm/gesture-handler.native.js +2 -2
- package/dist/esm/gesture-handler.native.js.map +1 -1
- package/dist/esm/gestureState.mjs +90 -21
- package/dist/esm/gestureState.mjs.map +1 -1
- package/dist/esm/gestureState.native.js +96 -21
- package/dist/esm/gestureState.native.js.map +1 -1
- package/dist/esm/globalState.mjs +1 -1
- package/dist/esm/globalState.mjs.map +1 -1
- package/dist/esm/globalState.native.js +1 -1
- package/dist/esm/globalState.native.js.map +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.mjs +2 -2
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/index.native.js +2 -2
- package/dist/esm/index.native.js.map +1 -1
- package/dist/esm/setup-burnt.mjs +2 -2
- package/dist/esm/setup-burnt.mjs.map +1 -1
- package/dist/esm/setup-burnt.native.js +2 -2
- package/dist/esm/setup-burnt.native.js.map +1 -1
- package/dist/esm/setup-expo-linear-gradient.mjs +2 -2
- package/dist/esm/setup-expo-linear-gradient.mjs.map +1 -1
- package/dist/esm/setup-expo-linear-gradient.native.js +2 -2
- package/dist/esm/setup-expo-linear-gradient.native.js.map +1 -1
- package/dist/esm/setup-gesture-handler.mjs +16 -7
- package/dist/esm/setup-gesture-handler.mjs.map +1 -1
- package/dist/esm/setup-gesture-handler.native.js +16 -7
- package/dist/esm/setup-gesture-handler.native.js.map +1 -1
- package/dist/esm/setup-keyboard-controller.native.js +2 -2
- package/dist/esm/setup-safe-area.native.js +8 -2
- package/dist/esm/setup-safe-area.native.js.map +1 -1
- package/dist/esm/setup-teleport.mjs +3 -3
- package/dist/esm/setup-teleport.mjs.map +1 -1
- package/dist/esm/setup-teleport.native.js +3 -3
- package/dist/esm/setup-teleport.native.js.map +1 -1
- package/dist/esm/setup-worklets.mjs +2 -2
- package/dist/esm/setup-worklets.mjs.map +1 -1
- package/dist/esm/setup-worklets.native.js +2 -2
- package/dist/esm/setup-worklets.native.js.map +1 -1
- package/dist/esm/setup-zeego.mjs +2 -2
- package/dist/esm/setup-zeego.mjs.map +1 -1
- package/dist/esm/setup-zeego.native.js +2 -2
- package/dist/esm/setup-zeego.native.js.map +1 -1
- package/gesture-handler/index.cjs +1 -0
- package/gesture-handler/index.js +1 -0
- package/gesture-handler/index.native.cjs +1 -0
- package/gesture-handler/index.native.js +1 -0
- package/package.json +34 -71
- package/setup-burnt/index.cjs +2 -0
- package/setup-burnt/index.js +2 -0
- package/setup-burnt/index.native.cjs +2 -0
- package/setup-burnt/index.native.js +2 -0
- package/setup-expo-linear-gradient/index.cjs +2 -0
- package/setup-expo-linear-gradient/index.js +2 -0
- package/setup-expo-linear-gradient/index.native.cjs +2 -0
- package/setup-expo-linear-gradient/index.native.js +2 -0
- package/setup-gesture-handler/index.cjs +2 -0
- package/setup-gesture-handler/index.js +2 -0
- package/setup-gesture-handler/index.native.cjs +2 -0
- package/setup-gesture-handler/index.native.js +2 -0
- package/setup-keyboard-controller/index.cjs +2 -0
- package/setup-keyboard-controller/index.js +2 -0
- package/setup-keyboard-controller/index.native.cjs +2 -0
- package/setup-keyboard-controller/index.native.js +2 -0
- package/setup-safe-area/index.cjs +2 -0
- package/setup-safe-area/index.js +2 -0
- package/setup-safe-area/index.native.cjs +2 -0
- package/setup-safe-area/index.native.js +2 -0
- package/setup-teleport/index.cjs +2 -0
- package/setup-teleport/index.js +2 -0
- package/setup-teleport/index.native.cjs +2 -0
- package/setup-teleport/index.native.js +2 -0
- package/setup-worklets/index.cjs +2 -0
- package/setup-worklets/index.js +2 -0
- package/setup-worklets/index.native.cjs +2 -0
- package/setup-worklets/index.native.js +2 -0
- package/setup-zeego/index.cjs +2 -0
- package/setup-zeego/index.js +2 -0
- package/setup-zeego/index.native.cjs +2 -0
- package/setup-zeego/index.native.js +2 -0
- package/src/components.tsx +3 -3
- package/src/gesture-handler.ts +1 -0
- package/src/gestureState.ts +185 -28
- package/src/globalState.ts +1 -1
- package/src/index.ts +1 -0
- package/src/setup-burnt.ts +2 -2
- package/src/setup-expo-linear-gradient.ts +2 -2
- package/src/setup-gesture-handler.ts +20 -5
- package/src/setup-keyboard-controller.ts +2 -2
- package/src/setup-safe-area.ts +2 -2
- package/src/setup-teleport.ts +3 -3
- package/src/setup-worklets.ts +2 -2
- package/src/setup-zeego.ts +2 -2
- package/src/types.ts +4 -0
- package/types/components.d.ts.map +1 -1
- package/types/gesture-handler.d.ts +1 -1
- package/types/gesture-handler.d.ts.map +2 -2
- package/types/gestureState.d.ts +2 -0
- package/types/gestureState.d.ts.map +2 -2
- package/types/globalState.d.ts.map +1 -1
- package/types/index.d.ts +1 -1
- package/types/index.d.ts.map +2 -2
- package/types/setup-burnt.d.ts.map +1 -1
- package/types/setup-expo-linear-gradient.d.ts.map +1 -1
- package/types/setup-gesture-handler.d.ts.map +1 -1
- package/types/setup-keyboard-controller.d.ts.map +1 -1
- package/types/setup-safe-area.d.ts.map +1 -1
- package/types/setup-teleport.d.ts.map +1 -1
- package/types/setup-worklets.d.ts.map +1 -1
- package/types/setup-zeego.d.ts.map +1 -1
- package/types/types.d.ts +1 -0
- package/types/types.d.ts.map +2 -2
package/types/index.d.ts.map
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
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,SACE,+BAA+B,sCAC/B,iCAAiC,8CAC5B;AACP,cACE,6BACA,wBACA,0BACK;AAGP,cAAc,4BAA4B;AAG1C,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",
|
|
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,SACE,+BAA+B,sCAC/B,6BAA6B,oCAC7B,iCAAiC,8CAC5B;AACP,cACE,6BACA,wBACA,0BACK;AAGP,cAAc,4BAA4B;AAG1C,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
3
|
"names": [],
|
|
4
4
|
"sources": [
|
|
5
5
|
"src/index.ts"
|
|
6
6
|
],
|
|
7
7
|
"version": 3,
|
|
8
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 {\n claimExternalPressOwnership as unstable_claimExternalPressOwnership,\n releaseExternalPressOwnership as unstable_releaseExternalPressOwnership,\n} from './gestureState'\nexport type {\n ExternalPressOwnershipToken,\n GestureHandlerAccessor,\n PressGestureConfig,\n} from './gestureState'\n// NOTE: setupGestureHandler is exported from setup-gesture-handler.ts entry point,\n// not here, to avoid bundler pulling in RNGH require during tree-shaking\nexport type { GestureHandlerConfig } from './setup-gesture-handler'\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"
|
|
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 {\n claimExternalPressOwnership as unstable_claimExternalPressOwnership,\n hasExternalPressOwnership as unstable_hasExternalPressOwnership,\n releaseExternalPressOwnership as unstable_releaseExternalPressOwnership,\n} from './gestureState'\nexport type {\n ExternalPressOwnershipToken,\n GestureHandlerAccessor,\n PressGestureConfig,\n} from './gestureState'\n// NOTE: setupGestureHandler is exported from setup-gesture-handler.ts entry point,\n// not here, to avoid bundler pulling in RNGH require during tree-shaking\nexport type { GestureHandlerConfig } from './setup-gesture-handler'\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
10
|
]
|
|
11
11
|
}
|
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
],
|
|
7
7
|
"version": 3,
|
|
8
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.
|
|
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.__hanzogui_native_burnt_setup) return\n g.__hanzogui_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
10
|
]
|
|
11
11
|
}
|
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
],
|
|
7
7
|
"version": 3,
|
|
8
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.
|
|
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.__hanzogui_native_linear_gradient_setup) return\n g.__hanzogui_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
10
|
]
|
|
11
11
|
}
|
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
],
|
|
7
7
|
"version": 3,
|
|
8
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 * // auto-setup with all features enabled\n * import '@hanzogui/native/setup-gesture-handler'\n *\n * // or configure selectively\n * import { setupGestureHandler } from '@hanzogui/native/setup-gesture-handler'\n * setupGestureHandler({ pressEvents: true, sheet: false })\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\nexport interface GestureHandlerConfig {\n /** use RNGH for press events on Gui components (default: true) */\n pressEvents?: boolean\n /** use RNGH for Sheet drag gestures (default: true) */\n sheet?: boolean\n}\n\nlet currentConfig: GestureHandlerConfig = {\n pressEvents: true,\n sheet: true,\n}\n\nexport function getGestureHandlerConfig(): GestureHandlerConfig {\n return currentConfig\n}\n\nexport function setupGestureHandler(config?: GestureHandlerConfig): void {\n const g = globalThis as any\n\n // override config if provided\n if (config) {\n currentConfig = config\n }\n\n // allow re-running setup to change config\n const isFirstRun = !g.
|
|
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 * // auto-setup with all features enabled\n * import '@hanzogui/native/setup-gesture-handler'\n *\n * // or configure selectively\n * import { setupGestureHandler } from '@hanzogui/native/setup-gesture-handler'\n * setupGestureHandler({ pressEvents: true, sheet: false })\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 { canChangeGestureHandlerEnabled, getGestureHandler } from './gestureState'\n\nexport interface GestureHandlerConfig {\n /** use RNGH for press events on Gui components (default: true) */\n pressEvents?: boolean\n /** use RNGH for Sheet drag gestures (default: true) */\n sheet?: boolean\n}\n\nlet currentConfig: GestureHandlerConfig = {\n pressEvents: true,\n sheet: true,\n}\n\nexport function getGestureHandlerConfig(): GestureHandlerConfig {\n return currentConfig\n}\n\nexport function setupGestureHandler(config?: GestureHandlerConfig): void {\n const g = globalThis as any\n\n // override config if provided\n if (config) {\n currentConfig = config\n\n if (\n config.pressEvents !== undefined &&\n !canChangeGestureHandlerEnabled(\n config.pressEvents !== false,\n 'setupGestureHandler()'\n )\n ) {\n currentConfig = {\n ...currentConfig,\n pressEvents: getGestureHandler().isEnabled,\n }\n }\n }\n\n // allow re-running setup to change config\n const isFirstRun = !g.__hanzogui_native_gesture_setup_complete\n g.__hanzogui_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, GestureHandlerRootView } = rngh\n\n if (Gesture && GestureDetector) {\n // only enable if pressEvents is true\n getGestureHandler().set({\n enabled: currentConfig.pressEvents !== false,\n Gesture,\n GestureDetector,\n ScrollView: ScrollView || null,\n RootView: GestureHandlerRootView || null,\n })\n\n // sheet state - only enable if sheet is true\n g.__hanzogui_sheet_gesture_state__ = {\n enabled: currentConfig.sheet !== false,\n Gesture,\n GestureDetector,\n ScrollView: ScrollView || null,\n RootView: GestureHandlerRootView || null,\n }\n }\n } catch {\n // RNGH not available, that's fine\n }\n}\n\n// run setup immediately on import (can be overridden by calling setupGestureHandler)\nsetupGestureHandler()\n"
|
|
10
10
|
]
|
|
11
11
|
}
|
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
],
|
|
7
7
|
"version": 3,
|
|
8
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.
|
|
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.__hanzogui_native_keyboard_controller_setup_complete) {\n return\n }\n g.__hanzogui_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
10
|
]
|
|
11
11
|
}
|
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
],
|
|
7
7
|
"version": 3,
|
|
8
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.
|
|
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.__hanzogui_native_safe_area_setup_complete) {\n return\n }\n g.__hanzogui_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
10
|
]
|
|
11
11
|
}
|
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
],
|
|
7
7
|
"version": 3,
|
|
8
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.
|
|
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.__hanzogui_native_portal_setup) return\n g.__hanzogui_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.__hanzogui_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
10
|
]
|
|
11
11
|
}
|
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
],
|
|
7
7
|
"version": 3,
|
|
8
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.
|
|
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.__hanzogui_native_worklets_setup_complete) {\n return\n }\n g.__hanzogui_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
10
|
]
|
|
11
11
|
}
|
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
],
|
|
7
7
|
"version": 3,
|
|
8
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.
|
|
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.__hanzogui_native_zeego_setup) return\n g.__hanzogui_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
10
|
]
|
|
11
11
|
}
|
package/types/types.d.ts
CHANGED
package/types/types.d.ts.map
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
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",
|
|
2
|
+
"mappings": "AAAA,cAAc,iBAAiB;AAE/B,YAAY,oBAAoB;CAC9B;CACA,MAAM,aAAa;;AAGrB,iBAAiB,aAAa;CAC5B;CACA;CACA;CACA;CAIA;;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
3
|
"names": [],
|
|
4
4
|
"sources": [
|
|
5
5
|
"src/types.ts"
|
|
6
6
|
],
|
|
7
7
|
"version": 3,
|
|
8
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"
|
|
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 // rngh's GestureHandlerRootView. native portals can render outside the app's\n // root gesture view, so components that portal rngh gestures need to\n // re-establish one around their content.\n RootView: 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
10
|
]
|
|
11
11
|
}
|