@oxy.so/bloom 19.5.1 → 19.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/activity-heatmap.mdx +7 -0
- package/docs/adoption-matrix.mdx +26 -26
- package/docs/announcement.mdx +7 -0
- package/docs/app-shell.mdx +18 -11
- package/docs/avatar.mdx +2 -0
- package/docs/badge.mdx +2 -0
- package/docs/chip.mdx +6 -2
- package/docs/compose-layouts.mdx +114 -2
- package/docs/composition-bar.mdx +4 -0
- package/docs/contact-card.mdx +5 -0
- package/docs/dialog.mdx +7 -0
- package/docs/divider.mdx +8 -0
- package/docs/empty-state.mdx +8 -0
- package/docs/engagement-bar.mdx +9 -0
- package/docs/icon-circle.mdx +2 -0
- package/docs/layout.mdx +1 -1
- package/docs/list.mdx +4 -3
- package/docs/page-header.mdx +7 -0
- package/docs/public-parts.mdx +39 -28
- package/docs/screen.mdx +4 -0
- package/docs/scroll.mdx +6 -3
- package/docs/sidebar.mdx +26 -5
- package/docs/task-catalog.json +1 -1
- package/docs/task-catalog.mdx +1 -1
- package/docs/typography.mdx +9 -0
- package/lib/commonjs/app-shell/AppShell.js +3 -3
- package/lib/commonjs/app-shell/AppShell.js.map +1 -1
- package/lib/commonjs/app-shell/AppShellEngine.js +2 -1
- package/lib/commonjs/app-shell/AppShellEngine.js.map +1 -1
- package/lib/commonjs/app-shell/AppShellPanelLayout.js +345 -172
- package/lib/commonjs/app-shell/AppShellPanelLayout.js.map +1 -1
- package/lib/commonjs/app-shell/RetainedPanelLayout.js +6 -0
- package/lib/commonjs/app-shell/RetainedPanelLayout.js.map +1 -1
- package/lib/commonjs/app-shell/panel-layout-css.js +20 -13
- package/lib/commonjs/app-shell/panel-layout-css.js.map +1 -1
- package/lib/commonjs/app-shell/panel-layout.js +33 -185
- package/lib/commonjs/app-shell/panel-layout.js.map +1 -1
- package/lib/commonjs/app-shell/panel-motion.js +13 -36
- package/lib/commonjs/app-shell/panel-motion.js.map +1 -1
- package/lib/commonjs/app-shell/panel-transitions.js +26 -0
- package/lib/commonjs/app-shell/panel-transitions.js.map +1 -0
- package/lib/commonjs/app-shell/shell-layout-css.js +2 -2
- package/lib/commonjs/app-shell/shell-layout-css.js.map +1 -1
- package/lib/commonjs/app-shell/use-panel-exit-completion.js +100 -0
- package/lib/commonjs/app-shell/use-panel-exit-completion.js.map +1 -0
- package/lib/commonjs/app-shell/use-panel-resize.js +21 -7
- package/lib/commonjs/app-shell/use-panel-resize.js.map +1 -1
- package/lib/commonjs/app-shell/use-panel-reveal.js +2 -1
- package/lib/commonjs/app-shell/use-panel-reveal.js.map +1 -1
- package/lib/commonjs/bottom-sheet/BottomSheetBase.js +3 -2
- package/lib/commonjs/bottom-sheet/BottomSheetBase.js.map +1 -1
- package/lib/commonjs/chip/Chip.js +10 -1
- package/lib/commonjs/chip/Chip.js.map +1 -1
- package/lib/commonjs/chip/shared.js +2 -2
- package/lib/commonjs/dialog/DialogBottomSheet.js +6 -3
- package/lib/commonjs/dialog/DialogBottomSheet.js.map +1 -1
- package/lib/commonjs/engagement-bar/EngagementAction.js +6 -5
- package/lib/commonjs/engagement-bar/EngagementAction.js.map +1 -1
- package/lib/commonjs/engagement-bar/EngagementBar.js +31 -7
- package/lib/commonjs/engagement-bar/EngagementBar.js.map +1 -1
- package/lib/commonjs/engagement-bar/EngagementPop.js +10 -3
- package/lib/commonjs/engagement-bar/EngagementPop.js.map +1 -1
- package/lib/commonjs/engagement-bar/context.js.map +1 -1
- package/lib/commonjs/engagement-bar/paint.js +59 -12
- package/lib/commonjs/engagement-bar/paint.js.map +1 -1
- package/lib/commonjs/hooks/use-border-box-size.js +46 -0
- package/lib/commonjs/hooks/use-border-box-size.js.map +1 -0
- package/lib/commonjs/layout/ScrollBar.web.js +62 -29
- package/lib/commonjs/layout/ScrollBar.web.js.map +1 -1
- package/lib/commonjs/layout/scroll-metrics.js.map +1 -1
- package/lib/commonjs/list/VirtualList.js +12 -0
- package/lib/commonjs/list/VirtualList.js.map +1 -1
- package/lib/commonjs/list/VirtualList.web.js +40 -19
- package/lib/commonjs/list/VirtualList.web.js.map +1 -1
- package/lib/commonjs/list/flash-list-module.js.map +1 -1
- package/lib/commonjs/page-header/EdgeScrim.js +14 -4
- package/lib/commonjs/page-header/EdgeScrim.js.map +1 -1
- package/lib/commonjs/page-header/PageHeader.js +19 -6
- package/lib/commonjs/page-header/PageHeader.js.map +1 -1
- package/lib/commonjs/screen/ScreenBase.js +15 -6
- package/lib/commonjs/screen/ScreenBase.js.map +1 -1
- package/lib/commonjs/screen/ScreenScrollViewBase.js +12 -2
- package/lib/commonjs/screen/ScreenScrollViewBase.js.map +1 -1
- package/lib/commonjs/screen/context.js.map +1 -1
- package/lib/commonjs/screen/use-intrinsic-content-height.js +53 -0
- package/lib/commonjs/screen/use-intrinsic-content-height.js.map +1 -0
- package/lib/commonjs/screen/use-screen-viewport.js +37 -6
- package/lib/commonjs/screen/use-screen-viewport.js.map +1 -1
- package/lib/commonjs/scroll/constants.js +4 -1
- package/lib/commonjs/scroll/constants.js.map +1 -1
- package/lib/commonjs/scroll/owner-handoff.js +27 -7
- package/lib/commonjs/scroll/owner-handoff.js.map +1 -1
- package/lib/commonjs/scroll/use-scroll-restoration.web.js +2 -11
- package/lib/commonjs/scroll/use-scroll-restoration.web.js.map +1 -1
- package/lib/commonjs/sidebar/Sidebar.js +121 -87
- package/lib/commonjs/sidebar/Sidebar.js.map +1 -1
- package/lib/commonjs/sidebar/arrangement.js +36 -0
- package/lib/commonjs/sidebar/arrangement.js.map +1 -0
- package/lib/commonjs/sidebar/index.js.map +1 -1
- package/lib/commonjs/stay-filters/CountFilter.js +1 -1
- package/lib/commonjs/stay-filters/FilterChip.js +1 -1
- package/lib/commonjs/stay-filters/ToggleChipGroup.js +1 -1
- package/lib/module/app-shell/AppShell.js +3 -3
- package/lib/module/app-shell/AppShell.js.map +1 -1
- package/lib/module/app-shell/AppShellEngine.js +2 -1
- package/lib/module/app-shell/AppShellEngine.js.map +1 -1
- package/lib/module/app-shell/AppShellPanelLayout.js +319 -147
- package/lib/module/app-shell/AppShellPanelLayout.js.map +1 -1
- package/lib/module/app-shell/RetainedPanelLayout.js +7 -1
- package/lib/module/app-shell/RetainedPanelLayout.js.map +1 -1
- package/lib/module/app-shell/panel-layout-css.js +19 -12
- package/lib/module/app-shell/panel-layout-css.js.map +1 -1
- package/lib/module/app-shell/panel-layout.js +32 -183
- package/lib/module/app-shell/panel-layout.js.map +1 -1
- package/lib/module/app-shell/panel-motion.js +14 -36
- package/lib/module/app-shell/panel-motion.js.map +1 -1
- package/lib/module/app-shell/panel-transitions.js +21 -0
- package/lib/module/app-shell/panel-transitions.js.map +1 -0
- package/lib/module/app-shell/shell-layout-css.js +2 -2
- package/lib/module/app-shell/shell-layout-css.js.map +1 -1
- package/lib/module/app-shell/use-panel-exit-completion.js +97 -0
- package/lib/module/app-shell/use-panel-exit-completion.js.map +1 -0
- package/lib/module/app-shell/use-panel-resize.js +22 -8
- package/lib/module/app-shell/use-panel-resize.js.map +1 -1
- package/lib/module/app-shell/use-panel-reveal.js +2 -1
- package/lib/module/app-shell/use-panel-reveal.js.map +1 -1
- package/lib/module/bottom-sheet/BottomSheetBase.js +3 -2
- package/lib/module/bottom-sheet/BottomSheetBase.js.map +1 -1
- package/lib/module/chip/Chip.js +10 -1
- package/lib/module/chip/Chip.js.map +1 -1
- package/lib/module/chip/shared.js +2 -2
- package/lib/module/dialog/DialogBottomSheet.js +6 -3
- package/lib/module/dialog/DialogBottomSheet.js.map +1 -1
- package/lib/module/engagement-bar/EngagementAction.js +7 -6
- package/lib/module/engagement-bar/EngagementAction.js.map +1 -1
- package/lib/module/engagement-bar/EngagementBar.js +29 -5
- package/lib/module/engagement-bar/EngagementBar.js.map +1 -1
- package/lib/module/engagement-bar/EngagementPop.js +10 -3
- package/lib/module/engagement-bar/EngagementPop.js.map +1 -1
- package/lib/module/engagement-bar/context.js.map +1 -1
- package/lib/module/engagement-bar/paint.js +60 -13
- package/lib/module/engagement-bar/paint.js.map +1 -1
- package/lib/module/hooks/use-border-box-size.js +42 -0
- package/lib/module/hooks/use-border-box-size.js.map +1 -0
- package/lib/module/layout/ScrollBar.web.js +64 -31
- package/lib/module/layout/ScrollBar.web.js.map +1 -1
- package/lib/module/layout/scroll-metrics.js.map +1 -1
- package/lib/module/list/VirtualList.js +12 -0
- package/lib/module/list/VirtualList.js.map +1 -1
- package/lib/module/list/VirtualList.web.js +41 -20
- package/lib/module/list/VirtualList.web.js.map +1 -1
- package/lib/module/list/flash-list-module.js.map +1 -1
- package/lib/module/page-header/EdgeScrim.js +14 -4
- package/lib/module/page-header/EdgeScrim.js.map +1 -1
- package/lib/module/page-header/PageHeader.js +19 -6
- package/lib/module/page-header/PageHeader.js.map +1 -1
- package/lib/module/screen/ScreenBase.js +15 -6
- package/lib/module/screen/ScreenBase.js.map +1 -1
- package/lib/module/screen/ScreenScrollViewBase.js +12 -2
- package/lib/module/screen/ScreenScrollViewBase.js.map +1 -1
- package/lib/module/screen/context.js.map +1 -1
- package/lib/module/screen/use-intrinsic-content-height.js +50 -0
- package/lib/module/screen/use-intrinsic-content-height.js.map +1 -0
- package/lib/module/screen/use-screen-viewport.js +39 -8
- package/lib/module/screen/use-screen-viewport.js.map +1 -1
- package/lib/module/scroll/constants.js +3 -0
- package/lib/module/scroll/constants.js.map +1 -1
- package/lib/module/scroll/owner-handoff.js +27 -8
- package/lib/module/scroll/owner-handoff.js.map +1 -1
- package/lib/module/scroll/use-scroll-restoration.web.js +1 -10
- package/lib/module/scroll/use-scroll-restoration.web.js.map +1 -1
- package/lib/module/sidebar/Sidebar.js +121 -87
- package/lib/module/sidebar/Sidebar.js.map +1 -1
- package/lib/module/sidebar/arrangement.js +32 -0
- package/lib/module/sidebar/arrangement.js.map +1 -0
- package/lib/module/sidebar/index.js.map +1 -1
- package/lib/module/stay-filters/CountFilter.js +1 -1
- package/lib/module/stay-filters/FilterChip.js +1 -1
- package/lib/module/stay-filters/ToggleChipGroup.js +1 -1
- package/lib/typescript/commonjs/app-shell/AppShell.d.ts.map +1 -1
- package/lib/typescript/commonjs/app-shell/AppShellEngine.d.ts.map +1 -1
- package/lib/typescript/commonjs/app-shell/AppShellPanelLayout.d.ts.map +1 -1
- package/lib/typescript/commonjs/app-shell/RetainedPanelLayout.d.ts.map +1 -1
- package/lib/typescript/commonjs/app-shell/panel-layout-css.d.ts +2 -1
- package/lib/typescript/commonjs/app-shell/panel-layout-css.d.ts.map +1 -1
- package/lib/typescript/commonjs/app-shell/panel-layout-types.d.ts +11 -2
- package/lib/typescript/commonjs/app-shell/panel-layout-types.d.ts.map +1 -1
- package/lib/typescript/commonjs/app-shell/panel-layout.d.ts +13 -27
- package/lib/typescript/commonjs/app-shell/panel-layout.d.ts.map +1 -1
- package/lib/typescript/commonjs/app-shell/panel-motion.d.ts +1 -12
- package/lib/typescript/commonjs/app-shell/panel-motion.d.ts.map +1 -1
- package/lib/typescript/commonjs/app-shell/panel-transitions.d.ts +4 -0
- package/lib/typescript/commonjs/app-shell/panel-transitions.d.ts.map +1 -0
- package/lib/typescript/commonjs/app-shell/shell-layout-css.d.ts.map +1 -1
- package/lib/typescript/commonjs/app-shell/types.d.ts +4 -0
- package/lib/typescript/commonjs/app-shell/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/app-shell/use-panel-exit-completion.d.ts +14 -0
- package/lib/typescript/commonjs/app-shell/use-panel-exit-completion.d.ts.map +1 -0
- package/lib/typescript/commonjs/app-shell/use-panel-reorder.d.ts +2 -2
- package/lib/typescript/commonjs/app-shell/use-panel-reorder.d.ts.map +1 -1
- package/lib/typescript/commonjs/app-shell/use-panel-resize.d.ts +4 -2
- package/lib/typescript/commonjs/app-shell/use-panel-resize.d.ts.map +1 -1
- package/lib/typescript/commonjs/app-shell/use-panel-reveal.d.ts +2 -2
- package/lib/typescript/commonjs/app-shell/use-panel-reveal.d.ts.map +1 -1
- package/lib/typescript/commonjs/bottom-sheet/BottomSheetBase.d.ts.map +1 -1
- package/lib/typescript/commonjs/bottom-sheet/types.d.ts +2 -0
- package/lib/typescript/commonjs/bottom-sheet/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/chip/Chip.d.ts.map +1 -1
- package/lib/typescript/commonjs/chip/shared.d.ts +1 -1
- package/lib/typescript/commonjs/chip/types.d.ts +1 -1
- package/lib/typescript/commonjs/dialog/DialogBottomSheet.d.ts +2 -2
- package/lib/typescript/commonjs/dialog/DialogBottomSheet.d.ts.map +1 -1
- package/lib/typescript/commonjs/dialog/types.d.ts +2 -0
- package/lib/typescript/commonjs/dialog/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/engagement-bar/EngagementAction.d.ts.map +1 -1
- package/lib/typescript/commonjs/engagement-bar/EngagementBar.d.ts +3 -3
- package/lib/typescript/commonjs/engagement-bar/EngagementBar.d.ts.map +1 -1
- package/lib/typescript/commonjs/engagement-bar/EngagementPop.d.ts +2 -1
- package/lib/typescript/commonjs/engagement-bar/EngagementPop.d.ts.map +1 -1
- package/lib/typescript/commonjs/engagement-bar/context.d.ts +1 -0
- package/lib/typescript/commonjs/engagement-bar/context.d.ts.map +1 -1
- package/lib/typescript/commonjs/engagement-bar/paint.d.ts +4 -2
- package/lib/typescript/commonjs/engagement-bar/paint.d.ts.map +1 -1
- package/lib/typescript/commonjs/engagement-bar/types.d.ts +10 -1
- package/lib/typescript/commonjs/engagement-bar/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/hooks/use-border-box-size.d.ts +13 -0
- package/lib/typescript/commonjs/hooks/use-border-box-size.d.ts.map +1 -0
- package/lib/typescript/commonjs/layout/ScrollBar.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/layout/scroll-metrics.d.ts +2 -0
- package/lib/typescript/commonjs/layout/scroll-metrics.d.ts.map +1 -1
- package/lib/typescript/commonjs/layout/types.d.ts +2 -2
- package/lib/typescript/commonjs/layout/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/list/VirtualList.d.ts.map +1 -1
- package/lib/typescript/commonjs/list/VirtualList.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/list/flash-list-module.d.ts +1 -1
- package/lib/typescript/commonjs/list/flash-list-module.d.ts.map +1 -1
- package/lib/typescript/commonjs/page-header/EdgeScrim.d.ts +3 -1
- package/lib/typescript/commonjs/page-header/EdgeScrim.d.ts.map +1 -1
- package/lib/typescript/commonjs/page-header/PageHeader.d.ts +1 -1
- package/lib/typescript/commonjs/page-header/PageHeader.d.ts.map +1 -1
- package/lib/typescript/commonjs/page-header/types.d.ts +2 -0
- package/lib/typescript/commonjs/page-header/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/screen/ScreenBase.d.ts.map +1 -1
- package/lib/typescript/commonjs/screen/ScreenScrollViewBase.d.ts.map +1 -1
- package/lib/typescript/commonjs/screen/context.d.ts +3 -0
- package/lib/typescript/commonjs/screen/context.d.ts.map +1 -1
- package/lib/typescript/commonjs/screen/use-intrinsic-content-height.d.ts +3 -0
- package/lib/typescript/commonjs/screen/use-intrinsic-content-height.d.ts.map +1 -0
- package/lib/typescript/commonjs/screen/use-screen-viewport.d.ts.map +1 -1
- package/lib/typescript/commonjs/scroll/constants.d.ts +2 -0
- package/lib/typescript/commonjs/scroll/constants.d.ts.map +1 -1
- package/lib/typescript/commonjs/scroll/owner-handoff.d.ts +3 -1
- package/lib/typescript/commonjs/scroll/owner-handoff.d.ts.map +1 -1
- package/lib/typescript/commonjs/scroll/use-scroll-restoration.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/sidebar/Sidebar.d.ts.map +1 -1
- package/lib/typescript/commonjs/sidebar/arrangement.d.ts +32 -0
- package/lib/typescript/commonjs/sidebar/arrangement.d.ts.map +1 -0
- package/lib/typescript/commonjs/sidebar/index.d.ts +1 -0
- package/lib/typescript/commonjs/sidebar/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/sidebar/types.d.ts +13 -1
- package/lib/typescript/commonjs/sidebar/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/stay-filters/CountFilter.d.ts +1 -1
- package/lib/typescript/commonjs/stay-filters/ToggleChipGroup.d.ts +1 -1
- package/lib/typescript/module/app-shell/AppShell.d.ts.map +1 -1
- package/lib/typescript/module/app-shell/AppShellEngine.d.ts.map +1 -1
- package/lib/typescript/module/app-shell/AppShellPanelLayout.d.ts.map +1 -1
- package/lib/typescript/module/app-shell/RetainedPanelLayout.d.ts.map +1 -1
- package/lib/typescript/module/app-shell/panel-layout-css.d.ts +2 -1
- package/lib/typescript/module/app-shell/panel-layout-css.d.ts.map +1 -1
- package/lib/typescript/module/app-shell/panel-layout-types.d.ts +11 -2
- package/lib/typescript/module/app-shell/panel-layout-types.d.ts.map +1 -1
- package/lib/typescript/module/app-shell/panel-layout.d.ts +13 -27
- package/lib/typescript/module/app-shell/panel-layout.d.ts.map +1 -1
- package/lib/typescript/module/app-shell/panel-motion.d.ts +1 -12
- package/lib/typescript/module/app-shell/panel-motion.d.ts.map +1 -1
- package/lib/typescript/module/app-shell/panel-transitions.d.ts +4 -0
- package/lib/typescript/module/app-shell/panel-transitions.d.ts.map +1 -0
- package/lib/typescript/module/app-shell/shell-layout-css.d.ts.map +1 -1
- package/lib/typescript/module/app-shell/types.d.ts +4 -0
- package/lib/typescript/module/app-shell/types.d.ts.map +1 -1
- package/lib/typescript/module/app-shell/use-panel-exit-completion.d.ts +14 -0
- package/lib/typescript/module/app-shell/use-panel-exit-completion.d.ts.map +1 -0
- package/lib/typescript/module/app-shell/use-panel-reorder.d.ts +2 -2
- package/lib/typescript/module/app-shell/use-panel-reorder.d.ts.map +1 -1
- package/lib/typescript/module/app-shell/use-panel-resize.d.ts +4 -2
- package/lib/typescript/module/app-shell/use-panel-resize.d.ts.map +1 -1
- package/lib/typescript/module/app-shell/use-panel-reveal.d.ts +2 -2
- package/lib/typescript/module/app-shell/use-panel-reveal.d.ts.map +1 -1
- package/lib/typescript/module/bottom-sheet/BottomSheetBase.d.ts.map +1 -1
- package/lib/typescript/module/bottom-sheet/types.d.ts +2 -0
- package/lib/typescript/module/bottom-sheet/types.d.ts.map +1 -1
- package/lib/typescript/module/chip/Chip.d.ts.map +1 -1
- package/lib/typescript/module/chip/shared.d.ts +1 -1
- package/lib/typescript/module/chip/types.d.ts +1 -1
- package/lib/typescript/module/dialog/DialogBottomSheet.d.ts +2 -2
- package/lib/typescript/module/dialog/DialogBottomSheet.d.ts.map +1 -1
- package/lib/typescript/module/dialog/types.d.ts +2 -0
- package/lib/typescript/module/dialog/types.d.ts.map +1 -1
- package/lib/typescript/module/engagement-bar/EngagementAction.d.ts.map +1 -1
- package/lib/typescript/module/engagement-bar/EngagementBar.d.ts +3 -3
- package/lib/typescript/module/engagement-bar/EngagementBar.d.ts.map +1 -1
- package/lib/typescript/module/engagement-bar/EngagementPop.d.ts +2 -1
- package/lib/typescript/module/engagement-bar/EngagementPop.d.ts.map +1 -1
- package/lib/typescript/module/engagement-bar/context.d.ts +1 -0
- package/lib/typescript/module/engagement-bar/context.d.ts.map +1 -1
- package/lib/typescript/module/engagement-bar/paint.d.ts +4 -2
- package/lib/typescript/module/engagement-bar/paint.d.ts.map +1 -1
- package/lib/typescript/module/engagement-bar/types.d.ts +10 -1
- package/lib/typescript/module/engagement-bar/types.d.ts.map +1 -1
- package/lib/typescript/module/hooks/use-border-box-size.d.ts +13 -0
- package/lib/typescript/module/hooks/use-border-box-size.d.ts.map +1 -0
- package/lib/typescript/module/layout/ScrollBar.web.d.ts.map +1 -1
- package/lib/typescript/module/layout/scroll-metrics.d.ts +2 -0
- package/lib/typescript/module/layout/scroll-metrics.d.ts.map +1 -1
- package/lib/typescript/module/layout/types.d.ts +2 -2
- package/lib/typescript/module/layout/types.d.ts.map +1 -1
- package/lib/typescript/module/list/VirtualList.d.ts.map +1 -1
- package/lib/typescript/module/list/VirtualList.web.d.ts.map +1 -1
- package/lib/typescript/module/list/flash-list-module.d.ts +1 -1
- package/lib/typescript/module/list/flash-list-module.d.ts.map +1 -1
- package/lib/typescript/module/page-header/EdgeScrim.d.ts +3 -1
- package/lib/typescript/module/page-header/EdgeScrim.d.ts.map +1 -1
- package/lib/typescript/module/page-header/PageHeader.d.ts +1 -1
- package/lib/typescript/module/page-header/PageHeader.d.ts.map +1 -1
- package/lib/typescript/module/page-header/types.d.ts +2 -0
- package/lib/typescript/module/page-header/types.d.ts.map +1 -1
- package/lib/typescript/module/screen/ScreenBase.d.ts.map +1 -1
- package/lib/typescript/module/screen/ScreenScrollViewBase.d.ts.map +1 -1
- package/lib/typescript/module/screen/context.d.ts +3 -0
- package/lib/typescript/module/screen/context.d.ts.map +1 -1
- package/lib/typescript/module/screen/use-intrinsic-content-height.d.ts +3 -0
- package/lib/typescript/module/screen/use-intrinsic-content-height.d.ts.map +1 -0
- package/lib/typescript/module/screen/use-screen-viewport.d.ts.map +1 -1
- package/lib/typescript/module/scroll/constants.d.ts +2 -0
- package/lib/typescript/module/scroll/constants.d.ts.map +1 -1
- package/lib/typescript/module/scroll/owner-handoff.d.ts +3 -1
- package/lib/typescript/module/scroll/owner-handoff.d.ts.map +1 -1
- package/lib/typescript/module/scroll/use-scroll-restoration.web.d.ts.map +1 -1
- package/lib/typescript/module/sidebar/Sidebar.d.ts.map +1 -1
- package/lib/typescript/module/sidebar/arrangement.d.ts +32 -0
- package/lib/typescript/module/sidebar/arrangement.d.ts.map +1 -0
- package/lib/typescript/module/sidebar/index.d.ts +1 -0
- package/lib/typescript/module/sidebar/index.d.ts.map +1 -1
- package/lib/typescript/module/sidebar/types.d.ts +13 -1
- package/lib/typescript/module/sidebar/types.d.ts.map +1 -1
- package/lib/typescript/module/stay-filters/CountFilter.d.ts +1 -1
- package/lib/typescript/module/stay-filters/ToggleChipGroup.d.ts +1 -1
- package/package.json +1 -1
- package/src/__tests__/support/public-part-classifications.json +169 -26
- package/src/__tests__/support/yoga-host-tree.ts +55 -2
- package/src/app-shell/AppShell.tsx +7 -3
- package/src/app-shell/AppShellEngine.tsx +6 -2
- package/src/app-shell/AppShellPanelLayout.tsx +466 -189
- package/src/app-shell/RetainedPanelLayout.tsx +7 -1
- package/src/app-shell/panel-layout-css.ts +41 -27
- package/src/app-shell/panel-layout-types.ts +11 -2
- package/src/app-shell/panel-layout.ts +49 -256
- package/src/app-shell/panel-motion.ts +34 -52
- package/src/app-shell/panel-transitions.ts +39 -0
- package/src/app-shell/shell-layout-css.ts +6 -2
- package/src/app-shell/types.ts +4 -0
- package/src/app-shell/use-panel-exit-completion.ts +95 -0
- package/src/app-shell/use-panel-reorder.ts +2 -2
- package/src/app-shell/use-panel-resize.ts +37 -10
- package/src/app-shell/use-panel-reveal.ts +4 -9
- package/src/bottom-sheet/BottomSheetBase.tsx +6 -2
- package/src/bottom-sheet/types.ts +2 -0
- package/src/chip/Chip.tsx +3 -1
- package/src/chip/shared.ts +2 -2
- package/src/chip/types.ts +1 -1
- package/src/dialog/DialogBottomSheet.tsx +13 -2
- package/src/dialog/types.ts +2 -0
- package/src/engagement-bar/EngagementAction.tsx +5 -4
- package/src/engagement-bar/EngagementBar.tsx +30 -5
- package/src/engagement-bar/EngagementPop.tsx +11 -3
- package/src/engagement-bar/context.ts +1 -0
- package/src/engagement-bar/paint.ts +60 -13
- package/src/engagement-bar/types.ts +10 -1
- package/src/hooks/use-border-box-size.ts +38 -0
- package/src/layout/ScrollBar.web.tsx +74 -40
- package/src/layout/scroll-metrics.tsx +2 -0
- package/src/layout/types.ts +2 -2
- package/src/list/VirtualList.tsx +18 -0
- package/src/list/VirtualList.web.tsx +69 -22
- package/src/list/flash-list-module.ts +2 -0
- package/src/page-header/EdgeScrim.tsx +29 -9
- package/src/page-header/PageHeader.tsx +10 -6
- package/src/page-header/types.ts +2 -0
- package/src/screen/ScreenBase.tsx +13 -6
- package/src/screen/ScreenScrollViewBase.tsx +24 -2
- package/src/screen/context.ts +3 -0
- package/src/screen/use-intrinsic-content-height.ts +56 -0
- package/src/screen/use-screen-viewport.ts +60 -11
- package/src/scroll/constants.ts +3 -0
- package/src/scroll/owner-handoff.ts +45 -11
- package/src/scroll/use-scroll-restoration.web.ts +4 -10
- package/src/sidebar/Sidebar.tsx +146 -121
- package/src/sidebar/arrangement.ts +47 -0
- package/src/sidebar/index.ts +6 -0
- package/src/sidebar/types.ts +13 -1
- package/src/stay-filters/CountFilter.tsx +1 -1
- package/src/stay-filters/FilterChip.tsx +1 -1
- package/src/stay-filters/ToggleChipGroup.tsx +1 -1
|
@@ -13,6 +13,9 @@ var _context = require("../scroll/context.js");
|
|
|
13
13
|
var _ownerHandoff = require("../scroll/owner-handoff.js");
|
|
14
14
|
var _reselect = require("./reselect.js");
|
|
15
15
|
var _usePrefersReducedMotion = require("../hooks/use-prefers-reduced-motion.js");
|
|
16
|
+
// Retained route Screens can share one panel metric. An outgoing cleanup must
|
|
17
|
+
// not clear the next Screen's measurement.
|
|
18
|
+
const intrinsicOwners = new WeakMap();
|
|
16
19
|
const useNoContentId = () => null;
|
|
17
20
|
|
|
18
21
|
/** Observes the existing owner for chrome/restoration; never computes layout styles. */
|
|
@@ -34,6 +37,30 @@ function useScreenViewportBinding(screen, enabled, documentFlow, reserved, host)
|
|
|
34
37
|
const restoring = (0, _react.useRef)(false);
|
|
35
38
|
const active = (0, _react.useRef)(screen.active);
|
|
36
39
|
active.current = screen.active;
|
|
40
|
+
const intrinsicScope = (0, _react.useMemo)(() => ({
|
|
41
|
+
sources: new Map()
|
|
42
|
+
}), [contentId, metrics]);
|
|
43
|
+
const currentIntrinsicScope = (0, _react.useRef)(intrinsicScope);
|
|
44
|
+
currentIntrinsicScope.current = intrinsicScope;
|
|
45
|
+
const setIntrinsicContentHeight = (0, _react.useCallback)((source, height) => {
|
|
46
|
+
const metric = metrics.intrinsicContentHeight;
|
|
47
|
+
if (!metric || currentIntrinsicScope.current !== intrinsicScope) return;
|
|
48
|
+
if (height === null) intrinsicScope.sources.delete(source);else if (enabled && active.current) intrinsicScope.sources.set(source, height);else return;
|
|
49
|
+
if (height !== null) intrinsicOwners.set(metrics, intrinsicScope);
|
|
50
|
+
if (intrinsicOwners.get(metrics) !== intrinsicScope) return;
|
|
51
|
+
const values = [...intrinsicScope.sources.values()];
|
|
52
|
+
metric.value = values.length && values.every(value => value >= 0) ? Math.max(...values) : -1;
|
|
53
|
+
}, [enabled, intrinsicScope, metrics]);
|
|
54
|
+
(0, _react.useLayoutEffect)(() => {
|
|
55
|
+
if (!enabled || !screen.active) return;
|
|
56
|
+
return () => {
|
|
57
|
+
intrinsicScope.sources.clear();
|
|
58
|
+
if (intrinsicOwners.get(metrics) === intrinsicScope) {
|
|
59
|
+
intrinsicOwners.delete(metrics);
|
|
60
|
+
if (metrics.intrinsicContentHeight) metrics.intrinsicContentHeight.value = -1;
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
}, [enabled, screen.active, intrinsicScope, metrics]);
|
|
37
64
|
const reducedMotion = (0, _usePrefersReducedMotion.usePrefersReducedMotion)();
|
|
38
65
|
const owner = (0, _react.useRef)(null);
|
|
39
66
|
// A layout change can clamp the outgoing document before it dispatches its
|
|
@@ -42,11 +69,13 @@ function useScreenViewportBinding(screen, enabled, documentFlow, reserved, host)
|
|
|
42
69
|
(0, _react.useLayoutEffect)(() => {
|
|
43
70
|
if (!enabled || !web || typeof window === 'undefined') return;
|
|
44
71
|
const previous = owner.current;
|
|
72
|
+
const element = scrollRef.current;
|
|
73
|
+
const target = documentFlow ? window : element;
|
|
45
74
|
let releaseHandoff;
|
|
46
75
|
if (previous && previous.contentId === contentId && previous.documentFlow !== documentFlow && previous.active && screen.active) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
76
|
+
if (target) releaseHandoff = (0, _ownerHandoff.recordScrollOwnerHandoff)(target, previous.offset, offset => {
|
|
77
|
+
if (owner.current?.documentFlow === documentFlow) owner.current.offset = offset;
|
|
78
|
+
});
|
|
50
79
|
if (documentFlow) window.scrollTo({
|
|
51
80
|
top: previous.offset,
|
|
52
81
|
behavior: 'instant'
|
|
@@ -56,7 +85,7 @@ function useScreenViewportBinding(screen, enabled, documentFlow, reserved, host)
|
|
|
56
85
|
contentId,
|
|
57
86
|
documentFlow,
|
|
58
87
|
active: screen.active,
|
|
59
|
-
offset: documentFlow ? window.scrollY :
|
|
88
|
+
offset: (target ? (0, _ownerHandoff.readScrollOwnerHandoff)(target) : undefined) ?? (documentFlow ? window.scrollY : element?.scrollTop ?? 0)
|
|
60
89
|
};
|
|
61
90
|
// A newly mounted router sidecar can focus on a later commit. Retain the
|
|
62
91
|
// transfer for this active owner lifetime instead of expiring it during
|
|
@@ -73,7 +102,7 @@ function useScreenViewportBinding(screen, enabled, documentFlow, reserved, host)
|
|
|
73
102
|
const update = () => {
|
|
74
103
|
const node = documentFlow ? document.scrollingElement ?? document.documentElement : element;
|
|
75
104
|
const y = documentFlow ? window.scrollY : node.scrollTop;
|
|
76
|
-
if (owner.current?.documentFlow === documentFlow) owner.current.offset = Math.max(0, y);
|
|
105
|
+
if (owner.current?.documentFlow === documentFlow) owner.current.offset = (0, _ownerHandoff.readScrollOwnerHandoff)(target) ?? Math.max(0, y);
|
|
77
106
|
metrics.scrollY.value = Math.max(0, y);
|
|
78
107
|
metrics.contentHeight.value = node.scrollHeight;
|
|
79
108
|
metrics.viewportHeight.value = Math.max(0, node.clientHeight - (documentFlow ? reserved : 0));
|
|
@@ -106,6 +135,8 @@ function useScreenViewportBinding(screen, enabled, documentFlow, reserved, host)
|
|
|
106
135
|
scrollRef: documentFlow ? null : scrollRef,
|
|
107
136
|
metrics,
|
|
108
137
|
active: screen.active,
|
|
138
|
+
contentRef,
|
|
139
|
+
setIntrinsicContentHeight,
|
|
109
140
|
scrollTo(options) {
|
|
110
141
|
if (!active.current) return;
|
|
111
142
|
if (web) {
|
|
@@ -123,7 +154,7 @@ function useScreenViewportBinding(screen, enabled, documentFlow, reserved, host)
|
|
|
123
154
|
});
|
|
124
155
|
}
|
|
125
156
|
}
|
|
126
|
-
}), [web, documentFlow, metrics, screen.active, scrollRef]);
|
|
157
|
+
}), [web, documentFlow, metrics, screen.active, scrollRef, setIntrinsicContentHeight]);
|
|
127
158
|
// The screen's own viewport answers a reselect, as the page: a list scrolling
|
|
128
159
|
// inside it wins.
|
|
129
160
|
(0, _reselect.useRegisterScreenScroller)(enabled ? {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_reactNative","_reactNativeReanimated","_recipes","_context","_ownerHandoff","_reselect","_usePrefersReducedMotion","useNoContentId","useScreenViewportBinding","screen","enabled","documentFlow","reserved","host","restoration","useOptionalScrollRestorationContext","useContentId","Platform","OS","adapter","useScreenContentId","contentId","ownRef","useRef","scrollRef","contentRef","contentHeight","useSharedValue","viewportHeight","metrics","useMemo","scrollY","web","restoring","active","current","
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_reactNativeReanimated","_recipes","_context","_ownerHandoff","_reselect","_usePrefersReducedMotion","intrinsicOwners","WeakMap","useNoContentId","useScreenViewportBinding","screen","enabled","documentFlow","reserved","host","restoration","useOptionalScrollRestorationContext","useContentId","Platform","OS","adapter","useScreenContentId","contentId","ownRef","useRef","scrollRef","contentRef","contentHeight","useSharedValue","viewportHeight","metrics","useMemo","scrollY","web","restoring","active","current","intrinsicScope","sources","Map","currentIntrinsicScope","setIntrinsicContentHeight","useCallback","source","height","metric","intrinsicContentHeight","delete","set","get","values","value","length","every","Math","max","useLayoutEffect","clear","reducedMotion","usePrefersReducedMotion","owner","window","previous","element","target","releaseHandoff","recordScrollOwnerHandoff","offset","scrollTo","top","behavior","scrollTop","readScrollOwnerHandoff","undefined","useEffect","update","node","document","scrollingElement","documentElement","y","scrollHeight","clientHeight","delta","collapse","collapseTarget","animateMotion","collapseProgress","addEventListener","passive","observer","ResizeObserver","observe","Element","removeEventListener","disconnect","kind","options","left","x","animated","scrollToOffset","useRegisterScreenScroller","createScreenViewportRestoration","useScrollRestoration","ScreenViewportRestoration","binding","restorePending"],"sourceRoot":"../../../src","sources":["screen/use-screen-viewport.ts"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAQA,IAAAC,YAAA,GAA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;EACD,OAAO;IAAEgB,KAAK;IAAE1B,SAAS;IAAEC,UAAU;IAAEQ;EAAU,CAAC;AACpD;;AAEA;AACO,SAASqE,+BAA+BA,CAACC,oBAAiD,EAAE;EACjG,OAAO,SAASC,yBAAyBA,CAAC;IACxCzC,MAAM;IACN7B,MAAM;IACND;EAKF,CAAC,EAAE;IACD,MAAMwE,OAAO,GAAGF,oBAAoB,CAACxC,MAAM,EAAE;MAAErD,OAAO,EAAEwB;IAAO,CAAC,CAAC;IACjE,IAAAqB,sBAAe,EAAC,MAAM;MACpBtB,SAAS,CAACE,OAAO,GAAGsE,OAAO,CAACC,cAAc;MAC1C,OAAO,MAAM;QACXzE,SAAS,CAACE,OAAO,GAAG,KAAK;MAC3B,CAAC;IACH,CAAC,EAAE,CAACF,SAAS,EAAEwE,OAAO,CAACC,cAAc,CAAC,CAAC;IACvC,OAAO,IAAI;EACb,CAAC;AACH","ignoreList":[]}
|
|
@@ -3,7 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.SCROLL_USER_TAKEOVER_EVENTS = void 0;
|
|
6
|
+
exports.SCROLL_USER_TAKEOVER_EVENTS = exports.SCROLL_RESTORE_TOLERANCE_PX = void 0;
|
|
7
7
|
/** Inputs that transfer control of scrolling from restoration to the reader. */
|
|
8
8
|
const SCROLL_USER_TAKEOVER_EVENTS = exports.SCROLL_USER_TAKEOVER_EVENTS = ['wheel', 'touchstart', 'pointerdown', 'keydown'];
|
|
9
|
+
|
|
10
|
+
/** Fractional CSS pixels may round when the browser accepts a restored offset. */
|
|
11
|
+
const SCROLL_RESTORE_TOLERANCE_PX = exports.SCROLL_RESTORE_TOLERANCE_PX = 2;
|
|
9
12
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SCROLL_USER_TAKEOVER_EVENTS","exports"],"sourceRoot":"../../../src","sources":["scroll/constants.ts"],"mappings":";;;;;;AAAA;AACO,MAAMA,2BAA2B,GAAAC,OAAA,CAAAD,2BAAA,GAAG,CACzC,OAAO,EACP,YAAY,EACZ,aAAa,EACb,SAAS,CACD","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["SCROLL_USER_TAKEOVER_EVENTS","exports","SCROLL_RESTORE_TOLERANCE_PX"],"sourceRoot":"../../../src","sources":["scroll/constants.ts"],"mappings":";;;;;;AAAA;AACO,MAAMA,2BAA2B,GAAAC,OAAA,CAAAD,2BAAA,GAAG,CACzC,OAAO,EACP,YAAY,EACZ,aAAa,EACb,SAAS,CACD;;AAEV;AACO,MAAME,2BAA2B,GAAAD,OAAA,CAAAC,2BAAA,GAAG,CAAC","ignoreList":[]}
|
|
@@ -3,26 +3,34 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports.readScrollOwnerHandoff = readScrollOwnerHandoff;
|
|
6
7
|
exports.recordScrollOwnerHandoff = recordScrollOwnerHandoff;
|
|
7
8
|
exports.takeScrollOwnerHandoff = takeScrollOwnerHandoff;
|
|
8
9
|
var _constants = require("./constants.js");
|
|
9
|
-
/**
|
|
10
|
+
/** One restoration claim; keep its intent until the owner accepts it or the user takes over. */
|
|
10
11
|
const offsets = new WeakMap();
|
|
11
|
-
function recordScrollOwnerHandoff(owner, offset) {
|
|
12
|
+
function recordScrollOwnerHandoff(owner, offset, onTakeOver) {
|
|
12
13
|
offsets.get(owner)?.release();
|
|
13
14
|
const target = owner;
|
|
14
15
|
let userTookOver = false;
|
|
16
|
+
const current = () => typeof window !== 'undefined' && owner === window ? window.scrollY : target.scrollTop;
|
|
15
17
|
const observe = () => {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
if (typeof
|
|
18
|
+
const value = current();
|
|
19
|
+
if (value !== undefined && Math.abs(value - transfer.offset) <= _constants.SCROLL_RESTORE_TOLERANCE_PX) transfer.pending = false;
|
|
20
|
+
if (userTookOver && typeof value === 'number' && Number.isFinite(value)) transfer.offset = Math.max(0, value);
|
|
21
|
+
if (transfer.consumed && !transfer.pending) transfer.release();
|
|
19
22
|
};
|
|
20
23
|
const takeOver = () => {
|
|
21
24
|
userTookOver = true;
|
|
25
|
+
transfer.pending = false;
|
|
22
26
|
observe();
|
|
27
|
+
onTakeOver?.(transfer.offset);
|
|
23
28
|
};
|
|
24
29
|
const transfer = {
|
|
25
30
|
offset,
|
|
31
|
+
consumed: false,
|
|
32
|
+
pending: true,
|
|
33
|
+
current,
|
|
26
34
|
release() {
|
|
27
35
|
// A departed Screen must not delete a newer Screen's transfer on the
|
|
28
36
|
// shared window owner. Release belongs to this transfer, not its node.
|
|
@@ -46,7 +54,19 @@ function recordScrollOwnerHandoff(owner, offset) {
|
|
|
46
54
|
}
|
|
47
55
|
function takeScrollOwnerHandoff(owner) {
|
|
48
56
|
const transfer = offsets.get(owner);
|
|
49
|
-
transfer
|
|
50
|
-
|
|
57
|
+
if (!transfer || transfer.consumed) return undefined;
|
|
58
|
+
transfer.consumed = true;
|
|
59
|
+
readScrollOwnerHandoff(owner);
|
|
60
|
+
return transfer.offset;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** Geometry can clamp a receiving owner before its virtual content is ready. */
|
|
64
|
+
function readScrollOwnerHandoff(owner) {
|
|
65
|
+
const transfer = offsets.get(owner);
|
|
66
|
+
if (!transfer) return undefined;
|
|
67
|
+
const current = transfer.current();
|
|
68
|
+
if (current !== undefined && Math.abs(current - transfer.offset) <= _constants.SCROLL_RESTORE_TOLERANCE_PX) transfer.pending = false;
|
|
69
|
+
if (transfer.consumed && !transfer.pending) transfer.release();
|
|
70
|
+
return transfer.pending ? transfer.offset : undefined;
|
|
51
71
|
}
|
|
52
72
|
//# sourceMappingURL=owner-handoff.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_constants","require","offsets","WeakMap","recordScrollOwnerHandoff","owner","offset","get","release","target","userTookOver","
|
|
1
|
+
{"version":3,"names":["_constants","require","offsets","WeakMap","recordScrollOwnerHandoff","owner","offset","onTakeOver","get","release","target","userTookOver","current","window","scrollY","scrollTop","observe","value","undefined","Math","abs","transfer","SCROLL_RESTORE_TOLERANCE_PX","pending","Number","isFinite","max","consumed","takeOver","delete","removeEventListener","event","SCROLL_USER_TAKEOVER_EVENTS","set","addEventListener","passive","takeScrollOwnerHandoff","readScrollOwnerHandoff"],"sourceRoot":"../../../src","sources":["scroll/owner-handoff.ts"],"mappings":";;;;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAEA;AACA,MAAMC,OAAO,GAAG,IAAIC,OAAO,CASzB,CAAC;AAEI,SAASC,wBAAwBA,CACtCC,KAAa,EACbC,MAAc,EACdC,UAAqC,EACrC;EACAL,OAAO,CAACM,GAAG,CAACH,KAAK,CAAC,EAAEI,OAAO,CAAC,CAAC;EAC7B,MAAMC,MAAM,GAAGL,KAAsD;EACrE,IAAIM,YAAY,GAAG,KAAK;EACxB,MAAMC,OAAO,GAAGA,CAAA,KACd,OAAOC,MAAM,KAAK,WAAW,IAAIR,KAAK,KAAKQ,MAAM,GAAGA,MAAM,CAACC,OAAO,GAAGJ,MAAM,CAACK,SAAS;EACvF,MAAMC,OAAO,GAAGA,CAAA,KAAM;IACpB,MAAMC,KAAK,GAAGL,OAAO,CAAC,CAAC;IACvB,IAAIK,KAAK,KAAKC,SAAS,IAAIC,IAAI,CAACC,GAAG,CAACH,KAAK,GAAGI,QAAQ,CAACf,MAAM,CAAC,IAAIgB,sCAA2B,EACzFD,QAAQ,CAACE,OAAO,GAAG,KAAK;IAC1B,IAAIZ,YAAY,IAAI,OAAOM,KAAK,KAAK,QAAQ,IAAIO,MAAM,CAACC,QAAQ,CAACR,KAAK,CAAC,EACrEI,QAAQ,CAACf,MAAM,GAAGa,IAAI,CAACO,GAAG,CAAC,CAAC,EAAET,KAAK,CAAC;IACtC,IAAII,QAAQ,CAACM,QAAQ,IAAI,CAACN,QAAQ,C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T,SAAS;EACpDG,QAAQ,CAACM,QAAQ,GAAG,IAAI;EACxBU,sBAAsB,CAAChC,KAAK,CAAC;EAC7B,OAAOgB,QAAQ,CAACf,MAAM;AACxB;;AAEA;AACO,SAAS+B,sBAAsBA,CAAChC,KAAa,EAAsB;EACxE,MAAMgB,QAAQ,GAAGnB,OAAO,CAACM,GAAG,CAACH,KAAK,CAAC;EACnC,IAAI,CAACgB,QAAQ,EAAE,OAAOH,SAAS;EAC/B,MAAMN,OAAO,GAAGS,QAAQ,CAACT,OAAO,CAAC,CAAC;EAClC,IAAIA,OAAO,KAAKM,SAAS,IAAIC,IAAI,CAACC,GAAG,CAACR,OAAO,GAAGS,QAAQ,CAACf,MAAM,CAAC,IAAIgB,sCAA2B,EAC7FD,QAAQ,CAACE,OAAO,GAAG,KAAK;EAC1B,IAAIF,QAAQ,CAACM,QAAQ,IAAI,CAACN,QAAQ,CAACE,OAAO,EAAEF,QAAQ,CAACZ,OAAO,CAAC,CAAC;EAC9D,OAAOY,QAAQ,CAACE,OAAO,GAAGF,QAAQ,CAACf,MAAM,GAAGY,SAAS;AACvD","ignoreList":[]}
|
|
@@ -61,15 +61,6 @@ var _ownerHandoff = require("./owner-handoff.js");
|
|
|
61
61
|
*/
|
|
62
62
|
const RESTORE_FRAME_CAP = 30;
|
|
63
63
|
|
|
64
|
-
/**
|
|
65
|
-
* Tolerance (in CSS pixels) for considering a restore "stuck". After writing
|
|
66
|
-
* `element.scrollTop = target`, the browser may clamp it to the current
|
|
67
|
-
* `scrollHeight - clientHeight`; if the resulting offset is within this many
|
|
68
|
-
* pixels of the target we treat the restore as complete. Sub-pixel rounding and
|
|
69
|
-
* fractional device-pixel ratios make an exact equality check unreliable.
|
|
70
|
-
*/
|
|
71
|
-
const RESTORE_STICK_TOLERANCE_PX = 2;
|
|
72
|
-
|
|
73
64
|
/**
|
|
74
65
|
* This platform observes offsets by subscribing to the resolved DOM node's own
|
|
75
66
|
* `scroll` event, so it needs nothing from the caller. The handler is still
|
|
@@ -218,7 +209,7 @@ function useScrollRestoration(target, options) {
|
|
|
218
209
|
// the last trusted offset (or the arrival target before any live save)
|
|
219
210
|
// actually exceeds that bottom. Keep that baseline across repeated
|
|
220
211
|
// clamp events so a second event cannot overwrite the original target.
|
|
221
|
-
if (maxOffset < maxOffsetAtLastSave && (lastObservedOffset ?? targetOffset) > maxOffset && Math.abs(offset - maxOffset) <=
|
|
212
|
+
if (maxOffset < maxOffsetAtLastSave && (lastObservedOffset ?? targetOffset) > maxOffset && Math.abs(offset - maxOffset) <= _constants.SCROLL_RESTORE_TOLERANCE_PX) {
|
|
222
213
|
return;
|
|
223
214
|
}
|
|
224
215
|
if (offset === echoOffset) {
|
|
@@ -294,7 +285,7 @@ function useScrollRestoration(target, options) {
|
|
|
294
285
|
echoOffset = landed;
|
|
295
286
|
// Stop once the write took effect (content grew tall enough) or we
|
|
296
287
|
// exhaust the frame budget.
|
|
297
|
-
const reached = Math.abs(landed - targetOffset) <=
|
|
288
|
+
const reached = Math.abs(landed - targetOffset) <= _constants.SCROLL_RESTORE_TOLERANCE_PX;
|
|
298
289
|
if (!reached && framesLeft > 0) {
|
|
299
290
|
rafId = requestAnimationFrame(applyOffset);
|
|
300
291
|
} else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_context","_constants","_scrollableWeb","_store","_ownerHandoff","RESTORE_FRAME_CAP","
|
|
1
|
+
{"version":3,"names":["_react","require","_context","_constants","_scrollableWeb","_store","_ownerHandoff","RESTORE_FRAME_CAP","WEB_ON_SCROLL","undefined","USER_TAKEOVER_EVENTS","SCROLL_USER_TAKEOVER_EVENTS","useScrollRestoration","target","options","store","adapter","useScrollRestorationContext","contentId","useScreenContentId","enabled","scrollKey","deriveScrollKey","key","resetKeyRef","useRef","restorePending","setRestorePending","useState","read","useScreenFocusEffect","useCallback","resolved","resolveScrollTarget","scroller","createScroller","element","window","resolveScrollEventTarget","handedOff","takeScrollOwnerHandoff","save","lastObservedOffset","echoOffset","maxOffsetAtLastSave","getMaxOffset","offset","getOffset","maxOffset","targetOffset","Math","abs","RESTORE_STICK_TOLERANCE_PX","isReset","has","alreadyReset","current","rafId","stopWaitingForContent","stopRestore","cancelAnimationFrame","setOffset","requestAnimationFrame","framesLeft","applyOffset","landed","reached","node","document","documentElement","HTMLElement","observeContentGrowth","type","addEventListener","passive","removeEventListener","flush","useMemo","onScroll","EventTarget","handle","getScrollableNode","retry","resize","ResizeObserver","observeChildren","disconnect","observe","child","Array","from","children","mutation","MutationObserver","childList","subtree","characterData"],"sourceRoot":"../../../src","sources":["scroll/use-scroll-restoration.web.ts"],"mappings":";;;;;;AAwCA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AAIA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AAjDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAiBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMM,iBAAiB,GAAG,EAAE;;AAE5B;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,aAAmD,GAAGA,CAAA,KAAMC,SAAS;;AAE3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,oBAAoB,GAAGC,sCAA2B;;AAExD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,oBAAoBA,CAClC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;EACDH,eAAe,CAAC,CAAC;EACjB,MAAMO,QAAQ,GACZ,OAAOC,gBAAgB,KAAK,WAAW,GACnC,IAAI,GACJ,IAAIA,gBAAgB,CAAC,MAAM;IACzBR,eAAe,CAAC,CAAC;IACjBH,KAAK,CAAC,CAAC;EACT,CAAC,CAAC;EACRU,QAAQ,EAAEL,OAAO,CAACpB,IAAI,EAAE;IAAE2B,SAAS,EAAE,IAAI;IAAEC,OAAO,EAAE,IAAI;IAAEC,aAAa,EAAE;EAAK,CAAC,CAAC;EAChF,OAAO,MAAM;IACXb,MAAM,EAAEG,UAAU,CAAC,CAAC;IACpBM,QAAQ,EAAEN,UAAU,CAAC,CAAC;EACxB,CAAC;AACH","ignoreList":[]}
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.Sidebar = void 0;
|
|
7
|
+
var _arrangement = require("./arrangement.js");
|
|
7
8
|
var _paint = require("../theme/paint.js");
|
|
8
9
|
var _surfaceLevels = require("../styles/surface-levels.js");
|
|
9
10
|
var _resolveSurfaceMaterial = require("../surface/resolve-surface-material.js");
|
|
@@ -155,6 +156,7 @@ const SidebarPanel = ({
|
|
|
155
156
|
primaryAction,
|
|
156
157
|
primaryActionPlacement = 'bottom',
|
|
157
158
|
contentAlignment = 'start',
|
|
159
|
+
arrangement,
|
|
158
160
|
content,
|
|
159
161
|
onScroll,
|
|
160
162
|
footer,
|
|
@@ -785,6 +787,10 @@ const SidebarPanel = ({
|
|
|
785
787
|
|
|
786
788
|
// Keep the same children mounted while the header changes from a row to a
|
|
787
789
|
// column. Numeric positions share the panel clock, including reversals.
|
|
790
|
+
const placed = (0, _arrangement.resolveSidebarArrangement)(contentAlignment, arrangement);
|
|
791
|
+
// The logo and its account menu move into the centred group only where the panel draws its own
|
|
792
|
+
// header row: a consumer's `header` replaces the row, and the mobile drawer keeps its own.
|
|
793
|
+
const identityGrouped = !mobile && header == null && Boolean(logo || accountMenu) && placed.logo === 'group';
|
|
788
794
|
const headerRow = mobile ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
789
795
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
790
796
|
style: {
|
|
@@ -821,7 +827,7 @@ const SidebarPanel = ({
|
|
|
821
827
|
width: '100%',
|
|
822
828
|
position: 'relative'
|
|
823
829
|
}, headerGeometry],
|
|
824
|
-
children: [logo || accountMenu ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.View, {
|
|
830
|
+
children: [!identityGrouped && (logo || accountMenu) ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.View, {
|
|
825
831
|
style: [{
|
|
826
832
|
position: 'absolute',
|
|
827
833
|
insetInlineStart: 0,
|
|
@@ -847,7 +853,7 @@ const SidebarPanel = ({
|
|
|
847
853
|
}, headerControlGeometry],
|
|
848
854
|
children: headerControl
|
|
849
855
|
})]
|
|
850
|
-
}), logo ? accountMenu : null]
|
|
856
|
+
}), !identityGrouped && logo ? accountMenu : null]
|
|
851
857
|
});
|
|
852
858
|
const treeView = shownSections.map(({
|
|
853
859
|
section,
|
|
@@ -864,6 +870,109 @@ const SidebarPanel = ({
|
|
|
864
870
|
onTreeItemPress: onTreeItemPress,
|
|
865
871
|
palette: palette
|
|
866
872
|
}, section.key ?? section.label));
|
|
873
|
+
|
|
874
|
+
// Anything grouped is centred with the destinations in the room above the persistent footer;
|
|
875
|
+
// what is not stays pinned (the controls at the top, the footer at the bottom).
|
|
876
|
+
const {
|
|
877
|
+
centred
|
|
878
|
+
} = placed;
|
|
879
|
+
const actionPlacement = arrangement?.primaryAction ?? (primaryActionPlacement === 'top' ? 'top' : placed.primaryAction);
|
|
880
|
+
const primaryActionNode = primaryAction ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_SidebarPrimaryAction.SidebarPrimaryAction, {
|
|
881
|
+
action: primaryAction,
|
|
882
|
+
collapsed: collapsed,
|
|
883
|
+
placement: actionPlacement === 'top' ? 'top' : undefined,
|
|
884
|
+
testID: testID ? `${testID}-primary-action` : undefined
|
|
885
|
+
}) : null;
|
|
886
|
+
const identityNode = identityGrouped ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeReanimated.default.View, {
|
|
887
|
+
style: [{
|
|
888
|
+
width: '100%',
|
|
889
|
+
gap: 12,
|
|
890
|
+
paddingBottom: 12
|
|
891
|
+
}, scrollInsets],
|
|
892
|
+
children: [logo ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_SidebarLogoView.SidebarLogoView, {
|
|
893
|
+
logo: logo,
|
|
894
|
+
collapsed: collapsed,
|
|
895
|
+
testID: "sidebar-logo"
|
|
896
|
+
}) : accountMenu, logo ? accountMenu : null]
|
|
897
|
+
}) : null;
|
|
898
|
+
const headerNode = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeReanimated.default.View, {
|
|
899
|
+
testID: `${testID ?? 'sidebar'}-fixed-header`,
|
|
900
|
+
style: [{
|
|
901
|
+
width: '100%',
|
|
902
|
+
gap: 12,
|
|
903
|
+
paddingTop: Math.max(expandedPadding, windowControlsRoom),
|
|
904
|
+
paddingBottom: 12
|
|
905
|
+
}, scrollInsets],
|
|
906
|
+
children: [header != null ? typeof header === 'function' ? header({
|
|
907
|
+
collapsed
|
|
908
|
+
}) : header : headerRow, typeof toolbar === 'function' ? toolbar({
|
|
909
|
+
collapsed
|
|
910
|
+
}) : toolbar, actionPlacement === 'top' ? primaryActionNode : null, inlineModes ? null : modeSwitcher, showSearch && !flatMobile ? searchButton : null]
|
|
911
|
+
});
|
|
912
|
+
const mainRegion = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeReanimated.default.View, {
|
|
913
|
+
testID: `${testID ?? 'sidebar'}-main-region`,
|
|
914
|
+
style: [{
|
|
915
|
+
width: '100%',
|
|
916
|
+
flexGrow: centred ? 0 : 1,
|
|
917
|
+
paddingBottom: 8,
|
|
918
|
+
gap: hasSections ? 24 : 0
|
|
919
|
+
}, scrollInsets],
|
|
920
|
+
children: [shownItems.length > 0 || !hasTree ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.View, {
|
|
921
|
+
collapsable: false,
|
|
922
|
+
role: "navigation",
|
|
923
|
+
style: [{
|
|
924
|
+
width: '100%',
|
|
925
|
+
gap: 4
|
|
926
|
+
}, !hasTree && navInset],
|
|
927
|
+
children: nothingMatches && !hasTree ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_index5.Text, {
|
|
928
|
+
variant: "body-regular",
|
|
929
|
+
style: {
|
|
930
|
+
paddingLeft: 8,
|
|
931
|
+
paddingRight: 8,
|
|
932
|
+
paddingTop: 12,
|
|
933
|
+
paddingBottom: 12,
|
|
934
|
+
color: palette.textTertiary
|
|
935
|
+
},
|
|
936
|
+
children: noResultsLabel
|
|
937
|
+
}) : shownItems.map(renderRow)
|
|
938
|
+
}) : null, onboarding && !collapsed ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_SidebarOnboardingCard.SidebarOnboardingCard, {
|
|
939
|
+
...onboarding,
|
|
940
|
+
testID: onboarding.testID ?? `${testID ?? 'sidebar'}-onboarding`
|
|
941
|
+
}) : null, collapsed || shownSections.length === 0 ? null : onTreeItemDrop ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_SidebarTreeDrag.TreeDragProvider, {
|
|
942
|
+
sections: sections,
|
|
943
|
+
onDrop: onTreeItemDrop,
|
|
944
|
+
movedLabel: messages.moved,
|
|
945
|
+
scroll: treeScroll,
|
|
946
|
+
children: treeView
|
|
947
|
+
}) : treeView, content != null ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.View, {
|
|
948
|
+
testID: `${testID ?? 'sidebar'}-content`,
|
|
949
|
+
pointerEvents: collapsed ? 'none' : 'auto',
|
|
950
|
+
"aria-hidden": collapsed,
|
|
951
|
+
accessibilityElementsHidden: collapsed,
|
|
952
|
+
importantForAccessibility: collapsed ? 'no-hide-descendants' : 'auto',
|
|
953
|
+
...(_platform.IS_WEB && collapsed ? {
|
|
954
|
+
inert: true
|
|
955
|
+
} : {}),
|
|
956
|
+
ref: contentFade.ref,
|
|
957
|
+
style: [{
|
|
958
|
+
overflow: 'hidden',
|
|
959
|
+
flexShrink: 0
|
|
960
|
+
}, contentMorph, contentFade.style],
|
|
961
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.View, {
|
|
962
|
+
onLayout: event => setContentHeight(event.nativeEvent.layout.height),
|
|
963
|
+
style: contentWidth,
|
|
964
|
+
children: content
|
|
965
|
+
})
|
|
966
|
+
}) : null, nothingMatches && hasTree ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_index5.Text, {
|
|
967
|
+
variant: "body-regular",
|
|
968
|
+
style: {
|
|
969
|
+
paddingLeft: 8,
|
|
970
|
+
paddingRight: 8,
|
|
971
|
+
color: palette.textTertiary
|
|
972
|
+
},
|
|
973
|
+
children: noResultsLabel
|
|
974
|
+
}) : null]
|
|
975
|
+
});
|
|
867
976
|
const sidebar = /*#__PURE__*/(0, _jsxRuntime.jsx)(_metrics.SidebarSizeProvider, {
|
|
868
977
|
value: size,
|
|
869
978
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_geometry.SidebarGeometryProvider, {
|
|
@@ -917,25 +1026,7 @@ const SidebarPanel = ({
|
|
|
917
1026
|
contentContainerStyle: {
|
|
918
1027
|
flexGrow: 1
|
|
919
1028
|
},
|
|
920
|
-
stickyHeader:
|
|
921
|
-
testID: `${testID ?? 'sidebar'}-fixed-header`,
|
|
922
|
-
style: [{
|
|
923
|
-
width: '100%',
|
|
924
|
-
gap: 12,
|
|
925
|
-
paddingTop: Math.max(expandedPadding, windowControlsRoom),
|
|
926
|
-
paddingBottom: 12
|
|
927
|
-
}, scrollInsets],
|
|
928
|
-
children: [header != null ? typeof header === 'function' ? header({
|
|
929
|
-
collapsed
|
|
930
|
-
}) : header : headerRow, typeof toolbar === 'function' ? toolbar({
|
|
931
|
-
collapsed
|
|
932
|
-
}) : toolbar, primaryAction && primaryActionPlacement === 'top' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_SidebarPrimaryAction.SidebarPrimaryAction, {
|
|
933
|
-
action: primaryAction,
|
|
934
|
-
collapsed: collapsed,
|
|
935
|
-
placement: "top",
|
|
936
|
-
testID: testID ? `${testID}-primary-action` : undefined
|
|
937
|
-
}) : null, inlineModes ? null : modeSwitcher, showSearch && !flatMobile ? searchButton : null]
|
|
938
|
-
}),
|
|
1029
|
+
stickyHeader: headerNode,
|
|
939
1030
|
stickyFooter: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeReanimated.default.View, {
|
|
940
1031
|
testID: `${testID ?? 'sidebar'}-sticky-footer`,
|
|
941
1032
|
style: [{
|
|
@@ -944,11 +1035,7 @@ const SidebarPanel = ({
|
|
|
944
1035
|
paddingTop: hasTree ? 12 : 0,
|
|
945
1036
|
paddingBottom: expandedPadding
|
|
946
1037
|
}, scrollInsets],
|
|
947
|
-
children: [
|
|
948
|
-
action: primaryAction,
|
|
949
|
-
collapsed: collapsed,
|
|
950
|
-
testID: testID ? `${testID}-primary-action` : undefined
|
|
951
|
-
}) : null, showThemeToggle ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeReanimated.default.View, {
|
|
1038
|
+
children: [actionPlacement === 'bottom' ? primaryActionNode : null, showThemeToggle ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeReanimated.default.View, {
|
|
952
1039
|
testID: "sidebar-theme-morph",
|
|
953
1040
|
style: [{
|
|
954
1041
|
position: 'relative',
|
|
@@ -1037,69 +1124,16 @@ const SidebarPanel = ({
|
|
|
1037
1124
|
}) : footer
|
|
1038
1125
|
}) : null]
|
|
1039
1126
|
}),
|
|
1040
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(
|
|
1041
|
-
|
|
1042
|
-
style: [{
|
|
1043
|
-
width: '100%',
|
|
1127
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
1128
|
+
style: {
|
|
1044
1129
|
flexGrow: 1,
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
}, scrollInsets],
|
|
1049
|
-
children: [shownItems.length > 0 || !hasTree ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.View, {
|
|
1050
|
-
collapsable: false,
|
|
1051
|
-
role: "navigation",
|
|
1130
|
+
justifyContent: centred ? 'center' : undefined
|
|
1131
|
+
},
|
|
1132
|
+
children: [identityNode, mainRegion, actionPlacement === 'group' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.View, {
|
|
1052
1133
|
style: [{
|
|
1053
|
-
width: '100%'
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
children: nothingMatches && !hasTree ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_index5.Text, {
|
|
1057
|
-
variant: "body-regular",
|
|
1058
|
-
style: {
|
|
1059
|
-
paddingLeft: 8,
|
|
1060
|
-
paddingRight: 8,
|
|
1061
|
-
paddingTop: 12,
|
|
1062
|
-
paddingBottom: 12,
|
|
1063
|
-
color: palette.textTertiary
|
|
1064
|
-
},
|
|
1065
|
-
children: noResultsLabel
|
|
1066
|
-
}) : shownItems.map(renderRow)
|
|
1067
|
-
}) : null, onboarding && !collapsed ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_SidebarOnboardingCard.SidebarOnboardingCard, {
|
|
1068
|
-
...onboarding,
|
|
1069
|
-
testID: onboarding.testID ?? `${testID ?? 'sidebar'}-onboarding`
|
|
1070
|
-
}) : null, collapsed || shownSections.length === 0 ? null : onTreeItemDrop ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_SidebarTreeDrag.TreeDragProvider, {
|
|
1071
|
-
sections: sections,
|
|
1072
|
-
onDrop: onTreeItemDrop,
|
|
1073
|
-
movedLabel: messages.moved,
|
|
1074
|
-
scroll: treeScroll,
|
|
1075
|
-
children: treeView
|
|
1076
|
-
}) : treeView, content != null ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.View, {
|
|
1077
|
-
testID: `${testID ?? 'sidebar'}-content`,
|
|
1078
|
-
pointerEvents: collapsed ? 'none' : 'auto',
|
|
1079
|
-
"aria-hidden": collapsed,
|
|
1080
|
-
accessibilityElementsHidden: collapsed,
|
|
1081
|
-
importantForAccessibility: collapsed ? 'no-hide-descendants' : 'auto',
|
|
1082
|
-
...(_platform.IS_WEB && collapsed ? {
|
|
1083
|
-
inert: true
|
|
1084
|
-
} : {}),
|
|
1085
|
-
ref: contentFade.ref,
|
|
1086
|
-
style: [{
|
|
1087
|
-
overflow: 'hidden',
|
|
1088
|
-
flexShrink: 0
|
|
1089
|
-
}, contentMorph, contentFade.style],
|
|
1090
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.View, {
|
|
1091
|
-
onLayout: event => setContentHeight(event.nativeEvent.layout.height),
|
|
1092
|
-
style: contentWidth,
|
|
1093
|
-
children: content
|
|
1094
|
-
})
|
|
1095
|
-
}) : null, nothingMatches && hasTree ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_index5.Text, {
|
|
1096
|
-
variant: "body-regular",
|
|
1097
|
-
style: {
|
|
1098
|
-
paddingLeft: 8,
|
|
1099
|
-
paddingRight: 8,
|
|
1100
|
-
color: palette.textTertiary
|
|
1101
|
-
},
|
|
1102
|
-
children: noResultsLabel
|
|
1134
|
+
width: '100%'
|
|
1135
|
+
}, scrollInsets],
|
|
1136
|
+
children: primaryActionNode
|
|
1103
1137
|
}) : null]
|
|
1104
1138
|
})
|
|
1105
1139
|
})]
|