@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
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { useEffect, useLayoutEffect, useMemo, useRef } from 'react';
|
|
3
|
+
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef } from 'react';
|
|
4
4
|
import { Platform } from 'react-native';
|
|
5
5
|
import { useSharedValue } from 'react-native-reanimated';
|
|
6
6
|
import { animateMotion } from "../motion/recipes.js";
|
|
7
7
|
import { useOptionalScrollRestorationContext } from "../scroll/context.js";
|
|
8
|
-
import { recordScrollOwnerHandoff } from "../scroll/owner-handoff.js";
|
|
8
|
+
import { readScrollOwnerHandoff, recordScrollOwnerHandoff } from "../scroll/owner-handoff.js";
|
|
9
9
|
import { useRegisterScreenScroller } from "./reselect.js";
|
|
10
10
|
import { usePrefersReducedMotion } from "../hooks/use-prefers-reduced-motion.js";
|
|
11
|
+
// Retained route Screens can share one panel metric. An outgoing cleanup must
|
|
12
|
+
// not clear the next Screen's measurement.
|
|
13
|
+
const intrinsicOwners = new WeakMap();
|
|
11
14
|
const useNoContentId = () => null;
|
|
12
15
|
|
|
13
16
|
/** Observes the existing owner for chrome/restoration; never computes layout styles. */
|
|
@@ -29,6 +32,30 @@ export function useScreenViewportBinding(screen, enabled, documentFlow, reserved
|
|
|
29
32
|
const restoring = useRef(false);
|
|
30
33
|
const active = useRef(screen.active);
|
|
31
34
|
active.current = screen.active;
|
|
35
|
+
const intrinsicScope = useMemo(() => ({
|
|
36
|
+
sources: new Map()
|
|
37
|
+
}), [contentId, metrics]);
|
|
38
|
+
const currentIntrinsicScope = useRef(intrinsicScope);
|
|
39
|
+
currentIntrinsicScope.current = intrinsicScope;
|
|
40
|
+
const setIntrinsicContentHeight = useCallback((source, height) => {
|
|
41
|
+
const metric = metrics.intrinsicContentHeight;
|
|
42
|
+
if (!metric || currentIntrinsicScope.current !== intrinsicScope) return;
|
|
43
|
+
if (height === null) intrinsicScope.sources.delete(source);else if (enabled && active.current) intrinsicScope.sources.set(source, height);else return;
|
|
44
|
+
if (height !== null) intrinsicOwners.set(metrics, intrinsicScope);
|
|
45
|
+
if (intrinsicOwners.get(metrics) !== intrinsicScope) return;
|
|
46
|
+
const values = [...intrinsicScope.sources.values()];
|
|
47
|
+
metric.value = values.length && values.every(value => value >= 0) ? Math.max(...values) : -1;
|
|
48
|
+
}, [enabled, intrinsicScope, metrics]);
|
|
49
|
+
useLayoutEffect(() => {
|
|
50
|
+
if (!enabled || !screen.active) return;
|
|
51
|
+
return () => {
|
|
52
|
+
intrinsicScope.sources.clear();
|
|
53
|
+
if (intrinsicOwners.get(metrics) === intrinsicScope) {
|
|
54
|
+
intrinsicOwners.delete(metrics);
|
|
55
|
+
if (metrics.intrinsicContentHeight) metrics.intrinsicContentHeight.value = -1;
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
}, [enabled, screen.active, intrinsicScope, metrics]);
|
|
32
59
|
const reducedMotion = usePrefersReducedMotion();
|
|
33
60
|
const owner = useRef(null);
|
|
34
61
|
// A layout change can clamp the outgoing document before it dispatches its
|
|
@@ -37,11 +64,13 @@ export function useScreenViewportBinding(screen, enabled, documentFlow, reserved
|
|
|
37
64
|
useLayoutEffect(() => {
|
|
38
65
|
if (!enabled || !web || typeof window === 'undefined') return;
|
|
39
66
|
const previous = owner.current;
|
|
67
|
+
const element = scrollRef.current;
|
|
68
|
+
const target = documentFlow ? window : element;
|
|
40
69
|
let releaseHandoff;
|
|
41
70
|
if (previous && previous.contentId === contentId && previous.documentFlow !== documentFlow && previous.active && screen.active) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
71
|
+
if (target) releaseHandoff = recordScrollOwnerHandoff(target, previous.offset, offset => {
|
|
72
|
+
if (owner.current?.documentFlow === documentFlow) owner.current.offset = offset;
|
|
73
|
+
});
|
|
45
74
|
if (documentFlow) window.scrollTo({
|
|
46
75
|
top: previous.offset,
|
|
47
76
|
behavior: 'instant'
|
|
@@ -51,7 +80,7 @@ export function useScreenViewportBinding(screen, enabled, documentFlow, reserved
|
|
|
51
80
|
contentId,
|
|
52
81
|
documentFlow,
|
|
53
82
|
active: screen.active,
|
|
54
|
-
offset: documentFlow ? window.scrollY :
|
|
83
|
+
offset: (target ? readScrollOwnerHandoff(target) : undefined) ?? (documentFlow ? window.scrollY : element?.scrollTop ?? 0)
|
|
55
84
|
};
|
|
56
85
|
// A newly mounted router sidecar can focus on a later commit. Retain the
|
|
57
86
|
// transfer for this active owner lifetime instead of expiring it during
|
|
@@ -68,7 +97,7 @@ export function useScreenViewportBinding(screen, enabled, documentFlow, reserved
|
|
|
68
97
|
const update = () => {
|
|
69
98
|
const node = documentFlow ? document.scrollingElement ?? document.documentElement : element;
|
|
70
99
|
const y = documentFlow ? window.scrollY : node.scrollTop;
|
|
71
|
-
if (owner.current?.documentFlow === documentFlow) owner.current.offset = Math.max(0, y);
|
|
100
|
+
if (owner.current?.documentFlow === documentFlow) owner.current.offset = readScrollOwnerHandoff(target) ?? Math.max(0, y);
|
|
72
101
|
metrics.scrollY.value = Math.max(0, y);
|
|
73
102
|
metrics.contentHeight.value = node.scrollHeight;
|
|
74
103
|
metrics.viewportHeight.value = Math.max(0, node.clientHeight - (documentFlow ? reserved : 0));
|
|
@@ -101,6 +130,8 @@ export function useScreenViewportBinding(screen, enabled, documentFlow, reserved
|
|
|
101
130
|
scrollRef: documentFlow ? null : scrollRef,
|
|
102
131
|
metrics,
|
|
103
132
|
active: screen.active,
|
|
133
|
+
contentRef,
|
|
134
|
+
setIntrinsicContentHeight,
|
|
104
135
|
scrollTo(options) {
|
|
105
136
|
if (!active.current) return;
|
|
106
137
|
if (web) {
|
|
@@ -118,7 +149,7 @@ export function useScreenViewportBinding(screen, enabled, documentFlow, reserved
|
|
|
118
149
|
});
|
|
119
150
|
}
|
|
120
151
|
}
|
|
121
|
-
}), [web, documentFlow, metrics, screen.active, scrollRef]);
|
|
152
|
+
}), [web, documentFlow, metrics, screen.active, scrollRef, setIntrinsicContentHeight]);
|
|
122
153
|
// The screen's own viewport answers a reselect, as the page: a list scrolling
|
|
123
154
|
// inside it wins.
|
|
124
155
|
useRegisterScreenScroller(enabled ? {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useEffect","useLayoutEffect","useMemo","useRef","Platform","useSharedValue","animateMotion","useOptionalScrollRestorationContext","recordScrollOwnerHandoff","useRegisterScreenScroller","usePrefersReducedMotion","useNoContentId","useScreenViewportBinding","screen","enabled","documentFlow","reserved","host","restoration","useContentId","OS","adapter","useScreenContentId","contentId","ownRef","scrollRef","contentRef","contentHeight","viewportHeight","metrics","scrollY","web","restoring","active","current","reducedMotion","owner","window","previous","
|
|
1
|
+
{"version":3,"names":["useCallback","useEffect","useLayoutEffect","useMemo","useRef","Platform","useSharedValue","animateMotion","useOptionalScrollRestorationContext","readScrollOwnerHandoff","recordScrollOwnerHandoff","useRegisterScreenScroller","usePrefersReducedMotion","intrinsicOwners","WeakMap","useNoContentId","useScreenViewportBinding","screen","enabled","documentFlow","reserved","host","restoration","useContentId","OS","adapter","useScreenContentId","contentId","ownRef","scrollRef","contentRef","contentHeight","viewportHeight","metrics","scrollY","web","restoring","active","current","intrinsicScope","sources","Map","currentIntrinsicScope","setIntrinsicContentHeight","source","height","metric","intrinsicContentHeight","delete","set","get","values","value","length","every","Math","max","clear","reducedMotion","owner","window","previous","element","target","releaseHandoff","offset","scrollTo","top","behavior","scrollTop","undefined","update","node","document","scrollingElement","documentElement","y","scrollHeight","clientHeight","delta","collapse","collapseTarget","collapseProgress","addEventListener","passive","observer","ResizeObserver","observe","Element","removeEventListener","disconnect","kind","options","left","x","animated","scrollToOffset","createScreenViewportRestoration","useScrollRestoration","ScreenViewportRestoration","binding","restorePending"],"sourceRoot":"../../../src","sources":["screen/use-screen-viewport.ts"],"mappings":";;AAAA,SACEA,WAAW,EACXC,SAAS,EACTC,eAAe,EACfC,OAAO,EACPC,MAAM,QAED,OAAO;AACd,SAASC,QAAQ,QAAQ,cAAc;AACvC,SAASC,cAAc,QAAQ,yBAAyB;AACxD,SAASC,aAAa,QAAQ,sBAAmB;AAIjD,SAASC,mCAAmC,QAAQ,sBAAmB;AACvE,SAASC,sBAAsB,EAAEC,wBAAwB,QAAQ,4BAAyB;AAE1F,SAASC,yBAAyB,QAAQ,eAAY;AACtD,SAASC,uBAAuB,QAAQ,wCAAqC;AAG7E;AACA;AACA,MAAMC,eAAe,GAAG,IAAIC,OAAO,CAAwB,CAAC;AAE5D,MAAMC,cAAc,GAAGA,CAAA,KAAM,IAAI;;AAEjC;AACA,OAAO,SAASC,wBAAwBA,CACtCC,MAA0B,EAC1BC,OAAgB,EAChBC,YAAqB,EACrBC,QAAgB,EAChBC,IAAsB,EACtB;EACA,MAAMC,WAAW,GAAGd,mCAAmC,CAAC,CAAC;EACzD,MAAMe,YAAY,GAChBlB,QAAQ,CAACmB,EAAE,KAAK,KAAK,GAChBF,WAAW,EAAEG,OAAO,CAACC,kBAAkB,IAAIX,cAAc,GAC1DA,cAAc;EACpB,MAAMY,SAAS,GAAGJ,YAAY,CAAC,CAAC;EAChC,MAAMK,MAAM,GAAGxB,MAAM,CAAU,IAAI,CAAC;EACpC,MAAMyB,SAAS,GAAGX,OAAO,IAAIG,IAAI,EAAEQ,SAAS,GAAGR,IAAI,CAACQ,SAAS,GAAGD,MAAM;EACtE,MAAME,UAAU,GAAG1B,MAAM,CAAU,IAAI,CAAC;EACxC,MAAM2B,aAAa,GAAGzB,cAAc,CAAC,CAAC,CAAC,CAAC;EACxC,MAAM0B,cAAc,GAAG1B,cAAc,CAAC,CAAC,CAAC;EACxC,MAAM2B,OAAO,GAAG9B,OAAO,CACrB,MACEe,OAAO,IAA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AC;EAAE,CAAC,GACrF,IAAI,EACR1D,OAAO,IAAID,MAAM,CAACoB,MAAM,EACxB,IACF,CAAC;EACD,OAAO;IAAEe,KAAK;IAAEvB,SAAS;IAAEC,UAAU;IAAEM;EAAU,CAAC;AACpD;;AAEA;AACA,OAAO,SAAS6D,+BAA+BA,CAACC,oBAAiD,EAAE;EACjG,OAAO,SAASC,yBAAyBA,CAAC;IACxCpC,MAAM;IACN1B,MAAM;IACND;EAKF,CAAC,EAAE;IACD,MAAMgE,OAAO,GAAGF,oBAAoB,CAACnC,MAAM,EAAE;MAAE7C,OAAO,EAAEmB;IAAO,CAAC,CAAC;IACjEnC,eAAe,CAAC,MAAM;MACpBkC,SAAS,CAACE,OAAO,GAAG8D,OAAO,CAACC,cAAc;MAC1C,OAAO,MAAM;QACXjE,SAAS,CAACE,OAAO,GAAG,KAAK;MAC3B,CAAC;IACH,CAAC,EAAE,CAACF,SAAS,EAAEgE,OAAO,CAACC,cAAc,CAAC,CAAC;IACvC,OAAO,IAAI;EACb,CAAC;AACH","ignoreList":[]}
|
|
@@ -2,4 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
/** Inputs that transfer control of scrolling from restoration to the reader. */
|
|
4
4
|
export const SCROLL_USER_TAKEOVER_EVENTS = ['wheel', 'touchstart', 'pointerdown', 'keydown'];
|
|
5
|
+
|
|
6
|
+
/** Fractional CSS pixels may round when the browser accepts a restored offset. */
|
|
7
|
+
export const SCROLL_RESTORE_TOLERANCE_PX = 2;
|
|
5
8
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SCROLL_USER_TAKEOVER_EVENTS"],"sourceRoot":"../../../src","sources":["scroll/constants.ts"],"mappings":";;AAAA;AACA,OAAO,MAAMA,2BAA2B,GAAG,CACzC,OAAO,EACP,YAAY,EACZ,aAAa,EACb,SAAS,CACD","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["SCROLL_USER_TAKEOVER_EVENTS","SCROLL_RESTORE_TOLERANCE_PX"],"sourceRoot":"../../../src","sources":["scroll/constants.ts"],"mappings":";;AAAA;AACA,OAAO,MAAMA,2BAA2B,GAAG,CACzC,OAAO,EACP,YAAY,EACZ,aAAa,EACb,SAAS,CACD;;AAEV;AACA,OAAO,MAAMC,2BAA2B,GAAG,CAAC","ignoreList":[]}
|
|
@@ -1,24 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { SCROLL_USER_TAKEOVER_EVENTS } from "./constants.js";
|
|
3
|
+
import { SCROLL_RESTORE_TOLERANCE_PX, SCROLL_USER_TAKEOVER_EVENTS } from "./constants.js";
|
|
4
4
|
|
|
5
|
-
/**
|
|
5
|
+
/** One restoration claim; keep its intent until the owner accepts it or the user takes over. */
|
|
6
6
|
const offsets = new WeakMap();
|
|
7
|
-
export function recordScrollOwnerHandoff(owner, offset) {
|
|
7
|
+
export function recordScrollOwnerHandoff(owner, offset, onTakeOver) {
|
|
8
8
|
offsets.get(owner)?.release();
|
|
9
9
|
const target = owner;
|
|
10
10
|
let userTookOver = false;
|
|
11
|
+
const current = () => typeof window !== 'undefined' && owner === window ? window.scrollY : target.scrollTop;
|
|
11
12
|
const observe = () => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
if (typeof
|
|
13
|
+
const value = current();
|
|
14
|
+
if (value !== undefined && Math.abs(value - transfer.offset) <= SCROLL_RESTORE_TOLERANCE_PX) transfer.pending = false;
|
|
15
|
+
if (userTookOver && typeof value === 'number' && Number.isFinite(value)) transfer.offset = Math.max(0, value);
|
|
16
|
+
if (transfer.consumed && !transfer.pending) transfer.release();
|
|
15
17
|
};
|
|
16
18
|
const takeOver = () => {
|
|
17
19
|
userTookOver = true;
|
|
20
|
+
transfer.pending = false;
|
|
18
21
|
observe();
|
|
22
|
+
onTakeOver?.(transfer.offset);
|
|
19
23
|
};
|
|
20
24
|
const transfer = {
|
|
21
25
|
offset,
|
|
26
|
+
consumed: false,
|
|
27
|
+
pending: true,
|
|
28
|
+
current,
|
|
22
29
|
release() {
|
|
23
30
|
// A departed Screen must not delete a newer Screen's transfer on the
|
|
24
31
|
// shared window owner. Release belongs to this transfer, not its node.
|
|
@@ -42,7 +49,19 @@ export function recordScrollOwnerHandoff(owner, offset) {
|
|
|
42
49
|
}
|
|
43
50
|
export function takeScrollOwnerHandoff(owner) {
|
|
44
51
|
const transfer = offsets.get(owner);
|
|
45
|
-
transfer
|
|
46
|
-
|
|
52
|
+
if (!transfer || transfer.consumed) return undefined;
|
|
53
|
+
transfer.consumed = true;
|
|
54
|
+
readScrollOwnerHandoff(owner);
|
|
55
|
+
return transfer.offset;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** Geometry can clamp a receiving owner before its virtual content is ready. */
|
|
59
|
+
export function readScrollOwnerHandoff(owner) {
|
|
60
|
+
const transfer = offsets.get(owner);
|
|
61
|
+
if (!transfer) return undefined;
|
|
62
|
+
const current = transfer.current();
|
|
63
|
+
if (current !== undefined && Math.abs(current - transfer.offset) <= SCROLL_RESTORE_TOLERANCE_PX) transfer.pending = false;
|
|
64
|
+
if (transfer.consumed && !transfer.pending) transfer.release();
|
|
65
|
+
return transfer.pending ? transfer.offset : undefined;
|
|
47
66
|
}
|
|
48
67
|
//# sourceMappingURL=owner-handoff.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SCROLL_USER_TAKEOVER_EVENTS","offsets","WeakMap","recordScrollOwnerHandoff","owner","offset","get","release","target","userTookOver","
|
|
1
|
+
{"version":3,"names":["SCROLL_RESTORE_TOLERANCE_PX","SCROLL_USER_TAKEOVER_EVENTS","offsets","WeakMap","recordScrollOwnerHandoff","owner","offset","onTakeOver","get","release","target","userTookOver","current","window","scrollY","scrollTop","observe","value","undefined","Math","abs","transfer","pending","Number","isFinite","max","consumed","takeOver","delete","removeEventListener","event","set","addEventListener","passive","takeScrollOwnerHandoff","readScrollOwnerHandoff"],"sourceRoot":"../../../src","sources":["scroll/owner-hand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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,IAAIN,2BAA2B,EAC7FqB,QAAQ,CAACC,OAAO,GAAG,KAAK;EAC1B,IAAID,QAAQ,CAACK,QAAQ,IAAI,CAACL,QAAQ,CAACC,OAAO,EAAED,QAAQ,CAACZ,OAAO,CAAC,CAAC;EAC9D,OAAOY,QAAQ,CAACC,OAAO,GAAGD,QAAQ,CAACf,MAAM,GAAGY,SAAS;AACvD","ignoreList":[]}
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
*/
|
|
43
43
|
import { useCallback, useMemo, useRef, useState } from 'react';
|
|
44
44
|
import { useScrollRestorationContext } from "./context.js";
|
|
45
|
-
import { SCROLL_USER_TAKEOVER_EVENTS } from "./constants.js";
|
|
45
|
+
import { SCROLL_RESTORE_TOLERANCE_PX as RESTORE_STICK_TOLERANCE_PX, SCROLL_USER_TAKEOVER_EVENTS } from "./constants.js";
|
|
46
46
|
import { createScroller, resolveScrollTarget } from "./scrollable.web.js";
|
|
47
47
|
import { deriveScrollKey } from "./store.js";
|
|
48
48
|
import { takeScrollOwnerHandoff } from "./owner-handoff.js";
|
|
@@ -56,15 +56,6 @@ import { takeScrollOwnerHandoff } from "./owner-handoff.js";
|
|
|
56
56
|
*/
|
|
57
57
|
const RESTORE_FRAME_CAP = 30;
|
|
58
58
|
|
|
59
|
-
/**
|
|
60
|
-
* Tolerance (in CSS pixels) for considering a restore "stuck". After writing
|
|
61
|
-
* `element.scrollTop = target`, the browser may clamp it to the current
|
|
62
|
-
* `scrollHeight - clientHeight`; if the resulting offset is within this many
|
|
63
|
-
* pixels of the target we treat the restore as complete. Sub-pixel rounding and
|
|
64
|
-
* fractional device-pixel ratios make an exact equality check unreliable.
|
|
65
|
-
*/
|
|
66
|
-
const RESTORE_STICK_TOLERANCE_PX = 2;
|
|
67
|
-
|
|
68
59
|
/**
|
|
69
60
|
* This platform observes offsets by subscribing to the resolved DOM node's own
|
|
70
61
|
* `scroll` event, so it needs nothing from the caller. The handler is still
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useCallback","useMemo","useRef","useState","useScrollRestorationContext","SCROLL_USER_TAKEOVER_EVENTS","createScroller","resolveScrollTarget","deriveScrollKey","takeScrollOwnerHandoff","RESTORE_FRAME_CAP","
|
|
1
|
+
{"version":3,"names":["useCallback","useMemo","useRef","useState","useScrollRestorationContext","SCROLL_RESTORE_TOLERANCE_PX","RESTORE_STICK_TOLERANCE_PX","SCROLL_USER_TAKEOVER_EVENTS","createScroller","resolveScrollTarget","deriveScrollKey","takeScrollOwnerHandoff","RESTORE_FRAME_CAP","WEB_ON_SCROLL","undefined","USER_TAKEOVER_EVENTS","useScrollRestoration","target","options","store","adapter","contentId","useScreenContentId","enabled","scrollKey","key","resetKeyRef","restorePending","setRestorePending","read","useScreenFocusEffect","resolved","scroller","element","window","resolveScrollEventTarget","handedOff","save","lastObservedOffset","echoOffset","maxOffsetAtLastSave","getMaxOffset","offset","getOffset","maxOffset","targetOffset","Math","abs","isReset","has","alreadyReset","current","rafId","stopWaitingForContent","stopRestore","cancelAnimationFrame","setOffset","requestAnimationFrame","framesLeft","applyOffset","landed","reached","node","document","documentElement","HTMLElement","observeContentGrowth","type","addEventListener","passive","removeEventListener","flush","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":";;AAAA;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;AAC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angement } from "./arrangement.js";
|
|
3
4
|
import { resolvePaintMode } from "../theme/paint.js";
|
|
4
5
|
import { SurfaceLevelProvider, surfaceFillVars, useSurfaceFill, useSurfaceLevelValue } from "../styles/surface-levels.js";
|
|
5
6
|
import { resolveSurfaceMaterial } from "../surface/resolve-surface-material.js";
|
|
@@ -152,6 +153,7 @@ const SidebarPanel = ({
|
|
|
152
153
|
primaryAction,
|
|
153
154
|
primaryActionPlacement = 'bottom',
|
|
154
155
|
contentAlignment = 'start',
|
|
156
|
+
arrangement,
|
|
155
157
|
content,
|
|
156
158
|
onScroll,
|
|
157
159
|
footer,
|
|
@@ -782,6 +784,10 @@ const SidebarPanel = ({
|
|
|
782
784
|
|
|
783
785
|
// Keep the same children mounted while the header changes from a row to a
|
|
784
786
|
// column. Numeric positions share the panel clock, including reversals.
|
|
787
|
+
const placed = resolveSidebarArrangement(contentAlignment, arrangement);
|
|
788
|
+
// The logo and its account menu move into the centred group only where the panel draws its own
|
|
789
|
+
// header row: a consumer's `header` replaces the row, and the mobile drawer keeps its own.
|
|
790
|
+
const identityGrouped = !mobile && header == null && Boolean(logo || accountMenu) && placed.logo === 'group';
|
|
785
791
|
const headerRow = mobile ? /*#__PURE__*/_jsxs(_Fragment, {
|
|
786
792
|
children: [/*#__PURE__*/_jsxs(View, {
|
|
787
793
|
style: {
|
|
@@ -818,7 +824,7 @@ const SidebarPanel = ({
|
|
|
818
824
|
width: '100%',
|
|
819
825
|
position: 'relative'
|
|
820
826
|
}, headerGeometry],
|
|
821
|
-
children: [logo || accountMenu ? /*#__PURE__*/_jsx(Animated.View, {
|
|
827
|
+
children: [!identityGrouped && (logo || accountMenu) ? /*#__PURE__*/_jsx(Animated.View, {
|
|
822
828
|
style: [{
|
|
823
829
|
position: 'absolute',
|
|
824
830
|
insetInlineStart: 0,
|
|
@@ -844,7 +850,7 @@ const SidebarPanel = ({
|
|
|
844
850
|
}, headerControlGeometry],
|
|
845
851
|
children: headerControl
|
|
846
852
|
})]
|
|
847
|
-
}), logo ? accountMenu : null]
|
|
853
|
+
}), !identityGrouped && logo ? accountMenu : null]
|
|
848
854
|
});
|
|
849
855
|
const treeView = shownSections.map(({
|
|
850
856
|
section,
|
|
@@ -861,6 +867,109 @@ const SidebarPanel = ({
|
|
|
861
867
|
onTreeItemPress: onTreeItemPress,
|
|
862
868
|
palette: palette
|
|
863
869
|
}, section.key ?? section.label));
|
|
870
|
+
|
|
871
|
+
// Anything grouped is centred with the destinations in the room above the persistent footer;
|
|
872
|
+
// what is not stays pinned (the controls at the top, the footer at the bottom).
|
|
873
|
+
const {
|
|
874
|
+
centred
|
|
875
|
+
} = placed;
|
|
876
|
+
const actionPlacement = arrangement?.primaryAction ?? (primaryActionPlacement === 'top' ? 'top' : placed.primaryAction);
|
|
877
|
+
const primaryActionNode = primaryAction ? /*#__PURE__*/_jsx(SidebarPrimaryAction, {
|
|
878
|
+
action: primaryAction,
|
|
879
|
+
collapsed: collapsed,
|
|
880
|
+
placement: actionPlacement === 'top' ? 'top' : undefined,
|
|
881
|
+
testID: testID ? `${testID}-primary-action` : undefined
|
|
882
|
+
}) : null;
|
|
883
|
+
const identityNode = identityGrouped ? /*#__PURE__*/_jsxs(Animated.View, {
|
|
884
|
+
style: [{
|
|
885
|
+
width: '100%',
|
|
886
|
+
gap: 12,
|
|
887
|
+
paddingBottom: 12
|
|
888
|
+
}, scrollInsets],
|
|
889
|
+
children: [logo ? /*#__PURE__*/_jsx(SidebarLogoView, {
|
|
890
|
+
logo: logo,
|
|
891
|
+
collapsed: collapsed,
|
|
892
|
+
testID: "sidebar-logo"
|
|
893
|
+
}) : accountMenu, logo ? accountMenu : null]
|
|
894
|
+
}) : null;
|
|
895
|
+
const headerNode = /*#__PURE__*/_jsxs(Animated.View, {
|
|
896
|
+
testID: `${testID ?? 'sidebar'}-fixed-header`,
|
|
897
|
+
style: [{
|
|
898
|
+
width: '100%',
|
|
899
|
+
gap: 12,
|
|
900
|
+
paddingTop: Math.max(expandedPadding, windowControlsRoom),
|
|
901
|
+
paddingBottom: 12
|
|
902
|
+
}, scrollInsets],
|
|
903
|
+
children: [header != null ? typeof header === 'function' ? header({
|
|
904
|
+
collapsed
|
|
905
|
+
}) : header : headerRow, typeof toolbar === 'function' ? toolbar({
|
|
906
|
+
collapsed
|
|
907
|
+
}) : toolbar, actionPlacement === 'top' ? primaryActionNode : null, inlineModes ? null : modeSwitcher, showSearch && !flatMobile ? searchButton : null]
|
|
908
|
+
});
|
|
909
|
+
const mainRegion = /*#__PURE__*/_jsxs(Animated.View, {
|
|
910
|
+
testID: `${testID ?? 'sidebar'}-main-region`,
|
|
911
|
+
style: [{
|
|
912
|
+
width: '100%',
|
|
913
|
+
flexGrow: centred ? 0 : 1,
|
|
914
|
+
paddingBottom: 8,
|
|
915
|
+
gap: hasSections ? 24 : 0
|
|
916
|
+
}, scrollInsets],
|
|
917
|
+
children: [shownItems.length > 0 || !hasTree ? /*#__PURE__*/_jsx(Animated.View, {
|
|
918
|
+
collapsable: false,
|
|
919
|
+
role: "navigation",
|
|
920
|
+
style: [{
|
|
921
|
+
width: '100%',
|
|
922
|
+
gap: 4
|
|
923
|
+
}, !hasTree && navInset],
|
|
924
|
+
children: nothingMatches && !hasTree ? /*#__PURE__*/_jsx(Text, {
|
|
925
|
+
variant: "body-regular",
|
|
926
|
+
style: {
|
|
927
|
+
paddingLeft: 8,
|
|
928
|
+
paddingRight: 8,
|
|
929
|
+
paddingTop: 12,
|
|
930
|
+
paddingBottom: 12,
|
|
931
|
+
color: palette.textTertiary
|
|
932
|
+
},
|
|
933
|
+
children: noResultsLabel
|
|
934
|
+
}) : shownItems.map(renderRow)
|
|
935
|
+
}) : null, onboarding && !collapsed ? /*#__PURE__*/_jsx(SidebarOnboardingCard, {
|
|
936
|
+
...onboarding,
|
|
937
|
+
testID: onboarding.testID ?? `${testID ?? 'sidebar'}-onboarding`
|
|
938
|
+
}) : null, collapsed || shownSections.length === 0 ? null : onTreeItemDrop ? /*#__PURE__*/_jsx(TreeDragProvider, {
|
|
939
|
+
sections: sections,
|
|
940
|
+
onDrop: onTreeItemDrop,
|
|
941
|
+
movedLabel: messages.moved,
|
|
942
|
+
scroll: treeScroll,
|
|
943
|
+
children: treeView
|
|
944
|
+
}) : treeView, content != null ? /*#__PURE__*/_jsx(Animated.View, {
|
|
945
|
+
testID: `${testID ?? 'sidebar'}-content`,
|
|
946
|
+
pointerEvents: collapsed ? 'none' : 'auto',
|
|
947
|
+
"aria-hidden": collapsed,
|
|
948
|
+
accessibilityElementsHidden: collapsed,
|
|
949
|
+
importantForAccessibility: collapsed ? 'no-hide-descendants' : 'auto',
|
|
950
|
+
...(IS_WEB && collapsed ? {
|
|
951
|
+
inert: true
|
|
952
|
+
} : {}),
|
|
953
|
+
ref: contentFade.ref,
|
|
954
|
+
style: [{
|
|
955
|
+
overflow: 'hidden',
|
|
956
|
+
flexShrink: 0
|
|
957
|
+
}, contentMorph, contentFade.style],
|
|
958
|
+
children: /*#__PURE__*/_jsx(Animated.View, {
|
|
959
|
+
onLayout: event => setContentHeight(event.nativeEvent.layout.height),
|
|
960
|
+
style: contentWidth,
|
|
961
|
+
children: content
|
|
962
|
+
})
|
|
963
|
+
}) : null, nothingMatches && hasTree ? /*#__PURE__*/_jsx(Text, {
|
|
964
|
+
variant: "body-regular",
|
|
965
|
+
style: {
|
|
966
|
+
paddingLeft: 8,
|
|
967
|
+
paddingRight: 8,
|
|
968
|
+
color: palette.textTertiary
|
|
969
|
+
},
|
|
970
|
+
children: noResultsLabel
|
|
971
|
+
}) : null]
|
|
972
|
+
});
|
|
864
973
|
const sidebar = /*#__PURE__*/_jsx(SidebarSizeProvider, {
|
|
865
974
|
value: size,
|
|
866
975
|
children: /*#__PURE__*/_jsx(SidebarGeometryProvider, {
|
|
@@ -914,25 +1023,7 @@ const SidebarPanel = ({
|
|
|
914
1023
|
contentContainerStyle: {
|
|
915
1024
|
flexGrow: 1
|
|
916
1025
|
},
|
|
917
|
-
stickyHeader:
|
|
918
|
-
testID: `${testID ?? 'sidebar'}-fixed-header`,
|
|
919
|
-
style: [{
|
|
920
|
-
width: '100%',
|
|
921
|
-
gap: 12,
|
|
922
|
-
paddingTop: Math.max(expandedPadding, windowControlsRoom),
|
|
923
|
-
paddingBottom: 12
|
|
924
|
-
}, scrollInsets],
|
|
925
|
-
children: [header != null ? typeof header === 'function' ? header({
|
|
926
|
-
collapsed
|
|
927
|
-
}) : header : headerRow, typeof toolbar === 'function' ? toolbar({
|
|
928
|
-
collapsed
|
|
929
|
-
}) : toolbar, primaryAction && primaryActionPlacement === 'top' ? /*#__PURE__*/_jsx(SidebarPrimaryAction, {
|
|
930
|
-
action: primaryAction,
|
|
931
|
-
collapsed: collapsed,
|
|
932
|
-
placement: "top",
|
|
933
|
-
testID: testID ? `${testID}-primary-action` : undefined
|
|
934
|
-
}) : null, inlineModes ? null : modeSwitcher, showSearch && !flatMobile ? searchButton : null]
|
|
935
|
-
}),
|
|
1026
|
+
stickyHeader: headerNode,
|
|
936
1027
|
stickyFooter: /*#__PURE__*/_jsxs(Animated.View, {
|
|
937
1028
|
testID: `${testID ?? 'sidebar'}-sticky-footer`,
|
|
938
1029
|
style: [{
|
|
@@ -941,11 +1032,7 @@ const SidebarPanel = ({
|
|
|
941
1032
|
paddingTop: hasTree ? 12 : 0,
|
|
942
1033
|
paddingBottom: expandedPadding
|
|
943
1034
|
}, scrollInsets],
|
|
944
|
-
children: [
|
|
945
|
-
action: primaryAction,
|
|
946
|
-
collapsed: collapsed,
|
|
947
|
-
testID: testID ? `${testID}-primary-action` : undefined
|
|
948
|
-
}) : null, showThemeToggle ? /*#__PURE__*/_jsxs(Animated.View, {
|
|
1035
|
+
children: [actionPlacement === 'bottom' ? primaryActionNode : null, showThemeToggle ? /*#__PURE__*/_jsxs(Animated.View, {
|
|
949
1036
|
testID: "sidebar-theme-morph",
|
|
950
1037
|
style: [{
|
|
951
1038
|
position: 'relative',
|
|
@@ -1034,69 +1121,16 @@ const SidebarPanel = ({
|
|
|
1034
1121
|
}) : footer
|
|
1035
1122
|
}) : null]
|
|
1036
1123
|
}),
|
|
1037
|
-
children: /*#__PURE__*/_jsxs(
|
|
1038
|
-
|
|
1039
|
-
style: [{
|
|
1040
|
-
width: '100%',
|
|
1124
|
+
children: /*#__PURE__*/_jsxs(View, {
|
|
1125
|
+
style: {
|
|
1041
1126
|
flexGrow: 1,
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
}, scrollInsets],
|
|
1046
|
-
children: [shownItems.length > 0 || !hasTree ? /*#__PURE__*/_jsx(Animated.View, {
|
|
1047
|
-
collapsable: false,
|
|
1048
|
-
role: "navigation",
|
|
1127
|
+
justifyContent: centred ? 'center' : undefined
|
|
1128
|
+
},
|
|
1129
|
+
children: [identityNode, mainRegion, actionPlacement === 'group' ? /*#__PURE__*/_jsx(Animated.View, {
|
|
1049
1130
|
style: [{
|
|
1050
|
-
width: '100%'
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
children: nothingMatches && !hasTree ? /*#__PURE__*/_jsx(Text, {
|
|
1054
|
-
variant: "body-regular",
|
|
1055
|
-
style: {
|
|
1056
|
-
paddingLeft: 8,
|
|
1057
|
-
paddingRight: 8,
|
|
1058
|
-
paddingTop: 12,
|
|
1059
|
-
paddingBottom: 12,
|
|
1060
|
-
color: palette.textTertiary
|
|
1061
|
-
},
|
|
1062
|
-
children: noResultsLabel
|
|
1063
|
-
}) : shownItems.map(renderRow)
|
|
1064
|
-
}) : null, onboarding && !collapsed ? /*#__PURE__*/_jsx(SidebarOnboardingCard, {
|
|
1065
|
-
...onboarding,
|
|
1066
|
-
testID: onboarding.testID ?? `${testID ?? 'sidebar'}-onboarding`
|
|
1067
|
-
}) : null, collapsed || shownSections.length === 0 ? null : onTreeItemDrop ? /*#__PURE__*/_jsx(TreeDragProvider, {
|
|
1068
|
-
sections: sections,
|
|
1069
|
-
onDrop: onTreeItemDrop,
|
|
1070
|
-
movedLabel: messages.moved,
|
|
1071
|
-
scroll: treeScroll,
|
|
1072
|
-
children: treeView
|
|
1073
|
-
}) : treeView, content != null ? /*#__PURE__*/_jsx(Animated.View, {
|
|
1074
|
-
testID: `${testID ?? 'sidebar'}-content`,
|
|
1075
|
-
pointerEvents: collapsed ? 'none' : 'auto',
|
|
1076
|
-
"aria-hidden": collapsed,
|
|
1077
|
-
accessibilityElementsHidden: collapsed,
|
|
1078
|
-
importantForAccessibility: collapsed ? 'no-hide-descendants' : 'auto',
|
|
1079
|
-
...(IS_WEB && collapsed ? {
|
|
1080
|
-
inert: true
|
|
1081
|
-
} : {}),
|
|
1082
|
-
ref: contentFade.ref,
|
|
1083
|
-
style: [{
|
|
1084
|
-
overflow: 'hidden',
|
|
1085
|
-
flexShrink: 0
|
|
1086
|
-
}, contentMorph, contentFade.style],
|
|
1087
|
-
children: /*#__PURE__*/_jsx(Animated.View, {
|
|
1088
|
-
onLayout: event => setContentHeight(event.nativeEvent.layout.height),
|
|
1089
|
-
style: contentWidth,
|
|
1090
|
-
children: content
|
|
1091
|
-
})
|
|
1092
|
-
}) : null, nothingMatches && hasTree ? /*#__PURE__*/_jsx(Text, {
|
|
1093
|
-
variant: "body-regular",
|
|
1094
|
-
style: {
|
|
1095
|
-
paddingLeft: 8,
|
|
1096
|
-
paddingRight: 8,
|
|
1097
|
-
color: palette.textTertiary
|
|
1098
|
-
},
|
|
1099
|
-
children: noResultsLabel
|
|
1131
|
+
width: '100%'
|
|
1132
|
+
}, scrollInsets],
|
|
1133
|
+
children: primaryActionNode
|
|
1100
1134
|
}) : null]
|
|
1101
1135
|
})
|
|
1102
1136
|
})]
|