Commit Graph

184 Commits

Author SHA1 Message Date
lodev09
acdd9e4cf4
chore: update example deps 2025-12-28 08:20:08 +08:00
lodev09
97f93f1b81
chore: update expo scripts 2025-12-28 07:13:04 +08:00
lodev09
0734cc3163
fix(android): fix animated sheet dismiss with keyboard shown 2025-12-27 04:08:04 +08:00
lodev09
48d8ceb788
docs: add docs about autofocus input behavior 2025-12-27 02:59:31 +08:00
lodev09
30f9d1b7fb
fix(android): wait for window attachment before initial presentation 2025-12-27 01:00:02 +08:00
lodev09
ed1346b346
fix(ios): add compile-time check for iOS 26.1+ APIs 2025-12-27 00:42:00 +08:00
lodev09
a7ac1d7839
fix(android): add safe value for halfExpandedRatio 2025-12-26 22:55:26 +08:00
lodev09
b156ad77d2
ci: maybe improve build-ios workflow 2025-12-26 01:10:06 +08:00
Jovanni Lo
b09440d548
fix(ios): use native backgroundEffect for blur on iOS 26.1+ (#350)
* fix(ios): use native backgroundEffect for blur on iOS 26.1+

- Extract blur style mapping into BlurUtil
- Refactor setupBackground and setupGrabber into helper methods
- Add sheet getter for cleaner code
- Use native UIBlurEffect on backgroundEffect when only blurTint is set (iOS 26.1+)

* refactor: rename blurTint to backgroundBlur
2025-12-25 17:59:55 +08:00
lodev09
3f78fe5423
fix(ios): ignore TrueSheetView in scroll view pinning traversal 2025-12-23 03:51:06 +08:00
lodev09
2e4494024f
docs: update docs 2025-12-22 00:57:12 +08:00
lodev09
cece31ba27
fix(android): parent stacking after rn-screen dismissed 2025-12-21 23:00:35 +08:00
Jovanni Lo
4b02ca77f6
refactor(android): replace DialogFragment with CoordinatorLayout (#344)
* docs: add planning doc

* refactor(android): migrate from DialogFragment to CoordinatorLayout

This solves the touch lag issue when TrueSheet is presented over interactive
components like Maps. The sheet now stays in the same activity window instead
of a separate dialog window.

Changes:
- Add TrueSheetCoordinatorLayout to host sheet and dim view
- Add TrueSheetBottomSheetView with BottomSheetBehavior
- Refactor TrueSheetViewController to use CoordinatorLayout approach
- Update TrueSheetDimView for in-hierarchy usage with touch handling
- Remove TrueSheetDialogFragment (no longer needed)
- Remove unused dialog styles and animations

* fix(android): animate sheet on present using BottomSheetBehavior

* fix(android): animate sheet on present when not dismissible

* refactor(android): simplify dismiss animation using ViewPropertyAnimator

* docs: update AGENTS.md with new Android architecture

* fix(android): prevent duplicate initial present on re-mount

* fix(android): fix keyboard handling and parent sheet translation

* fix(android): prevent parent sheet layout reset when keyboard shows

- Add TrueSheetBottomSheetViewDelegate with isTopmostSheet property
- Skip onLayout for parent sheets to prevent BottomSheetBehavior from
  resetting translationY during system layout passes
- Refactor TrueSheetCoordinatorLayout.Delegate to standalone interface

* fix(android): preserve parent sheet translation during keyboard transitions

Override setTranslationY in TrueSheetBottomSheetView to prevent
keyboard inset animations from resetting parent sheet translation to 0.
Parent sheets (non-topmost) now maintain their translation value.

* refactor(android): rename TrueSheetDialogObserver to TrueSheetStackManager

* refactor(android): remove edgeToEdgeFullScreen prop

* fix(android): prevent sheet from showing during navigation within modal

* fix(android): clamp detent heights to available screen space

* fix(android): post when initialDetentAnimated is false
2025-12-21 16:10:23 +08:00
lodev09
e6b6c36a2e
fix(android): keep sheet at target position during non-animated present 2025-12-20 11:46:22 +08:00
Jovanni Lo
7a35fa6bfb
refactor(android): use BottomSheetDialogFragment instead of BottomSheetDialog (#342)
* fix(android): restore original code

* refactor(android): use BottomSheetDialogFragment instead of BottomSheetDialog

- Create TrueSheetDialogFragment in core/ for better lifecycle management
- Refactor TrueSheetViewController to use the new fragment
- Add TrueSheetDialogFragmentDelegate for fragment callbacks
- Maintain all existing functionality (detents, animations, keyboard, stacking)

* fix(android): fix dialog fragment presentation issues

- Move setupSheetDetents and setupDimmedBackground to onDialogShow
- Clear FLAG_DIM_BEHIND in fragment's onCreateDialog
- Fix footer positioning with post and isPresented check
- Rename setDraggable to updateDraggable to fix JVM signature clash

* fix(android): animate sheet on content size change

- Add animate parameter to configureDetents
- Use setPeekHeight with animate flag when sheet is presented
- Remove unnecessary footerView.post wrapper

* fix(android): position footer during keyboard transitions

* fix(android): restore translationY animation for present

- Restore translationY logic in animator for child sheets
- Remove duplicate setStateForDetentIndex call in onDialogShow
- Position sheet off-screen before animation starts
- Clean up debug logging

* fix(android): fix dismissible behavior and clean up onSlide

- Re-apply isHideable after dialog show to fix dismissible
- Move isAnimating check to early return in onSlide
- Clean up debug logging
2025-12-19 08:18:56 +08:00
lodev09
6976f172a7
chore: update example components 2025-12-18 03:57:05 +08:00
Jovanni Lo
c88fb1c037
feat(android): improve transition animations and refactor detent calculations (#337)
* feat: update slide animation styles

* fix: move rn-screen observer to preAttached and detached

* feat(android): implement programmatic slide animations for present/dismiss

* refactor(android): cleanup unused animation resources and fix present animation flash

* fix(android): animate footer with sheet during present/dismiss

* refactor(android): sync dim alpha with sheet translation during animations

- Update updateDimAmount() to accept optional sheetTop parameter
- Call updateDimAmount() on each frame during present/dismiss animations
- Remove unused animateDimAlpha() from TrueSheetViewController
- Remove unused animateAlpha() from TrueSheetDimView

* refactor(android): cleanup TrueSheetViewController

- Remove unused imports (Log, ViewCompat)
- Remove unused positionAnimator and setupTransitionTracker
- Use AnimatorListenerAdapter instead of full Animator.AnimatorListener
- Simplify comments and remove debug logs

* fix: move setup methods out of onShowListener

* refactor: make methods consistent

* refactor(android): use alpha + window flags for modal hide/show

- Use alpha fade instead of visibility for hiding sheet during RN Screens modal
- Add FLAG_NOT_TOUCHABLE and FLAG_NOT_FOCUSABLE to prevent interaction when hidden
- Remove unused TrueSheetSlideAnimation style and anim resources

* feat: translate bottomSheetView instead of setupSheetDetents with keyboard

* fix(android): clamp sheet translation during drag to prevent going beyond visible screen

* feat(android): dismiss keyboard when sheet is dragged down to a lower detent

* feat(android): expand to last detent on keyboard show, restore on hide

- Refactor keyboard observer delegate callbacks
- Track pre-keyboard detent and restore on hide
- Skip emitting detent change for keyboard transitions
- Fix 2-detent state map to include STATE_HALF_EXPANDED

* refactor(android): extract TrueSheetDetentCalculator and TrueSheetAnimator

- Extract detent calculations into TrueSheetDetentCalculator class
- Extract present/dismiss animations into TrueSheetAnimator class
- Use interface-based pattern for dynamic prop updates
- Consolidate state variables (InteractionState, KeyboardState)
- Reduce TrueSheetViewController from ~900 to ~650 lines

* refactor(ios): extract TrueSheetDetentCalculator from TrueSheetViewController

- Create TrueSheetDetentCalculator with TrueSheetDetentMeasurements protocol
- Extract detent calculation methods: detentValueForIndex, estimatedPositionForIndex,
  findSegmentForPosition, interpolatedIndexForPosition, interpolatedDetentForPosition
- TrueSheetViewController conforms to protocol for dynamic prop access
- Mirrors Android's interface-based pattern for consistency

* feat(android): skip keyboard handling when sheet is not topmost or hidden by modal

* feat(android): use setupSheetDetents for keyboard handling instead of Y translation

* feat(android): dismiss keyboard when dragged below original position

* chore: run tidy
2025-12-18 00:50:50 +08:00
lodev09
f0ecafca37
docs: add android stacking and dimming blog 2025-12-16 17:58:28 +08:00
lodev09
ba217f63b1
fix(expo): add demo api key to map view 2025-12-16 17:35:30 +08:00
Jovanni Lo
f3df5e2681
feat: add adaptive grabber color for light/dark mode (#325)
* feat(android): adaptive grabber color based on light/dark mode

* feat: add adaptive option to grabber for light/dark mode support
2025-12-15 05:20:07 +08:00
lodev09
7f4bb3810a
docs: update docs 2025-12-14 09:33:48 +08:00
Jovanni Lo
c8cc19fc44
fix: batch dismiss behavior for stacked sheets (#322)
* fix(android): dismiss stacked sheets like iOS

* fix(android): fix dismiss animated

* docs: update stacking docs

* feat(example): add names to example sheets

* fix(web): dismiss stacked sheets like iOS
2025-12-14 09:05:50 +08:00
lodev09
e70fc72e2f
fix(ios): prevent parent sheet footer from translating on keyboard show 2025-12-13 19:10:55 +08:00
lodev09
e1ea6b64ac
chore: update PromptSheet example 2025-12-13 08:52:08 +08:00
Jovanni Lo
0c7d983483
feat: improve keyboard handling for Android and iOS (#317)
* fix(android): improve keyboard handling with translationY

* refactor(android): remove keyboardMode prop

* fix(android): cap keyboard translation to screen height

* refactor(android): add TrueSheetKeyboardHandler with API < 30 fallback

* feat(ios): add keyboard handler for footer view
2025-12-13 08:41:05 +08:00
Jovanni Lo
69f0dba353
feat(web): add stackBehavior prop for sheet stacking control (#307)
* chore: tidy clean script

* fix: implement TrueSheetProvider for web

* refactor(example): move TrueSheetProvider to screen level and improve web support

- Move TrueSheetProvider and ReanimatedTrueSheetProvider from root layout to individual screens
- Remove (sheet) folder and rename route to 'sheet'
- Improve web grabber defaults and container layout
- Fix Platform.select to use 'default' instead of 'android' for web compatibility
- Update Input placeholder color and add text color for web visibility
- Add backgroundComponent={null} and fix handle zIndex in web implementation

* feat(web): add stackBehavior prop for sheet stacking control

* docs: simplify Expo Router example with proper types
2025-12-12 07:10:15 +08:00
lodev09
fb7b51266e
fix(expo): use patched react-native-screens for sheet presentation 2025-12-12 04:11:09 +08:00
lodev09
cca0ea14be
chore: extend root tsconfig in expo example and fix eslint ignore 2025-12-12 03:35:22 +08:00
lodev09
2dec5fc4bc
chore: remove tsconfig from example/shared 2025-12-12 03:29:39 +08:00
Jovanni Lo
4606a1bee9
refactor: reorganize examples with shared package (#306)
* feat(expo-example): update to match example app structure

- Add promise-based present/dismiss to TrueSheet.web.tsx
- Remove tabs navigation, use stack-based routing
- Add screens: Map, Standard, Modal, Test
- Add shared components and sheet components
- Add utils (constants, times, random)
- Add react-native-maps dependency

* feat(expo-example): add Map component and SheetStack with withLayoutContext

- Add platform-specific Map component (native MapView, web View fallback)
- Add sheet-stack route using expo-router's withLayoutContext
- Integrate createTrueSheetNavigator with expo-router file-based routing

* refactor: create shared example-shared package for common components

- Create @truesheet/example-shared workspace package
- Move common components (Button, Header, Footer, etc.) to shared
- Move sheet components (BasicSheet, PromptSheet, etc.) to shared
- Move utils (constants, times, random) to shared
- Update example and expo-example to re-export from shared

* chore: reorganize examples into examples/ folder

- Move example/ to examples/bare/
- Move expo-example/ to examples/expo/
- Move example-shared/ to examples/shared/
- Update workspace paths in root package.json
- Rename packages to @truesheet/bare-example, @truesheet/expo-example
- Update script names (example -> bare, expo)

* chore: update config paths for examples folder reorganization

* chore: rename examples to example and update package names to @example/*

* chore: move screen components to shared package

- Add MapScreen, ModalScreen, StandardScreen, TestScreen to shared
- Make screens navigation-agnostic with callback props
- Add MapComponent prop to MapScreen for platform-specific map
- Create Map component in bare example
- Update expo and bare examples to use shared screens

* chore: import screens directly from @example/shared/screens

* chore: import components and utils directly from @example/shared

* chore: remove unused sheets index files

* chore: move Map component to shared package

* chore: remove unused constants folder from expo example

* chore: remove unused ReanimatedExample component

* chore: update scripts for new example folder structure

* chore: exclude example folder from jest test paths

* chore: add expo prebuild step to clean script

* fix: update config paths for new example folder structure

* chore: categorize steps in clean script

* fix: use workspace:* for example dependencies

- Change @lodev09/react-native-true-sheet from * to workspace:* in bare and expo examples
- Fixes duplicate view registration error caused by npm version being installed alongside workspace
- Silence clean.sh script output while preserving error visibility
2025-12-12 03:08:20 +08:00
lodev09
a52d09baa9
chore: add reanimated and worklets resolution 2025-12-11 07:54:06 +08:00
Jovanni Lo
381a0a0e06
fix: interpolated index and detent for single detent (#297)
* fix: interpolated index and detent for single detent

When only one detent is provided (e.g., [1]), the interpolated index
and detent values were fixed at 0 and 1 respectively instead of
changing as the sheet moves.

Updated findSegmentForPosition on both iOS and Android to calculate
the interpolation between the closed state and the single detent.

* refactor: simplify findSegmentForPosition

Deduplicate the 'above first detent' logic by handling it once
before the single/multi-detent branching.

* chore: restore MapScreen
2025-12-09 22:18:30 +08:00
Jovanni Lo
af5d0295fc
fix(ios): hide host view to prevent background color showing (#294)
* fix(ios): hide host view to prevent background color showing

* chore: add constant to default navigator
2025-12-09 20:20:42 +08:00
lodev09
18d7e140fe
feat(navigation): rename reanimatedPositionChangeHandler to positionChangeHandler
- Simplify API: accept worklet function directly
- Add positionChangeHandler to regular TrueSheetScreen
- When reanimated enabled, handler must be a worklet
- Remove ReanimatedTrueSheetScreenProps type
- Update documentation
2025-12-09 04:03:17 +08:00
Jovanni Lo
dc10c4e528
feat(navigation): add per-screen reanimated option (#291)
* feat(navigation): add reanimated config option

* feat(navigation): use reanimated position change handler

* refactor(navigation): extract screen components to separate files

* refactor(navigation): move screen components to screen folder

* refactor(navigation): simplify useSheetScreenState return with eventHandlers spread

* feat(navigation): add reanimated support with ReanimatedTrueSheet

* refactor(navigation): extract screen types and fix resizeKey dependency

* feat(navigation): make reanimated integration optional with lazy require

* refactor(navigation): convert functions to arrow functions

* feat(navigation): add per-screen reanimated option with position change handler

* docs: add reanimated integration to navigation guide

* refactor: move spread below
2025-12-09 03:15:52 +08:00
Jovanni Lo
3abdc442d4
refactor: rename background prop to backgroundColor (#286)
- Use ColorValue type in native component spec for proper color handling
- iOS: Use RCTUIColorFromSharedColor directly with SharedColor
- Android: Use customType="Color" for automatic color conversion
- Remove manual processColor call in TrueSheet.tsx
2025-12-08 06:44:04 +08:00
Jovanni Lo
e69a0c152e
fix: Android layout calculations and add insetAdjustment prop (#285)
* feat(android): adjust android layout calculations

* fix(android): fix footer positioning

* fix(android): emit correct position relative to js screen height

* fix(android): fix halfExpandedRatio calculation with 3 detents

* refactor(android): pre-calculate positions by index

* chore: restore examples

* fix(android): fix halfExpandedRatio calculation

* feat(android): add bottomInset to detent heights for iOS consistency

- Add bottomInset to auto and fractional detent heights to match iOS behavior
- Update ScreenUtils to use ReactContext instead of View for reliable inset retrieval
- Remove unused getScreenY method
- Simplify currentSheetTop to use view.top directly

* fix(android): adjust halfExpandedRatio and expandedOffset for edgeToEdgeFullScreen

- Use maxOf(edgeToEdgeTopInset, realHeight - detentHeight) for expandedOffset
- Subtract edgeToEdgeTopInset from detent heights when calculating halfExpandedRatio
- Ensures sheet respects top inset when edgeToEdgeFullScreen is disabled

* fix(android): emit position on dismiss and sheet stacking

- Add emitDismissedPosition() for dismiss scenarios
- Add emitPosition parameter to hideDialog/showDialog
- Emit position when sheet is hidden/shown due to sheet stacking
- Skip position emission for RN Screens modal show/hide

* refactor(android): simplify setupSheetDetents calculation

- Extract common pattern for peekHeight, halfExpandedRatio, expandedOffset
- Fix halfExpandedRatio to cap at maxAvailableHeight instead of subtracting edgeToEdgeTopInset
- Remove redundant when block with unified calculation logic

* feat: add insetAdjustment prop for controlling bottom inset behavior

* fix(ios): fix ios insetAdjustment logic

* fix(ios): add pending layout update flag for detents and insetAdjustment changes

* refactor(ios): rename to detentBottomInsetForHeight, skip for iOS 26 floating sheets

* docs: add insetAdjustment prop documentation
2025-12-08 05:28:35 +08:00
Jovanni Lo
26008cbc8f
feat: add sheet navigator for react-navigation integration (#279)
* docs: fix broken links

* feat: add react-navigation integration

- Add createTrueSheetNavigator for custom sheet navigator
- Add TrueSheetRouter with snapTo action creator
- Add TrueSheetView component for rendering sheet screens
- Add useTrueSheetNavigation hook
- Export as separate optional import via /navigation
- Add optional peer dependencies for @react-navigation/native, nanoid

* docs: add expo-router support section to navigation guide

* feat: add sheet navigator for react-navigation integration

- Add createTrueSheetNavigator for react-navigation support
- Add TrueSheetRouter with RESIZE action
- Add TrueSheetView to render first screen as content, rest as sheets
- Add useTrueSheetNavigation hook with resize method
- Add navigation module as separate import (@lodev09/react-native-true-sheet/navigation)
- Refactor example to use navigators folder structure
- Update documentation with usage examples and Expo Router support

* fix: wait for sheet dismiss animation before removing route

- Intercept GO_BACK/POP actions to mark route as closing instead of removing
- Add DISMISS and REMOVE custom actions to TrueSheetRouter
- Sheet stays in navigation state until dismiss animation completes
- Handle user swipe dismiss by calling goBack then skipping dismiss
- Refactor example: rename NavigationScreen to StandardScreen
- Remove MapView from SheetNavigator example
- Add navigation examples to SheetNavigator (Test screen, Modal)

* refactor(navigation): use Pick for TrueSheetNavigationOptions type

* fix(android): prevent state reset during resize animation

* refactor(navigation): clean up types and remove redundancies

- Remove unused TrueSheetNavigationConfig type
- Combine GO_BACK, POP, and DISMISS action handling in router
- Remove unused navigation prop from TrueSheetView
- Remove unused rest spread from TrueSheetNavigator
- Export TrueSheetActionType and TrueSheetNavigationState types

* refactor(navigation): simplify detentIndex logic and use initialDetentIndex

- Use initialDetentIndex prop for faster initial presentation (no JS-native roundtrip)
- Capture initialDetentIndex in ref to prevent prop changes on resize
- Extract clampDetentIndex helper for cleaner index calculation
- Apply detent defaults in destructuring instead of inline nullish coalescing

* feat(navigation): add sheet-specific navigation events

- Add sheetWillPresent, sheetDidPresent events
- Add sheetWillDismiss, sheetDidDismiss events
- Add sheetDetentChange event
- Add sheetDragBegin, sheetDragChange, sheetDragEnd events
- Add sheetPositionChange event with realtime flag
- Add sheetWillFocus, sheetDidFocus, sheetWillBlur, sheetDidBlur events
- Export DetentChangeEventData and PositionChangeEventData types
- Add example usage in SheetNavigator

* refactor(navigation): reuse event payload types from TrueSheet.types

- Replace DetentChangeEventData with DetentInfoEventPayload
- Replace PositionChangeEventData with PositionChangeEventPayload
- Re-export payload types from TrueSheet.types in navigation index

* refactor(navigation): use nested pattern instead of independent tree

- First screen in Sheet.Navigator is base content (existing app/navigator)
- Subsequent screens are presented as sheets on top
- Prevents dismissing base screen in router
- Updated docs to show wrapping existing navigation pattern
- Updated Expo Router example with (main)/ route group structure

* feat(navigation): support initialRouteName to determine base screen

- Base screen is determined by initialRouteName (defaults to first screen)
- Updated docs and example to reflect the new pattern

* docs: simplify navigation doc

* docs: update navigation doc

* docs: tidy

* chore(example): restore example

* fix(navigation): bubble goBack to parent when on base screen

- Return null instead of state when goBack is called on base screen
- Allows navigation actions to propagate to parent navigator
- Simplified navigation docs
2025-12-06 14:32:55 +08:00
Jovanni Lo
9cc50f5167
feat: emit focus/blur events during present/dismiss (#278)
* feat: emit focus/blur events during present/dismiss

* docs: update focus/blur events documentation

* feat(android): emit focus/blur events during present/dismiss

- Add willFocus/didFocus events with willPresent/didPresent
- Add willBlur/didBlur events with willDismiss/didDismiss
- Use postDelayed with animation duration for did* events after animation
- Handle both programmatic dismiss (STATE_HIDDEN) and user-initiated cancel
- Use isDismissing flag to prevent duplicate events

* refactor(android): extract dismiss event helpers to reduce redundancy

- Add emitWillDismissEvents() helper for willBlur/willDismiss + parent focus
- Add emitDidDismissEvents() helper for didBlur/didDismiss + parent focus + promise
- Update dismiss(), STATE_HIDDEN, and setOnCancelListener to use helpers

* fix(android): emit position change on user-initiated dismiss

onSlide isn't triggered for user-initiated dismiss (back button, tap outside),
so manually emit off-screen position after dismiss animation completes.

* test: add focus/blur event callback tests

* fix: add animated param to mock present/dismiss methods
2025-12-05 01:17:21 +08:00
lodev09
91c2221755
fix(android): handle scrollable when detent values changes 2025-12-04 04:06:45 +08:00
Jovanni Lo
b87f0570d1
feat: add animated parameter to present and dismiss methods (#276) 2025-12-04 01:24:10 +08:00
lodev09
e3d0ba3ff5
fix(example): fix example metro to not require built lib folder 2025-12-03 01:59:22 +08:00
lodev09
81264e7d41
chore: regenerate lock files 2025-12-03 01:34:00 +08:00
Jovanni Lo
f5028f9469
fix: make react-native-reanimated truly optional (#271)
- Remove unconditional reanimated export from main index
- Add separate export path for reanimated integration
- Update example app to use new import path

Users can now import reanimated features via:
import { ReanimatedTrueSheet } from '@lodev09/react-native-true-sheet/reanimated'
2025-12-03 00:01:42 +08:00
Jovanni Lo
83d58fb59d
feat(android): add onBackPress event (#269)
* feat(android): add onBackPress event

* docs: add onBackPress event documentation
2025-12-02 22:58:43 +08:00
lodev09
b59f02d167
chore(example): run pod install 2025-12-02 06:42:30 +08:00
Jovanni Lo
1d7ba50003
fix(ios): support presenting react-navigation modals from nested sheets (#266) 2025-12-02 06:40:51 +08:00
Jovanni Lo
77a7c51da2
fix(ios): emit -1 position when sheet is going to dismiss (#262)
* fix(ios): emit -1 position when sheet is going to dismiss

* chore: regenerate gemfile
2025-12-01 23:10:33 +08:00
Jovanni Lo
b426723084
feat: iOS blur and grabber improvements (#259)
* feat(ios): add custom grabber view with vibrancy effect

* refactor(ios): simplify blur and grabber view setup

* feat: add grabberOptions prop for customizing grabber appearance

- Add GrabberOptions type with width, height, topMargin, and color options
- iOS: Use system grabber by default, custom grabber when options provided
- Android: Pass options to TrueSheetGrabberView
- Update docs with new prop and type reference

* fix(ios): fix grabberOptions color handling

- Use Int32 for color in codegen spec (like background prop)
- Process color with processColor in TrueSheet.tsx
- Apply color to vibrancy view backgroundColor

* refactor(ios): consolidate blur options into blurOptions prop

- Add BlurOptions type with intensity and interaction properties
- Use -1 as sentinel value for intensity to support value of 0
- Keep blurTint as separate prop
- Update docs

* refactor: use WithDefault in codegen for blurOptions

* feat: add cornerRadius option to grabberOptions
2025-12-01 21:31:48 +08:00
Jovanni Lo
72d625727f
fix: correct interpolated index and detent values for position changes (#258)
* feat(ios): emit consistent position values for lifecycle events

- Update delegate protocol to pass index, position, and detent params
- Use dispatch_async for willPresent, didPresent, detentChange events
- Remove unused methods from public header
- Update TrueSheetView to use delegate params directly

* refactor(ios): remove layoutTransitioning property

* fix(ios): correct interpolated index and detent values for position changes

- Store actual Y positions when sheet settles at each detent
- Use stored positions for accurate interpolation instead of estimating from detent fractions
- Add estimatedPositionForIndex helper to calculate positions with offset correction
- Fixes incorrect interpolated values caused by iOS safe area insets

Fixes #255

* fix(ios): update resolved position in viewDidLayoutSubviews

- Move position storage to viewDidLayoutSubviews for centralized handling
- Handles content size changes correctly
- Remove duplicate storage from detent change delegate

* feat(example): add content toggle to MapScreen for testing dynamic height

* fix(android): correct interpolated index and detent values for position changes

* refactor(ios): extract findSegmentForPosition helper to reduce duplication

* fix(ios): emit detent change after sheet settles for programmatic resize

* refactor(ios): simplify position tracking and remove transition animation tracking

* fix(ios): emit realtime position changes when another controller is presented

* fix(android): adjust sheet position when content size changes at auto detent

* docs: remove auto detent placement restriction note
2025-12-01 07:37:45 +08:00