@tamagui/native 2.0.0-rc.3 → 2.0.0-rc.31
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/.turbo/turbo-build.log +2 -0
- package/dist/cjs/burntState.cjs +44 -0
- package/dist/cjs/burntState.native.js +47 -0
- package/dist/cjs/burntState.native.js.map +1 -0
- package/dist/cjs/gestureState.cjs +12 -17
- package/dist/cjs/gestureState.native.js +8 -13
- package/dist/cjs/gestureState.native.js.map +1 -1
- package/dist/cjs/globalState.cjs +39 -0
- package/dist/cjs/globalState.native.js +42 -0
- package/dist/cjs/globalState.native.js.map +1 -0
- package/dist/cjs/index.cjs +4 -0
- package/dist/cjs/index.native.js +4 -0
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/keyboardControllerState.cjs +14 -18
- package/dist/cjs/keyboardControllerState.native.js +6 -10
- package/dist/cjs/keyboardControllerState.native.js.map +1 -1
- package/dist/cjs/linearGradientState.cjs +6 -5
- package/dist/cjs/linearGradientState.native.js +8 -7
- package/dist/cjs/linearGradientState.native.js.map +1 -1
- package/dist/cjs/{state.cjs → nativeMenuContext.cjs} +6 -15
- package/dist/cjs/{state.native.js → nativeMenuContext.native.js} +7 -16
- package/dist/cjs/nativeMenuContext.native.js.map +1 -0
- package/dist/cjs/portalState.cjs +6 -5
- package/dist/cjs/portalState.native.js +8 -7
- package/dist/cjs/portalState.native.js.map +1 -1
- package/dist/cjs/safeAreaState.cjs +11 -14
- package/dist/cjs/safeAreaState.native.js +11 -14
- package/dist/cjs/safeAreaState.native.js.map +1 -1
- package/dist/cjs/setup-burnt.cjs +16 -0
- package/dist/cjs/setup-burnt.native.js +19 -0
- package/dist/cjs/setup-burnt.native.js.map +1 -0
- package/dist/cjs/setup-zeego.cjs +3 -1
- package/dist/cjs/setup-zeego.native.js +3 -1
- package/dist/cjs/setup-zeego.native.js.map +1 -1
- package/dist/cjs/workletsState.cjs +11 -15
- package/dist/cjs/workletsState.native.js +6 -10
- package/dist/cjs/workletsState.native.js.map +1 -1
- package/dist/cjs/zeegoState.cjs +6 -5
- package/dist/cjs/zeegoState.native.js +9 -8
- package/dist/cjs/zeegoState.native.js.map +1 -1
- package/dist/esm/burntState.mjs +21 -0
- package/dist/esm/burntState.mjs.map +1 -0
- package/dist/esm/burntState.native.js +21 -0
- package/dist/esm/burntState.native.js.map +1 -0
- package/dist/esm/gestureState.mjs +12 -17
- package/dist/esm/gestureState.mjs.map +1 -1
- package/dist/esm/gestureState.native.js +12 -17
- package/dist/esm/gestureState.native.js.map +1 -1
- package/dist/esm/globalState.mjs +16 -0
- package/dist/esm/globalState.mjs.map +1 -0
- package/dist/esm/globalState.native.js +16 -0
- package/dist/esm/globalState.native.js.map +1 -0
- package/dist/esm/index.js +11 -26
- package/dist/esm/index.js.map +1 -6
- package/dist/esm/index.mjs +3 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/index.native.js +3 -1
- package/dist/esm/index.native.js.map +1 -1
- package/dist/esm/keyboardControllerState.mjs +14 -18
- package/dist/esm/keyboardControllerState.mjs.map +1 -1
- package/dist/esm/keyboardControllerState.native.js +14 -18
- package/dist/esm/keyboardControllerState.native.js.map +1 -1
- package/dist/esm/linearGradientState.mjs +6 -5
- package/dist/esm/linearGradientState.mjs.map +1 -1
- package/dist/esm/linearGradientState.native.js +6 -5
- package/dist/esm/linearGradientState.native.js.map +1 -1
- package/dist/esm/nativeMenuContext.mjs +4 -0
- package/dist/esm/nativeMenuContext.mjs.map +1 -0
- package/dist/esm/nativeMenuContext.native.js +4 -0
- package/dist/esm/nativeMenuContext.native.js.map +1 -0
- package/dist/esm/portalState.mjs +6 -5
- package/dist/esm/portalState.mjs.map +1 -1
- package/dist/esm/portalState.native.js +6 -5
- package/dist/esm/portalState.native.js.map +1 -1
- package/dist/esm/safeAreaState.mjs +11 -14
- package/dist/esm/safeAreaState.mjs.map +1 -1
- package/dist/esm/safeAreaState.native.js +11 -14
- package/dist/esm/safeAreaState.native.js.map +1 -1
- package/dist/esm/setup-burnt.mjs +17 -0
- package/dist/esm/setup-burnt.mjs.map +1 -0
- package/dist/esm/setup-burnt.native.js +17 -0
- package/dist/esm/setup-burnt.native.js.map +1 -0
- package/dist/esm/setup-zeego.mjs +3 -1
- package/dist/esm/setup-zeego.mjs.map +1 -1
- package/dist/esm/setup-zeego.native.js +3 -1
- package/dist/esm/setup-zeego.native.js.map +1 -1
- package/dist/esm/workletsState.mjs +11 -15
- package/dist/esm/workletsState.mjs.map +1 -1
- package/dist/esm/workletsState.native.js +11 -15
- package/dist/esm/workletsState.native.js.map +1 -1
- package/dist/esm/zeegoState.mjs +6 -5
- package/dist/esm/zeegoState.mjs.map +1 -1
- package/dist/esm/zeegoState.native.js +6 -5
- package/dist/esm/zeegoState.native.js.map +1 -1
- package/package.json +61 -73
- 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-burnt.cjs +1 -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-expo-linear-gradient.cjs +1 -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-gesture-handler.cjs +1 -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-keyboard-controller.cjs +1 -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-safe-area.cjs +1 -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-teleport.cjs +1 -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-worklets.cjs +1 -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/setup-zeego.cjs +1 -0
- package/src/burntState.ts +28 -0
- package/src/gestureState.ts +12 -21
- package/src/globalState.ts +32 -0
- package/src/index.ts +6 -0
- package/src/keyboardControllerState.ts +16 -31
- package/src/linearGradientState.ts +8 -4
- package/src/nativeMenuContext.ts +4 -0
- package/src/portalState.ts +8 -4
- package/src/safeAreaState.ts +16 -23
- package/src/setup-burnt.ts +38 -0
- package/src/setup-zeego.ts +4 -1
- package/src/types.ts +17 -0
- package/src/workletsState.ts +11 -19
- package/src/zeegoState.ts +9 -4
- package/tsconfig.json +12 -0
- package/types/burntState.d.ts +9 -0
- package/types/burntState.d.ts.map +11 -0
- package/types/components.d.ts.map +2 -2
- package/types/gestureState.d.ts.map +4 -4
- package/types/globalState.d.ts +8 -0
- package/types/globalState.d.ts.map +11 -0
- package/types/index.d.ts +4 -1
- package/types/index.d.ts.map +4 -4
- package/types/keyboardControllerState.d.ts +2 -10
- package/types/keyboardControllerState.d.ts.map +4 -4
- package/types/linearGradientState.d.ts.map +4 -4
- package/types/nativeMenuContext.d.ts +4 -0
- package/types/nativeMenuContext.d.ts.map +11 -0
- package/types/portalState.d.ts.map +4 -4
- package/types/safeAreaState.d.ts.map +4 -4
- package/types/setup-burnt.d.ts +3 -0
- package/types/setup-burnt.d.ts.map +11 -0
- package/types/setup-expo-linear-gradient.d.ts.map +2 -2
- package/types/setup-gesture-handler.d.ts.map +2 -2
- package/types/setup-keyboard-controller.d.ts.map +2 -2
- package/types/setup-keyboard-controller.web.d.ts.map +2 -2
- package/types/setup-safe-area.d.ts.map +2 -2
- package/types/setup-teleport.d.ts.map +2 -2
- package/types/setup-worklets.d.ts.map +2 -2
- package/types/setup-zeego.d.ts.map +3 -3
- package/types/types.d.ts +15 -0
- package/types/types.d.ts.map +4 -4
- package/types/workletsState.d.ts.map +4 -4
- package/types/zeegoState.d.ts.map +4 -4
- package/dist/cjs/components.js +0 -41
- package/dist/cjs/components.js.map +0 -6
- package/dist/cjs/gestureState.js +0 -62
- package/dist/cjs/gestureState.js.map +0 -6
- package/dist/cjs/index.js +0 -32
- package/dist/cjs/index.js.map +0 -6
- package/dist/cjs/keyboardControllerState.js +0 -46
- package/dist/cjs/keyboardControllerState.js.map +0 -6
- package/dist/cjs/linearGradientState.js +0 -34
- package/dist/cjs/linearGradientState.js.map +0 -6
- package/dist/cjs/portalState.js +0 -34
- package/dist/cjs/portalState.js.map +0 -6
- package/dist/cjs/safeAreaState.js +0 -52
- package/dist/cjs/safeAreaState.js.map +0 -6
- package/dist/cjs/setup-expo-linear-gradient.js +0 -17
- package/dist/cjs/setup-expo-linear-gradient.js.map +0 -6
- package/dist/cjs/setup-gesture-handler.js +0 -24
- package/dist/cjs/setup-gesture-handler.js.map +0 -6
- package/dist/cjs/setup-keyboard-controller.js +0 -1
- package/dist/cjs/setup-keyboard-controller.js.map +0 -6
- package/dist/cjs/setup-portal.cjs +0 -66
- package/dist/cjs/setup-portal.js +0 -53
- package/dist/cjs/setup-portal.js.map +0 -6
- package/dist/cjs/setup-portal.native.js +0 -74
- package/dist/cjs/setup-portal.native.js.map +0 -1
- package/dist/cjs/setup-safe-area.js +0 -2
- package/dist/cjs/setup-safe-area.js.map +0 -6
- package/dist/cjs/setup-teleport.js +0 -17
- package/dist/cjs/setup-teleport.js.map +0 -6
- package/dist/cjs/setup-worklets.js +0 -20
- package/dist/cjs/setup-worklets.js.map +0 -6
- package/dist/cjs/setup-zeego.js +0 -18
- package/dist/cjs/setup-zeego.js.map +0 -6
- package/dist/cjs/setup.cjs +0 -64
- package/dist/cjs/setup.js +0 -50
- package/dist/cjs/setup.js.map +0 -6
- package/dist/cjs/setup.native.js +0 -72
- package/dist/cjs/setup.native.js.map +0 -1
- package/dist/cjs/state.js +0 -28
- package/dist/cjs/state.js.map +0 -6
- package/dist/cjs/state.native.js.map +0 -1
- package/dist/cjs/types.js +0 -14
- package/dist/cjs/types.js.map +0 -6
- package/dist/cjs/workletsState.js +0 -45
- package/dist/cjs/workletsState.js.map +0 -6
- package/dist/cjs/zeegoState.js +0 -34
- package/dist/cjs/zeegoState.js.map +0 -6
- package/dist/esm/components.js +0 -26
- package/dist/esm/components.js.map +0 -6
- package/dist/esm/gestureState.js +0 -46
- package/dist/esm/gestureState.js.map +0 -6
- package/dist/esm/keyboardControllerState.js +0 -30
- package/dist/esm/keyboardControllerState.js.map +0 -6
- package/dist/esm/linearGradientState.js +0 -18
- package/dist/esm/linearGradientState.js.map +0 -6
- package/dist/esm/portalState.js +0 -18
- package/dist/esm/portalState.js.map +0 -6
- package/dist/esm/safeAreaState.js +0 -36
- package/dist/esm/safeAreaState.js.map +0 -6
- package/dist/esm/setup-expo-linear-gradient.js +0 -17
- package/dist/esm/setup-expo-linear-gradient.js.map +0 -6
- package/dist/esm/setup-gesture-handler.js +0 -24
- package/dist/esm/setup-gesture-handler.js.map +0 -6
- package/dist/esm/setup-keyboard-controller.js +0 -1
- package/dist/esm/setup-keyboard-controller.js.map +0 -6
- package/dist/esm/setup-portal.js +0 -37
- package/dist/esm/setup-portal.js.map +0 -6
- package/dist/esm/setup-portal.mjs +0 -43
- package/dist/esm/setup-portal.mjs.map +0 -1
- package/dist/esm/setup-portal.native.js +0 -48
- package/dist/esm/setup-portal.native.js.map +0 -1
- package/dist/esm/setup-safe-area.js +0 -2
- package/dist/esm/setup-safe-area.js.map +0 -6
- package/dist/esm/setup-teleport.js +0 -17
- package/dist/esm/setup-teleport.js.map +0 -6
- package/dist/esm/setup-worklets.js +0 -20
- package/dist/esm/setup-worklets.js.map +0 -6
- package/dist/esm/setup-zeego.js +0 -18
- package/dist/esm/setup-zeego.js.map +0 -6
- package/dist/esm/setup.js +0 -34
- package/dist/esm/setup.js.map +0 -6
- package/dist/esm/setup.mjs +0 -41
- package/dist/esm/setup.mjs.map +0 -1
- package/dist/esm/setup.native.js +0 -46
- package/dist/esm/setup.native.js.map +0 -1
- package/dist/esm/state.js +0 -12
- package/dist/esm/state.js.map +0 -6
- package/dist/esm/state.mjs +0 -12
- package/dist/esm/state.mjs.map +0 -1
- package/dist/esm/state.native.js +0 -12
- package/dist/esm/state.native.js.map +0 -1
- package/dist/esm/types.js +0 -1
- package/dist/esm/types.js.map +0 -6
- package/dist/esm/workletsState.js +0 -29
- package/dist/esm/workletsState.js.map +0 -6
- package/dist/esm/zeegoState.js +0 -18
- package/dist/esm/zeegoState.js.map +0 -6
- package/types/setup-portal.d.ts.map +0 -11
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
import { createGlobalState } from './globalState'
|
|
1
2
|
import type { LinearGradientState } from './types'
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
const state = createGlobalState<LinearGradientState>(`linear_gradient`, {
|
|
5
|
+
enabled: false,
|
|
6
|
+
Component: null,
|
|
7
|
+
})
|
|
4
8
|
|
|
5
9
|
export interface LinearGradientAccessor {
|
|
6
10
|
readonly isEnabled: boolean
|
|
@@ -11,13 +15,13 @@ export interface LinearGradientAccessor {
|
|
|
11
15
|
export function getLinearGradient(): LinearGradientAccessor {
|
|
12
16
|
return {
|
|
13
17
|
get isEnabled(): boolean {
|
|
14
|
-
return state.enabled
|
|
18
|
+
return state.get().enabled
|
|
15
19
|
},
|
|
16
20
|
get state(): LinearGradientState {
|
|
17
|
-
return state
|
|
21
|
+
return state.get()
|
|
18
22
|
},
|
|
19
23
|
set(newState: LinearGradientState): void {
|
|
20
|
-
state
|
|
24
|
+
state.set(newState)
|
|
21
25
|
},
|
|
22
26
|
}
|
|
23
27
|
}
|
package/src/portalState.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
import { createGlobalState } from './globalState'
|
|
1
2
|
import type { NativePortalState } from './types'
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
const state = createGlobalState<NativePortalState>(`portal`, {
|
|
5
|
+
enabled: false,
|
|
6
|
+
type: null,
|
|
7
|
+
})
|
|
4
8
|
|
|
5
9
|
export interface PortalAccessor {
|
|
6
10
|
readonly isEnabled: boolean
|
|
@@ -11,13 +15,13 @@ export interface PortalAccessor {
|
|
|
11
15
|
export function getPortal(): PortalAccessor {
|
|
12
16
|
return {
|
|
13
17
|
get isEnabled(): boolean {
|
|
14
|
-
return state.enabled
|
|
18
|
+
return state.get().enabled
|
|
15
19
|
},
|
|
16
20
|
get state(): NativePortalState {
|
|
17
|
-
return state
|
|
21
|
+
return state.get()
|
|
18
22
|
},
|
|
19
23
|
set(newState: NativePortalState): void {
|
|
20
|
-
state
|
|
24
|
+
state.set(newState)
|
|
21
25
|
},
|
|
22
26
|
}
|
|
23
27
|
}
|
package/src/safeAreaState.ts
CHANGED
|
@@ -1,19 +1,12 @@
|
|
|
1
|
+
import { createGlobalState } from './globalState'
|
|
1
2
|
import type { SafeAreaState, SafeAreaInsets, SafeAreaFrame } from './types'
|
|
2
3
|
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
enabled: false,
|
|
10
|
-
useSafeAreaInsets: null,
|
|
11
|
-
useSafeAreaFrame: null,
|
|
12
|
-
initialMetrics: null,
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
return g[GLOBAL_KEY]
|
|
16
|
-
}
|
|
4
|
+
const state = createGlobalState<SafeAreaState>(`safe_area`, {
|
|
5
|
+
enabled: false,
|
|
6
|
+
useSafeAreaInsets: null,
|
|
7
|
+
useSafeAreaFrame: null,
|
|
8
|
+
initialMetrics: null,
|
|
9
|
+
})
|
|
17
10
|
|
|
18
11
|
const defaultInsets: SafeAreaInsets = { top: 0, right: 0, bottom: 0, left: 0 }
|
|
19
12
|
const defaultFrame: SafeAreaFrame = { x: 0, y: 0, width: 0, height: 0 }
|
|
@@ -31,27 +24,27 @@ export interface SafeAreaAccessor {
|
|
|
31
24
|
export function getSafeArea(): SafeAreaAccessor {
|
|
32
25
|
return {
|
|
33
26
|
get isEnabled() {
|
|
34
|
-
return
|
|
27
|
+
return state.get().enabled
|
|
35
28
|
},
|
|
36
29
|
get state() {
|
|
37
|
-
return
|
|
30
|
+
return state.get()
|
|
38
31
|
},
|
|
39
32
|
set(updates: Partial<SafeAreaState>) {
|
|
40
|
-
Object.assign(
|
|
33
|
+
Object.assign(state.get(), updates)
|
|
41
34
|
},
|
|
42
35
|
getInsets() {
|
|
43
|
-
const
|
|
44
|
-
if (!
|
|
36
|
+
const s = state.get()
|
|
37
|
+
if (!s.enabled || !s.initialMetrics) {
|
|
45
38
|
return defaultInsets
|
|
46
39
|
}
|
|
47
|
-
return
|
|
40
|
+
return s.initialMetrics.insets
|
|
48
41
|
},
|
|
49
42
|
getFrame() {
|
|
50
|
-
const
|
|
51
|
-
if (!
|
|
43
|
+
const s = state.get()
|
|
44
|
+
if (!s.enabled || !s.initialMetrics) {
|
|
52
45
|
return defaultFrame
|
|
53
46
|
}
|
|
54
|
-
return
|
|
47
|
+
return s.initialMetrics.frame
|
|
55
48
|
},
|
|
56
49
|
}
|
|
57
50
|
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Setup burnt for Tamagui native toasts.
|
|
3
|
+
*
|
|
4
|
+
* Simply import this module at the top of your app entry point:
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```tsx
|
|
8
|
+
* import '@tamagui/native/setup-burnt'
|
|
9
|
+
* ```
|
|
10
|
+
*
|
|
11
|
+
* This automatically detects and configures burnt for use with
|
|
12
|
+
* native Toast functionality.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { getBurnt } from './burntState'
|
|
16
|
+
|
|
17
|
+
function setup(): void {
|
|
18
|
+
const g = globalThis as any
|
|
19
|
+
if (g.__tamagui_native_burnt_setup) return
|
|
20
|
+
g.__tamagui_native_burnt_setup = true
|
|
21
|
+
|
|
22
|
+
try {
|
|
23
|
+
const Burnt = require('burnt') as typeof import('burnt')
|
|
24
|
+
|
|
25
|
+
if (Burnt) {
|
|
26
|
+
getBurnt().set({
|
|
27
|
+
enabled: true,
|
|
28
|
+
toast: Burnt.toast,
|
|
29
|
+
dismissAllAlerts: Burnt.dismissAllAlerts,
|
|
30
|
+
})
|
|
31
|
+
}
|
|
32
|
+
} catch {
|
|
33
|
+
// burnt not installed
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// run setup immediately on import
|
|
38
|
+
setup()
|
package/src/setup-zeego.ts
CHANGED
package/src/types.ts
CHANGED
|
@@ -69,3 +69,20 @@ export interface ZeegoState {
|
|
|
69
69
|
DropdownMenu: any
|
|
70
70
|
ContextMenu: any
|
|
71
71
|
}
|
|
72
|
+
|
|
73
|
+
export interface BurntState {
|
|
74
|
+
enabled: boolean
|
|
75
|
+
toast: ((options: any) => void) | null
|
|
76
|
+
dismissAllAlerts: (() => void) | null
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export interface KeyboardControllerState {
|
|
80
|
+
enabled: boolean
|
|
81
|
+
KeyboardProvider: any
|
|
82
|
+
KeyboardAwareScrollView: any
|
|
83
|
+
useKeyboardHandler: any
|
|
84
|
+
useReanimatedKeyboardAnimation: any
|
|
85
|
+
KeyboardController: any
|
|
86
|
+
KeyboardEvents: any
|
|
87
|
+
KeyboardStickyView: any
|
|
88
|
+
}
|
package/src/workletsState.ts
CHANGED
|
@@ -1,20 +1,13 @@
|
|
|
1
|
+
import { createGlobalState } from './globalState'
|
|
1
2
|
import type { WorkletsState } from './types'
|
|
2
3
|
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
Worklets: null,
|
|
11
|
-
useRunOnJS: null,
|
|
12
|
-
useWorklet: null,
|
|
13
|
-
createWorkletContextValue: null,
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
return g[GLOBAL_KEY]
|
|
17
|
-
}
|
|
4
|
+
const state = createGlobalState<WorkletsState>(`worklets`, {
|
|
5
|
+
enabled: false,
|
|
6
|
+
Worklets: null,
|
|
7
|
+
useRunOnJS: null,
|
|
8
|
+
useWorklet: null,
|
|
9
|
+
createWorkletContextValue: null,
|
|
10
|
+
})
|
|
18
11
|
|
|
19
12
|
export interface WorkletsAccessor {
|
|
20
13
|
readonly isEnabled: boolean
|
|
@@ -25,14 +18,13 @@ export interface WorkletsAccessor {
|
|
|
25
18
|
export function getWorklets(): WorkletsAccessor {
|
|
26
19
|
return {
|
|
27
20
|
get isEnabled(): boolean {
|
|
28
|
-
return
|
|
21
|
+
return state.get().enabled
|
|
29
22
|
},
|
|
30
23
|
get state(): WorkletsState {
|
|
31
|
-
return
|
|
24
|
+
return state.get()
|
|
32
25
|
},
|
|
33
26
|
set(updates: Partial<WorkletsState>): void {
|
|
34
|
-
|
|
35
|
-
Object.assign(state, updates)
|
|
27
|
+
Object.assign(state.get(), updates)
|
|
36
28
|
},
|
|
37
29
|
}
|
|
38
30
|
}
|
package/src/zeegoState.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
|
+
import { createGlobalState } from './globalState'
|
|
1
2
|
import type { ZeegoState } from './types'
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
const state = createGlobalState<ZeegoState>(`zeego`, {
|
|
5
|
+
enabled: false,
|
|
6
|
+
DropdownMenu: null,
|
|
7
|
+
ContextMenu: null,
|
|
8
|
+
})
|
|
4
9
|
|
|
5
10
|
export interface ZeegoAccessor {
|
|
6
11
|
readonly isEnabled: boolean
|
|
@@ -11,13 +16,13 @@ export interface ZeegoAccessor {
|
|
|
11
16
|
export function getZeego(): ZeegoAccessor {
|
|
12
17
|
return {
|
|
13
18
|
get isEnabled(): boolean {
|
|
14
|
-
return state.enabled
|
|
19
|
+
return state.get().enabled
|
|
15
20
|
},
|
|
16
21
|
get state(): ZeegoState {
|
|
17
|
-
return state
|
|
22
|
+
return state.get()
|
|
18
23
|
},
|
|
19
24
|
set(newState: ZeegoState): void {
|
|
20
|
-
state
|
|
25
|
+
state.set(newState)
|
|
21
26
|
},
|
|
22
27
|
}
|
|
23
28
|
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { BurntState } from "./types";
|
|
2
|
+
export interface BurntAccessor {
|
|
3
|
+
readonly isEnabled: boolean;
|
|
4
|
+
readonly state: BurntState;
|
|
5
|
+
set(newState: BurntState): void;
|
|
6
|
+
}
|
|
7
|
+
export declare function getBurnt(): BurntAccessor;
|
|
8
|
+
|
|
9
|
+
//# sourceMappingURL=burntState.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"mappings": "AACA,cAAc,kBAAkB;AAQhC,iBAAiB,cAAc;UACpB;UACA,OAAO;CAChB,IAAI,UAAU;;AAGhB,OAAO,iBAAS,YAAY",
|
|
3
|
+
"names": [],
|
|
4
|
+
"sources": [
|
|
5
|
+
"src/burntState.ts"
|
|
6
|
+
],
|
|
7
|
+
"version": 3,
|
|
8
|
+
"sourcesContent": [
|
|
9
|
+
"import { createGlobalState } from './globalState'\nimport type { BurntState } from './types'\n\nconst state = createGlobalState<BurntState>(`burnt`, {\n enabled: false,\n toast: null,\n dismissAllAlerts: null,\n})\n\nexport interface BurntAccessor {\n readonly isEnabled: boolean\n readonly state: BurntState\n set(newState: BurntState): void\n}\n\nexport function getBurnt(): BurntAccessor {\n return {\n get isEnabled(): boolean {\n return state.get().enabled\n },\n get state(): BurntState {\n return state.get()\n },\n set(newState: BurntState): void {\n state.set(newState)\n },\n }\n}\n"
|
|
10
|
+
]
|
|
11
|
+
}
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
"sources": [
|
|
5
5
|
"src/components.tsx"
|
|
6
6
|
],
|
|
7
|
+
"version": 3,
|
|
7
8
|
"sourcesContent": [
|
|
8
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).__tamagui_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).__tamagui_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).__tamagui_teleport\n return <PortalProvider>{children}</PortalProvider>\n}\n"
|
|
9
|
-
]
|
|
10
|
-
"version": 3
|
|
10
|
+
]
|
|
11
11
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
|
-
"mappings": "
|
|
2
|
+
"mappings": "AACA,cAAc,oBAAoB;AASlC,iBAAiB,OAAO;CACtB;CACA;CACA;CACA;;AAGF,YAAY,qBAAqB;CAC/B,aAAa;CACb,cAAc;CACd,WAAW;CACX,eAAe;CACf;CACA,mBAAmB;;AAGrB,iBAAiB,uBAAuB;UAC7B;UACA,OAAO;CAChB,IAAI,SAAS,QAAQ;CACrB;CACA,mBAAmB,QAAQ;;AAG7B,OAAO,iBAAS,qBAAqB",
|
|
3
3
|
"names": [],
|
|
4
4
|
"sources": [
|
|
5
5
|
"src/gestureState.ts"
|
|
6
6
|
],
|
|
7
|
+
"version": 3,
|
|
7
8
|
"sourcesContent": [
|
|
8
|
-
"import type { GestureState } from './types'\n\nconst
|
|
9
|
-
]
|
|
10
|
-
"version": 3
|
|
9
|
+
"import { createGlobalState } from './globalState'\nimport type { GestureState } from './types'\n\nconst state = createGlobalState<GestureState>(`gesture`, {\n enabled: false,\n Gesture: null,\n GestureDetector: null,\n ScrollView: null,\n})\n\nexport interface Insets {\n top?: number\n left?: number\n bottom?: number\n right?: number\n}\n\nexport type PressGestureConfig = {\n onPressIn?: (e: any) => void\n onPressOut?: (e: any) => void\n onPress?: (e: any) => void\n onLongPress?: (e: any) => void\n delayLongPress?: number\n hitSlop?: number | Insets | null\n}\n\nexport interface GestureHandlerAccessor {\n readonly isEnabled: boolean\n readonly state: GestureState\n set(updates: Partial<GestureState>): void\n disable(): void\n createPressGesture(config: PressGestureConfig): any\n}\n\nexport function getGestureHandler(): GestureHandlerAccessor {\n return {\n get isEnabled(): boolean {\n return state.get().enabled\n },\n get state(): GestureState {\n return state.get()\n },\n set(updates: Partial<GestureState>): void {\n Object.assign(state.get(), updates)\n },\n\n disable(): void {\n state.get().enabled = false\n },\n\n createPressGesture(config: PressGestureConfig): any {\n const { Gesture } = state.get()\n if (!Gesture) return null\n\n const longPressDuration = config.delayLongPress ?? 500\n\n // Tap gesture for regular presses\n // Use long maxDuration to not cancel during long presses\n const tap = Gesture.Tap()\n .runOnJS(true)\n .maxDuration(10000) // allow very long presses\n .onBegin((e: any) => {\n config.onPressIn?.(e)\n })\n .onEnd((e: any) => {\n config.onPress?.(e)\n })\n .onFinalize((e: any) => {\n config.onPressOut?.(e)\n })\n\n if (config.hitSlop) tap.hitSlop(config.hitSlop)\n\n // if no long press handler, just use tap\n if (!config.onLongPress) return tap\n\n // LongPress gesture for long press handling\n const longPress = Gesture.LongPress()\n .runOnJS(true)\n .minDuration(longPressDuration)\n .onBegin((e: any) => config.onPressIn?.(e))\n .onStart((e: any) => config.onLongPress?.(e))\n .onFinalize((e: any) => config.onPressOut?.(e))\n\n if (config.hitSlop) longPress.hitSlop(config.hitSlop)\n\n // exclusive: longPress has priority, tap is fallback for quick presses\n return Gesture.Exclusive(longPress, tap)\n },\n }\n}\n"
|
|
10
|
+
]
|
|
11
11
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
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 = `__tamagui_${key}__`\n\n type TamaguiGlobal = typeof globalThis & {\n [GLOBAL_KEY]?: T\n }\n\n function getGlobalState(): T {\n const g = globalThis as TamaguiGlobal\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 TamaguiGlobal)[GLOBAL_KEY] = newState\n }\n\n return {\n get: getGlobalState,\n set: setGlobalState,\n }\n}\n"
|
|
10
|
+
]
|
|
11
|
+
}
|
package/types/index.d.ts
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* // LinearGradient will use expo-linear-gradient when installed
|
|
19
19
|
* ```
|
|
20
20
|
*/
|
|
21
|
-
export type { NativePortalState, GestureState, WorkletsState, SafeAreaState, SafeAreaInsets, SafeAreaFrame, SafeAreaMetrics, LinearGradientState, ZeegoState, NativePortalProps, NativePortalHostProps, NativePortalProviderProps } from "./types";
|
|
21
|
+
export type { NativePortalState, GestureState, WorkletsState, SafeAreaState, SafeAreaInsets, SafeAreaFrame, SafeAreaMetrics, LinearGradientState, ZeegoState, BurntState, NativePortalProps, NativePortalHostProps, NativePortalProviderProps } from "./types";
|
|
22
22
|
export { getPortal } from "./portalState";
|
|
23
23
|
export type { PortalAccessor } from "./portalState";
|
|
24
24
|
export { getGestureHandler } from "./gestureState";
|
|
@@ -33,6 +33,9 @@ export { isKeyboardControllerEnabled, getKeyboardControllerState, setKeyboardCon
|
|
|
33
33
|
export type { KeyboardControllerState } from "./keyboardControllerState";
|
|
34
34
|
export { getZeego } from "./zeegoState";
|
|
35
35
|
export type { ZeegoAccessor } from "./zeegoState";
|
|
36
|
+
export { NativeMenuContext } from "./nativeMenuContext";
|
|
37
|
+
export { getBurnt } from "./burntState";
|
|
38
|
+
export type { BurntAccessor } from "./burntState";
|
|
36
39
|
export { NativePortal, NativePortalHost, NativePortalProvider } from "./components";
|
|
37
40
|
|
|
38
41
|
//# sourceMappingURL=index.d.ts.map
|
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,mBACA,uBACA,iCACK;AAGP,SAAS,iBAAiB;AAC1B,cAAc,sBAAsB;AAGpC,SAAS,yBAAyB;AAClC,cAAc,wBAAwB,0BAA0B;AAGhE,SAAS,mBAAmB;AAC5B,cAAc,wBAAwB;AAGtC,SAAS,mBAAmB;AAC5B,cAAc,wBAAwB;AAGtC,SAAS,yBAAyB;AAClC,cAAc,8BAA8B;AAG5C,SACE,6BACA,4BACA,kCACK;AACP,cAAc,+BAA+B;AAG7C,SAAS,gBAAgB;AACzB,cAAc,qBAAqB;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,cAAc,wBAAwB,0BAA0B;AAGhE,SAAS,mBAAmB;AAC5B,cAAc,wBAAwB;AAGtC,SAAS,mBAAmB;AAC5B,cAAc,wBAAwB;AAGtC,SAAS,yBAAyB;AAClC,cAAc,8BAA8B;AAG5C,SACE,6BACA,4BACA,kCACK;AACP,cAAc,+BAA+B;AAG7C,SAAS,gBAAgB;AACzB,cAAc,qBAAqB;AACnC,SAAS,yBAAyB;AAGlC,SAAS,gBAAgB;AACzB,cAAc,qBAAqB;AAGnC,SAAS,cAAc,kBAAkB,4BAA4B",
|
|
3
3
|
"names": [],
|
|
4
4
|
"sources": [
|
|
5
5
|
"src/index.ts"
|
|
6
6
|
],
|
|
7
|
+
"version": 3,
|
|
7
8
|
"sourcesContent": [
|
|
8
|
-
"/**\n * @tamagui/native\n *\n * Native setup modules for Tamagui. Import these at the top of your app entry point.\n *\n * @example\n * ```tsx\n * // In your app entry (index.js or App.tsx)\n * import '@tamagui/native/setup-teleport'\n * import '@tamagui/native/setup-gesture-handler'\n * import '@tamagui/native/setup-worklets'\n * import '@tamagui/native/setup-safe-area'\n * import '@tamagui/native/expo-linear-gradient'\n * import '@tamagui/native/setup-keyboard-controller'\n *\n * // Then use Tamagui components normally\n * // Sheet will automatically use native gestures when available\n * // LinearGradient will use expo-linear-gradient when installed\n * ```\n */\n\n// types\nexport type {\n NativePortalState,\n GestureState,\n WorkletsState,\n SafeAreaState,\n SafeAreaInsets,\n SafeAreaFrame,\n SafeAreaMetrics,\n LinearGradientState,\n ZeegoState,\n NativePortalProps,\n NativePortalHostProps,\n NativePortalProviderProps,\n} from './types'\n\n// portal\nexport { getPortal } from './portalState'\nexport type { PortalAccessor } from './portalState'\n\n// gesture handler\nexport { getGestureHandler } from './gestureState'\nexport type { GestureHandlerAccessor, PressGestureConfig } from './gestureState'\n\n// worklets\nexport { getWorklets } from './workletsState'\nexport type { WorkletsAccessor } from './workletsState'\n\n// safe area\nexport { getSafeArea } from './safeAreaState'\nexport type { SafeAreaAccessor } from './safeAreaState'\n\n// linear gradient\nexport { getLinearGradient } from './linearGradientState'\nexport type { LinearGradientAccessor } from './linearGradientState'\n\n// keyboard controller state exports (safe - no side effects)\nexport {\n isKeyboardControllerEnabled,\n getKeyboardControllerState,\n setKeyboardControllerState,\n} from './keyboardControllerState'\nexport type { KeyboardControllerState } from './keyboardControllerState'\n\n// zeego (native menus)\nexport { getZeego } from './zeegoState'\nexport type { ZeegoAccessor } from './zeegoState'\n\n// components\nexport { NativePortal, NativePortalHost, NativePortalProvider } from './components'\n"
|
|
9
|
-
]
|
|
10
|
-
"version": 3
|
|
9
|
+
"/**\n * @tamagui/native\n *\n * Native setup modules for Tamagui. Import these at the top of your app entry point.\n *\n * @example\n * ```tsx\n * // In your app entry (index.js or App.tsx)\n * import '@tamagui/native/setup-teleport'\n * import '@tamagui/native/setup-gesture-handler'\n * import '@tamagui/native/setup-worklets'\n * import '@tamagui/native/setup-safe-area'\n * import '@tamagui/native/expo-linear-gradient'\n * import '@tamagui/native/setup-keyboard-controller'\n *\n * // Then use Tamagui components normally\n * // Sheet will automatically use native gestures when available\n * // LinearGradient will use expo-linear-gradient when installed\n * ```\n */\n\n// types\nexport type {\n NativePortalState,\n GestureState,\n WorkletsState,\n SafeAreaState,\n SafeAreaInsets,\n SafeAreaFrame,\n SafeAreaMetrics,\n LinearGradientState,\n ZeegoState,\n BurntState,\n NativePortalProps,\n NativePortalHostProps,\n NativePortalProviderProps,\n} from './types'\n\n// portal\nexport { getPortal } from './portalState'\nexport type { PortalAccessor } from './portalState'\n\n// gesture handler\nexport { getGestureHandler } from './gestureState'\nexport type { GestureHandlerAccessor, PressGestureConfig } from './gestureState'\n\n// worklets\nexport { getWorklets } from './workletsState'\nexport type { WorkletsAccessor } from './workletsState'\n\n// safe area\nexport { getSafeArea } from './safeAreaState'\nexport type { SafeAreaAccessor } from './safeAreaState'\n\n// linear gradient\nexport { getLinearGradient } from './linearGradientState'\nexport type { LinearGradientAccessor } from './linearGradientState'\n\n// keyboard controller state exports (safe - no side effects)\nexport {\n isKeyboardControllerEnabled,\n getKeyboardControllerState,\n setKeyboardControllerState,\n} from './keyboardControllerState'\nexport type { KeyboardControllerState } from './keyboardControllerState'\n\n// zeego (native menus)\nexport { getZeego } from './zeegoState'\nexport type { ZeegoAccessor } from './zeegoState'\nexport { NativeMenuContext } from './nativeMenuContext'\n\n// burnt (native toasts)\nexport { getBurnt } from './burntState'\nexport type { BurntAccessor } from './burntState'\n\n// components\nexport { NativePortal, NativePortalHost, NativePortalProvider } from './components'\n"
|
|
10
|
+
]
|
|
11
11
|
}
|
|
@@ -1,13 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
KeyboardProvider: any;
|
|
4
|
-
KeyboardAwareScrollView: any;
|
|
5
|
-
useKeyboardHandler: any;
|
|
6
|
-
useReanimatedKeyboardAnimation: any;
|
|
7
|
-
KeyboardController: any;
|
|
8
|
-
KeyboardEvents: any;
|
|
9
|
-
KeyboardStickyView: any;
|
|
10
|
-
}
|
|
1
|
+
import type { KeyboardControllerState } from "./types";
|
|
2
|
+
export type { KeyboardControllerState };
|
|
11
3
|
export declare function isKeyboardControllerEnabled(): boolean;
|
|
12
4
|
export declare function getKeyboardControllerState(): KeyboardControllerState;
|
|
13
5
|
export declare function setKeyboardControllerState(updates: Partial<KeyboardControllerState>): void;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
|
-
"mappings": "
|
|
2
|
+
"mappings": "AACA,cAAc,+BAA+B;AAE7C,cAAc;AAad,OAAO,iBAAS;AAIhB,OAAO,iBAAS,8BAA8B;AAI9C,OAAO,iBAAS,2BACd,SAAS,QAAQ",
|
|
3
3
|
"names": [],
|
|
4
4
|
"sources": [
|
|
5
5
|
"src/keyboardControllerState.ts"
|
|
6
6
|
],
|
|
7
|
+
"version": 3,
|
|
7
8
|
"sourcesContent": [
|
|
8
|
-
"
|
|
9
|
-
]
|
|
10
|
-
"version": 3
|
|
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
11
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
|
-
"mappings": "
|
|
2
|
+
"mappings": "AACA,cAAc,2BAA2B;AAOzC,iBAAiB,uBAAuB;UAC7B;UACA,OAAO;CAChB,IAAI,UAAU;;AAGhB,OAAO,iBAAS,qBAAqB",
|
|
3
3
|
"names": [],
|
|
4
4
|
"sources": [
|
|
5
5
|
"src/linearGradientState.ts"
|
|
6
6
|
],
|
|
7
|
+
"version": 3,
|
|
7
8
|
"sourcesContent": [
|
|
8
|
-
"import type { LinearGradientState } from './types'\n\
|
|
9
|
-
]
|
|
10
|
-
"version": 3
|
|
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
11
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"mappings": "AAAA,YAAY,WAAW;AAGvB,OAAO,cAAM,mBAAmB,MAAM",
|
|
3
|
+
"names": [],
|
|
4
|
+
"sources": [
|
|
5
|
+
"src/nativeMenuContext.ts"
|
|
6
|
+
],
|
|
7
|
+
"version": 3,
|
|
8
|
+
"sourcesContent": [
|
|
9
|
+
"import type React from 'react'\nimport { createContext } from 'react'\n\nexport const NativeMenuContext: React.Context<boolean> = createContext(false)\n"
|
|
10
|
+
]
|
|
11
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
|
-
"mappings": "
|
|
2
|
+
"mappings": "AACA,cAAc,yBAAyB;AAOvC,iBAAiB,eAAe;UACrB;UACA,OAAO;CAChB,IAAI,UAAU;;AAGhB,OAAO,iBAAS,aAAa",
|
|
3
3
|
"names": [],
|
|
4
4
|
"sources": [
|
|
5
5
|
"src/portalState.ts"
|
|
6
6
|
],
|
|
7
|
+
"version": 3,
|
|
7
8
|
"sourcesContent": [
|
|
8
|
-
"import type { NativePortalState } from './types'\n\
|
|
9
|
-
]
|
|
10
|
-
"version": 3
|
|
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
11
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
|
-
"mappings": "
|
|
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
3
|
"names": [],
|
|
4
4
|
"sources": [
|
|
5
5
|
"src/safeAreaState.ts"
|
|
6
6
|
],
|
|
7
|
+
"version": 3,
|
|
7
8
|
"sourcesContent": [
|
|
8
|
-
"import type { SafeAreaState, SafeAreaInsets, SafeAreaFrame } from './types'\n\nconst
|
|
9
|
-
]
|
|
10
|
-
"version": 3
|
|
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
11
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"mappings": "",
|
|
3
|
+
"names": [],
|
|
4
|
+
"sources": [
|
|
5
|
+
"src/setup-burnt.ts"
|
|
6
|
+
],
|
|
7
|
+
"version": 3,
|
|
8
|
+
"sourcesContent": [
|
|
9
|
+
"/**\n * Setup burnt for Tamagui native toasts.\n *\n * Simply import this module at the top of your app entry point:\n *\n * @example\n * ```tsx\n * import '@tamagui/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.__tamagui_native_burnt_setup) return\n g.__tamagui_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
|
+
}
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
"sources": [
|
|
5
5
|
"src/setup-expo-linear-gradient.ts"
|
|
6
6
|
],
|
|
7
|
+
"version": 3,
|
|
7
8
|
"sourcesContent": [
|
|
8
9
|
"/**\n * Setup expo-linear-gradient for Tamagui.\n *\n * Simply import this module at the top of your app entry point:\n *\n * @example\n * ```tsx\n * import '@tamagui/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.__tamagui_native_linear_gradient_setup) return\n g.__tamagui_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"
|
|
9
|
-
]
|
|
10
|
-
"version": 3
|
|
10
|
+
]
|
|
11
11
|
}
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
"sources": [
|
|
5
5
|
"src/setup-gesture-handler.ts"
|
|
6
6
|
],
|
|
7
|
+
"version": 3,
|
|
7
8
|
"sourcesContent": [
|
|
8
9
|
"/**\n * Setup gesture handler for Tamagui native components.\n *\n * Simply import this module at the top of your app entry point:\n *\n * @example\n * ```tsx\n * import '@tamagui/native/setup-gesture-handler'\n * ```\n *\n * This automatically detects and configures react-native-gesture-handler\n * for use with Sheet and other gesture-aware components.\n */\n\nimport { getGestureHandler } from './gestureState'\n\nfunction setup() {\n const g = globalThis as any\n if (g.__tamagui_native_gesture_setup_complete) {\n return\n }\n g.__tamagui_native_gesture_setup_complete = true\n\n try {\n // dynamically require RNGH - it should already be imported by the app\n const rngh = require('react-native-gesture-handler')\n const { Gesture, GestureDetector, ScrollView } = rngh\n\n if (Gesture && GestureDetector) {\n getGestureHandler().set({\n enabled: true,\n Gesture,\n GestureDetector,\n ScrollView: ScrollView || null,\n })\n\n // also set on the legacy key for backward compat with @tamagui/sheet\n g.__tamagui_sheet_gesture_state__ = {\n enabled: true,\n Gesture,\n GestureDetector,\n ScrollView: ScrollView || null,\n }\n }\n } catch {\n // RNGH not available, that's fine\n }\n}\n\n// run setup immediately on import\nsetup()\n"
|
|
9
|
-
]
|
|
10
|
-
"version": 3
|
|
10
|
+
]
|
|
11
11
|
}
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
"sources": [
|
|
5
5
|
"src/setup-keyboard-controller.ts"
|
|
6
6
|
],
|
|
7
|
+
"version": 3,
|
|
7
8
|
"sourcesContent": [
|
|
8
9
|
"/**\n * Setup keyboard controller for Tamagui native components.\n *\n * Simply import this module at the top of your app entry point:\n *\n * @example\n * ```tsx\n * import '@tamagui/native/setup-keyboard-controller'\n * ```\n *\n * This automatically detects and configures react-native-keyboard-controller\n * for use with Sheet and other keyboard-aware components.\n *\n * When enabled, Sheet gains:\n * - Frame-by-frame keyboard tracking (60/120 FPS)\n * - Smooth gesture + keyboard handoff\n * - Interactive keyboard dismiss on sheet drag\n */\n\nimport { setKeyboardControllerState } from './keyboardControllerState'\n\nfunction setup() {\n const g = globalThis as any\n if (g.__tamagui_native_keyboard_controller_setup_complete) {\n return\n }\n g.__tamagui_native_keyboard_controller_setup_complete = true\n\n try {\n // dynamically require keyboard-controller - it should already be imported by the app\n const rnkc = require('react-native-keyboard-controller')\n const {\n KeyboardProvider,\n KeyboardAwareScrollView,\n useKeyboardHandler,\n useReanimatedKeyboardAnimation,\n KeyboardController,\n KeyboardEvents,\n KeyboardStickyView,\n } = rnkc\n\n if (useKeyboardHandler && KeyboardProvider) {\n setKeyboardControllerState({\n enabled: true,\n KeyboardProvider: KeyboardProvider || null,\n KeyboardAwareScrollView: KeyboardAwareScrollView || null,\n useKeyboardHandler: useKeyboardHandler || null,\n useReanimatedKeyboardAnimation: useReanimatedKeyboardAnimation || null,\n KeyboardController: KeyboardController || null,\n KeyboardEvents: KeyboardEvents || null,\n KeyboardStickyView: KeyboardStickyView || null,\n })\n }\n } catch {\n // keyboard-controller not available, that's fine\n }\n}\n\n// run setup immediately on import\nsetup()\n"
|
|
9
|
-
]
|
|
10
|
-
"version": 3
|
|
10
|
+
]
|
|
11
11
|
}
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
"sources": [
|
|
5
5
|
"src/setup-keyboard-controller.web.ts"
|
|
6
6
|
],
|
|
7
|
+
"version": 3,
|
|
7
8
|
"sourcesContent": [
|
|
8
9
|
"/**\n * Web stub for keyboard controller setup.\n * No-op on web - keyboard-controller is native-only.\n */\n\n// intentionally empty - web doesn't need keyboard-controller\n"
|
|
9
|
-
]
|
|
10
|
-
"version": 3
|
|
10
|
+
]
|
|
11
11
|
}
|