@hanzogui/native 8.3.1 → 8.3.3
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/PressBoundary.js +41 -0
- package/dist/cjs/PressBoundary.js.map +1 -0
- package/dist/cjs/burntState.js +23 -0
- package/dist/cjs/burntState.js.map +1 -0
- package/dist/cjs/components.js +50 -0
- package/dist/cjs/components.js.map +1 -0
- package/dist/cjs/gesture-handler.js +15 -0
- package/dist/cjs/gesture-handler.js.map +1 -0
- package/dist/cjs/gestureState.js +307 -0
- package/dist/cjs/gestureState.js.map +1 -0
- package/dist/cjs/globalState.js +24 -0
- package/dist/cjs/globalState.js.map +1 -0
- package/dist/cjs/index.js +61 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/keyboardControllerState.js +26 -0
- package/dist/cjs/keyboardControllerState.js.map +1 -0
- package/dist/cjs/linearGradientState.js +22 -0
- package/dist/cjs/linearGradientState.js.map +1 -0
- package/dist/cjs/nativeMenuContext.js +6 -0
- package/dist/cjs/nativeMenuContext.js.map +1 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/portalState.js +22 -0
- package/dist/cjs/portalState.js.map +1 -0
- package/dist/cjs/safeAreaState.js +40 -0
- package/dist/cjs/safeAreaState.js.map +1 -0
- package/dist/cjs/setup-burnt.js +38 -0
- package/dist/cjs/setup-burnt.js.map +1 -0
- package/dist/cjs/setup-expo-linear-gradient.js +37 -0
- package/dist/cjs/setup-expo-linear-gradient.js.map +1 -0
- package/dist/cjs/setup-gesture-handler.js +76 -0
- package/dist/cjs/setup-gesture-handler.js.map +1 -0
- package/dist/cjs/setup-keyboard-controller.js +51 -0
- package/dist/cjs/setup-keyboard-controller.js.map +1 -0
- package/dist/cjs/setup-keyboard-controller.web.js +7 -0
- package/dist/cjs/setup-keyboard-controller.web.js.map +1 -0
- package/dist/cjs/setup-safe-area.js +54 -0
- package/dist/cjs/setup-safe-area.js.map +1 -0
- package/dist/cjs/setup-teleport.js +37 -0
- package/dist/cjs/setup-teleport.js.map +1 -0
- package/dist/cjs/setup-worklets.js +48 -0
- package/dist/cjs/setup-worklets.js.map +1 -0
- package/dist/cjs/setup-zeego.js +42 -0
- package/dist/cjs/setup-zeego.js.map +1 -0
- package/dist/cjs/types.js +3 -0
- package/dist/cjs/types.js.map +1 -0
- package/dist/cjs/workletsState.js +25 -0
- package/dist/cjs/workletsState.js.map +1 -0
- package/dist/cjs/zeegoState.js +23 -0
- package/dist/cjs/zeegoState.js.map +1 -0
- package/dist/esm/PressBoundary.js +37 -0
- package/dist/esm/PressBoundary.js.map +1 -0
- package/dist/esm/burntState.js +20 -0
- package/dist/esm/burntState.js.map +1 -0
- package/dist/esm/components.js +45 -0
- package/dist/esm/components.js.map +1 -0
- package/dist/esm/gesture-handler.js +5 -0
- package/dist/esm/gesture-handler.js.map +1 -0
- package/dist/esm/gestureState.js +300 -0
- package/dist/esm/gestureState.js.map +1 -0
- package/dist/esm/globalState.js +21 -0
- package/dist/esm/globalState.js.map +1 -0
- package/dist/esm/index.js +41 -13
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/keyboardControllerState.js +21 -0
- package/dist/esm/keyboardControllerState.js.map +1 -0
- package/dist/esm/linearGradientState.js +19 -0
- package/dist/esm/linearGradientState.js.map +1 -0
- package/dist/esm/nativeMenuContext.js +3 -0
- package/dist/esm/nativeMenuContext.js.map +1 -0
- package/dist/esm/portalState.js +19 -0
- package/dist/esm/portalState.js.map +1 -0
- package/dist/esm/safeAreaState.js +37 -0
- package/dist/esm/safeAreaState.js.map +1 -0
- package/dist/esm/setup-burnt.js +36 -0
- package/dist/esm/setup-burnt.js.map +1 -0
- package/dist/esm/setup-expo-linear-gradient.js +35 -0
- package/dist/esm/setup-expo-linear-gradient.js.map +1 -0
- package/dist/esm/setup-gesture-handler.js +72 -0
- package/dist/esm/setup-gesture-handler.js.map +1 -0
- package/dist/esm/setup-keyboard-controller.js +49 -0
- package/dist/esm/setup-keyboard-controller.js.map +1 -0
- package/dist/esm/setup-keyboard-controller.web.js +7 -0
- package/dist/esm/setup-keyboard-controller.web.js.map +1 -0
- package/dist/esm/setup-safe-area.js +52 -0
- package/dist/esm/setup-safe-area.js.map +1 -0
- package/dist/esm/setup-teleport.js +35 -0
- package/dist/esm/setup-teleport.js.map +1 -0
- package/dist/esm/setup-worklets.js +46 -0
- package/dist/esm/setup-worklets.js.map +1 -0
- package/dist/esm/setup-zeego.js +40 -0
- package/dist/esm/setup-zeego.js.map +1 -0
- package/dist/esm/types.js +2 -0
- package/dist/esm/types.js.map +1 -0
- package/dist/esm/workletsState.js +22 -0
- package/dist/esm/workletsState.js.map +1 -0
- package/dist/esm/zeegoState.js +20 -0
- package/dist/esm/zeegoState.js.map +1 -0
- package/package.json +80 -93
- package/src/PressBoundary.tsx +1 -1
- package/src/burntState.ts +2 -2
- package/src/components.tsx +11 -5
- package/src/gesture-handler.ts +6 -6
- package/src/gestureState.ts +2 -2
- package/src/index.ts +21 -21
- package/src/keyboardControllerState.ts +2 -2
- package/src/linearGradientState.ts +2 -2
- package/src/portalState.ts +2 -2
- package/src/safeAreaState.ts +2 -2
- package/src/setup-burnt.ts +1 -1
- package/src/setup-expo-linear-gradient.ts +1 -1
- package/src/setup-gesture-handler.ts +1 -1
- package/src/setup-keyboard-controller.ts +1 -1
- package/src/setup-safe-area.ts +1 -1
- package/src/setup-teleport.ts +1 -1
- package/src/setup-worklets.ts +1 -1
- package/src/setup-zeego.ts +1 -1
- package/src/workletsState.ts +2 -2
- package/src/zeegoState.ts +2 -2
- package/types/PressBoundary.d.ts +9 -10
- package/types/PressBoundary.d.ts.map +1 -11
- package/types/burntState.d.ts +4 -5
- package/types/burntState.d.ts.map +1 -11
- package/types/components.d.ts +12 -13
- package/types/components.d.ts.map +1 -11
- package/types/gesture-handler.d.ts +6 -7
- package/types/gesture-handler.d.ts.map +1 -11
- package/types/gestureState.d.ts +17 -18
- package/types/gestureState.d.ts.map +1 -11
- package/types/globalState.d.ts +3 -4
- package/types/globalState.d.ts.map +1 -11
- package/types/index.d.ts +40 -41
- package/types/index.d.ts.map +1 -11
- package/types/keyboardControllerState.d.ts +1 -2
- package/types/keyboardControllerState.d.ts.map +1 -11
- package/types/linearGradientState.d.ts +4 -5
- package/types/linearGradientState.d.ts.map +1 -11
- package/types/nativeMenuContext.d.ts +1 -2
- package/types/nativeMenuContext.d.ts.map +1 -11
- package/types/portalState.d.ts +4 -5
- package/types/portalState.d.ts.map +1 -11
- package/types/safeAreaState.d.ts +8 -9
- package/types/safeAreaState.d.ts.map +1 -11
- package/types/setup-burnt.d.ts +13 -1
- package/types/setup-burnt.d.ts.map +1 -11
- package/types/setup-expo-linear-gradient.d.ts +13 -1
- package/types/setup-expo-linear-gradient.d.ts.map +1 -11
- package/types/setup-gesture-handler.d.ts +22 -5
- package/types/setup-gesture-handler.d.ts.map +1 -11
- package/types/setup-keyboard-controller.d.ts +18 -1
- package/types/setup-keyboard-controller.d.ts.map +1 -11
- package/types/setup-keyboard-controller.web.d.ts +4 -1
- package/types/setup-keyboard-controller.web.d.ts.map +1 -11
- package/types/setup-safe-area.d.ts +23 -1
- package/types/setup-safe-area.d.ts.map +1 -11
- package/types/setup-teleport.d.ts +13 -1
- package/types/setup-teleport.d.ts.map +1 -11
- package/types/setup-worklets.d.ts +19 -1
- package/types/setup-worklets.d.ts.map +1 -11
- package/types/setup-zeego.d.ts +13 -1
- package/types/setup-zeego.d.ts.map +1 -11
- package/types/types.d.ts +47 -48
- package/types/types.d.ts.map +1 -11
- package/types/workletsState.d.ts +4 -5
- package/types/workletsState.d.ts.map +1 -11
- package/types/zeegoState.d.ts +4 -5
- package/types/zeegoState.d.ts.map +1 -11
- package/dist/cjs/PressBoundary.cjs +0 -92
- package/dist/cjs/PressBoundary.native.js +0 -105
- package/dist/cjs/PressBoundary.native.js.map +0 -1
- package/dist/cjs/burntState.cjs +0 -46
- package/dist/cjs/burntState.native.js +0 -49
- package/dist/cjs/burntState.native.js.map +0 -1
- package/dist/cjs/components.cjs +0 -71
- package/dist/cjs/components.native.js +0 -77
- package/dist/cjs/components.native.js.map +0 -1
- package/dist/cjs/gesture-handler.cjs +0 -37
- package/dist/cjs/gesture-handler.native.js +0 -40
- package/dist/cjs/gesture-handler.native.js.map +0 -1
- package/dist/cjs/gestureState.cjs +0 -249
- package/dist/cjs/gestureState.native.js +0 -268
- package/dist/cjs/gestureState.native.js.map +0 -1
- package/dist/cjs/globalState.cjs +0 -45
- package/dist/cjs/globalState.native.js +0 -48
- package/dist/cjs/globalState.native.js.map +0 -1
- package/dist/cjs/index.cjs +0 -54
- package/dist/cjs/index.native.js +0 -57
- package/dist/cjs/index.native.js.map +0 -1
- package/dist/cjs/keyboardControllerState.cjs +0 -49
- package/dist/cjs/keyboardControllerState.native.js +0 -52
- package/dist/cjs/keyboardControllerState.native.js.map +0 -1
- package/dist/cjs/linearGradientState.cjs +0 -45
- package/dist/cjs/linearGradientState.native.js +0 -48
- package/dist/cjs/linearGradientState.native.js.map +0 -1
- package/dist/cjs/nativeMenuContext.cjs +0 -29
- package/dist/cjs/nativeMenuContext.native.js +0 -32
- package/dist/cjs/nativeMenuContext.native.js.map +0 -1
- package/dist/cjs/portalState.cjs +0 -45
- package/dist/cjs/portalState.native.js +0 -48
- package/dist/cjs/portalState.native.js.map +0 -1
- package/dist/cjs/safeAreaState.cjs +0 -73
- package/dist/cjs/safeAreaState.native.js +0 -76
- package/dist/cjs/safeAreaState.native.js.map +0 -1
- package/dist/cjs/setup-burnt.cjs +0 -17
- package/dist/cjs/setup-burnt.native.js +0 -20
- package/dist/cjs/setup-burnt.native.js.map +0 -1
- package/dist/cjs/setup-expo-linear-gradient.cjs +0 -16
- package/dist/cjs/setup-expo-linear-gradient.native.js +0 -19
- package/dist/cjs/setup-expo-linear-gradient.native.js.map +0 -1
- package/dist/cjs/setup-gesture-handler.cjs +0 -76
- package/dist/cjs/setup-gesture-handler.native.js +0 -79
- package/dist/cjs/setup-gesture-handler.native.js.map +0 -1
- package/dist/cjs/setup-keyboard-controller.cjs +0 -0
- package/dist/cjs/setup-keyboard-controller.native.js +0 -36
- package/dist/cjs/setup-keyboard-controller.native.js.map +0 -1
- package/dist/cjs/setup-safe-area.cjs +0 -3
- package/dist/cjs/setup-safe-area.native.js +0 -23
- package/dist/cjs/setup-safe-area.native.js.map +0 -1
- package/dist/cjs/setup-teleport.cjs +0 -18
- package/dist/cjs/setup-teleport.native.js +0 -21
- package/dist/cjs/setup-teleport.native.js.map +0 -1
- package/dist/cjs/setup-worklets.cjs +0 -21
- package/dist/cjs/setup-worklets.native.js +0 -24
- package/dist/cjs/setup-worklets.native.js.map +0 -1
- package/dist/cjs/setup-zeego.cjs +0 -22
- package/dist/cjs/setup-zeego.native.js +0 -25
- package/dist/cjs/setup-zeego.native.js.map +0 -1
- package/dist/cjs/types.cjs +0 -18
- package/dist/cjs/types.native.js +0 -21
- package/dist/cjs/types.native.js.map +0 -1
- package/dist/cjs/workletsState.cjs +0 -48
- package/dist/cjs/workletsState.native.js +0 -51
- package/dist/cjs/workletsState.native.js.map +0 -1
- package/dist/cjs/zeegoState.cjs +0 -46
- package/dist/cjs/zeegoState.native.js +0 -49
- package/dist/cjs/zeegoState.native.js.map +0 -1
- package/dist/esm/PressBoundary.mjs +0 -56
- package/dist/esm/PressBoundary.mjs.map +0 -1
- package/dist/esm/PressBoundary.native.js +0 -66
- package/dist/esm/PressBoundary.native.js.map +0 -1
- package/dist/esm/burntState.mjs +0 -21
- package/dist/esm/burntState.mjs.map +0 -1
- package/dist/esm/burntState.native.js +0 -21
- package/dist/esm/burntState.native.js.map +0 -1
- package/dist/esm/components.mjs +0 -44
- package/dist/esm/components.mjs.map +0 -1
- package/dist/esm/components.native.js +0 -47
- package/dist/esm/components.native.js.map +0 -1
- package/dist/esm/gesture-handler.mjs +0 -6
- package/dist/esm/gesture-handler.mjs.map +0 -1
- package/dist/esm/gesture-handler.native.js +0 -6
- package/dist/esm/gesture-handler.native.js.map +0 -1
- package/dist/esm/gestureState.mjs +0 -220
- package/dist/esm/gestureState.mjs.map +0 -1
- package/dist/esm/gestureState.native.js +0 -236
- package/dist/esm/gestureState.native.js.map +0 -1
- package/dist/esm/globalState.mjs +0 -20
- package/dist/esm/globalState.mjs.map +0 -1
- package/dist/esm/globalState.native.js +0 -20
- package/dist/esm/globalState.native.js.map +0 -1
- package/dist/esm/index.mjs +0 -13
- package/dist/esm/index.mjs.map +0 -1
- package/dist/esm/index.native.js +0 -13
- package/dist/esm/index.native.js.map +0 -1
- package/dist/esm/keyboardControllerState.mjs +0 -22
- package/dist/esm/keyboardControllerState.mjs.map +0 -1
- package/dist/esm/keyboardControllerState.native.js +0 -22
- package/dist/esm/keyboardControllerState.native.js.map +0 -1
- package/dist/esm/linearGradientState.mjs +0 -20
- package/dist/esm/linearGradientState.mjs.map +0 -1
- package/dist/esm/linearGradientState.native.js +0 -20
- package/dist/esm/linearGradientState.native.js.map +0 -1
- package/dist/esm/nativeMenuContext.mjs +0 -4
- package/dist/esm/nativeMenuContext.mjs.map +0 -1
- package/dist/esm/nativeMenuContext.native.js +0 -4
- package/dist/esm/nativeMenuContext.native.js.map +0 -1
- package/dist/esm/portalState.mjs +0 -20
- package/dist/esm/portalState.mjs.map +0 -1
- package/dist/esm/portalState.native.js +0 -20
- package/dist/esm/portalState.native.js.map +0 -1
- package/dist/esm/safeAreaState.mjs +0 -48
- package/dist/esm/safeAreaState.mjs.map +0 -1
- package/dist/esm/safeAreaState.native.js +0 -48
- package/dist/esm/safeAreaState.native.js.map +0 -1
- package/dist/esm/setup-burnt.mjs +0 -18
- package/dist/esm/setup-burnt.mjs.map +0 -1
- package/dist/esm/setup-burnt.native.js +0 -18
- package/dist/esm/setup-burnt.native.js.map +0 -1
- package/dist/esm/setup-expo-linear-gradient.mjs +0 -17
- package/dist/esm/setup-expo-linear-gradient.mjs.map +0 -1
- package/dist/esm/setup-expo-linear-gradient.native.js +0 -17
- package/dist/esm/setup-expo-linear-gradient.native.js.map +0 -1
- package/dist/esm/setup-gesture-handler.mjs +0 -50
- package/dist/esm/setup-gesture-handler.mjs.map +0 -1
- package/dist/esm/setup-gesture-handler.native.js +0 -50
- package/dist/esm/setup-gesture-handler.native.js.map +0 -1
- package/dist/esm/setup-keyboard-controller.mjs +0 -2
- package/dist/esm/setup-keyboard-controller.mjs.map +0 -1
- package/dist/esm/setup-keyboard-controller.native.js +0 -34
- package/dist/esm/setup-keyboard-controller.native.js.map +0 -1
- package/dist/esm/setup-safe-area.mjs +0 -4
- package/dist/esm/setup-safe-area.mjs.map +0 -1
- package/dist/esm/setup-safe-area.native.js +0 -27
- package/dist/esm/setup-safe-area.native.js.map +0 -1
- package/dist/esm/setup-teleport.mjs +0 -19
- package/dist/esm/setup-teleport.mjs.map +0 -1
- package/dist/esm/setup-teleport.native.js +0 -19
- package/dist/esm/setup-teleport.native.js.map +0 -1
- package/dist/esm/setup-worklets.mjs +0 -22
- package/dist/esm/setup-worklets.mjs.map +0 -1
- package/dist/esm/setup-worklets.native.js +0 -22
- package/dist/esm/setup-worklets.native.js.map +0 -1
- package/dist/esm/setup-zeego.mjs +0 -23
- package/dist/esm/setup-zeego.mjs.map +0 -1
- package/dist/esm/setup-zeego.native.js +0 -23
- package/dist/esm/setup-zeego.native.js.map +0 -1
- package/dist/esm/types.mjs +0 -2
- package/dist/esm/types.mjs.map +0 -1
- package/dist/esm/types.native.js +0 -2
- package/dist/esm/types.native.js.map +0 -1
- package/dist/esm/workletsState.mjs +0 -23
- package/dist/esm/workletsState.mjs.map +0 -1
- package/dist/esm/workletsState.native.js +0 -23
- package/dist/esm/workletsState.native.js.map +0 -1
- package/dist/esm/zeegoState.mjs +0 -21
- package/dist/esm/zeegoState.mjs.map +0 -1
- package/dist/esm/zeegoState.native.js +0 -21
- package/dist/esm/zeegoState.native.js.map +0 -1
- package/gesture-handler/index.cjs +0 -1
- package/gesture-handler/index.js +0 -1
- package/gesture-handler/index.native.cjs +0 -1
- package/gesture-handler/index.native.js +0 -1
- package/gesture-handler.cjs +0 -1
- package/setup-burnt/index.cjs +0 -2
- package/setup-burnt/index.js +0 -2
- package/setup-burnt/index.native.cjs +0 -2
- package/setup-burnt/index.native.js +0 -2
- package/setup-burnt.cjs +0 -1
- package/setup-expo-linear-gradient/index.cjs +0 -2
- package/setup-expo-linear-gradient/index.js +0 -2
- package/setup-expo-linear-gradient/index.native.cjs +0 -2
- package/setup-expo-linear-gradient/index.native.js +0 -2
- package/setup-expo-linear-gradient.cjs +0 -1
- package/setup-gesture-handler/index.cjs +0 -2
- package/setup-gesture-handler/index.js +0 -2
- package/setup-gesture-handler/index.native.cjs +0 -2
- package/setup-gesture-handler/index.native.js +0 -2
- package/setup-gesture-handler.cjs +0 -1
- package/setup-keyboard-controller/index.cjs +0 -2
- package/setup-keyboard-controller/index.js +0 -2
- package/setup-keyboard-controller/index.native.cjs +0 -2
- package/setup-keyboard-controller/index.native.js +0 -2
- package/setup-keyboard-controller.cjs +0 -1
- package/setup-safe-area/index.cjs +0 -2
- package/setup-safe-area/index.js +0 -2
- package/setup-safe-area/index.native.cjs +0 -2
- package/setup-safe-area/index.native.js +0 -2
- package/setup-safe-area.cjs +0 -1
- package/setup-teleport/index.cjs +0 -2
- package/setup-teleport/index.js +0 -2
- package/setup-teleport/index.native.cjs +0 -2
- package/setup-teleport/index.native.js +0 -2
- package/setup-teleport.cjs +0 -1
- package/setup-worklets/index.cjs +0 -2
- package/setup-worklets/index.js +0 -2
- package/setup-worklets/index.native.cjs +0 -2
- package/setup-worklets/index.native.js +0 -2
- package/setup-worklets.cjs +0 -1
- package/setup-zeego/index.cjs +0 -2
- package/setup-zeego/index.js +0 -2
- package/setup-zeego/index.native.cjs +0 -2
- package/setup-zeego/index.native.js +0 -2
- package/setup-zeego.cjs +0 -1
package/types/components.d.ts
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import type { ReactNode } from
|
|
2
|
-
import type { NativePortalProps, NativePortalHostProps, NativePortalProviderProps } from
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { NativePortalProps, NativePortalHostProps, NativePortalProviderProps } from './types.ts';
|
|
3
3
|
export type { NativePortalProps, NativePortalHostProps, NativePortalProviderProps };
|
|
4
4
|
/**
|
|
5
|
-
* Renders children into a teleport Portal when available.
|
|
6
|
-
* Returns null when teleport is not set up (allows fallback handling by caller).
|
|
7
|
-
*/
|
|
8
|
-
export declare function NativePortal({ hostName, children }: NativePortalProps): ReactNode;
|
|
5
|
+
* Renders children into a teleport Portal when available.
|
|
6
|
+
* Returns null when teleport is not set up (allows fallback handling by caller).
|
|
7
|
+
*/
|
|
8
|
+
export declare function NativePortal({ hostName, children, }: NativePortalProps): ReactNode;
|
|
9
9
|
/**
|
|
10
|
-
* Renders a teleport PortalHost when available.
|
|
11
|
-
* Returns null when teleport is not set up.
|
|
12
|
-
*/
|
|
10
|
+
* Renders a teleport PortalHost when available.
|
|
11
|
+
* Returns null when teleport is not set up.
|
|
12
|
+
*/
|
|
13
13
|
export declare function NativePortalHost({ name }: NativePortalHostProps): ReactNode;
|
|
14
14
|
/**
|
|
15
|
-
* Wraps children with teleport PortalProvider when available.
|
|
16
|
-
* Returns children as-is when teleport is not set up.
|
|
17
|
-
*/
|
|
15
|
+
* Wraps children with teleport PortalProvider when available.
|
|
16
|
+
* Returns children as-is when teleport is not set up.
|
|
17
|
+
*/
|
|
18
18
|
export declare function NativePortalProvider({ children }: NativePortalProviderProps): ReactNode;
|
|
19
|
-
|
|
20
19
|
//# sourceMappingURL=components.d.ts.map
|
|
@@ -1,11 +1 @@
|
|
|
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).__hanzogui_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).__hanzogui_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).__hanzogui_teleport\n return <PortalProvider>{children}</PortalProvider>\n}\n"
|
|
10
|
-
]
|
|
11
|
-
}
|
|
1
|
+
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../src/components.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,OAAO,KAAK,EACV,iBAAiB,EACjB,qBAAqB,EACrB,yBAAyB,EAC1B,MAAM,YAAY,CAAA;AAEnB,YAAY,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,CAAA;AAEnF;;;GAGG;AACH,wBAAgB,YAAY,CAAC,EAC3B,QAAiB,EACjB,QAAQ,GACT,EAAE,iBAAiB,GAAG,SAAS,CAQ/B;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,IAAI,EAAE,EAAE,qBAAqB,GAAG,SAAS,CAQ3E;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,EAAE,QAAQ,EAAE,EAAE,yBAAyB,GAAG,SAAS,CAQvF"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
export { getGestureHandler } from
|
|
2
|
-
export type { ExternalPressOwnershipToken, GestureHandlerAccessor, PressGestureConfig } from
|
|
3
|
-
export { claimExternalPressOwnership as unstable_claimExternalPressOwnership, hasExternalPressOwnership as unstable_hasExternalPressOwnership, releaseExternalPressOwnership as unstable_releaseExternalPressOwnership } from
|
|
4
|
-
export { PressBoundary } from
|
|
5
|
-
export type { PressBoundaryProps } from
|
|
6
|
-
export { getGestureHandlerConfig, setupGestureHandler, type GestureHandlerConfig } from
|
|
7
|
-
|
|
1
|
+
export { getGestureHandler } from './gestureState.ts';
|
|
2
|
+
export type { ExternalPressOwnershipToken, GestureHandlerAccessor, PressGestureConfig, } from './gestureState.ts';
|
|
3
|
+
export { claimExternalPressOwnership as unstable_claimExternalPressOwnership, hasExternalPressOwnership as unstable_hasExternalPressOwnership, releaseExternalPressOwnership as unstable_releaseExternalPressOwnership, } from './gestureState.ts';
|
|
4
|
+
export { PressBoundary } from './PressBoundary.tsx';
|
|
5
|
+
export type { PressBoundaryProps } from './PressBoundary.tsx';
|
|
6
|
+
export { getGestureHandlerConfig, setupGestureHandler, type GestureHandlerConfig, } from './setup-gesture-handler.ts';
|
|
8
7
|
//# sourceMappingURL=gesture-handler.d.ts.map
|
|
@@ -1,11 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"mappings": "AAAA,SAAS,yBAAyB;AAClC,cACE,6BACA,wBACA,0BACK;AACP,SACE,+BAA+B,sCAC/B,6BAA6B,oCAC7B,iCAAiC,8CAC5B;AACP,SAAS,qBAAqB;AAC9B,cAAc,0BAA0B;AACxC,SACE,yBACA,0BACK,4BACA",
|
|
3
|
-
"names": [],
|
|
4
|
-
"sources": [
|
|
5
|
-
"src/gesture-handler.ts"
|
|
6
|
-
],
|
|
7
|
-
"version": 3,
|
|
8
|
-
"sourcesContent": [
|
|
9
|
-
"export { getGestureHandler } from './gestureState'\nexport type {\n ExternalPressOwnershipToken,\n GestureHandlerAccessor,\n PressGestureConfig,\n} from './gestureState'\nexport {\n claimExternalPressOwnership as unstable_claimExternalPressOwnership,\n hasExternalPressOwnership as unstable_hasExternalPressOwnership,\n releaseExternalPressOwnership as unstable_releaseExternalPressOwnership,\n} from './gestureState'\nexport { PressBoundary } from './PressBoundary'\nexport type { PressBoundaryProps } from './PressBoundary'\nexport {\n getGestureHandlerConfig,\n setupGestureHandler,\n type GestureHandlerConfig,\n} from './setup-gesture-handler'\n"
|
|
10
|
-
]
|
|
11
|
-
}
|
|
1
|
+
{"version":3,"file":"gesture-handler.d.ts","sourceRoot":"","sources":["../src/gesture-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AACrD,YAAY,EACV,2BAA2B,EAC3B,sBAAsB,EACtB,kBAAkB,GACnB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EACL,2BAA2B,IAAI,oCAAoC,EACnE,yBAAyB,IAAI,kCAAkC,EAC/D,6BAA6B,IAAI,sCAAsC,GACxE,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,YAAY,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAC7D,OAAO,EACL,uBAAuB,EACvB,mBAAmB,EACnB,KAAK,oBAAoB,GAC1B,MAAM,4BAA4B,CAAA"}
|
package/types/gestureState.d.ts
CHANGED
|
@@ -1,31 +1,30 @@
|
|
|
1
|
-
import type { GestureState } from
|
|
1
|
+
import type { GestureState } from './types.ts';
|
|
2
2
|
export declare function canChangeGestureHandlerEnabled(nextEnabled: boolean, source: string): boolean;
|
|
3
3
|
export interface Insets {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
top?: number;
|
|
5
|
+
left?: number;
|
|
6
|
+
bottom?: number;
|
|
7
|
+
right?: number;
|
|
8
8
|
}
|
|
9
9
|
export type PressGestureConfig = {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
debugName?: string | null;
|
|
11
|
+
onPressIn?: (e: any) => void;
|
|
12
|
+
onPressOut?: (e: any) => void;
|
|
13
|
+
onPress?: (e: any) => void;
|
|
14
|
+
onLongPress?: (e: any) => void;
|
|
15
|
+
delayLongPress?: number;
|
|
16
|
+
hitSlop?: number | Insets | null;
|
|
17
17
|
};
|
|
18
18
|
export interface GestureHandlerAccessor {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
readonly isEnabled: boolean;
|
|
20
|
+
readonly state: GestureState;
|
|
21
|
+
set(updates: Partial<GestureState>): void;
|
|
22
|
+
disable(): void;
|
|
23
|
+
createPressGesture(config: PressGestureConfig): any;
|
|
24
24
|
}
|
|
25
25
|
export type ExternalPressOwnershipToken = object;
|
|
26
26
|
export declare function claimExternalPressOwnership(debugName?: string | null): ExternalPressOwnershipToken;
|
|
27
27
|
export declare function releaseExternalPressOwnership(token: ExternalPressOwnershipToken | null | undefined, debugName?: string | null): void;
|
|
28
28
|
export declare function hasExternalPressOwnership(): boolean;
|
|
29
29
|
export declare function getGestureHandler(): GestureHandlerAccessor;
|
|
30
|
-
|
|
31
30
|
//# sourceMappingURL=gestureState.d.ts.map
|
|
@@ -1,11 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"mappings": "AACA,cAAc,oBAAoB;AAkDlC,OAAO,iBAAS,+BACd,sBACA;AAqFF,iBAAiB,OAAO;CACtB;CACA;CACA;CACA;;AAGF,YAAY,qBAAqB;CAC/B;CACA,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,YAAY;AAgBZ,OAAO,iBAAS,4BACd,4BACC;AAeH,OAAO,iBAAS,8BACd,OAAO,gDACP;AAQF,OAAO,iBAAS;AAKhB,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 RootView: null,\n})\n\ntype GestureEnabledFreezeState = {\n frozen: boolean\n enabled: boolean\n warned: boolean\n}\n\nconst GESTURE_ENABLED_FREEZE_KEY = '__hanzogui_gesture_enabled_freeze__'\n\nfunction getGestureEnabledFreezeState(): GestureEnabledFreezeState {\n const g = globalThis as typeof globalThis & {\n [GESTURE_ENABLED_FREEZE_KEY]?: GestureEnabledFreezeState\n }\n\n if (!g[GESTURE_ENABLED_FREEZE_KEY]) {\n g[GESTURE_ENABLED_FREEZE_KEY] = {\n frozen: false,\n enabled: false,\n warned: false,\n }\n }\n\n return g[GESTURE_ENABLED_FREEZE_KEY]!\n}\n\nfunction warnGestureEnabledMutationIgnored(source: string) {\n const freezeState = getGestureEnabledFreezeState()\n\n if (freezeState.warned || process.env.NODE_ENV === 'production') {\n return\n }\n\n freezeState.warned = true\n\n console.warn(\n `[Gui] Ignored ${source} because gesture handler press events were already ` +\n `${freezeState.enabled ? 'enabled' : 'disabled'} when GuiProvider mounted. ` +\n `Configure gesture handler mode before the first render.`\n )\n}\n\nexport function canChangeGestureHandlerEnabled(\n nextEnabled: boolean,\n source: string\n): boolean {\n const freezeState = getGestureEnabledFreezeState()\n\n if (!freezeState.frozen || freezeState.enabled === nextEnabled) {\n return true\n }\n\n warnGestureEnabledMutationIgnored(source)\n return false\n}\n\nlet pressGestureDebugId = 0\nlet externalPressDebugId = 0\n\n// distance in dp the finger may travel before a press is treated as a\n// scroll/drag and cancelled. tracked in absolute (screen) coordinates by the\n// Tap's onTouchesMove (see createPressGesture) so a view translating under a\n// stationary finger - a sheet sliding on keyboard open/close, a sheet open\n// animation - does not cancel the press; only genuine finger travel does.\n// this also makes scroll-cancels-press work for any scroll container (a plain\n// RN ScrollView/FlatList or an RNGH one), since the press cancels itself\n// rather than relying on a parent RNGH gesture to steal it.\nconst PRESS_MOVE_CANCEL_DISTANCE = 12\nconst PRESS_MOVE_CANCEL_DISTANCE_SQ =\n PRESS_MOVE_CANCEL_DISTANCE * PRESS_MOVE_CANCEL_DISTANCE\n\n// minimal shapes of the RNGH gesture events createPressGesture reads. RNGH is\n// injected at runtime (GestureState.Gesture is untyped), so this module keeps\n// no type dependency on react-native-gesture-handler - these name just the\n// fields the press gesture touches.\ntype GesturePoint = {\n absoluteX: number\n absoluteY: number\n}\ntype GestureBeginEvent = Partial<GesturePoint>\ntype GestureTouchEvent = {\n changedTouches?: GesturePoint[]\n allTouches?: GesturePoint[]\n}\n\ntype PressOwnerSource = 'internal' | 'external' | null\ntype PressOwnershipState = {\n owner: object | null\n ownerId: number | null\n ownerSource: PressOwnerSource\n ownerPointerId: number | null\n timestamp: number\n}\n\nconst PRESS_STATE_KEY = '__hanzogui_press_state__'\n\nfunction getEventPointerId(e: any): number | null {\n const pointerId =\n e?.pointerId ??\n e?.pointer?.id ??\n e?.event?.pointerId ??\n e?.event?.pointer?.id ??\n e?.nativeEvent?.pointerId ??\n e?.nativeEvent?.id ??\n e?.event?.nativeEvent?.pointerId ??\n e?.event?.nativeEvent?.id ??\n null\n\n return pointerId == null || Number.isNaN(pointerId) ? null : Number(pointerId)\n}\n\n/**\n * Global press coordination - ensures only innermost pressable fires press events,\n * matching RN Pressable/responder system semantics where deepest component wins.\n * Uses a grace period to allow child gestures to steal ownership from parent,\n * since RNGH fires parent gestures before child gestures.\n */\nconst pressState = ((\n globalThis as typeof globalThis & {\n [PRESS_STATE_KEY]?: PressOwnershipState\n }\n)[PRESS_STATE_KEY] ??= {\n owner: null,\n ownerId: null,\n ownerSource: null,\n ownerPointerId: null,\n timestamp: 0,\n})\n\nexport interface Insets {\n top?: number\n left?: number\n bottom?: number\n right?: number\n}\n\nexport type PressGestureConfig = {\n debugName?: string | null\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 type ExternalPressOwnershipToken = object\n\nfunction resetPressOwner() {\n pressState.owner = null\n pressState.ownerId = null\n pressState.ownerSource = null\n pressState.ownerPointerId = null\n pressState.timestamp = 0\n}\n\nfunction resetStaleOwner(now: number, debugName?: string | null) {\n if (now - pressState.timestamp > 2000) {\n resetPressOwner()\n }\n}\n\nexport function claimExternalPressOwnership(\n debugName?: string | null\n): ExternalPressOwnershipToken {\n const now = Date.now()\n resetStaleOwner(now, debugName)\n\n const token = {}\n const ownerId = ++externalPressDebugId\n\n pressState.owner = token\n pressState.ownerId = ownerId\n pressState.ownerSource = 'external'\n pressState.timestamp = now\n\n return token\n}\n\nexport function releaseExternalPressOwnership(\n token: ExternalPressOwnershipToken | null | undefined,\n debugName?: string | null\n): void {\n if (!token || pressState.owner !== token) {\n return\n }\n resetPressOwner()\n}\n\nexport function hasExternalPressOwnership(): boolean {\n resetStaleOwner(Date.now())\n return pressState.ownerSource === 'external'\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 if (\n updates.enabled !== undefined &&\n !canChangeGestureHandlerEnabled(updates.enabled, 'getGestureHandler().set()')\n ) {\n return\n }\n\n Object.assign(state.get(), updates)\n },\n\n disable(): void {\n if (!canChangeGestureHandlerEnabled(false, 'getGestureHandler().disable()')) {\n return\n }\n\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 // unique token for this gesture instance - used to track ownership\n const myToken = {}\n const myDebugId = ++pressGestureDebugId\n // mutable gesture state kept on an object so handler bodies that get\n // workletized by react-native-worklets (>=0.7.4) see live values.\n // primitive `let`s get frozen into the worklet's serialized __closure\n // at factory time, so reassignments from workletized handlers never\n // propagate out. object property mutation goes through the captured\n // reference and is always observed.\n const flags = {\n didLongPress: false,\n didPressIn: false,\n pressInTimer: null as ReturnType<typeof setTimeout> | null,\n // absolute (screen) coords of the press start, and whether the finger\n // has since travelled far enough to be treated as a scroll/drag.\n moveStartX: null as number | null,\n moveStartY: 0,\n cancelledByMove: false,\n }\n\n // Grace period for child gestures to steal ownership from parent.\n // RNGH fires parent before child, but we want innermost to win.\n // Claims typically span a few ms, 24ms gives enough room to observe\n // ordering while debugging slower frames.\n const GRACE_PERIOD_MS = process.env.GUI_RNGH_PRESS_DELAY\n ? +process.env.GUI_RNGH_PRESS_DELAY\n : 24\n\n const tryClaimOwnership = (e: any) => {\n const now = Date.now()\n resetStaleOwner(now, config.debugName)\n\n const currentPointerId = getEventPointerId(e)\n const isSameTouchPointer =\n currentPointerId == null ||\n pressState.ownerPointerId == null ||\n pressState.ownerPointerId === currentPointerId\n\n if (\n pressState.owner === null ||\n (pressState.ownerSource === 'internal' && isSameTouchPointer)\n ) {\n pressState.owner = myToken\n pressState.ownerId = myDebugId\n pressState.ownerSource = 'internal'\n pressState.ownerPointerId = currentPointerId\n pressState.timestamp = now\n }\n return pressState.owner === myToken\n }\n\n const isOwner = () => pressState.owner === myToken\n\n const releaseOwnership = () => {\n if (flags.pressInTimer) {\n clearTimeout(flags.pressInTimer)\n flags.pressInTimer = null\n }\n if (pressState.owner === myToken) {\n resetPressOwner()\n }\n }\n\n const firePressIn = (e: any) => {\n if (!flags.didPressIn && isOwner()) {\n flags.didPressIn = true\n config.onPressIn?.(e)\n }\n }\n\n const schedulePressIn = (e: any) => {\n if (flags.pressInTimer) {\n clearTimeout(flags.pressInTimer)\n }\n flags.pressInTimer = setTimeout(() => {\n flags.pressInTimer = null\n if (isOwner()) {\n firePressIn(e)\n }\n }, GRACE_PERIOD_MS + 1)\n }\n\n // Tap gesture for regular presses.\n //\n // maxDuration is long so long-presses aren't cut off. We deliberately do\n // not use RNGH's .maxDistance(): it measures finger travel in the gesture\n // view's own coordinate space, so a view that translates under a\n // stationary finger (a sheet sliding on keyboard open/close, a sheet open\n // animation) reads as finger movement and silently cancels the press -\n // onPress never fires. Instead onTouchesMove tracks the finger in\n // absolute (screen) coordinates and cancels only on genuine finger\n // travel. That also makes scroll-cancels-press work for any scroll\n // container, since the press cancels itself instead of depending on a\n // parent RNGH gesture to steal the touch.\n const tap = Gesture.Tap()\n .runOnJS(true)\n .maxDuration(10000) // allow very long presses\n .onBegin((e: GestureBeginEvent) => {\n flags.didLongPress = false\n flags.didPressIn = false\n flags.cancelledByMove = false\n flags.moveStartX = typeof e.absoluteX === 'number' ? e.absoluteX : null\n flags.moveStartY = typeof e.absoluteY === 'number' ? e.absoluteY : 0\n tryClaimOwnership(e)\n // Defer onPressIn until after the grace window so child pressables\n // can steal ownership, but flush it on tap end for very fast taps.\n schedulePressIn(e)\n })\n .onTouchesMove((e: GestureTouchEvent) => {\n if (flags.cancelledByMove || flags.moveStartX === null) return\n const touch = e.changedTouches?.[0] ?? e.allTouches?.[0]\n if (!touch) return\n const dx = touch.absoluteX - flags.moveStartX\n const dy = touch.absoluteY - flags.moveStartY\n if (dx * dx + dy * dy <= PRESS_MOVE_CANCEL_DISTANCE_SQ) return\n // finger has travelled far enough to be a scroll/drag, not a tap.\n // release the pressStyle now (mid-scroll, so it doesn't stay stuck)\n // and make onEnd skip onPress on finger lift.\n flags.cancelledByMove = true\n if (flags.pressInTimer) {\n clearTimeout(flags.pressInTimer)\n flags.pressInTimer = null\n }\n if (flags.didPressIn) {\n flags.didPressIn = false\n config.onPressOut?.(e)\n }\n releaseOwnership()\n })\n .onEnd((e: unknown) => {\n if (isOwner() && !flags.didLongPress && !flags.cancelledByMove) {\n firePressIn(e)\n config.onPress?.(e)\n }\n })\n .onFinalize((e: unknown) => {\n if (isOwner()) {\n config.onPressOut?.(e)\n releaseOwnership()\n } else if (flags.didPressIn) {\n // we already fired onPressIn but lost ownership before finalize\n // (e.g. finger dragged onto a sibling pressable and that one\n // claimed ownership). fire onPressOut so callers can clear their\n // press state - otherwise pressStyle stays stuck on this view.\n flags.didPressIn = false\n config.onPressOut?.(e)\n }\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 .onStart((e: any) => {\n flags.didLongPress = true\n if (isOwner()) {\n firePressIn(e)\n config.onLongPress?.(e)\n }\n })\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
|
+
{"version":3,"file":"gestureState.d.ts","sourceRoot":"","sources":["../src/gestureState.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAkD9C,wBAAgB,8BAA8B,CAC5C,WAAW,EAAE,OAAO,EACpB,MAAM,EAAE,MAAM,GACb,OAAO,CAST;AA2ED,MAAM,WAAW,MAAM;IACrB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,SAAS,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,CAAA;IAC5B,UAAU,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,CAAA;IAC7B,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,CAAA;IAC1B,WAAW,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,CAAA;IAC9B,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAA;CACjC,CAAA;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAA;IAC3B,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAA;IAC5B,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,IAAI,CAAA;IACzC,OAAO,IAAI,IAAI,CAAA;IACf,kBAAkB,CAAC,MAAM,EAAE,kBAAkB,GAAG,GAAG,CAAA;CACpD;AAED,MAAM,MAAM,2BAA2B,GAAG,MAAM,CAAA;AAgBhD,wBAAgB,2BAA2B,CACzC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,GACxB,2BAA2B,CAa7B;AAED,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,2BAA2B,GAAG,IAAI,GAAG,SAAS,EACrD,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,GACxB,IAAI,CAKN;AAED,wBAAgB,yBAAyB,IAAI,OAAO,CAGnD;AAED,wBAAgB,iBAAiB,IAAI,sBAAsB,CA6M1D"}
|
package/types/globalState.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
export declare function createGlobalState<T extends {
|
|
2
|
-
|
|
2
|
+
enabled: boolean;
|
|
3
3
|
}>(key: string, defaultValue: T): {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
get: () => T;
|
|
5
|
+
set: (next: T) => void;
|
|
6
6
|
};
|
|
7
|
-
|
|
8
7
|
//# sourceMappingURL=globalState.d.ts.map
|
|
@@ -1,11 +1 @@
|
|
|
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 = `__hanzogui_${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
|
+
{"version":3,"file":"globalState.d.ts","sourceRoot":"","sources":["../src/globalState.ts"],"names":[],"mappings":"AAAA,wBAAgB,iBAAiB,CAAC,CAAC,SAAS;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,EAC9D,GAAG,EAAE,MAAM,EACX,YAAY,EAAE,CAAC,GACd;IACD,GAAG,EAAE,MAAM,CAAC,CAAA;IACZ,GAAG,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,CAAA;CACvB,CAyBA"}
|
package/types/index.d.ts
CHANGED
|
@@ -1,43 +1,42 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @hanzogui/native
|
|
3
|
-
*
|
|
4
|
-
* Native setup modules for Gui. Import these at the top of your app entry point.
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* ```tsx
|
|
8
|
-
* // In your app entry (index.js or App.tsx)
|
|
9
|
-
* import '@hanzogui/native/setup-teleport'
|
|
10
|
-
* import '@hanzogui/native/setup-gesture-handler'
|
|
11
|
-
* import '@hanzogui/native/setup-worklets'
|
|
12
|
-
* import '@hanzogui/native/setup-safe-area'
|
|
13
|
-
* import '@hanzogui/native/expo-linear-gradient'
|
|
14
|
-
* import '@hanzogui/native/setup-keyboard-controller'
|
|
15
|
-
*
|
|
16
|
-
* // Then use Gui components normally
|
|
17
|
-
* // Sheet will automatically use native gestures when available
|
|
18
|
-
* // LinearGradient will use expo-linear-gradient when installed
|
|
19
|
-
* ```
|
|
20
|
-
*/
|
|
21
|
-
export type { NativePortalState, GestureState, WorkletsState, SafeAreaState, SafeAreaInsets, SafeAreaFrame, SafeAreaMetrics, LinearGradientState, ZeegoState, BurntState, NativePortalProps, NativePortalHostProps, NativePortalProviderProps } from
|
|
22
|
-
export { getPortal } from
|
|
23
|
-
export type { PortalAccessor } from
|
|
24
|
-
export { getGestureHandler } from
|
|
25
|
-
export { claimExternalPressOwnership as unstable_claimExternalPressOwnership, hasExternalPressOwnership as unstable_hasExternalPressOwnership, releaseExternalPressOwnership as unstable_releaseExternalPressOwnership } from
|
|
26
|
-
export type { ExternalPressOwnershipToken, GestureHandlerAccessor, PressGestureConfig } from
|
|
27
|
-
export type { GestureHandlerConfig } from
|
|
28
|
-
export { getWorklets } from
|
|
29
|
-
export type { WorkletsAccessor } from
|
|
30
|
-
export { getSafeArea } from
|
|
31
|
-
export type { SafeAreaAccessor } from
|
|
32
|
-
export { getLinearGradient } from
|
|
33
|
-
export type { LinearGradientAccessor } from
|
|
34
|
-
export { isKeyboardControllerEnabled, getKeyboardControllerState, setKeyboardControllerState } from
|
|
35
|
-
export type { KeyboardControllerState } from
|
|
36
|
-
export { getZeego } from
|
|
37
|
-
export type { ZeegoAccessor } from
|
|
38
|
-
export { NativeMenuContext } from
|
|
39
|
-
export { getBurnt } from
|
|
40
|
-
export type { BurntAccessor } from
|
|
41
|
-
export { NativePortal, NativePortalHost, NativePortalProvider } from
|
|
42
|
-
|
|
2
|
+
* @hanzogui/native
|
|
3
|
+
*
|
|
4
|
+
* Native setup modules for Gui. Import these at the top of your app entry point.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```tsx
|
|
8
|
+
* // In your app entry (index.js or App.tsx)
|
|
9
|
+
* import '@hanzogui/native/setup-teleport'
|
|
10
|
+
* import '@hanzogui/native/setup-gesture-handler'
|
|
11
|
+
* import '@hanzogui/native/setup-worklets'
|
|
12
|
+
* import '@hanzogui/native/setup-safe-area'
|
|
13
|
+
* import '@hanzogui/native/expo-linear-gradient'
|
|
14
|
+
* import '@hanzogui/native/setup-keyboard-controller'
|
|
15
|
+
*
|
|
16
|
+
* // Then use Gui components normally
|
|
17
|
+
* // Sheet will automatically use native gestures when available
|
|
18
|
+
* // LinearGradient will use expo-linear-gradient when installed
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export type { NativePortalState, GestureState, WorkletsState, SafeAreaState, SafeAreaInsets, SafeAreaFrame, SafeAreaMetrics, LinearGradientState, ZeegoState, BurntState, NativePortalProps, NativePortalHostProps, NativePortalProviderProps, } from './types.ts';
|
|
22
|
+
export { getPortal } from './portalState.ts';
|
|
23
|
+
export type { PortalAccessor } from './portalState.ts';
|
|
24
|
+
export { getGestureHandler } from './gestureState.ts';
|
|
25
|
+
export { claimExternalPressOwnership as unstable_claimExternalPressOwnership, hasExternalPressOwnership as unstable_hasExternalPressOwnership, releaseExternalPressOwnership as unstable_releaseExternalPressOwnership, } from './gestureState.ts';
|
|
26
|
+
export type { ExternalPressOwnershipToken, GestureHandlerAccessor, PressGestureConfig, } from './gestureState.ts';
|
|
27
|
+
export type { GestureHandlerConfig } from './setup-gesture-handler.ts';
|
|
28
|
+
export { getWorklets } from './workletsState.ts';
|
|
29
|
+
export type { WorkletsAccessor } from './workletsState.ts';
|
|
30
|
+
export { getSafeArea } from './safeAreaState.ts';
|
|
31
|
+
export type { SafeAreaAccessor } from './safeAreaState.ts';
|
|
32
|
+
export { getLinearGradient } from './linearGradientState.ts';
|
|
33
|
+
export type { LinearGradientAccessor } from './linearGradientState.ts';
|
|
34
|
+
export { isKeyboardControllerEnabled, getKeyboardControllerState, setKeyboardControllerState, } from './keyboardControllerState.ts';
|
|
35
|
+
export type { KeyboardControllerState } from './keyboardControllerState.ts';
|
|
36
|
+
export { getZeego } from './zeegoState.ts';
|
|
37
|
+
export type { ZeegoAccessor } from './zeegoState.ts';
|
|
38
|
+
export { NativeMenuContext } from './nativeMenuContext.ts';
|
|
39
|
+
export { getBurnt } from './burntState.ts';
|
|
40
|
+
export type { BurntAccessor } from './burntState.ts';
|
|
41
|
+
export { NativePortal, NativePortalHost, NativePortalProvider } from './components.tsx';
|
|
43
42
|
//# sourceMappingURL=index.d.ts.map
|
package/types/index.d.ts.map
CHANGED
|
@@ -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,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
|
-
"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 {\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
|
-
]
|
|
11
|
-
}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,YAAY,EACV,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,aAAa,EACb,cAAc,EACd,aAAa,EACb,eAAe,EACf,mBAAmB,EACnB,UAAU,EACV,UAAU,EACV,iBAAiB,EACjB,qBAAqB,EACrB,yBAAyB,GAC1B,MAAM,YAAY,CAAA;AAGnB,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAC5C,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAGtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AACrD,OAAO,EACL,2BAA2B,IAAI,oCAAoC,EACnE,yBAAyB,IAAI,kCAAkC,EAC/D,6BAA6B,IAAI,sCAAsC,GACxE,MAAM,mBAAmB,CAAA;AAC1B,YAAY,EACV,2BAA2B,EAC3B,sBAAsB,EACtB,kBAAkB,GACnB,MAAM,mBAAmB,CAAA;AAG1B,YAAY,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAA;AAGtE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAChD,YAAY,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAG1D,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAChD,YAAY,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAG1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,YAAY,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AAGtE,OAAO,EACL,2BAA2B,EAC3B,0BAA0B,EAC1B,0BAA0B,GAC3B,MAAM,8BAA8B,CAAA;AACrC,YAAY,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAA;AAG3E,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC1C,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAG1D,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC1C,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAGpD,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAA"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type { KeyboardControllerState } from
|
|
1
|
+
import type { KeyboardControllerState } from './types.ts';
|
|
2
2
|
export type { KeyboardControllerState };
|
|
3
3
|
export declare function isKeyboardControllerEnabled(): boolean;
|
|
4
4
|
export declare function getKeyboardControllerState(): KeyboardControllerState;
|
|
5
5
|
export declare function setKeyboardControllerState(updates: Partial<KeyboardControllerState>): void;
|
|
6
|
-
|
|
7
6
|
//# sourceMappingURL=keyboardControllerState.d.ts.map
|
|
@@ -1,11 +1 @@
|
|
|
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
|
+
{"version":3,"file":"keyboardControllerState.d.ts","sourceRoot":"","sources":["../src/keyboardControllerState.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAA;AAEzD,YAAY,EAAE,uBAAuB,EAAE,CAAA;AAavC,wBAAgB,2BAA2B,IAAI,OAAO,CAErD;AAED,wBAAgB,0BAA0B,IAAI,uBAAuB,CAEpE;AAED,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,OAAO,CAAC,uBAAuB,CAAC,GACxC,IAAI,CAEN"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import type { LinearGradientState } from
|
|
1
|
+
import type { LinearGradientState } from './types.ts';
|
|
2
2
|
export interface LinearGradientAccessor {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
readonly isEnabled: boolean;
|
|
4
|
+
readonly state: LinearGradientState;
|
|
5
|
+
set(newState: LinearGradientState): void;
|
|
6
6
|
}
|
|
7
7
|
export declare function getLinearGradient(): LinearGradientAccessor;
|
|
8
|
-
|
|
9
8
|
//# sourceMappingURL=linearGradientState.d.ts.map
|
|
@@ -1,11 +1 @@
|
|
|
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
|
+
{"version":3,"file":"linearGradientState.d.ts","sourceRoot":"","sources":["../src/linearGradientState.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAOrD,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAA;IAC3B,QAAQ,CAAC,KAAK,EAAE,mBAAmB,CAAA;IACnC,GAAG,CAAC,QAAQ,EAAE,mBAAmB,GAAG,IAAI,CAAA;CACzC;AAED,wBAAgB,iBAAiB,IAAI,sBAAsB,CAY1D"}
|
|
@@ -1,11 +1 @@
|
|
|
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
|
+
{"version":3,"file":"nativeMenuContext.d.ts","sourceRoot":"","sources":["../src/nativeMenuContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,OAAO,CAAC,OAAO,CAAwB,CAAA"}
|
package/types/portalState.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import type { NativePortalState } from
|
|
1
|
+
import type { NativePortalState } from './types.ts';
|
|
2
2
|
export interface PortalAccessor {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
readonly isEnabled: boolean;
|
|
4
|
+
readonly state: NativePortalState;
|
|
5
|
+
set(newState: NativePortalState): void;
|
|
6
6
|
}
|
|
7
7
|
export declare function getPortal(): PortalAccessor;
|
|
8
|
-
|
|
9
8
|
//# sourceMappingURL=portalState.d.ts.map
|
|
@@ -1,11 +1 @@
|
|
|
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
|
+
{"version":3,"file":"portalState.d.ts","sourceRoot":"","sources":["../src/portalState.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAOnD,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAA;IAC3B,QAAQ,CAAC,KAAK,EAAE,iBAAiB,CAAA;IACjC,GAAG,CAAC,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAA;CACvC;AAED,wBAAgB,SAAS,IAAI,cAAc,CAY1C"}
|
package/types/safeAreaState.d.ts
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import type { SafeAreaState, SafeAreaInsets, SafeAreaFrame } from
|
|
1
|
+
import type { SafeAreaState, SafeAreaInsets, SafeAreaFrame } from './types.ts';
|
|
2
2
|
export interface SafeAreaAccessor {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
readonly isEnabled: boolean;
|
|
4
|
+
readonly state: SafeAreaState;
|
|
5
|
+
set(updates: Partial<SafeAreaState>): void;
|
|
6
|
+
/** Get initial insets (non-reactive, for style resolution) */
|
|
7
|
+
getInsets(): SafeAreaInsets;
|
|
8
|
+
/** Get initial frame (non-reactive) */
|
|
9
|
+
getFrame(): SafeAreaFrame;
|
|
10
10
|
}
|
|
11
11
|
export declare function getSafeArea(): SafeAreaAccessor;
|
|
12
|
-
|
|
13
12
|
//# sourceMappingURL=safeAreaState.d.ts.map
|
|
@@ -1,11 +1 @@
|
|
|
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
|
+
{"version":3,"file":"safeAreaState.d.ts","sourceRoot":"","sources":["../src/safeAreaState.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAY9E,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAA;IAC3B,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAA;IAC7B,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,aAAa,CAAC,GAAG,IAAI,CAAA;IAC1C,8DAA8D;IAC9D,SAAS,IAAI,cAAc,CAAA;IAC3B,uCAAuC;IACvC,QAAQ,IAAI,aAAa,CAAA;CAC1B;AAED,wBAAgB,WAAW,IAAI,gBAAgB,CA0B9C"}
|
package/types/setup-burnt.d.ts
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Setup burnt for Gui native toasts.
|
|
3
|
+
*
|
|
4
|
+
* Simply import this module at the top of your app entry point:
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```tsx
|
|
8
|
+
* import '@hanzogui/native/setup-burnt'
|
|
9
|
+
* ```
|
|
10
|
+
*
|
|
11
|
+
* This automatically detects and configures burnt for use with
|
|
12
|
+
* native Toast functionality.
|
|
13
|
+
*/
|
|
1
14
|
export {};
|
|
2
|
-
|
|
3
15
|
//# sourceMappingURL=setup-burnt.d.ts.map
|
|
@@ -1,11 +1 @@
|
|
|
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.__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
|
-
]
|
|
11
|
-
}
|
|
1
|
+
{"version":3,"file":"setup-burnt.d.ts","sourceRoot":"","sources":["../src/setup-burnt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG"}
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Setup expo-linear-gradient for Gui.
|
|
3
|
+
*
|
|
4
|
+
* Simply import this module at the top of your app entry point:
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```tsx
|
|
8
|
+
* import '@hanzogui/native/setup-expo-linear-gradient'
|
|
9
|
+
* ```
|
|
10
|
+
*
|
|
11
|
+
* This automatically detects and configures expo-linear-gradient.
|
|
12
|
+
* If not installed, LinearGradient will log a warning on native.
|
|
13
|
+
*/
|
|
1
14
|
export {};
|
|
2
|
-
|
|
3
15
|
//# sourceMappingURL=setup-expo-linear-gradient.d.ts.map
|
|
@@ -1,11 +1 @@
|
|
|
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.__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
|
-
]
|
|
11
|
-
}
|
|
1
|
+
{"version":3,"file":"setup-expo-linear-gradient.d.ts","sourceRoot":"","sources":["../src/setup-expo-linear-gradient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG"}
|
|
@@ -1,10 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Setup gesture handler for Gui native components.
|
|
3
|
+
*
|
|
4
|
+
* Simply import this module at the top of your app entry point:
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```tsx
|
|
8
|
+
* // auto-setup with all features enabled
|
|
9
|
+
* import '@hanzogui/native/setup-gesture-handler'
|
|
10
|
+
*
|
|
11
|
+
* // or configure selectively
|
|
12
|
+
* import { setupGestureHandler } from '@hanzogui/native/setup-gesture-handler'
|
|
13
|
+
* setupGestureHandler({ pressEvents: true, sheet: false })
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* This automatically detects and configures react-native-gesture-handler
|
|
17
|
+
* for use with Sheet and other gesture-aware components.
|
|
18
|
+
*/
|
|
1
19
|
export interface GestureHandlerConfig {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
20
|
+
/** use RNGH for press events on Gui components (default: true) */
|
|
21
|
+
pressEvents?: boolean;
|
|
22
|
+
/** use RNGH for Sheet drag gestures (default: true) */
|
|
23
|
+
sheet?: boolean;
|
|
6
24
|
}
|
|
7
25
|
export declare function getGestureHandlerConfig(): GestureHandlerConfig;
|
|
8
26
|
export declare function setupGestureHandler(config?: GestureHandlerConfig): void;
|
|
9
|
-
|
|
10
27
|
//# sourceMappingURL=setup-gesture-handler.d.ts.map
|
|
@@ -1,11 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"mappings": "AAqBA,iBAAiB,qBAAqB;;CAEpC;;CAEA;;AAQF,OAAO,iBAAS,2BAA2B;AAI3C,OAAO,iBAAS,oBAAoB,SAAS",
|
|
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 * // 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
|
-
]
|
|
11
|
-
}
|
|
1
|
+
{"version":3,"file":"setup-gesture-handler.d.ts","sourceRoot":"","sources":["../src/setup-gesture-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAIH,MAAM,WAAW,oBAAoB;IACnC,kEAAkE;IAClE,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,uDAAuD;IACvD,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB;AAOD,wBAAgB,uBAAuB,IAAI,oBAAoB,CAE9D;AAED,wBAAgB,mBAAmB,CAAC,MAAM,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAoDvE"}
|
|
@@ -1,3 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Setup keyboard controller for Gui native components.
|
|
3
|
+
*
|
|
4
|
+
* Simply import this module at the top of your app entry point:
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```tsx
|
|
8
|
+
* import '@hanzogui/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
|
+
*/
|
|
1
19
|
export {};
|
|
2
|
-
|
|
3
20
|
//# sourceMappingURL=setup-keyboard-controller.d.ts.map
|