@oxy.so/bloom 19.5.2 → 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/adoption-matrix.mdx +13 -13
- package/docs/app-shell.mdx +18 -11
- package/docs/compose-layouts.mdx +114 -2
- package/docs/dialog.mdx +7 -0
- package/docs/engagement-bar.mdx +9 -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 +1 -1
- 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/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/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/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/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/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/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/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/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/package.json +1 -1
- 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/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
|
@@ -7,10 +7,17 @@ import React, {
|
|
|
7
7
|
useContext,
|
|
8
8
|
useRef,
|
|
9
9
|
useState,
|
|
10
|
+
useId,
|
|
10
11
|
type ComponentType,
|
|
11
12
|
type ComponentRef,
|
|
12
13
|
} from 'react';
|
|
13
|
-
import {
|
|
14
|
+
import { Platform, type View as NativeView, type ViewStyle } from 'react-native';
|
|
15
|
+
import { StyledView as View } from '../styles/styled-primitives';
|
|
16
|
+
import {
|
|
17
|
+
SafeAreaInsetsContext,
|
|
18
|
+
useSafeAreaInsets,
|
|
19
|
+
type EdgeInsets,
|
|
20
|
+
} from 'react-native-safe-area-context';
|
|
14
21
|
import Animated, {
|
|
15
22
|
cancelAnimation,
|
|
16
23
|
useAnimatedStyle,
|
|
@@ -18,6 +25,7 @@ import Animated, {
|
|
|
18
25
|
withTiming,
|
|
19
26
|
runOnJS,
|
|
20
27
|
} from 'react-native-reanimated';
|
|
28
|
+
import { ContentPanelNestingContext } from '../content-panel/context';
|
|
21
29
|
import type { ContentPanelProps } from '../content-panel/types';
|
|
22
30
|
import type { DialogProps } from '../dialog/types';
|
|
23
31
|
import { useDialogControl, useDialogContext } from '../dialog/context';
|
|
@@ -26,8 +34,8 @@ import { useCommonMessages } from '../locale/common-messages';
|
|
|
26
34
|
import type { BloomColorScopeProps } from '../theme/color-scope/ColorScope';
|
|
27
35
|
import type { ScrollAreaProps, ScrollBarProps } from '../layout/types';
|
|
28
36
|
import type { useScrollRestoration as UseScrollRestoration } from '../scroll/use-scroll-restoration';
|
|
29
|
-
import { useAppShellRegion } from '../layout/app-shell-region';
|
|
30
|
-
import { useBottomEdgeInset } from '../layout/bottom-edge';
|
|
37
|
+
import { AppShellRegionContext, useAppShellRegion } from '../layout/app-shell-region';
|
|
38
|
+
import { BottomEdgeProvider, useBottomEdgeInset } from '../layout/bottom-edge';
|
|
31
39
|
import { ScrollMetricsContext } from '../layout/scroll-metrics';
|
|
32
40
|
import { ScrollOffsetProvider } from '../layout/scroll-offset';
|
|
33
41
|
import { ScreenScope } from '../layout/screen-scope';
|
|
@@ -39,6 +47,8 @@ import type { ScreenProps } from '../screen/types';
|
|
|
39
47
|
import { ResizeHandle } from '../layout/ResizeHandle';
|
|
40
48
|
import { PanelErrorBoundary } from '../error-boundary/PanelErrorBoundary';
|
|
41
49
|
import { PANEL_EXIT_MS, PANEL_LAYOUT_MS, animatePanelFlex } from './panel-motion';
|
|
50
|
+
import { panelGeometryTransitions } from './panel-transitions';
|
|
51
|
+
import { usePanelExitCompletion } from './use-panel-exit-completion';
|
|
42
52
|
import { UNSET } from '../styles/animated-style';
|
|
43
53
|
import { useMeasuredSizeClass, useWindowSizeWhile } from '../hooks/use-width-class';
|
|
44
54
|
import { IS_WEB } from '../styles/platform';
|
|
@@ -56,7 +66,12 @@ import { PanelReorderHandle } from './PanelReorderHandle';
|
|
|
56
66
|
import { usePanelReveal } from './use-panel-reveal';
|
|
57
67
|
import { usePanelResize, type PanelResizePreview } from './use-panel-resize';
|
|
58
68
|
import { useRoomChanged } from './use-room-changed';
|
|
59
|
-
import {
|
|
69
|
+
import {
|
|
70
|
+
PanelCssContext,
|
|
71
|
+
PanelResponsiveScopeContext,
|
|
72
|
+
panelCssScope,
|
|
73
|
+
panelLayoutCss,
|
|
74
|
+
} from './panel-layout-css';
|
|
60
75
|
import { ServerStyleSheet } from '../styles/ServerStyleSheet';
|
|
61
76
|
import {
|
|
62
77
|
AppShellPanelContext,
|
|
@@ -72,18 +87,23 @@ import {
|
|
|
72
87
|
applyPanelSpans,
|
|
73
88
|
isFlexiblePanel,
|
|
74
89
|
panelWindowChrome,
|
|
75
|
-
|
|
90
|
+
panelForAxis,
|
|
91
|
+
eligiblePanels,
|
|
76
92
|
panelLayoutMinimum,
|
|
77
93
|
panelLayoutWidthThresholds,
|
|
78
94
|
resolvePanelAxis,
|
|
79
95
|
resolvePanelFlex,
|
|
80
|
-
resolvePanelTracks,
|
|
81
96
|
splitPairSpans,
|
|
82
97
|
type PanelFlexTrack,
|
|
83
98
|
} from './panel-layout';
|
|
84
99
|
import { PanelDropProvider, PanelDropZones, usePanelDropCoordinator } from './PanelDropZones';
|
|
85
100
|
import { RetainedPanelLayout } from './RetainedPanelLayout';
|
|
86
101
|
|
|
102
|
+
const PanelWindowInsetsContext = React.createContext<EdgeInsets | null>(null);
|
|
103
|
+
// The document is one scroll owner. Transparent groups delegate its restoration
|
|
104
|
+
// down the primary branch instead of each layout restoring the same window.
|
|
105
|
+
const PanelDocumentRestorationContext = React.createContext(true);
|
|
106
|
+
|
|
87
107
|
/** A track the CSS compositor sizes: its flex values are the stylesheet's, never read. */
|
|
88
108
|
const CSS_TRACK: Omit<PanelFlexTrack, 'id' | 'visible'> = {
|
|
89
109
|
grow: 0,
|
|
@@ -163,10 +183,12 @@ export function createPanelLayoutView(
|
|
|
163
183
|
panel,
|
|
164
184
|
open,
|
|
165
185
|
children,
|
|
186
|
+
onClosed,
|
|
166
187
|
testID,
|
|
167
188
|
}: {
|
|
168
189
|
panel: AppShellPanelDefinition;
|
|
169
190
|
open: boolean;
|
|
191
|
+
onClosed: () => void;
|
|
170
192
|
children: React.ReactNode;
|
|
171
193
|
testID?: string;
|
|
172
194
|
}) {
|
|
@@ -181,16 +203,18 @@ export function createPanelLayoutView(
|
|
|
181
203
|
<Dialog
|
|
182
204
|
control={control}
|
|
183
205
|
label={panel.floating!.label}
|
|
184
|
-
placement=
|
|
206
|
+
placement={panel.floating?.placement ?? 'end'}
|
|
185
207
|
width={panel.floating!.width ?? panel.width ?? 410}
|
|
186
208
|
inset={{ top: 12, bottom: 12, left: 12, right: 12 }}
|
|
187
209
|
scrollable={false}
|
|
210
|
+
sizing="fill"
|
|
188
211
|
contentPadding={0}
|
|
189
212
|
testID={testID ? `${testID}-floating` : undefined}
|
|
190
213
|
onClose={() => {
|
|
191
214
|
// An explicit state close already belongs to the host. Only surface
|
|
192
215
|
// dismissal reports a new intent, after Dialog's exit completes.
|
|
193
216
|
if (intent.current) panel.floating!.onOpenChange(false);
|
|
217
|
+
onClosed();
|
|
194
218
|
}}
|
|
195
219
|
>
|
|
196
220
|
{children}
|
|
@@ -308,12 +332,14 @@ export function createPanelLayoutView(
|
|
|
308
332
|
visibilityReady,
|
|
309
333
|
index,
|
|
310
334
|
getSize,
|
|
311
|
-
modelSize,
|
|
312
335
|
vertical,
|
|
313
336
|
naturalHeight,
|
|
337
|
+
safeAreaTop,
|
|
338
|
+
shellWidth,
|
|
314
339
|
track,
|
|
315
340
|
alone,
|
|
316
341
|
document: documentFlow,
|
|
342
|
+
documentRestorationOwner,
|
|
317
343
|
joined,
|
|
318
344
|
gap,
|
|
319
345
|
onResize,
|
|
@@ -336,13 +362,14 @@ export function createPanelLayoutView(
|
|
|
336
362
|
visibilityReady: boolean;
|
|
337
363
|
index: number;
|
|
338
364
|
getSize: () => number;
|
|
339
|
-
/** Its size as the group's measured room divides it (`resolvePanelTracks`), where no layout can be read. */
|
|
340
|
-
modelSize: () => number;
|
|
341
365
|
vertical: boolean;
|
|
342
366
|
naturalHeight: boolean;
|
|
367
|
+
safeAreaTop: number;
|
|
368
|
+
shellWidth: number;
|
|
343
369
|
track: PanelFlexTrack;
|
|
344
370
|
alone: boolean;
|
|
345
371
|
document: boolean;
|
|
372
|
+
documentRestorationOwner: boolean;
|
|
346
373
|
joined: boolean;
|
|
347
374
|
gap: number;
|
|
348
375
|
onResize: (width: number) => void;
|
|
@@ -358,6 +385,13 @@ export function createPanelLayoutView(
|
|
|
358
385
|
testID?: string;
|
|
359
386
|
}) {
|
|
360
387
|
const layoutReady = useShellLayoutReady();
|
|
388
|
+
const fallbackInsets = useSafeAreaInsets();
|
|
389
|
+
const safeArea = useContext(SafeAreaInsetsContext) ?? fallbackInsets;
|
|
390
|
+
const windowInsets = useContext(PanelWindowInsetsContext) ?? safeArea;
|
|
391
|
+
const inlineInsets = useMemo(
|
|
392
|
+
() => ({ ...safeArea, top: safeAreaTop }),
|
|
393
|
+
[safeArea, safeAreaTop],
|
|
394
|
+
);
|
|
361
395
|
// One tree whether or not the panel holds the window's chrome right now.
|
|
362
396
|
const platformWindow = usePlatformWindow();
|
|
363
397
|
const windowed = platformWindow != null;
|
|
@@ -367,7 +401,7 @@ export function createPanelLayoutView(
|
|
|
367
401
|
windowChrome != null && platformWindow != null
|
|
368
402
|
? windowEdgeTopCorners(platformWindow.metrics)
|
|
369
403
|
: null;
|
|
370
|
-
const panelRef = useRef<ComponentRef<typeof
|
|
404
|
+
const panelRef = useRef<ComponentRef<typeof NativeView>>(null);
|
|
371
405
|
const dragOffset = useSharedValue(0);
|
|
372
406
|
const dragLayer = useSharedValue(0);
|
|
373
407
|
useEffect(
|
|
@@ -420,21 +454,35 @@ export function createPanelLayoutView(
|
|
|
420
454
|
const theme = useTheme();
|
|
421
455
|
const rtl = useIsRtl();
|
|
422
456
|
// Only the web places a sticky panel from the viewport's height.
|
|
423
|
-
const viewportHeight = useWindowSizeWhile(
|
|
457
|
+
const viewportHeight = useWindowSizeWhile(
|
|
458
|
+
Platform.OS === 'web' && !!panel.sticky && documentFlow,
|
|
459
|
+
).height;
|
|
424
460
|
const [stickyHeight, setStickyHeight] = useState(0);
|
|
425
461
|
const document = documentFlow && !track.floating;
|
|
462
|
+
const documentFrame = document && (!vertical || alone);
|
|
426
463
|
const floatingOpen = !!track.floating && !!panel.floating?.open && panel.visible !== false;
|
|
427
|
-
const sticky = !!panel.sticky &&
|
|
464
|
+
const sticky = !!panel.sticky && documentFrame;
|
|
428
465
|
const parent = React.useContext(ScreenContext);
|
|
466
|
+
const ancestorHost = useContext(ScreenHostContext);
|
|
429
467
|
const active =
|
|
430
|
-
panel.visible !== false &&
|
|
468
|
+
panel.visible !== false &&
|
|
469
|
+
(track.visible || floatingOpen) &&
|
|
470
|
+
(parent?.active ?? true) &&
|
|
471
|
+
ancestorHost.active;
|
|
431
472
|
const screenRef = useRef<unknown>(null);
|
|
432
473
|
const scrollY = useSharedValue(0);
|
|
433
474
|
const contentHeight = useSharedValue(-1);
|
|
475
|
+
const intrinsicContentHeight = useSharedValue(-1);
|
|
434
476
|
const scrollViewportHeight = useSharedValue(0);
|
|
435
477
|
const metrics = useMemo(
|
|
436
|
-
() => ({
|
|
437
|
-
|
|
478
|
+
() => ({
|
|
479
|
+
scrollY,
|
|
480
|
+
contentHeight,
|
|
481
|
+
intrinsicContentHeight:
|
|
482
|
+
panel.resizeMaxHeight === 'content' ? intrinsicContentHeight : undefined,
|
|
483
|
+
viewportHeight: scrollViewportHeight,
|
|
484
|
+
}),
|
|
485
|
+
[scrollY, contentHeight, intrinsicContentHeight, scrollViewportHeight, panel.resizeMaxHeight],
|
|
438
486
|
);
|
|
439
487
|
const [screenColor, claimPanelColor] = useLatestClaim<ProfileColor>();
|
|
440
488
|
const claimShellColor = useContext(ShellColorClaimContext);
|
|
@@ -458,6 +506,7 @@ export function createPanelLayoutView(
|
|
|
458
506
|
const host = useMemo(
|
|
459
507
|
() => ({
|
|
460
508
|
active,
|
|
509
|
+
sizing: naturalHeight ? ('content' as const) : ('fill' as const),
|
|
461
510
|
back,
|
|
462
511
|
restoresDocument: document,
|
|
463
512
|
kind: (Platform.OS !== 'web' ? 'native' : document ? 'document' : 'element') as
|
|
@@ -481,6 +530,7 @@ export function createPanelLayoutView(
|
|
|
481
530
|
}),
|
|
482
531
|
[
|
|
483
532
|
active,
|
|
533
|
+
naturalHeight,
|
|
484
534
|
back,
|
|
485
535
|
document,
|
|
486
536
|
metrics,
|
|
@@ -496,9 +546,8 @@ export function createPanelLayoutView(
|
|
|
496
546
|
const start = useRef(0);
|
|
497
547
|
const reduced = usePrefersReducedMotion();
|
|
498
548
|
// The track's flex along the group's axis (`resolvePanelFlex`), as shared
|
|
499
|
-
// values: Yoga
|
|
500
|
-
//
|
|
501
|
-
// shown, hidden, resized by its handle) moves them.
|
|
549
|
+
// values: Yoga distributes room without a React sizing pass. Semantic
|
|
550
|
+
// visibility changes and direct gestures update these declarative values.
|
|
502
551
|
const grow = useSharedValue(track.grow);
|
|
503
552
|
const basis = useSharedValue(track.basis);
|
|
504
553
|
const min = useSharedValue(track.min);
|
|
@@ -507,6 +556,7 @@ export function createPanelLayoutView(
|
|
|
507
556
|
const opacity = useSharedValue(track.visible ? 1 : 0);
|
|
508
557
|
const panelScale = useSharedValue(1);
|
|
509
558
|
const lastHeight = useSharedValue(0);
|
|
559
|
+
const lastWidth = useSharedValue(0);
|
|
510
560
|
// A resize gesture holds the track at the size it drags to (a frozen
|
|
511
561
|
// basis), and its commit lands at once: what it settled on is already drawn.
|
|
512
562
|
const gestureHeld = useRef(false);
|
|
@@ -517,8 +567,24 @@ export function createPanelLayoutView(
|
|
|
517
567
|
const box = (
|
|
518
568
|
panelRef.current as unknown as MeasurableNode | null
|
|
519
569
|
)?.getBoundingClientRect?.();
|
|
520
|
-
return box
|
|
570
|
+
return box
|
|
571
|
+
? vertical
|
|
572
|
+
? box.height
|
|
573
|
+
: box.width
|
|
574
|
+
: vertical
|
|
575
|
+
? lastHeight.value
|
|
576
|
+
: lastWidth.value;
|
|
521
577
|
},
|
|
578
|
+
contentHeight:
|
|
579
|
+
panel.resizeMaxHeight === 'content'
|
|
580
|
+
? (height) => {
|
|
581
|
+
const intrinsic = intrinsicContentHeight.value;
|
|
582
|
+
const viewport = scrollViewportHeight.value;
|
|
583
|
+
return intrinsic >= 0 && viewport > 0
|
|
584
|
+
? Math.max(0, height - viewport) + intrinsic
|
|
585
|
+
: undefined;
|
|
586
|
+
}
|
|
587
|
+
: undefined,
|
|
522
588
|
update: (size) => {
|
|
523
589
|
gestureHeld.current = true;
|
|
524
590
|
cancelAnimation(grow);
|
|
@@ -527,7 +593,15 @@ export function createPanelLayoutView(
|
|
|
527
593
|
basis.value = size;
|
|
528
594
|
},
|
|
529
595
|
}),
|
|
530
|
-
[
|
|
596
|
+
[
|
|
597
|
+
registerResizePreview,
|
|
598
|
+
grow,
|
|
599
|
+
basis,
|
|
600
|
+
vertical,
|
|
601
|
+
panel.resizeMaxHeight,
|
|
602
|
+
intrinsicContentHeight,
|
|
603
|
+
scrollViewportHeight,
|
|
604
|
+
],
|
|
531
605
|
);
|
|
532
606
|
// The panel paints the material: on the web its fade is its presence, never
|
|
533
607
|
// an opacity on the track above it (the CSS compositor does the same).
|
|
@@ -537,6 +611,14 @@ export function createPanelLayoutView(
|
|
|
537
611
|
: transition === 'exit-before-enter'
|
|
538
612
|
? PANEL_EXIT_MS
|
|
539
613
|
: PANEL_LAYOUT_MS;
|
|
614
|
+
const { captureNativeCompletion, completeFloating } = usePanelExitCompletion({
|
|
615
|
+
present: panel.visible !== false && (!track.floating || floatingOpen),
|
|
616
|
+
floating: !!track.floating,
|
|
617
|
+
css: !!cssScope,
|
|
618
|
+
reducedMotion: reduced,
|
|
619
|
+
owner: panelRef,
|
|
620
|
+
onExitComplete: panel.onExitComplete,
|
|
621
|
+
});
|
|
540
622
|
useSurfacePresenceContent(cssScope ? null : panelRef, {
|
|
541
623
|
presence: track.visible ? 1 : 0,
|
|
542
624
|
duration: fadeMs,
|
|
@@ -562,6 +644,7 @@ export function createPanelLayoutView(
|
|
|
562
644
|
},
|
|
563
645
|
transition === 'exit-before-enter',
|
|
564
646
|
reduced || resized || held,
|
|
647
|
+
track.floating ? undefined : captureNativeCompletion(),
|
|
565
648
|
);
|
|
566
649
|
}, [
|
|
567
650
|
track.grow,
|
|
@@ -570,6 +653,8 @@ export function createPanelLayoutView(
|
|
|
570
653
|
track.max,
|
|
571
654
|
track.gap,
|
|
572
655
|
track.visible,
|
|
656
|
+
track.floating,
|
|
657
|
+
panel.visible,
|
|
573
658
|
grow,
|
|
574
659
|
basis,
|
|
575
660
|
min,
|
|
@@ -580,6 +665,7 @@ export function createPanelLayoutView(
|
|
|
580
665
|
transition,
|
|
581
666
|
reduced,
|
|
582
667
|
cssScope,
|
|
668
|
+
captureNativeCompletion,
|
|
583
669
|
]);
|
|
584
670
|
// Every key on every run (`styles/animated-style.ts`).
|
|
585
671
|
// The track's basis is its main-axis SIZE (`width` across, `height` down)
|
|
@@ -713,8 +799,12 @@ export function createPanelLayoutView(
|
|
|
713
799
|
// Under the bottom bar a side-by-side panel reaches it: its content clears
|
|
714
800
|
// the bar and drives it (the shell's navigation motion); a stacked one sits
|
|
715
801
|
// above the group viewport's own clearance.
|
|
716
|
-
const underBar = !
|
|
717
|
-
const body = (
|
|
802
|
+
const underBar = !documentFrame && !!region?.underBottomBar;
|
|
803
|
+
const body = panel.group ? (
|
|
804
|
+
<ScreenHostContext.Provider value={{ ...ancestorHost, active }}>
|
|
805
|
+
{content}
|
|
806
|
+
</ScreenHostContext.Provider>
|
|
807
|
+
) : (
|
|
718
808
|
<>
|
|
719
809
|
<ScreenScope inheritBottomEdge={document || underBar} inheritNavigation={underBar}>
|
|
720
810
|
<ScreenHostContext.Provider value={navigation ? { ...host, navigation } : host}>
|
|
@@ -729,11 +819,13 @@ export function createPanelLayoutView(
|
|
|
729
819
|
</ScrollMetricsContext.Provider>
|
|
730
820
|
</ScreenHostContext.Provider>
|
|
731
821
|
</ScreenScope>
|
|
732
|
-
<DocumentPanelReserve height={
|
|
822
|
+
<DocumentPanelReserve height={documentFrame ? (region?.bottomReserve ?? 0) : 0} />
|
|
733
823
|
</>
|
|
734
824
|
);
|
|
735
825
|
const framed = region?.framed ?? true;
|
|
736
|
-
const surface =
|
|
826
|
+
const surface = panel.group ? (
|
|
827
|
+
body
|
|
828
|
+
) : joined ? (
|
|
737
829
|
<View style={FILL}>
|
|
738
830
|
{panel.errorBoundary ? (
|
|
739
831
|
<PanelErrorBoundary {...(panel.errorBoundary === true ? {} : panel.errorBoundary)}>
|
|
@@ -752,13 +844,13 @@ export function createPanelLayoutView(
|
|
|
752
844
|
framed={cssScope && cssFraming ? true : framed}
|
|
753
845
|
maskColor={region?.maskColor}
|
|
754
846
|
errorBoundary={panel.errorBoundary}
|
|
755
|
-
fill={!document}
|
|
847
|
+
fill={!document && !naturalHeight}
|
|
756
848
|
scrollable={false}
|
|
757
|
-
overlaySizing={
|
|
758
|
-
overlayInset={
|
|
849
|
+
overlaySizing={documentFrame ? 'viewport' : 'panel'}
|
|
850
|
+
overlayInset={documentFrame ? region?.viewportInset : undefined}
|
|
759
851
|
surfaceStyle={[
|
|
760
852
|
FILL,
|
|
761
|
-
|
|
853
|
+
documentFrame && !sticky && region
|
|
762
854
|
? {
|
|
763
855
|
minHeight: webViewportHeightMinus(
|
|
764
856
|
region.viewportInset.top + region.viewportInset.bottom,
|
|
@@ -808,12 +900,17 @@ export function createPanelLayoutView(
|
|
|
808
900
|
resizable ? { zIndex: 1 } : undefined,
|
|
809
901
|
Platform.OS !== 'web' ? reorderStyle : undefined,
|
|
810
902
|
]}
|
|
811
|
-
onLayout={
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
903
|
+
onLayout={
|
|
904
|
+
cssScope && !sticky
|
|
905
|
+
? undefined
|
|
906
|
+
: (event) => {
|
|
907
|
+
if (track.visible) {
|
|
908
|
+
lastHeight.value = event.nativeEvent.layout.height;
|
|
909
|
+
lastWidth.value = event.nativeEvent.layout.width;
|
|
910
|
+
if (sticky) setStickyHeight(event.nativeEvent.layout.height);
|
|
911
|
+
}
|
|
912
|
+
}
|
|
913
|
+
}
|
|
817
914
|
aria-hidden={!active ? true : undefined}
|
|
818
915
|
{...(Platform.OS === 'web' && !active ? { inert: true } : null)}
|
|
819
916
|
importantForAccessibility={active ? 'auto' : 'no-hide-descendants'}
|
|
@@ -847,7 +944,9 @@ export function createPanelLayoutView(
|
|
|
847
944
|
: undefined,
|
|
848
945
|
]}
|
|
849
946
|
>
|
|
850
|
-
{
|
|
947
|
+
<SafeAreaInsetsContext.Provider value={inlineInsets}>
|
|
948
|
+
{surface}
|
|
949
|
+
</SafeAreaInsetsContext.Provider>
|
|
851
950
|
</View>
|
|
852
951
|
</ColorScope>
|
|
853
952
|
</PlacementBoundaryContext.Provider>
|
|
@@ -906,27 +1005,53 @@ export function createPanelLayoutView(
|
|
|
906
1005
|
) : null}
|
|
907
1006
|
</AnimatedView>
|
|
908
1007
|
{track.floating && panel.floating ? (
|
|
909
|
-
<
|
|
910
|
-
<
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
1008
|
+
<SafeAreaInsetsContext.Provider value={windowInsets}>
|
|
1009
|
+
<PanelFloatingSurface
|
|
1010
|
+
panel={panel}
|
|
1011
|
+
open={floatingOpen}
|
|
1012
|
+
onClosed={completeFloating}
|
|
1013
|
+
testID={testID}
|
|
1014
|
+
>
|
|
1015
|
+
<SafeAreaInsetsContext.Provider value={{ ...windowInsets, top: 0 }}>
|
|
1016
|
+
<AppShellPanelContext.Provider value={floatingValue}>
|
|
1017
|
+
<ColorScope colorPreset={scopeColorPreset} seed={scopeSeed} asChild>
|
|
1018
|
+
<View style={FILL}>
|
|
1019
|
+
{panel.errorBoundary ? (
|
|
1020
|
+
<PanelErrorBoundary
|
|
1021
|
+
{...(panel.errorBoundary === true ? {} : panel.errorBoundary)}
|
|
1022
|
+
>
|
|
1023
|
+
{body}
|
|
1024
|
+
</PanelErrorBoundary>
|
|
1025
|
+
) : (
|
|
1026
|
+
body
|
|
1027
|
+
)}
|
|
1028
|
+
</View>
|
|
1029
|
+
</ColorScope>
|
|
1030
|
+
</AppShellPanelContext.Provider>
|
|
1031
|
+
</SafeAreaInsetsContext.Provider>
|
|
1032
|
+
</PanelFloatingSurface>
|
|
1033
|
+
</SafeAreaInsetsContext.Provider>
|
|
926
1034
|
) : null}
|
|
927
1035
|
</>
|
|
928
1036
|
);
|
|
929
1037
|
};
|
|
1038
|
+
if (panel.group)
|
|
1039
|
+
return renderPanel(
|
|
1040
|
+
<PanelDocumentRestorationContext.Provider value={documentRestorationOwner && active}>
|
|
1041
|
+
<NestedPanelGroup
|
|
1042
|
+
layout={panel.group}
|
|
1043
|
+
groupActions={
|
|
1044
|
+
<>
|
|
1045
|
+
{reorderHandle}
|
|
1046
|
+
{panel.headerActions}
|
|
1047
|
+
</>
|
|
1048
|
+
}
|
|
1049
|
+
shellWidth={shellWidth}
|
|
1050
|
+
gap={gap}
|
|
1051
|
+
testID={testID ? `${testID}-group` : undefined}
|
|
1052
|
+
/>
|
|
1053
|
+
</PanelDocumentRestorationContext.Provider>,
|
|
1054
|
+
);
|
|
930
1055
|
// Navigation and restoration belong to the persistent descriptor, above
|
|
931
1056
|
// the inline/portal presentation boundary. Closing or docking a surface
|
|
932
1057
|
// does not recreate its history or scroll store.
|
|
@@ -955,6 +1080,144 @@ export function createPanelLayoutView(
|
|
|
955
1080
|
</PanelScrollScope>
|
|
956
1081
|
);
|
|
957
1082
|
}
|
|
1083
|
+
function NestedPanelGroup({
|
|
1084
|
+
layout: declared,
|
|
1085
|
+
shellWidth,
|
|
1086
|
+
gap,
|
|
1087
|
+
testID,
|
|
1088
|
+
groupActions,
|
|
1089
|
+
}: PanelLayoutViewProps & { groupActions?: React.ReactNode }) {
|
|
1090
|
+
const region = useAppShellRegion();
|
|
1091
|
+
const parentScope = useContext(PanelCssContext);
|
|
1092
|
+
const inheritedResponsiveScope = useContext(PanelResponsiveScopeContext);
|
|
1093
|
+
const scope = panelCssScope(useId());
|
|
1094
|
+
const groupRef = useRef<ComponentRef<typeof NativeView>>(null);
|
|
1095
|
+
const reducedMotion = usePrefersReducedMotion();
|
|
1096
|
+
const wantsDocument =
|
|
1097
|
+
Platform.OS === 'web' &&
|
|
1098
|
+
region?.flow === 'document' &&
|
|
1099
|
+
declared.singlePanelFlow === 'document' &&
|
|
1100
|
+
declared.mode !== 'flow' &&
|
|
1101
|
+
declared.mode !== 'deck' &&
|
|
1102
|
+
eligiblePanels(declared, shellWidth).length === 1;
|
|
1103
|
+
const [documentReady, setDocumentReady] = useState(wantsDocument);
|
|
1104
|
+
const document = wantsDocument && documentReady;
|
|
1105
|
+
// Keep the same bounded owner while the outgoing track closes and the
|
|
1106
|
+
// survivor expands, including ancestor width changes when leaving Deck.
|
|
1107
|
+
// Transfer to document scrolling only when those actual CSS transitions
|
|
1108
|
+
// finish: no timeout or JavaScript geometry calculation.
|
|
1109
|
+
useLayoutEffect(() => {
|
|
1110
|
+
if (!wantsDocument) {
|
|
1111
|
+
setDocumentReady(false);
|
|
1112
|
+
return;
|
|
1113
|
+
}
|
|
1114
|
+
if (documentReady) return;
|
|
1115
|
+
const node = groupRef.current as unknown as HTMLElement | null;
|
|
1116
|
+
const ancestors = new Set<HTMLElement>();
|
|
1117
|
+
for (let ancestor = node?.parentElement; ancestor; ancestor = ancestor.parentElement) {
|
|
1118
|
+
if (
|
|
1119
|
+
ancestor.dataset.bloomPanelOwner ||
|
|
1120
|
+
ancestor.dataset.bloomReadingEnvelope ||
|
|
1121
|
+
ancestor.dataset.bloomShellFrame
|
|
1122
|
+
)
|
|
1123
|
+
ancestors.add(ancestor);
|
|
1124
|
+
}
|
|
1125
|
+
let cancelled = false;
|
|
1126
|
+
const finishWhenSettled = () => {
|
|
1127
|
+
if (cancelled) return;
|
|
1128
|
+
const owners = node?.querySelectorAll<HTMLElement>(`[data-bloom-panel-owner="${scope}"]`);
|
|
1129
|
+
const animations = reducedMotion
|
|
1130
|
+
? []
|
|
1131
|
+
: panelGeometryTransitions([...(owners ?? []), ...ancestors]);
|
|
1132
|
+
if (!animations.length) {
|
|
1133
|
+
setDocumentReady(true);
|
|
1134
|
+
return;
|
|
1135
|
+
}
|
|
1136
|
+
// A resize can replace an in-flight transition without changing the
|
|
1137
|
+
// requested owner. Recheck its replacement before committing the handoff.
|
|
1138
|
+
void Promise.allSettled(animations.map((animation) => animation.finished)).then(
|
|
1139
|
+
finishWhenSettled,
|
|
1140
|
+
);
|
|
1141
|
+
};
|
|
1142
|
+
finishWhenSettled();
|
|
1143
|
+
return () => {
|
|
1144
|
+
cancelled = true;
|
|
1145
|
+
};
|
|
1146
|
+
}, [wantsDocument, documentReady, reducedMotion, scope]);
|
|
1147
|
+
const firstInline = eligiblePanels(declared, shellWidth)[0]?.id;
|
|
1148
|
+
const layout = {
|
|
1149
|
+
...declared,
|
|
1150
|
+
panels: groupActions
|
|
1151
|
+
? declared.panels.map((panel) =>
|
|
1152
|
+
panel.id === firstInline
|
|
1153
|
+
? {
|
|
1154
|
+
...panel,
|
|
1155
|
+
headerActions: (
|
|
1156
|
+
<>
|
|
1157
|
+
{groupActions}
|
|
1158
|
+
{panel.headerActions}
|
|
1159
|
+
</>
|
|
1160
|
+
),
|
|
1161
|
+
}
|
|
1162
|
+
: panel,
|
|
1163
|
+
)
|
|
1164
|
+
: declared.panels,
|
|
1165
|
+
flow: document ? ('document' as const) : (declared.flow ?? ('bounded' as const)),
|
|
1166
|
+
horizontalScroll: 'contained' as const,
|
|
1167
|
+
gap:
|
|
1168
|
+
declared.gap ??
|
|
1169
|
+
(declared.appearance === 'joined' || declared.appearance === 'plain'
|
|
1170
|
+
? 1
|
|
1171
|
+
: (region?.gutter ?? gap)),
|
|
1172
|
+
};
|
|
1173
|
+
const nestedRegion = useMemo(
|
|
1174
|
+
() =>
|
|
1175
|
+
region
|
|
1176
|
+
? {
|
|
1177
|
+
...region,
|
|
1178
|
+
flow: document ? ('document' as const) : ('bounded' as const),
|
|
1179
|
+
bottomReserve: document ? region.bottomReserve : 0,
|
|
1180
|
+
underBottomBar: false,
|
|
1181
|
+
}
|
|
1182
|
+
: null,
|
|
1183
|
+
[region, document],
|
|
1184
|
+
);
|
|
1185
|
+
return (
|
|
1186
|
+
<View
|
|
1187
|
+
ref={groupRef}
|
|
1188
|
+
className="min-h-0 min-w-0 self-stretch grow shrink basis-auto"
|
|
1189
|
+
{...(parentScope ? { dataSet: { bloomLayout: scope } } : {})}
|
|
1190
|
+
style={
|
|
1191
|
+
!document && region?.flow === 'document'
|
|
1192
|
+
? {
|
|
1193
|
+
height: webViewportHeightMinus(
|
|
1194
|
+
region.viewportInset.top + region.viewportInset.bottom,
|
|
1195
|
+
),
|
|
1196
|
+
flexGrow: 0,
|
|
1197
|
+
flexShrink: 0,
|
|
1198
|
+
}
|
|
1199
|
+
: undefined
|
|
1200
|
+
}
|
|
1201
|
+
>
|
|
1202
|
+
<PanelCssContext.Provider value={parentScope ? scope : null}>
|
|
1203
|
+
<PanelResponsiveScopeContext.Provider value={inheritedResponsiveScope ?? parentScope}>
|
|
1204
|
+
<AppShellRegionContext.Provider value={nestedRegion}>
|
|
1205
|
+
<BottomEdgeProvider inherit={document}>
|
|
1206
|
+
<ContentPanelNestingContext.Provider value={false}>
|
|
1207
|
+
<PanelLayoutView
|
|
1208
|
+
layout={layout}
|
|
1209
|
+
shellWidth={shellWidth}
|
|
1210
|
+
gap={gap}
|
|
1211
|
+
testID={testID}
|
|
1212
|
+
/>
|
|
1213
|
+
</ContentPanelNestingContext.Provider>
|
|
1214
|
+
</BottomEdgeProvider>
|
|
1215
|
+
</AppShellRegionContext.Provider>
|
|
1216
|
+
</PanelResponsiveScopeContext.Provider>
|
|
1217
|
+
</PanelCssContext.Provider>
|
|
1218
|
+
</View>
|
|
1219
|
+
);
|
|
1220
|
+
}
|
|
958
1221
|
function PanelLayoutTracks({
|
|
959
1222
|
layout: declared,
|
|
960
1223
|
surfaceOwned = false,
|
|
@@ -970,16 +1233,22 @@ export function createPanelLayoutView(
|
|
|
970
1233
|
const layout = useMemo(() => applyPanelSpans(declared, spans), [declared, spans]);
|
|
971
1234
|
const region = useAppShellRegion();
|
|
972
1235
|
const restoration = useOptionalScrollRestorationContext();
|
|
1236
|
+
const canRestoreDocument = useContext(PanelDocumentRestorationContext);
|
|
973
1237
|
const ancestorHost = useContext(ScreenHostContext);
|
|
1238
|
+
const parentScreen = useContext(ScreenContext);
|
|
1239
|
+
const fallbackInsets = useSafeAreaInsets();
|
|
1240
|
+
const safeArea = useContext(SafeAreaInsetsContext) ?? fallbackInsets;
|
|
1241
|
+
const windowInsets = useContext(PanelWindowInsetsContext) ?? safeArea;
|
|
974
1242
|
const cssScope = useContext(PanelCssContext);
|
|
975
|
-
const
|
|
1243
|
+
const responsiveScope = useContext(PanelResponsiveScopeContext);
|
|
1244
|
+
const rootRef = useRef<ComponentRef<typeof NativeView>>(null);
|
|
976
1245
|
const reorderScrollRef = useRef<unknown>(null);
|
|
977
1246
|
const reorderScrollOffset = useRef({ x: 0, y: 0 });
|
|
978
1247
|
const nativeReorderScroll = useMemo<PanelReorderScroll>(
|
|
979
1248
|
() => ({
|
|
980
1249
|
measure: () =>
|
|
981
1250
|
new Promise((resolve) => {
|
|
982
|
-
const node = reorderScrollRef.current as ComponentRef<typeof
|
|
1251
|
+
const node = reorderScrollRef.current as ComponentRef<typeof NativeView> | null;
|
|
983
1252
|
if (!node?.measureInWindow) {
|
|
984
1253
|
resolve(null);
|
|
985
1254
|
return;
|
|
@@ -1020,10 +1289,18 @@ export function createPanelLayoutView(
|
|
|
1020
1289
|
const dimensions = vertical ? (layout.heights ?? ownHeights) : (layout.widths ?? ownWidths);
|
|
1021
1290
|
const joined = layout.appearance === 'joined' || layout.appearance === 'plain';
|
|
1022
1291
|
const actualGap = layout.gap ?? (joined ? 1 : gap);
|
|
1023
|
-
const document =
|
|
1024
|
-
|
|
1292
|
+
const document =
|
|
1293
|
+
layout.flow === 'document' &&
|
|
1294
|
+
layout.mode !== 'deck' &&
|
|
1295
|
+
layout.mode !== 'flow' &&
|
|
1296
|
+
Platform.OS === 'web';
|
|
1297
|
+
const deck = layout.mode === 'deck' || layout.mode === 'flow';
|
|
1025
1298
|
const documentHorizontal =
|
|
1026
|
-
!!cssScope &&
|
|
1299
|
+
!!cssScope &&
|
|
1300
|
+
deck &&
|
|
1301
|
+
layout.mode !== 'flow' &&
|
|
1302
|
+
!vertical &&
|
|
1303
|
+
layout.horizontalScroll !== 'contained';
|
|
1027
1304
|
const reducedMotion = usePrefersReducedMotion();
|
|
1028
1305
|
// The group's own size matters only at thresholds: the room below which a
|
|
1029
1306
|
// split shows its active track alone (its minimum, in every range of the
|
|
@@ -1032,13 +1309,8 @@ export function createPanelLayoutView(
|
|
|
1032
1309
|
// size only when it crosses one of these (`useMeasuredSizeClass`).
|
|
1033
1310
|
const shellRanges = panelLayoutWidthThresholds(layout);
|
|
1034
1311
|
const minima = shellRanges.map((lower) => panelLayoutMinimum(layout, lower, actualGap));
|
|
1035
|
-
// And where flexible tracks with minimums stop being held at them
|
|
1036
|
-
// (`flexibleRoomThresholds`): Yoga divides the room between those.
|
|
1037
|
-
const regimes = shellRanges.flatMap((lower) =>
|
|
1038
|
-
flexibleRoomThresholds(layout, lower, actualGap, dimensions),
|
|
1039
|
-
);
|
|
1040
1312
|
const heightReserve = document ? 0 : bottomEdge;
|
|
1041
|
-
const roomThresholds =
|
|
1313
|
+
const roomThresholds = minima;
|
|
1042
1314
|
const group = useMeasuredSizeClass(
|
|
1043
1315
|
vertical
|
|
1044
1316
|
? eligibilityFromGroup
|
|
@@ -1074,23 +1346,6 @@ export function createPanelLayoutView(
|
|
|
1074
1346
|
actualGap,
|
|
1075
1347
|
dimensions,
|
|
1076
1348
|
);
|
|
1077
|
-
// A track's size in pixels, when a resize gesture starts and the platform
|
|
1078
|
-
// gives no layout to read (`getBoundingClientRect`): the group's measured
|
|
1079
|
-
// room as Yoga divides it, which `resolvePanelTracks` models.
|
|
1080
|
-
const modelTrackSize = (id: string) => {
|
|
1081
|
-
// The window until the group's first layout, as its size classes read it.
|
|
1082
|
-
const measured = group.read() ?? Dimensions.get('window');
|
|
1083
|
-
const exactRoom = vertical ? Math.max(0, measured.height - heightReserve) : measured.width;
|
|
1084
|
-
return (
|
|
1085
|
-
resolvePanelTracks(
|
|
1086
|
-
{ ...layout, flow: document ? 'document' : 'bounded' },
|
|
1087
|
-
exactRoom,
|
|
1088
|
-
eligibilityFromGroup ? measured.width : shellWidth,
|
|
1089
|
-
actualGap,
|
|
1090
|
-
dimensions,
|
|
1091
|
-
).find((track) => track.id === id)?.width ?? 0
|
|
1092
|
-
);
|
|
1093
|
-
};
|
|
1094
1349
|
usePanelReveal({
|
|
1095
1350
|
rootRef,
|
|
1096
1351
|
request: layout.revealPanel,
|
|
@@ -1108,6 +1363,8 @@ export function createPanelLayoutView(
|
|
|
1108
1363
|
layout.widths ?? ownWidths,
|
|
1109
1364
|
layout.heights ?? ownHeights,
|
|
1110
1365
|
fillWidth,
|
|
1366
|
+
responsiveScope ?? cssScope,
|
|
1367
|
+
!fillWidth && !eligibilityFromGroup && responsiveScope === null,
|
|
1111
1368
|
)
|
|
1112
1369
|
: '';
|
|
1113
1370
|
const visibilityReady = cssScope ? cssState.measured : layoutReady;
|
|
@@ -1115,7 +1372,7 @@ export function createPanelLayoutView(
|
|
|
1115
1372
|
if (!cssScope || !rootRef.current || typeof getComputedStyle !== 'function') return;
|
|
1116
1373
|
const root = rootRef.current as unknown as HTMLElement;
|
|
1117
1374
|
const read = () => {
|
|
1118
|
-
const row = root.querySelector<HTMLElement>(
|
|
1375
|
+
const row = root.querySelector<HTMLElement>(`[data-bloom-panel-row="${cssScope}"]`);
|
|
1119
1376
|
if (!row) return;
|
|
1120
1377
|
const axis = getComputedStyle(row).getPropertyValue('--bloom-panel-axis').trim();
|
|
1121
1378
|
const next = layout.panels.map((panel, index) => {
|
|
@@ -1154,11 +1411,21 @@ export function createPanelLayoutView(
|
|
|
1154
1411
|
if (!root.hasAttribute('data-bloom-panel-resizing')) read();
|
|
1155
1412
|
});
|
|
1156
1413
|
observer?.observe(root);
|
|
1157
|
-
const shell = root.closest(
|
|
1414
|
+
const shell = root.closest(`[data-bloom-layout="${responsiveScope ?? cssScope}"]`);
|
|
1158
1415
|
if (shell) observer?.observe(shell);
|
|
1159
1416
|
return () => observer?.disconnect();
|
|
1160
|
-
}, [cssScope, cssRules, layout.panels]);
|
|
1417
|
+
}, [cssScope, responsiveScope, cssRules, layout.panels]);
|
|
1161
1418
|
const visible = tracks.filter((track) => track.visible);
|
|
1419
|
+
// Selection can survive Deck exit on a secondary column. Only actual
|
|
1420
|
+
// inline order (already resolved for expansion/compact mode) owns the page.
|
|
1421
|
+
const primaryId = visible[0]?.id;
|
|
1422
|
+
const primaryPanel = layout.panels.find((panel) => panel.id === primaryId);
|
|
1423
|
+
const ownsDocumentRestoration =
|
|
1424
|
+
canRestoreDocument &&
|
|
1425
|
+
ancestorHost.active !== false &&
|
|
1426
|
+
parentScreen?.active !== false &&
|
|
1427
|
+
primaryPanel !== undefined &&
|
|
1428
|
+
!primaryPanel.group;
|
|
1162
1429
|
const handedWindowChrome = useWindowChrome();
|
|
1163
1430
|
const platformWindow = usePlatformWindow();
|
|
1164
1431
|
// A web page deck scrolls the document from the shell's own start edge (the
|
|
@@ -1195,7 +1462,14 @@ export function createPanelLayoutView(
|
|
|
1195
1462
|
)
|
|
1196
1463
|
) {
|
|
1197
1464
|
const [first, second] = resized as [AppShellPanelDefinition, AppShellPanelDefinition];
|
|
1198
|
-
const
|
|
1465
|
+
const axis = vertical ? 'vertical' : 'horizontal';
|
|
1466
|
+
const weights = splitPairSpans(
|
|
1467
|
+
panelForAxis(first, axis),
|
|
1468
|
+
panelForAxis(second, axis),
|
|
1469
|
+
pair[first.id]!,
|
|
1470
|
+
pair[second.id]!,
|
|
1471
|
+
Platform.OS !== 'web',
|
|
1472
|
+
);
|
|
1199
1473
|
const nextSpans = { ...spans, ...weights };
|
|
1200
1474
|
if (declared.spans === undefined) setOwnSpans(nextSpans);
|
|
1201
1475
|
declared.onSpansChange?.(nextSpans);
|
|
@@ -1301,15 +1575,7 @@ export function createPanelLayoutView(
|
|
|
1301
1575
|
const row = (
|
|
1302
1576
|
<View
|
|
1303
1577
|
{...(cssScope ? { dataSet: { bloomPanelRow: cssScope } } : {})}
|
|
1304
|
-
|
|
1305
|
-
flexDirection: vertical ? 'column' : 'row',
|
|
1306
|
-
alignItems: 'stretch',
|
|
1307
|
-
flexGrow: 1,
|
|
1308
|
-
flexShrink: document ? 0 : 1,
|
|
1309
|
-
flexBasis: document ? 'auto' : 0,
|
|
1310
|
-
minHeight: 0,
|
|
1311
|
-
minWidth: 0,
|
|
1312
|
-
}}
|
|
1578
|
+
className={`min-h-0 min-w-0 items-stretch grow ${vertical ? 'flex-col' : 'flex-row'} ${document || (deck && vertical) ? 'shrink-0 basis-auto' : 'shrink basis-0'}`}
|
|
1313
1579
|
>
|
|
1314
1580
|
{layout.panels.map((panel, index) => (
|
|
1315
1581
|
<PanelHost
|
|
@@ -1337,17 +1603,23 @@ export function createPanelLayoutView(
|
|
|
1337
1603
|
visibilityReady={visibilityReady && trackById.has(panel.id)}
|
|
1338
1604
|
index={index}
|
|
1339
1605
|
getSize={() => resize.size(panel.id)}
|
|
1340
|
-
modelSize={() => modelTrackSize(panel.id)}
|
|
1341
1606
|
vertical={vertical}
|
|
1607
|
+
shellWidth={shellWidth}
|
|
1608
|
+
safeAreaTop={
|
|
1609
|
+
(parentScreen?.topInset ?? 0) > 0 || (vertical && visible[0]?.id !== panel.id)
|
|
1610
|
+
? 0
|
|
1611
|
+
: safeArea.top
|
|
1612
|
+
}
|
|
1342
1613
|
naturalHeight={
|
|
1343
1614
|
vertical &&
|
|
1344
|
-
document &&
|
|
1615
|
+
(document || layout.mode === 'flow') &&
|
|
1345
1616
|
panel.height === undefined &&
|
|
1346
1617
|
dimensions[panel.id] === undefined
|
|
1347
1618
|
}
|
|
1348
1619
|
track={trackById.get(panel.id) ?? { ...CSS_TRACK, id: panel.id, visible: false }}
|
|
1349
1620
|
alone={visible.length === 1}
|
|
1350
1621
|
document={document}
|
|
1622
|
+
documentRestorationOwner={canRestoreDocument && panel.id === primaryId}
|
|
1351
1623
|
joined={joined}
|
|
1352
1624
|
gap={actualGap}
|
|
1353
1625
|
hasNext={visible[visible.length - 1]?.id !== panel.id}
|
|
@@ -1380,98 +1652,100 @@ export function createPanelLayoutView(
|
|
|
1380
1652
|
</Viewport>
|
|
1381
1653
|
);
|
|
1382
1654
|
return (
|
|
1383
|
-
<
|
|
1384
|
-
<
|
|
1385
|
-
<
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
{
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
?
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1655
|
+
<PanelWindowInsetsContext.Provider value={windowInsets}>
|
|
1656
|
+
<PanelDropProvider value={drop}>
|
|
1657
|
+
<PanelOrderBoundary ids={layout.panels.map((panel) => panel.id)} rootRef={rootRef}>
|
|
1658
|
+
<ServerStyleSheet id={cssScope ?? ''} css={cssRules} />
|
|
1659
|
+
<View
|
|
1660
|
+
ref={rootRef}
|
|
1661
|
+
{...(cssScope
|
|
1662
|
+
? {
|
|
1663
|
+
dataSet: {
|
|
1664
|
+
bloomPanelGroup: cssScope,
|
|
1665
|
+
bloomPanelOrdering: reorder.ordering ? 'true' : undefined,
|
|
1666
|
+
},
|
|
1667
|
+
}
|
|
1668
|
+
: {})}
|
|
1669
|
+
testID={testID}
|
|
1670
|
+
onLayout={cssScope ? undefined : group.onLayout}
|
|
1671
|
+
style={[
|
|
1672
|
+
{
|
|
1673
|
+
minWidth: 0,
|
|
1674
|
+
alignSelf: 'stretch',
|
|
1675
|
+
// Horizontal document panels reserve inside their own surface.
|
|
1676
|
+
// A bounded group reserves the bottom bar, or — when the app keeps
|
|
1677
|
+
// the bar over its content — fills under it and what scrolls clears
|
|
1678
|
+
// it (`useBottomEdgeInset`, the panel scroller, the vertical deck).
|
|
1679
|
+
paddingBottom: document
|
|
1680
|
+
? vertical && visible.length > 1
|
|
1681
|
+
? (region?.bottomReserve ?? 0)
|
|
1682
|
+
: 0
|
|
1683
|
+
: region?.underBottomBar
|
|
1684
|
+
? 0
|
|
1685
|
+
: bottomEdge,
|
|
1686
|
+
...(cssScope
|
|
1687
|
+
? {
|
|
1688
|
+
containerType: document ? 'inline-size' : 'size',
|
|
1689
|
+
containerName: `${cssScope}-group`,
|
|
1690
|
+
}
|
|
1691
|
+
: {}),
|
|
1692
|
+
} as WebCssStyle,
|
|
1693
|
+
document ? {} : FILL,
|
|
1694
|
+
]}
|
|
1695
|
+
>
|
|
1696
|
+
{Platform.OS === 'web' && restoration && !ancestorHost.restoresDocument ? (
|
|
1697
|
+
<DocumentRestoration enabled={document && ownsDocumentRestoration} />
|
|
1698
|
+
) : null}
|
|
1699
|
+
{joined && !surfaceOwned ? (
|
|
1700
|
+
<ContentPanel
|
|
1701
|
+
appearance={layout.appearance === 'plain' ? 'plain' : undefined}
|
|
1702
|
+
framed={cssScope && !eligibilityFromGroup ? true : (region?.framed ?? true)}
|
|
1703
|
+
fill={!document}
|
|
1704
|
+
scrollable={false}
|
|
1705
|
+
overlaySizing={document ? 'viewport' : 'panel'}
|
|
1706
|
+
overlayInset={document ? region?.viewportInset : undefined}
|
|
1707
|
+
surfaceStyle={
|
|
1708
|
+
groupWindowChrome && platformWindow
|
|
1709
|
+
? [FILL, windowEdgeTopCorners(platformWindow.metrics)]
|
|
1710
|
+
: FILL
|
|
1711
|
+
}
|
|
1712
|
+
contentStyle={FILL}
|
|
1713
|
+
>
|
|
1714
|
+
{content}
|
|
1715
|
+
</ContentPanel>
|
|
1716
|
+
) : (
|
|
1717
|
+
content
|
|
1718
|
+
)}
|
|
1719
|
+
{layout.onPanelOrderChange ? (
|
|
1720
|
+
<Text
|
|
1721
|
+
accessibilityLiveRegion="polite"
|
|
1722
|
+
aria-live="polite"
|
|
1723
|
+
style={{
|
|
1724
|
+
position: 'absolute',
|
|
1725
|
+
width: 1,
|
|
1726
|
+
height: 1,
|
|
1727
|
+
overflow: 'hidden',
|
|
1728
|
+
opacity: 0,
|
|
1729
|
+
}}
|
|
1730
|
+
>
|
|
1731
|
+
{reorder.announcement}
|
|
1732
|
+
</Text>
|
|
1733
|
+
) : null}
|
|
1734
|
+
{documentHorizontal ? (
|
|
1735
|
+
<ScrollBar target="document" horizontal offset={bottomEdge} />
|
|
1736
|
+
) : null}
|
|
1737
|
+
{documentHorizontal && layout.trailingAction ? (
|
|
1738
|
+
<View
|
|
1739
|
+
{...{ dataSet: { bloomDeckTrailing: cssScope ?? undefined } }}
|
|
1740
|
+
testID={testID ? `${testID}-trailing-action` : undefined}
|
|
1741
|
+
>
|
|
1742
|
+
{layout.trailingAction}
|
|
1743
|
+
</View>
|
|
1744
|
+
) : null}
|
|
1745
|
+
</View>
|
|
1746
|
+
</PanelOrderBoundary>
|
|
1747
|
+
</PanelDropProvider>
|
|
1748
|
+
</PanelWindowInsetsContext.Provider>
|
|
1475
1749
|
);
|
|
1476
1750
|
}
|
|
1477
1751
|
function PanelLayoutView(props: PanelLayoutViewProps) {
|
|
@@ -1483,7 +1757,10 @@ export function createPanelLayoutView(
|
|
|
1483
1757
|
return <RetainedPanelLayout layout={props.layout} gap={props.gap} testID={props.testID} />;
|
|
1484
1758
|
if (props.layout.header === undefined) return <PanelLayoutTracks {...props} />;
|
|
1485
1759
|
const document =
|
|
1486
|
-
props.layout.flow === 'document' &&
|
|
1760
|
+
props.layout.flow === 'document' &&
|
|
1761
|
+
props.layout.mode !== 'deck' &&
|
|
1762
|
+
props.layout.mode !== 'flow' &&
|
|
1763
|
+
Platform.OS === 'web';
|
|
1487
1764
|
const joined = props.layout.appearance === 'joined' || props.layout.appearance === 'plain';
|
|
1488
1765
|
const workspace = (
|
|
1489
1766
|
<Screen
|