@hanzogui/sheet 2.0.0 → 2.0.4
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/controller/index.d.ts +1 -1
- package/package.json +20 -20
- package/src/Sheet.tsx +2 -2
- package/src/SheetContext.tsx +1 -1
- package/src/SheetController.tsx +1 -1
- package/src/SheetImplementationCustom.tsx +8 -8
- package/src/SheetScrollView.tsx +5 -5
- package/src/createSheet.tsx +9 -9
- package/src/gestureState.ts +3 -3
- package/src/nativeSheet.tsx +1 -1
- package/src/setupGestureHandler.ts +2 -2
- package/src/types.tsx +4 -4
- package/src/useKeyboardControllerSheet.native.ts +2 -2
- package/src/useSheetOpenState.tsx +1 -1
- package/src/useSheetProviderProps.tsx +4 -4
package/controller/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanzogui/sheet",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"source": "src/index.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -56,27 +56,27 @@
|
|
|
56
56
|
"clean": "hanzo-gui-build clean"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@hanzogui/adapt": "2.0.
|
|
60
|
-
"@hanzogui/animate-presence": "2.0.
|
|
61
|
-
"@hanzogui/animations-react-native": "2.0.
|
|
62
|
-
"@hanzogui/compose-refs": "2.0.
|
|
63
|
-
"@hanzogui/constants": "2.0.
|
|
64
|
-
"@hanzogui/core": "2.0.
|
|
65
|
-
"@hanzogui/create-context": "2.0.
|
|
66
|
-
"@hanzogui/helpers": "2.0.
|
|
67
|
-
"@hanzogui/native": "2.0.
|
|
68
|
-
"@hanzogui/portal": "2.0.
|
|
69
|
-
"@hanzogui/remove-scroll": "2.0.
|
|
70
|
-
"@hanzogui/scroll-view": "2.0.
|
|
71
|
-
"@hanzogui/stacks": "2.0.
|
|
72
|
-
"@hanzogui/use-constant": "2.0.
|
|
73
|
-
"@hanzogui/use-controllable-state": "2.0.
|
|
74
|
-
"@hanzogui/use-did-finish-ssr": "2.0.
|
|
75
|
-
"@hanzogui/use-keyboard-visible": "2.0.
|
|
76
|
-
"@hanzogui/z-index-stack": "2.0.
|
|
59
|
+
"@hanzogui/adapt": "2.0.1",
|
|
60
|
+
"@hanzogui/animate-presence": "2.0.1",
|
|
61
|
+
"@hanzogui/animations-react-native": "2.0.1",
|
|
62
|
+
"@hanzogui/compose-refs": "2.0.1",
|
|
63
|
+
"@hanzogui/constants": "2.0.1",
|
|
64
|
+
"@hanzogui/core": "2.0.1",
|
|
65
|
+
"@hanzogui/create-context": "2.0.1",
|
|
66
|
+
"@hanzogui/helpers": "2.0.1",
|
|
67
|
+
"@hanzogui/native": "2.0.1",
|
|
68
|
+
"@hanzogui/portal": "2.0.1",
|
|
69
|
+
"@hanzogui/remove-scroll": "2.0.1",
|
|
70
|
+
"@hanzogui/scroll-view": "2.0.1",
|
|
71
|
+
"@hanzogui/stacks": "2.0.1",
|
|
72
|
+
"@hanzogui/use-constant": "2.0.1",
|
|
73
|
+
"@hanzogui/use-controllable-state": "2.0.1",
|
|
74
|
+
"@hanzogui/use-did-finish-ssr": "2.0.1",
|
|
75
|
+
"@hanzogui/use-keyboard-visible": "2.0.1",
|
|
76
|
+
"@hanzogui/z-index-stack": "2.0.1"
|
|
77
77
|
},
|
|
78
78
|
"devDependencies": {
|
|
79
|
-
"@hanzogui/build": "2.0.
|
|
79
|
+
"@hanzogui/build": "2.0.1",
|
|
80
80
|
"react": ">=19",
|
|
81
81
|
"react-native": "0.83.2",
|
|
82
82
|
"react-native-gesture-handler": "~2.30.0"
|
package/src/Sheet.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { styled } from '@
|
|
2
|
-
import { XStack, YStack } from '@
|
|
1
|
+
import { styled } from '@hanzo/gui-core'
|
|
2
|
+
import { XStack, YStack } from '@hanzo/gui-stacks'
|
|
3
3
|
|
|
4
4
|
import { SHEET_HANDLE_NAME, SHEET_NAME, SHEET_OVERLAY_NAME } from './constants'
|
|
5
5
|
import { createSheet } from './createSheet'
|
package/src/SheetContext.tsx
CHANGED
package/src/SheetController.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ProvideAdaptContext, useAdaptContext } from '@
|
|
2
|
-
import { AnimatePresence } from '@
|
|
3
|
-
import { useComposedRefs } from '@
|
|
4
|
-
import { isWeb, useIsomorphicLayoutEffect } from '@
|
|
1
|
+
import { ProvideAdaptContext, useAdaptContext } from '@hanzo/gui-adapt'
|
|
2
|
+
import { AnimatePresence } from '@hanzo/gui-animate-presence'
|
|
3
|
+
import { useComposedRefs } from '@hanzo/gui-compose-refs'
|
|
4
|
+
import { isWeb, useIsomorphicLayoutEffect } from '@hanzo/gui-constants'
|
|
5
5
|
import {
|
|
6
6
|
LayoutMeasurementController,
|
|
7
7
|
View as GuiView,
|
|
@@ -9,9 +9,9 @@ import {
|
|
|
9
9
|
useDidFinishSSR,
|
|
10
10
|
useEvent,
|
|
11
11
|
useThemeName,
|
|
12
|
-
} from '@
|
|
13
|
-
import { getSafeArea } from '@
|
|
14
|
-
import { needsPortalRepropagation, Portal } from '@
|
|
12
|
+
} from '@hanzo/gui-core'
|
|
13
|
+
import { getSafeArea } from '@hanzo/gui-native'
|
|
14
|
+
import { needsPortalRepropagation, Portal } from '@hanzo/gui-portal'
|
|
15
15
|
import React, { useState } from 'react'
|
|
16
16
|
import type {
|
|
17
17
|
Animated,
|
|
@@ -37,7 +37,7 @@ const hiddenSize = 10_000.1
|
|
|
37
37
|
let _cachedSafeAreaTop: number | undefined
|
|
38
38
|
function getSafeAreaTopInset(): number {
|
|
39
39
|
if (_cachedSafeAreaTop !== undefined) return _cachedSafeAreaTop
|
|
40
|
-
// use @
|
|
40
|
+
// use @hanzo/gui-native abstraction - returns 0 when not enabled
|
|
41
41
|
_cachedSafeAreaTop = getSafeArea().getInsets().top
|
|
42
42
|
return _cachedSafeAreaTop
|
|
43
43
|
}
|
package/src/SheetScrollView.tsx
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { composeRefs } from '@
|
|
2
|
-
import { isWeb, View, type GetRef } from '@
|
|
3
|
-
import type { ScrollViewProps } from '@
|
|
4
|
-
import { ScrollView } from '@
|
|
5
|
-
import { useControllableState } from '@
|
|
1
|
+
import { composeRefs } from '@hanzo/gui-compose-refs'
|
|
2
|
+
import { isWeb, View, type GetRef } from '@hanzo/gui-core'
|
|
3
|
+
import type { ScrollViewProps } from '@hanzo/gui-scroll-view'
|
|
4
|
+
import { ScrollView } from '@hanzo/gui-scroll-view'
|
|
5
|
+
import { useControllableState } from '@hanzo/gui-use-controllable-state'
|
|
6
6
|
import React, { useEffect, useRef, useState } from 'react'
|
|
7
7
|
import type { ScrollView as RNScrollView } from 'react-native'
|
|
8
8
|
import { useGestureSheetContext } from './GestureSheetContext'
|
package/src/createSheet.tsx
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { useComposedRefs } from '@
|
|
2
|
-
import { useIsomorphicLayoutEffect } from '@
|
|
1
|
+
import { useComposedRefs } from '@hanzo/gui-compose-refs'
|
|
2
|
+
import { useIsomorphicLayoutEffect } from '@hanzo/gui-constants'
|
|
3
3
|
import type {
|
|
4
4
|
GetProps,
|
|
5
5
|
ViewProps,
|
|
6
6
|
GuiComponent,
|
|
7
7
|
GuiComponentExpectingVariants,
|
|
8
8
|
GuiElement,
|
|
9
|
-
} from '@
|
|
10
|
-
import { View } from '@
|
|
11
|
-
import { composeEventHandlers, withStaticProperties } from '@
|
|
12
|
-
import { resolveViewZIndex } from '@
|
|
13
|
-
import { RemoveScroll } from '@
|
|
14
|
-
import { useDidFinishSSR } from '@
|
|
15
|
-
import { StackZIndexContext } from '@
|
|
9
|
+
} from '@hanzo/gui-core'
|
|
10
|
+
import { View } from '@hanzo/gui-core'
|
|
11
|
+
import { composeEventHandlers, withStaticProperties } from '@hanzo/gui-helpers'
|
|
12
|
+
import { resolveViewZIndex } from '@hanzo/gui-portal'
|
|
13
|
+
import { RemoveScroll } from '@hanzo/gui-remove-scroll'
|
|
14
|
+
import { useDidFinishSSR } from '@hanzo/gui-use-did-finish-ssr'
|
|
15
|
+
import { StackZIndexContext } from '@hanzo/gui-z-index-stack'
|
|
16
16
|
import type { ForwardRefExoticComponent, FunctionComponent, RefAttributes } from 'react'
|
|
17
17
|
import { forwardRef, memo, useMemo, useEffect, useRef } from 'react'
|
|
18
18
|
import type { View as RNView } from 'react-native'
|
package/src/gestureState.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Re-export gesture state from @
|
|
2
|
+
* Re-export gesture state from @hanzo/gui-native.
|
|
3
3
|
* Sheet uses this for backward compatibility with existing code.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { getGestureHandler, type GestureState } from '@
|
|
6
|
+
import { getGestureHandler, type GestureState } from '@hanzo/gui-native'
|
|
7
7
|
|
|
8
|
-
export type { GestureState as GestureHandlerState } from '@
|
|
8
|
+
export type { GestureState as GestureHandlerState } from '@hanzo/gui-native'
|
|
9
9
|
|
|
10
10
|
// backward compat helpers
|
|
11
11
|
export function isGestureHandlerEnabled(): boolean {
|
package/src/nativeSheet.tsx
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Legacy setup - prefer `import '@
|
|
2
|
+
* Legacy setup - prefer `import '@hanzo/gui-native/setup-gesture-handler'` instead.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import { getGestureHandler } from '@
|
|
5
|
+
import { getGestureHandler } from '@hanzo/gui-native'
|
|
6
6
|
|
|
7
7
|
export function isGestureHandlerEnabled(): boolean {
|
|
8
8
|
return getGestureHandler().isEnabled
|
package/src/types.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { AnimatedNumberStrategy, TransitionProp } from '@
|
|
2
|
-
import type { ScopedProps } from '@
|
|
3
|
-
import type { PortalProps } from '@
|
|
4
|
-
import type { RemoveScroll } from '@
|
|
1
|
+
import type { AnimatedNumberStrategy, TransitionProp } from '@hanzo/gui-core'
|
|
2
|
+
import type { ScopedProps } from '@hanzo/gui-create-context'
|
|
3
|
+
import type { PortalProps } from '@hanzo/gui-portal'
|
|
4
|
+
import type { RemoveScroll } from '@hanzo/gui-remove-scroll'
|
|
5
5
|
import type { ReactNode } from 'react'
|
|
6
6
|
import type React from 'react'
|
|
7
7
|
|
|
@@ -21,11 +21,11 @@ let isKeyboardControllerEnabled: () => boolean = () => false
|
|
|
21
21
|
let getKeyboardControllerState: () => any = () => ({})
|
|
22
22
|
|
|
23
23
|
try {
|
|
24
|
-
const nativeModule = require('@
|
|
24
|
+
const nativeModule = require('@hanzo/gui-native')
|
|
25
25
|
isKeyboardControllerEnabled = nativeModule.isKeyboardControllerEnabled
|
|
26
26
|
getKeyboardControllerState = nativeModule.getKeyboardControllerState
|
|
27
27
|
} catch {
|
|
28
|
-
// @
|
|
28
|
+
// @hanzo/gui-native not available
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
export function useKeyboardControllerSheet(
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import type { GuiElement } from '@
|
|
3
|
-
import { useConfiguration } from '@
|
|
4
|
-
import { useConstant } from '@
|
|
5
|
-
import { useControllableState } from '@
|
|
2
|
+
import type { GuiElement } from '@hanzo/gui-core'
|
|
3
|
+
import { useConfiguration } from '@hanzo/gui-core'
|
|
4
|
+
import { useConstant } from '@hanzo/gui-use-constant'
|
|
5
|
+
import { useControllableState } from '@hanzo/gui-use-controllable-state'
|
|
6
6
|
|
|
7
7
|
import type { ScrollBridge, SheetProps } from './types'
|
|
8
8
|
import type { SheetOpenState } from './useSheetOpenState'
|