@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
|
@@ -6,8 +6,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.createPanelLayoutView = createPanelLayoutView;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
|
+
var _styledPrimitives = require("../styles/styled-primitives.js");
|
|
10
|
+
var _reactNativeSafeAreaContext = require("react-native-safe-area-context");
|
|
9
11
|
var _reactNativeReanimated = _interopRequireWildcard(require("react-native-reanimated"));
|
|
10
|
-
var _context = require("../
|
|
12
|
+
var _context = require("../content-panel/context.js");
|
|
13
|
+
var _context2 = require("../dialog/context.js");
|
|
11
14
|
var _CloseButton = require("../button/CloseButton.js");
|
|
12
15
|
var _commonMessages = require("../locale/common-messages.js");
|
|
13
16
|
var _appShellRegion = require("../layout/app-shell-region.js");
|
|
@@ -15,12 +18,14 @@ var _bottomEdge = require("../layout/bottom-edge.js");
|
|
|
15
18
|
var _scrollMetrics = require("../layout/scroll-metrics.js");
|
|
16
19
|
var _scrollOffset = require("../layout/scroll-offset.js");
|
|
17
20
|
var _screenScope = require("../layout/screen-scope.js");
|
|
18
|
-
var
|
|
19
|
-
var
|
|
21
|
+
var _context3 = require("../scroll/context.js");
|
|
22
|
+
var _context4 = require("../screen/context.js");
|
|
20
23
|
var _reselect = require("../screen/reselect.js");
|
|
21
24
|
var _ResizeHandle = require("../layout/ResizeHandle.js");
|
|
22
25
|
var _PanelErrorBoundary = require("../error-boundary/PanelErrorBoundary.js");
|
|
23
26
|
var _panelMotion = require("./panel-motion.js");
|
|
27
|
+
var _panelTransitions = require("./panel-transitions.js");
|
|
28
|
+
var _usePanelExitCompletion = require("./use-panel-exit-completion.js");
|
|
24
29
|
var _animatedStyle = require("../styles/animated-style.js");
|
|
25
30
|
var _useWidthClass = require("../hooks/use-width-class.js");
|
|
26
31
|
var _platform = require("../styles/platform.js");
|
|
@@ -38,20 +43,25 @@ var _usePanelResize = require("./use-panel-resize.js");
|
|
|
38
43
|
var _useRoomChanged = require("./use-room-changed.js");
|
|
39
44
|
var _panelLayoutCss = require("./panel-layout-css.js");
|
|
40
45
|
var _ServerStyleSheet = require("../styles/ServerStyleSheet.js");
|
|
41
|
-
var
|
|
46
|
+
var _context5 = require("./context.js");
|
|
42
47
|
var _useLatestClaim = require("../hooks/use-latest-claim.js");
|
|
43
48
|
var _placementBoundary = require("../overlay/placement-boundary.js");
|
|
44
49
|
var _PanelNavigation = require("./PanelNavigation.js");
|
|
45
50
|
var _panelLayout = require("./panel-layout.js");
|
|
46
51
|
var _PanelDropZones = require("./PanelDropZones.js");
|
|
47
52
|
var _RetainedPanelLayout = require("./RetainedPanelLayout.js");
|
|
48
|
-
var
|
|
49
|
-
var
|
|
53
|
+
var _context6 = require("../platform-surface/context.js");
|
|
54
|
+
var _context7 = require("../window/context.js");
|
|
50
55
|
var _geometry = require("../window/geometry.js");
|
|
51
56
|
var _usePrefersReducedMotion = require("../hooks/use-prefers-reduced-motion.js");
|
|
52
57
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
53
58
|
var cache;
|
|
54
59
|
function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var r, c, a = Object.defineProperty, n = { __proto__: null, default: e }; if (Object(e) !== e) return n; if (cache || "function" != typeof WeakMap || (cache = new WeakMap()), cache) { if (cache.has(e)) return cache.get(e); cache.set(e, n); } for (c in e) "default" !== c && {}.hasOwnProperty.call(e, c) && ((r = a && Object.getOwnPropertyDescriptor(e, c)) && (r.get || r.set) ? a(n, c, r) : n[c] = e[c]); return n; }
|
|
60
|
+
const PanelWindowInsetsContext = /*#__PURE__*/_react.default.createContext(null);
|
|
61
|
+
// The document is one scroll owner. Transparent groups delegate its restoration
|
|
62
|
+
// down the primary branch instead of each layout restoring the same window.
|
|
63
|
+
const PanelDocumentRestorationContext = /*#__PURE__*/_react.default.createContext(true);
|
|
64
|
+
|
|
55
65
|
/** A track the CSS compositor sizes: its flex values are the stylesheet's, never read. */
|
|
56
66
|
const CSS_TRACK = {
|
|
57
67
|
grow: 0,
|
|
@@ -65,7 +75,7 @@ const CSS_TRACK = {
|
|
|
65
75
|
|
|
66
76
|
/** How far a split's pill divider reaches into each pane beside its gap, px. */
|
|
67
77
|
const RESIZE_HANDLE_PANE_REACH = 2;
|
|
68
|
-
const AnimatedView = _reactNativeReanimated.default.createAnimatedComponent(
|
|
78
|
+
const AnimatedView = _reactNativeReanimated.default.createAnimatedComponent(_styledPrimitives.StyledView);
|
|
69
79
|
// A horizontal ScrollView's content is as wide as its children, so a row that
|
|
70
80
|
// does not scroll (a split, not a deck) is held to the viewport: its tracks fit
|
|
71
81
|
// by shrinking from their preferred widths (`resolvePanelFlex`), which an
|
|
@@ -85,7 +95,7 @@ const FILL = {
|
|
|
85
95
|
function DocumentPanelReserve({
|
|
86
96
|
height
|
|
87
97
|
}) {
|
|
88
|
-
return height > 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
98
|
+
return height > 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_styledPrimitives.StyledView, {
|
|
89
99
|
testID: "app-shell-panel-reserve",
|
|
90
100
|
style: {
|
|
91
101
|
height,
|
|
@@ -97,7 +107,7 @@ function DocumentPanelReserve({
|
|
|
97
107
|
/** Shared implementation for native and web; only material and scrollbar implementations differ. */
|
|
98
108
|
function createPanelLayoutView(ContentPanel, ColorScope, ScrollArea, ScrollBar, useScrollRestoration, Dialog, Screen) {
|
|
99
109
|
function PanelDismissAction() {
|
|
100
|
-
const surface = (0,
|
|
110
|
+
const surface = (0, _context2.useDialogContext)();
|
|
101
111
|
const messages = (0, _commonMessages.useCommonMessages)();
|
|
102
112
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_CloseButton.CloseButton, {
|
|
103
113
|
size: "md",
|
|
@@ -109,9 +119,10 @@ function createPanelLayoutView(ContentPanel, ColorScope, ScrollArea, ScrollBar,
|
|
|
109
119
|
panel,
|
|
110
120
|
open,
|
|
111
121
|
children,
|
|
122
|
+
onClosed,
|
|
112
123
|
testID
|
|
113
124
|
}) {
|
|
114
|
-
const control = (0,
|
|
125
|
+
const control = (0, _context2.useDialogControl)();
|
|
115
126
|
const intent = (0, _react.useRef)(open);
|
|
116
127
|
intent.current = open;
|
|
117
128
|
(0, _react.useEffect)(() => {
|
|
@@ -120,7 +131,7 @@ function createPanelLayoutView(ContentPanel, ColorScope, ScrollArea, ScrollBar,
|
|
|
120
131
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Dialog, {
|
|
121
132
|
control: control,
|
|
122
133
|
label: panel.floating.label,
|
|
123
|
-
placement:
|
|
134
|
+
placement: panel.floating?.placement ?? 'end',
|
|
124
135
|
width: panel.floating.width ?? panel.width ?? 410,
|
|
125
136
|
inset: {
|
|
126
137
|
top: 12,
|
|
@@ -129,12 +140,14 @@ function createPanelLayoutView(ContentPanel, ColorScope, ScrollArea, ScrollBar,
|
|
|
129
140
|
right: 12
|
|
130
141
|
},
|
|
131
142
|
scrollable: false,
|
|
143
|
+
sizing: "fill",
|
|
132
144
|
contentPadding: 0,
|
|
133
145
|
testID: testID ? `${testID}-floating` : undefined,
|
|
134
146
|
onClose: () => {
|
|
135
147
|
// An explicit state close already belongs to the host. Only surface
|
|
136
148
|
// dismissal reports a new intent, after Dialog's exit completes.
|
|
137
149
|
if (intent.current) panel.floating.onOpenChange(false);
|
|
150
|
+
onClosed();
|
|
138
151
|
},
|
|
139
152
|
children: children
|
|
140
153
|
});
|
|
@@ -162,12 +175,12 @@ function createPanelLayoutView(ContentPanel, ColorScope, ScrollArea, ScrollBar,
|
|
|
162
175
|
const handle = (0, _react.useRef)({
|
|
163
176
|
getScrollableNode: () => node.current
|
|
164
177
|
});
|
|
165
|
-
if (_reactNative.Platform.OS === 'web') return /*#__PURE__*/(0, _jsxRuntime.jsxs)(
|
|
178
|
+
if (_reactNative.Platform.OS === 'web') return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styledPrimitives.StyledView, {
|
|
166
179
|
style: document ? {
|
|
167
180
|
minWidth: 0
|
|
168
181
|
} : FILL,
|
|
169
182
|
testID: testID,
|
|
170
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
183
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_styledPrimitives.StyledView, {
|
|
171
184
|
ref: value => {
|
|
172
185
|
node.current = value;
|
|
173
186
|
},
|
|
@@ -222,7 +235,7 @@ function createPanelLayoutView(ContentPanel, ColorScope, ScrollArea, ScrollBar,
|
|
|
222
235
|
onScroll: binding.onScroll,
|
|
223
236
|
bottomInset: underBar ? bottomEdge : undefined,
|
|
224
237
|
testID: testID,
|
|
225
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
238
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_context5.PanelScrollContainerContext.Provider, {
|
|
226
239
|
value: document ? null : ref,
|
|
227
240
|
children: children
|
|
228
241
|
})
|
|
@@ -239,12 +252,14 @@ function createPanelLayoutView(ContentPanel, ColorScope, ScrollArea, ScrollBar,
|
|
|
239
252
|
visibilityReady,
|
|
240
253
|
index,
|
|
241
254
|
getSize,
|
|
242
|
-
modelSize,
|
|
243
255
|
vertical,
|
|
244
256
|
naturalHeight,
|
|
257
|
+
safeAreaTop,
|
|
258
|
+
shellWidth,
|
|
245
259
|
track,
|
|
246
260
|
alone,
|
|
247
261
|
document: documentFlow,
|
|
262
|
+
documentRestorationOwner,
|
|
248
263
|
joined,
|
|
249
264
|
gap,
|
|
250
265
|
onResize,
|
|
@@ -258,8 +273,15 @@ function createPanelLayoutView(ContentPanel, ColorScope, ScrollArea, ScrollBar,
|
|
|
258
273
|
testID
|
|
259
274
|
}) {
|
|
260
275
|
const layoutReady = (0, _useShellViewport.useShellLayoutReady)();
|
|
276
|
+
const fallbackInsets = (0, _reactNativeSafeAreaContext.useSafeAreaInsets)();
|
|
277
|
+
const safeArea = (0, _react.useContext)(_reactNativeSafeAreaContext.SafeAreaInsetsContext) ?? fallbackInsets;
|
|
278
|
+
const windowInsets = (0, _react.useContext)(PanelWindowInsetsContext) ?? safeArea;
|
|
279
|
+
const inlineInsets = (0, _react.useMemo)(() => ({
|
|
280
|
+
...safeArea,
|
|
281
|
+
top: safeAreaTop
|
|
282
|
+
}), [safeArea, safeAreaTop]);
|
|
261
283
|
// One tree whether or not the panel holds the window's chrome right now.
|
|
262
|
-
const platformWindow = (0,
|
|
284
|
+
const platformWindow = (0, _context6.usePlatformWindow)();
|
|
263
285
|
const windowed = platformWindow != null;
|
|
264
286
|
// Along the window's top edge the panel's top corners are concentric with
|
|
265
287
|
// the window's own.
|
|
@@ -326,24 +348,28 @@ function createPanelLayoutView(ContentPanel, ColorScope, ScrollArea, ScrollBar,
|
|
|
326
348
|
const theme = (0, _useTheme.useTheme)();
|
|
327
349
|
const rtl = (0, _useIsRtl.useIsRtl)();
|
|
328
350
|
// Only the web places a sticky panel from the viewport's height.
|
|
329
|
-
const viewportHeight = (0, _useWidthClass.useWindowSizeWhile)(_reactNative.Platform.OS === 'web').height;
|
|
351
|
+
const viewportHeight = (0, _useWidthClass.useWindowSizeWhile)(_reactNative.Platform.OS === 'web' && !!panel.sticky && documentFlow).height;
|
|
330
352
|
const [stickyHeight, setStickyHeight] = (0, _react.useState)(0);
|
|
331
353
|
const document = documentFlow && !track.floating;
|
|
354
|
+
const documentFrame = document && (!vertical || alone);
|
|
332
355
|
const floatingOpen = !!track.floating && !!panel.floating?.open && panel.visible !== false;
|
|
333
|
-
const sticky = !!panel.sticky &&
|
|
334
|
-
const parent = _react.default.useContext(
|
|
335
|
-
const
|
|
356
|
+
const sticky = !!panel.sticky && documentFrame;
|
|
357
|
+
const parent = _react.default.useContext(_context4.ScreenContext);
|
|
358
|
+
const ancestorHost = (0, _react.useContext)(_context4.ScreenHostContext);
|
|
359
|
+
const active = panel.visible !== false && (track.visible || floatingOpen) && (parent?.active ?? true) && ancestorHost.active;
|
|
336
360
|
const screenRef = (0, _react.useRef)(null);
|
|
337
361
|
const scrollY = (0, _reactNativeReanimated.useSharedValue)(0);
|
|
338
362
|
const contentHeight = (0, _reactNativeReanimated.useSharedValue)(-1);
|
|
363
|
+
const intrinsicContentHeight = (0, _reactNativeReanimated.useSharedValue)(-1);
|
|
339
364
|
const scrollViewportHeight = (0, _reactNativeReanimated.useSharedValue)(0);
|
|
340
365
|
const metrics = (0, _react.useMemo)(() => ({
|
|
341
366
|
scrollY,
|
|
342
367
|
contentHeight,
|
|
368
|
+
intrinsicContentHeight: panel.resizeMaxHeight === 'content' ? intrinsicContentHeight : undefined,
|
|
343
369
|
viewportHeight: scrollViewportHeight
|
|
344
|
-
}), [scrollY, contentHeight, scrollViewportHeight]);
|
|
370
|
+
}), [scrollY, contentHeight, intrinsicContentHeight, scrollViewportHeight, panel.resizeMaxHeight]);
|
|
345
371
|
const [screenColor, claimPanelColor] = (0, _useLatestClaim.useLatestClaim)();
|
|
346
|
-
const claimShellColor = (0, _react.useContext)(
|
|
372
|
+
const claimShellColor = (0, _react.useContext)(_context5.ShellColorClaimContext);
|
|
347
373
|
const claimColor = (0, _react.useCallback)(color => {
|
|
348
374
|
const releasePanel = claimPanelColor(color);
|
|
349
375
|
const releaseShell = claimShellColor?.(color);
|
|
@@ -359,9 +385,10 @@ function createPanelLayoutView(ContentPanel, ColorScope, ScrollArea, ScrollBar,
|
|
|
359
385
|
// history takes precedence over it where it can go back.
|
|
360
386
|
const {
|
|
361
387
|
back
|
|
362
|
-
} = (0, _react.useContext)(
|
|
388
|
+
} = (0, _react.useContext)(_context4.ScreenHostContext);
|
|
363
389
|
const host = (0, _react.useMemo)(() => ({
|
|
364
390
|
active,
|
|
391
|
+
sizing: naturalHeight ? 'content' : 'fill',
|
|
365
392
|
back,
|
|
366
393
|
restoresDocument: document,
|
|
367
394
|
kind: _reactNative.Platform.OS !== 'web' ? 'native' : document ? 'document' : 'element',
|
|
@@ -372,15 +399,14 @@ function createPanelLayoutView(ContentPanel, ColorScope, ScrollArea, ScrollBar,
|
|
|
372
399
|
}) : panel.headerActions,
|
|
373
400
|
claimColor,
|
|
374
401
|
metrics
|
|
375
|
-
}), [active, back, document, metrics, panel.headerActions, reorderHandle, panel.bottomBar, claimColor, track.floating]);
|
|
402
|
+
}), [active, naturalHeight, back, document, metrics, panel.headerActions, reorderHandle, panel.bottomBar, claimColor, track.floating]);
|
|
376
403
|
const mounted = (0, _react.useRef)(false);
|
|
377
404
|
if (track.visible || floatingOpen || panel.keepMounted) mounted.current = true;
|
|
378
405
|
const start = (0, _react.useRef)(0);
|
|
379
406
|
const reduced = (0, _usePrefersReducedMotion.usePrefersReducedMotion)();
|
|
380
407
|
// The track's flex along the group's axis (`resolvePanelFlex`), as shared
|
|
381
|
-
// values: Yoga
|
|
382
|
-
//
|
|
383
|
-
// shown, hidden, resized by its handle) moves them.
|
|
408
|
+
// values: Yoga distributes room without a React sizing pass. Semantic
|
|
409
|
+
// visibility changes and direct gestures update these declarative values.
|
|
384
410
|
const grow = (0, _reactNativeReanimated.useSharedValue)(track.grow);
|
|
385
411
|
const basis = (0, _reactNativeReanimated.useSharedValue)(track.basis);
|
|
386
412
|
const min = (0, _reactNativeReanimated.useSharedValue)(track.min);
|
|
@@ -389,14 +415,20 @@ function createPanelLayoutView(ContentPanel, ColorScope, ScrollArea, ScrollBar,
|
|
|
389
415
|
const opacity = (0, _reactNativeReanimated.useSharedValue)(track.visible ? 1 : 0);
|
|
390
416
|
const panelScale = (0, _reactNativeReanimated.useSharedValue)(1);
|
|
391
417
|
const lastHeight = (0, _reactNativeReanimated.useSharedValue)(0);
|
|
418
|
+
const lastWidth = (0, _reactNativeReanimated.useSharedValue)(0);
|
|
392
419
|
// A resize gesture holds the track at the size it drags to (a frozen
|
|
393
420
|
// basis), and its commit lands at once: what it settled on is already drawn.
|
|
394
421
|
const gestureHeld = (0, _react.useRef)(false);
|
|
395
422
|
(0, _react.useEffect)(() => registerResizePreview({
|
|
396
423
|
read: () => {
|
|
397
424
|
const box = panelRef.current?.getBoundingClientRect?.();
|
|
398
|
-
return box ? vertical ? box.height : box.width :
|
|
425
|
+
return box ? vertical ? box.height : box.width : vertical ? lastHeight.value : lastWidth.value;
|
|
399
426
|
},
|
|
427
|
+
contentHeight: panel.resizeMaxHeight === 'content' ? height => {
|
|
428
|
+
const intrinsic = intrinsicContentHeight.value;
|
|
429
|
+
const viewport = scrollViewportHeight.value;
|
|
430
|
+
return intrinsic >= 0 && viewport > 0 ? Math.max(0, height - viewport) + intrinsic : undefined;
|
|
431
|
+
} : undefined,
|
|
400
432
|
update: size => {
|
|
401
433
|
gestureHeld.current = true;
|
|
402
434
|
(0, _reactNativeReanimated.cancelAnimation)(grow);
|
|
@@ -404,10 +436,21 @@ function createPanelLayoutView(ContentPanel, ColorScope, ScrollArea, ScrollBar,
|
|
|
404
436
|
grow.value = 0;
|
|
405
437
|
basis.value = size;
|
|
406
438
|
}
|
|
407
|
-
}), [registerResizePreview, grow, basis, vertical]);
|
|
439
|
+
}), [registerResizePreview, grow, basis, vertical, panel.resizeMaxHeight, intrinsicContentHeight, scrollViewportHeight]);
|
|
408
440
|
// The panel paints the material: on the web its fade is its presence, never
|
|
409
441
|
// an opacity on the track above it (the CSS compositor does the same).
|
|
410
442
|
const fadeMs = cssScope || reduced ? 0 : transition === 'exit-before-enter' ? _panelMotion.PANEL_EXIT_MS : _panelMotion.PANEL_LAYOUT_MS;
|
|
443
|
+
const {
|
|
444
|
+
captureNativeCompletion,
|
|
445
|
+
completeFloating
|
|
446
|
+
} = (0, _usePanelExitCompletion.usePanelExitCompletion)({
|
|
447
|
+
present: panel.visible !== false && (!track.floating || floatingOpen),
|
|
448
|
+
floating: !!track.floating,
|
|
449
|
+
css: !!cssScope,
|
|
450
|
+
reducedMotion: reduced,
|
|
451
|
+
owner: panelRef,
|
|
452
|
+
onExitComplete: panel.onExitComplete
|
|
453
|
+
});
|
|
411
454
|
(0, _useSurfacePresence.useSurfacePresenceContent)(cssScope ? null : panelRef, {
|
|
412
455
|
presence: track.visible ? 1 : 0,
|
|
413
456
|
duration: fadeMs,
|
|
@@ -436,8 +479,8 @@ function createPanelLayoutView(ContentPanel, ColorScope, ScrollArea, ScrollBar,
|
|
|
436
479
|
max: track.max,
|
|
437
480
|
gap: track.gap,
|
|
438
481
|
visible: track.visible
|
|
439
|
-
}, transition === 'exit-before-enter', reduced || resized || held);
|
|
440
|
-
}, [track.grow, track.basis, track.min, track.max, track.gap, track.visible, grow, basis, min, max, leading, opacity, panelScale, transition, reduced, cssScope]);
|
|
482
|
+
}, transition === 'exit-before-enter', reduced || resized || held, track.floating ? undefined : captureNativeCompletion());
|
|
483
|
+
}, [track.grow, track.basis, track.min, track.max, track.gap, track.visible, track.floating, panel.visible, grow, basis, min, max, leading, opacity, panelScale, transition, reduced, cssScope, captureNativeCompletion]);
|
|
441
484
|
// Every key on every run (`styles/animated-style.ts`).
|
|
442
485
|
// The track's basis is its main-axis SIZE (`width` across, `height` down)
|
|
443
486
|
// under `flexBasis: auto`, never `flexBasis` itself: Fabric marks a node
|
|
@@ -491,7 +534,7 @@ function createPanelLayoutView(ContentPanel, ColorScope, ScrollArea, ScrollBar,
|
|
|
491
534
|
testID: testID ? `${testID}-scroll` : undefined,
|
|
492
535
|
children: content
|
|
493
536
|
}) : content
|
|
494
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
537
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_styledPrimitives.StyledView, {
|
|
495
538
|
style: FILL,
|
|
496
539
|
children: content
|
|
497
540
|
});
|
|
@@ -523,12 +566,18 @@ function createPanelLayoutView(ContentPanel, ColorScope, ScrollArea, ScrollBar,
|
|
|
523
566
|
// Under the bottom bar a side-by-side panel reaches it: its content clears
|
|
524
567
|
// the bar and drives it (the shell's navigation motion); a stacked one sits
|
|
525
568
|
// above the group viewport's own clearance.
|
|
526
|
-
const underBar = !
|
|
527
|
-
const body = /*#__PURE__*/(0, _jsxRuntime.
|
|
569
|
+
const underBar = !documentFrame && !!region?.underBottomBar;
|
|
570
|
+
const body = panel.group ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_context4.ScreenHostContext.Provider, {
|
|
571
|
+
value: {
|
|
572
|
+
...ancestorHost,
|
|
573
|
+
active
|
|
574
|
+
},
|
|
575
|
+
children: content
|
|
576
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
528
577
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_screenScope.ScreenScope, {
|
|
529
578
|
inheritBottomEdge: document || underBar,
|
|
530
579
|
inheritNavigation: underBar,
|
|
531
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
580
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_context4.ScreenHostContext.Provider, {
|
|
532
581
|
value: navigation ? {
|
|
533
582
|
...host,
|
|
534
583
|
navigation
|
|
@@ -537,7 +586,7 @@ function createPanelLayoutView(ContentPanel, ColorScope, ScrollArea, ScrollBar,
|
|
|
537
586
|
value: metrics,
|
|
538
587
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_scrollOffset.ScrollOffsetProvider, {
|
|
539
588
|
value: scrollY,
|
|
540
|
-
children: windowed ? /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
589
|
+
children: windowed ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_context7.WindowChromeProvider, {
|
|
541
590
|
value: windowChrome,
|
|
542
591
|
children: content
|
|
543
592
|
}) : content
|
|
@@ -545,11 +594,11 @@ function createPanelLayoutView(ContentPanel, ColorScope, ScrollArea, ScrollBar,
|
|
|
545
594
|
})
|
|
546
595
|
})
|
|
547
596
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(DocumentPanelReserve, {
|
|
548
|
-
height:
|
|
597
|
+
height: documentFrame ? region?.bottomReserve ?? 0 : 0
|
|
549
598
|
})]
|
|
550
599
|
});
|
|
551
600
|
const framed = region?.framed ?? true;
|
|
552
|
-
const surface = joined ? /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
601
|
+
const surface = panel.group ? body : joined ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_styledPrimitives.StyledView, {
|
|
553
602
|
style: FILL,
|
|
554
603
|
children: panel.errorBoundary ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_PanelErrorBoundary.PanelErrorBoundary, {
|
|
555
604
|
...(panel.errorBoundary === true ? {} : panel.errorBoundary),
|
|
@@ -563,11 +612,11 @@ function createPanelLayoutView(ContentPanel, ColorScope, ScrollArea, ScrollBar,
|
|
|
563
612
|
framed: cssScope && cssFraming ? true : framed,
|
|
564
613
|
maskColor: region?.maskColor,
|
|
565
614
|
errorBoundary: panel.errorBoundary,
|
|
566
|
-
fill: !document,
|
|
615
|
+
fill: !document && !naturalHeight,
|
|
567
616
|
scrollable: false,
|
|
568
|
-
overlaySizing:
|
|
569
|
-
overlayInset:
|
|
570
|
-
surfaceStyle: [FILL,
|
|
617
|
+
overlaySizing: documentFrame ? 'viewport' : 'panel',
|
|
618
|
+
overlayInset: documentFrame ? region?.viewportInset : undefined,
|
|
619
|
+
surfaceStyle: [FILL, documentFrame && !sticky && region ? {
|
|
571
620
|
minHeight: (0, _webViewStyle.webViewportHeightMinus)(region.viewportInset.top + region.viewportInset.bottom)
|
|
572
621
|
} : undefined,
|
|
573
622
|
// Only along a window's top edge, so the style is unchanged elsewhere.
|
|
@@ -600,9 +649,10 @@ function createPanelLayoutView(ContentPanel, ColorScope, ScrollArea, ScrollBar,
|
|
|
600
649
|
} : undefined, resizable ? {
|
|
601
650
|
zIndex: 1
|
|
602
651
|
} : undefined, _reactNative.Platform.OS !== 'web' ? reorderStyle : undefined],
|
|
603
|
-
onLayout: event => {
|
|
652
|
+
onLayout: cssScope && !sticky ? undefined : event => {
|
|
604
653
|
if (track.visible) {
|
|
605
654
|
lastHeight.value = event.nativeEvent.layout.height;
|
|
655
|
+
lastWidth.value = event.nativeEvent.layout.width;
|
|
606
656
|
if (sticky) setStickyHeight(event.nativeEvent.layout.height);
|
|
607
657
|
}
|
|
608
658
|
},
|
|
@@ -613,7 +663,7 @@ function createPanelLayoutView(ContentPanel, ColorScope, ScrollArea, ScrollBar,
|
|
|
613
663
|
importantForAccessibility: active ? 'auto' : 'no-hide-descendants',
|
|
614
664
|
accessibilityElementsHidden: !active,
|
|
615
665
|
pointerEvents: active ? 'auto' : 'none',
|
|
616
|
-
children: [mounted.current && !track.floating ? /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
666
|
+
children: [mounted.current && !track.floating ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_context5.AppShellPanelContext.Provider, {
|
|
617
667
|
value: panelValue,
|
|
618
668
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_placementBoundary.PlacementBoundaryContext.Provider, {
|
|
619
669
|
value: panelRef,
|
|
@@ -621,7 +671,7 @@ function createPanelLayoutView(ContentPanel, ColorScope, ScrollArea, ScrollBar,
|
|
|
621
671
|
colorPreset: scopeColorPreset,
|
|
622
672
|
seed: scopeSeed,
|
|
623
673
|
asChild: true,
|
|
624
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
674
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_styledPrimitives.StyledView, {
|
|
625
675
|
testID: testID ? `${testID}-surface-bounds` : undefined,
|
|
626
676
|
style: [FILL, _reactNative.Platform.OS === 'web' ? joined || document ? {
|
|
627
677
|
overflowX: 'clip',
|
|
@@ -634,14 +684,17 @@ function createPanelLayoutView(ContentPanel, ColorScope, ScrollArea, ScrollBar,
|
|
|
634
684
|
overflow: 'clip',
|
|
635
685
|
overflowClipMargin: gap
|
|
636
686
|
} : undefined],
|
|
637
|
-
children:
|
|
687
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSafeAreaContext.SafeAreaInsetsContext.Provider, {
|
|
688
|
+
value: inlineInsets,
|
|
689
|
+
children: surface
|
|
690
|
+
})
|
|
638
691
|
})
|
|
639
692
|
})
|
|
640
693
|
})
|
|
641
694
|
}) : null, track.visible && !track.floating ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_PanelDropZones.PanelDropZones, {
|
|
642
695
|
panelId: panel.id,
|
|
643
696
|
fill: typeof panel.surfaceColor === 'string' ? panel.surfaceColor : undefined
|
|
644
|
-
}) : null, (joined || !framed) && track.gap > 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
697
|
+
}) : null, (joined || !framed) && track.gap > 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_styledPrimitives.StyledView, {
|
|
645
698
|
pointerEvents: "none",
|
|
646
699
|
style: {
|
|
647
700
|
position: 'absolute',
|
|
@@ -658,7 +711,7 @@ function createPanelLayoutView(ContentPanel, ColorScope, ScrollArea, ScrollBar,
|
|
|
658
711
|
}),
|
|
659
712
|
backgroundColor: theme.colors.border
|
|
660
713
|
}
|
|
661
|
-
}) : null, resizable ? /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
714
|
+
}) : null, resizable ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_styledPrimitives.StyledView, {
|
|
662
715
|
testID: testID ? `${testID}-resize-anchor` : undefined,
|
|
663
716
|
pointerEvents: "box-none",
|
|
664
717
|
style: {
|
|
@@ -690,28 +743,50 @@ function createPanelLayoutView(ContentPanel, ColorScope, ScrollArea, ScrollBar,
|
|
|
690
743
|
onNudge: dx => onNudge(!vertical && rtl ? -dx : dx)
|
|
691
744
|
})
|
|
692
745
|
}) : null]
|
|
693
|
-
}), track.floating && panel.floating ? /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
746
|
+
}), track.floating && panel.floating ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSafeAreaContext.SafeAreaInsetsContext.Provider, {
|
|
747
|
+
value: windowInsets,
|
|
748
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(PanelFloatingSurface, {
|
|
749
|
+
panel: panel,
|
|
750
|
+
open: floatingOpen,
|
|
751
|
+
onClosed: completeFloating,
|
|
752
|
+
testID: testID,
|
|
753
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSafeAreaContext.SafeAreaInsetsContext.Provider, {
|
|
754
|
+
value: {
|
|
755
|
+
...windowInsets,
|
|
756
|
+
top: 0
|
|
757
|
+
},
|
|
758
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_context5.AppShellPanelContext.Provider, {
|
|
759
|
+
value: floatingValue,
|
|
760
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(ColorScope, {
|
|
761
|
+
colorPreset: scopeColorPreset,
|
|
762
|
+
seed: scopeSeed,
|
|
763
|
+
asChild: true,
|
|
764
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_styledPrimitives.StyledView, {
|
|
765
|
+
style: FILL,
|
|
766
|
+
children: panel.errorBoundary ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_PanelErrorBoundary.PanelErrorBoundary, {
|
|
767
|
+
...(panel.errorBoundary === true ? {} : panel.errorBoundary),
|
|
768
|
+
children: body
|
|
769
|
+
}) : body
|
|
770
|
+
})
|
|
771
|
+
})
|
|
709
772
|
})
|
|
710
773
|
})
|
|
711
774
|
})
|
|
712
775
|
}) : null]
|
|
713
776
|
});
|
|
714
777
|
};
|
|
778
|
+
if (panel.group) return renderPanel(/*#__PURE__*/(0, _jsxRuntime.jsx)(PanelDocumentRestorationContext.Provider, {
|
|
779
|
+
value: documentRestorationOwner && active,
|
|
780
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(NestedPanelGroup, {
|
|
781
|
+
layout: panel.group,
|
|
782
|
+
groupActions: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
783
|
+
children: [reorderHandle, panel.headerActions]
|
|
784
|
+
}),
|
|
785
|
+
shellWidth: shellWidth,
|
|
786
|
+
gap: gap,
|
|
787
|
+
testID: testID ? `${testID}-group` : undefined
|
|
788
|
+
})
|
|
789
|
+
}));
|
|
715
790
|
// Navigation and restoration belong to the persistent descriptor, above
|
|
716
791
|
// the inline/portal presentation boundary. Closing or docking a surface
|
|
717
792
|
// does not recreate its history or scroll store.
|
|
@@ -734,6 +809,110 @@ function createPanelLayoutView(ContentPanel, ColorScope, ScrollArea, ScrollBar,
|
|
|
734
809
|
}) : renderPanel(renderScreen(panel.content))
|
|
735
810
|
});
|
|
736
811
|
}
|
|
812
|
+
function NestedPanelGroup({
|
|
813
|
+
layout: declared,
|
|
814
|
+
shellWidth,
|
|
815
|
+
gap,
|
|
816
|
+
testID,
|
|
817
|
+
groupActions
|
|
818
|
+
}) {
|
|
819
|
+
const region = (0, _appShellRegion.useAppShellRegion)();
|
|
820
|
+
const parentScope = (0, _react.useContext)(_panelLayoutCss.PanelCssContext);
|
|
821
|
+
const inheritedResponsiveScope = (0, _react.useContext)(_panelLayoutCss.PanelResponsiveScopeContext);
|
|
822
|
+
const scope = (0, _panelLayoutCss.panelCssScope)((0, _react.useId)());
|
|
823
|
+
const groupRef = (0, _react.useRef)(null);
|
|
824
|
+
const reducedMotion = (0, _usePrefersReducedMotion.usePrefersReducedMotion)();
|
|
825
|
+
const wantsDocument = _reactNative.Platform.OS === 'web' && region?.flow === 'document' && declared.singlePanelFlow === 'document' && declared.mode !== 'flow' && declared.mode !== 'deck' && (0, _panelLayout.eligiblePanels)(declared, shellWidth).length === 1;
|
|
826
|
+
const [documentReady, setDocumentReady] = (0, _react.useState)(wantsDocument);
|
|
827
|
+
const document = wantsDocument && documentReady;
|
|
828
|
+
// Keep the same bounded owner while the outgoing track closes and the
|
|
829
|
+
// survivor expands, including ancestor width changes when leaving Deck.
|
|
830
|
+
// Transfer to document scrolling only when those actual CSS transitions
|
|
831
|
+
// finish: no timeout or JavaScript geometry calculation.
|
|
832
|
+
(0, _react.useLayoutEffect)(() => {
|
|
833
|
+
if (!wantsDocument) {
|
|
834
|
+
setDocumentReady(false);
|
|
835
|
+
return;
|
|
836
|
+
}
|
|
837
|
+
if (documentReady) return;
|
|
838
|
+
const node = groupRef.current;
|
|
839
|
+
const ancestors = new Set();
|
|
840
|
+
for (let ancestor = node?.parentElement; ancestor; ancestor = ancestor.parentElement) {
|
|
841
|
+
if (ancestor.dataset.bloomPanelOwner || ancestor.dataset.bloomReadingEnvelope || ancestor.dataset.bloomShellFrame) ancestors.add(ancestor);
|
|
842
|
+
}
|
|
843
|
+
let cancelled = false;
|
|
844
|
+
const finishWhenSettled = () => {
|
|
845
|
+
if (cancelled) return;
|
|
846
|
+
const owners = node?.querySelectorAll(`[data-bloom-panel-owner="${scope}"]`);
|
|
847
|
+
const animations = reducedMotion ? [] : (0, _panelTransitions.panelGeometryTransitions)([...(owners ?? []), ...ancestors]);
|
|
848
|
+
if (!animations.length) {
|
|
849
|
+
setDocumentReady(true);
|
|
850
|
+
return;
|
|
851
|
+
}
|
|
852
|
+
// A resize can replace an in-flight transition without changing the
|
|
853
|
+
// requested owner. Recheck its replacement before committing the handoff.
|
|
854
|
+
void Promise.allSettled(animations.map(animation => animation.finished)).then(finishWhenSettled);
|
|
855
|
+
};
|
|
856
|
+
finishWhenSettled();
|
|
857
|
+
return () => {
|
|
858
|
+
cancelled = true;
|
|
859
|
+
};
|
|
860
|
+
}, [wantsDocument, documentReady, reducedMotion, scope]);
|
|
861
|
+
const firstInline = (0, _panelLayout.eligiblePanels)(declared, shellWidth)[0]?.id;
|
|
862
|
+
const layout = {
|
|
863
|
+
...declared,
|
|
864
|
+
panels: groupActions ? declared.panels.map(panel => panel.id === firstInline ? {
|
|
865
|
+
...panel,
|
|
866
|
+
headerActions: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
867
|
+
children: [groupActions, panel.headerActions]
|
|
868
|
+
})
|
|
869
|
+
} : panel) : declared.panels,
|
|
870
|
+
flow: document ? 'document' : declared.flow ?? 'bounded',
|
|
871
|
+
horizontalScroll: 'contained',
|
|
872
|
+
gap: declared.gap ?? (declared.appearance === 'joined' || declared.appearance === 'plain' ? 1 : region?.gutter ?? gap)
|
|
873
|
+
};
|
|
874
|
+
const nestedRegion = (0, _react.useMemo)(() => region ? {
|
|
875
|
+
...region,
|
|
876
|
+
flow: document ? 'document' : 'bounded',
|
|
877
|
+
bottomReserve: document ? region.bottomReserve : 0,
|
|
878
|
+
underBottomBar: false
|
|
879
|
+
} : null, [region, document]);
|
|
880
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styledPrimitives.StyledView, {
|
|
881
|
+
ref: groupRef,
|
|
882
|
+
className: "min-h-0 min-w-0 self-stretch grow shrink basis-auto",
|
|
883
|
+
...(parentScope ? {
|
|
884
|
+
dataSet: {
|
|
885
|
+
bloomLayout: scope
|
|
886
|
+
}
|
|
887
|
+
} : {}),
|
|
888
|
+
style: !document && region?.flow === 'document' ? {
|
|
889
|
+
height: (0, _webViewStyle.webViewportHeightMinus)(region.viewportInset.top + region.viewportInset.bottom),
|
|
890
|
+
flexGrow: 0,
|
|
891
|
+
flexShrink: 0
|
|
892
|
+
} : undefined,
|
|
893
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_panelLayoutCss.PanelCssContext.Provider, {
|
|
894
|
+
value: parentScope ? scope : null,
|
|
895
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_panelLayoutCss.PanelResponsiveScopeContext.Provider, {
|
|
896
|
+
value: inheritedResponsiveScope ?? parentScope,
|
|
897
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_appShellRegion.AppShellRegionContext.Provider, {
|
|
898
|
+
value: nestedRegion,
|
|
899
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_bottomEdge.BottomEdgeProvider, {
|
|
900
|
+
inherit: document,
|
|
901
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_context.ContentPanelNestingContext.Provider, {
|
|
902
|
+
value: false,
|
|
903
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(PanelLayoutView, {
|
|
904
|
+
layout: layout,
|
|
905
|
+
shellWidth: shellWidth,
|
|
906
|
+
gap: gap,
|
|
907
|
+
testID: testID
|
|
908
|
+
})
|
|
909
|
+
})
|
|
910
|
+
})
|
|
911
|
+
})
|
|
912
|
+
})
|
|
913
|
+
})
|
|
914
|
+
});
|
|
915
|
+
}
|
|
737
916
|
function PanelLayoutTracks({
|
|
738
917
|
layout: declared,
|
|
739
918
|
surfaceOwned = false,
|
|
@@ -748,9 +927,15 @@ function createPanelLayoutView(ContentPanel, ColorScope, ScrollArea, ScrollBar,
|
|
|
748
927
|
const spans = declared.spans ?? ownSpans;
|
|
749
928
|
const layout = (0, _react.useMemo)(() => (0, _panelLayout.applyPanelSpans)(declared, spans), [declared, spans]);
|
|
750
929
|
const region = (0, _appShellRegion.useAppShellRegion)();
|
|
751
|
-
const restoration = (0,
|
|
752
|
-
const
|
|
930
|
+
const restoration = (0, _context3.useOptionalScrollRestorationContext)();
|
|
931
|
+
const canRestoreDocument = (0, _react.useContext)(PanelDocumentRestorationContext);
|
|
932
|
+
const ancestorHost = (0, _react.useContext)(_context4.ScreenHostContext);
|
|
933
|
+
const parentScreen = (0, _react.useContext)(_context4.ScreenContext);
|
|
934
|
+
const fallbackInsets = (0, _reactNativeSafeAreaContext.useSafeAreaInsets)();
|
|
935
|
+
const safeArea = (0, _react.useContext)(_reactNativeSafeAreaContext.SafeAreaInsetsContext) ?? fallbackInsets;
|
|
936
|
+
const windowInsets = (0, _react.useContext)(PanelWindowInsetsContext) ?? safeArea;
|
|
753
937
|
const cssScope = (0, _react.useContext)(_panelLayoutCss.PanelCssContext);
|
|
938
|
+
const responsiveScope = (0, _react.useContext)(_panelLayoutCss.PanelResponsiveScopeContext);
|
|
754
939
|
const rootRef = (0, _react.useRef)(null);
|
|
755
940
|
const reorderScrollRef = (0, _react.useRef)(null);
|
|
756
941
|
const reorderScrollOffset = (0, _react.useRef)({
|
|
@@ -797,9 +982,9 @@ function createPanelLayoutView(ContentPanel, ColorScope, ScrollArea, ScrollBar,
|
|
|
797
982
|
const dimensions = vertical ? layout.heights ?? ownHeights : layout.widths ?? ownWidths;
|
|
798
983
|
const joined = layout.appearance === 'joined' || layout.appearance === 'plain';
|
|
799
984
|
const actualGap = layout.gap ?? (joined ? 1 : gap);
|
|
800
|
-
const document = layout.flow === 'document' && layout.mode !== 'deck' && _reactNative.Platform.OS === 'web';
|
|
801
|
-
const deck = layout.mode === 'deck';
|
|
802
|
-
const documentHorizontal = !!cssScope && deck && !vertical && layout.horizontalScroll !== 'contained';
|
|
985
|
+
const document = layout.flow === 'document' && layout.mode !== 'deck' && layout.mode !== 'flow' && _reactNative.Platform.OS === 'web';
|
|
986
|
+
const deck = layout.mode === 'deck' || layout.mode === 'flow';
|
|
987
|
+
const documentHorizontal = !!cssScope && deck && layout.mode !== 'flow' && !vertical && layout.horizontalScroll !== 'contained';
|
|
803
988
|
const reducedMotion = (0, _usePrefersReducedMotion.usePrefersReducedMotion)();
|
|
804
989
|
// The group's own size matters only at thresholds: the room below which a
|
|
805
990
|
// split shows its active track alone (its minimum, in every range of the
|
|
@@ -808,11 +993,8 @@ function createPanelLayoutView(ContentPanel, ColorScope, ScrollArea, ScrollBar,
|
|
|
808
993
|
// size only when it crosses one of these (`useMeasuredSizeClass`).
|
|
809
994
|
const shellRanges = (0, _panelLayout.panelLayoutWidthThresholds)(layout);
|
|
810
995
|
const minima = shellRanges.map(lower => (0, _panelLayout.panelLayoutMinimum)(layout, lower, actualGap));
|
|
811
|
-
// And where flexible tracks with minimums stop being held at them
|
|
812
|
-
// (`flexibleRoomThresholds`): Yoga divides the room between those.
|
|
813
|
-
const regimes = shellRanges.flatMap(lower => (0, _panelLayout.flexibleRoomThresholds)(layout, lower, actualGap, dimensions));
|
|
814
996
|
const heightReserve = document ? 0 : bottomEdge;
|
|
815
|
-
const roomThresholds =
|
|
997
|
+
const roomThresholds = minima;
|
|
816
998
|
const group = (0, _useWidthClass.useMeasuredSizeClass)(vertical ? eligibilityFromGroup ? shellRanges : [] : [...roomThresholds, ...(eligibilityFromGroup ? shellRanges : [])], vertical ? roomThresholds.map(threshold => threshold + heightReserve) : []);
|
|
817
999
|
const room = vertical ? Math.max(0, group.height - heightReserve) : group.width;
|
|
818
1000
|
const eligibilityWidth = eligibilityFromGroup ? group.width : shellWidth;
|
|
@@ -832,18 +1014,6 @@ function createPanelLayoutView(ContentPanel, ColorScope, ScrollArea, ScrollBar,
|
|
|
832
1014
|
collapseBelow: Number.MAX_SAFE_INTEGER
|
|
833
1015
|
} : {})
|
|
834
1016
|
}, room, eligibilityWidth, actualGap, dimensions);
|
|
835
|
-
// A track's size in pixels, when a resize gesture starts and the platform
|
|
836
|
-
// gives no layout to read (`getBoundingClientRect`): the group's measured
|
|
837
|
-
// room as Yoga divides it, which `resolvePanelTracks` models.
|
|
838
|
-
const modelTrackSize = id => {
|
|
839
|
-
// The window until the group's first layout, as its size classes read it.
|
|
840
|
-
const measured = group.read() ?? _reactNative.Dimensions.get('window');
|
|
841
|
-
const exactRoom = vertical ? Math.max(0, measured.height - heightReserve) : measured.width;
|
|
842
|
-
return (0, _panelLayout.resolvePanelTracks)({
|
|
843
|
-
...layout,
|
|
844
|
-
flow: document ? 'document' : 'bounded'
|
|
845
|
-
}, exactRoom, eligibilityFromGroup ? measured.width : shellWidth, actualGap, dimensions).find(track => track.id === id)?.width ?? 0;
|
|
846
|
-
};
|
|
847
1017
|
(0, _usePanelReveal.usePanelReveal)({
|
|
848
1018
|
rootRef,
|
|
849
1019
|
request: layout.revealPanel,
|
|
@@ -853,13 +1023,13 @@ function createPanelLayoutView(ContentPanel, ColorScope, ScrollArea, ScrollBar,
|
|
|
853
1023
|
tracks,
|
|
854
1024
|
reducedMotion
|
|
855
1025
|
});
|
|
856
|
-
const cssRules = cssScope ? (0, _panelLayoutCss.panelLayoutCss)(cssScope, layout, actualGap, layout.widths ?? ownWidths, layout.heights ?? ownHeights, fillWidth) : '';
|
|
1026
|
+
const cssRules = cssScope ? (0, _panelLayoutCss.panelLayoutCss)(cssScope, layout, actualGap, layout.widths ?? ownWidths, layout.heights ?? ownHeights, fillWidth, responsiveScope ?? cssScope, !fillWidth && !eligibilityFromGroup && responsiveScope === null) : '';
|
|
857
1027
|
const visibilityReady = cssScope ? cssState.measured : layoutReady;
|
|
858
1028
|
(0, _react.useLayoutEffect)(() => {
|
|
859
1029
|
if (!cssScope || !rootRef.current || typeof getComputedStyle !== 'function') return;
|
|
860
1030
|
const root = rootRef.current;
|
|
861
1031
|
const read = () => {
|
|
862
|
-
const row = root.querySelector(
|
|
1032
|
+
const row = root.querySelector(`[data-bloom-panel-row="${cssScope}"]`);
|
|
863
1033
|
if (!row) return;
|
|
864
1034
|
const axis = getComputedStyle(row).getPropertyValue('--bloom-panel-axis').trim();
|
|
865
1035
|
const next = layout.panels.map((panel, index) => {
|
|
@@ -891,13 +1061,18 @@ function createPanelLayoutView(ContentPanel, ColorScope, ScrollArea, ScrollBar,
|
|
|
891
1061
|
if (!root.hasAttribute('data-bloom-panel-resizing')) read();
|
|
892
1062
|
});
|
|
893
1063
|
observer?.observe(root);
|
|
894
|
-
const shell = root.closest(
|
|
1064
|
+
const shell = root.closest(`[data-bloom-layout="${responsiveScope ?? cssScope}"]`);
|
|
895
1065
|
if (shell) observer?.observe(shell);
|
|
896
1066
|
return () => observer?.disconnect();
|
|
897
|
-
}, [cssScope, cssRules, layout.panels]);
|
|
1067
|
+
}, [cssScope, responsiveScope, cssRules, layout.panels]);
|
|
898
1068
|
const visible = tracks.filter(track => track.visible);
|
|
899
|
-
|
|
900
|
-
|
|
1069
|
+
// Selection can survive Deck exit on a secondary column. Only actual
|
|
1070
|
+
// inline order (already resolved for expansion/compact mode) owns the page.
|
|
1071
|
+
const primaryId = visible[0]?.id;
|
|
1072
|
+
const primaryPanel = layout.panels.find(panel => panel.id === primaryId);
|
|
1073
|
+
const ownsDocumentRestoration = canRestoreDocument && ancestorHost.active !== false && parentScreen?.active !== false && primaryPanel !== undefined && !primaryPanel.group;
|
|
1074
|
+
const handedWindowChrome = (0, _context7.useWindowChrome)();
|
|
1075
|
+
const platformWindow = (0, _context6.usePlatformWindow)();
|
|
901
1076
|
// A web page deck scrolls the document from the shell's own start edge (the
|
|
902
1077
|
// frame gives up its start inset), so its first panel is at the window's
|
|
903
1078
|
// edge and keeps the whole room.
|
|
@@ -919,7 +1094,8 @@ function createPanelLayoutView(ContentPanel, ColorScope, ScrollArea, ScrollBar,
|
|
|
919
1094
|
// Two flexible split tracks keep a proportion, not pixels: commit weights.
|
|
920
1095
|
if (!deck && ids.length === 2 && resized.every(candidate => candidate !== undefined && (0, _panelLayout.isFlexiblePanel)(candidate, vertical, dimensions))) {
|
|
921
1096
|
const [first, second] = resized;
|
|
922
|
-
const
|
|
1097
|
+
const axis = vertical ? 'vertical' : 'horizontal';
|
|
1098
|
+
const weights = (0, _panelLayout.splitPairSpans)((0, _panelLayout.panelForAxis)(first, axis), (0, _panelLayout.panelForAxis)(second, axis), pair[first.id], pair[second.id], _reactNative.Platform.OS !== 'web');
|
|
923
1099
|
const nextSpans = {
|
|
924
1100
|
...spans,
|
|
925
1101
|
...weights
|
|
@@ -1041,21 +1217,13 @@ function createPanelLayoutView(ContentPanel, ColorScope, ScrollArea, ScrollBar,
|
|
|
1041
1217
|
return () => node?.removeEventListener('scroll', report);
|
|
1042
1218
|
}, [documentHorizontal, hasViewportScrollObserver]);
|
|
1043
1219
|
const trackById = new Map(tracks.map(track => [track.id, track]));
|
|
1044
|
-
const row = /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
1220
|
+
const row = /*#__PURE__*/(0, _jsxRuntime.jsx)(_styledPrimitives.StyledView, {
|
|
1045
1221
|
...(cssScope ? {
|
|
1046
1222
|
dataSet: {
|
|
1047
1223
|
bloomPanelRow: cssScope
|
|
1048
1224
|
}
|
|
1049
1225
|
} : {}),
|
|
1050
|
-
|
|
1051
|
-
flexDirection: vertical ? 'column' : 'row',
|
|
1052
|
-
alignItems: 'stretch',
|
|
1053
|
-
flexGrow: 1,
|
|
1054
|
-
flexShrink: document ? 0 : 1,
|
|
1055
|
-
flexBasis: document ? 'auto' : 0,
|
|
1056
|
-
minHeight: 0,
|
|
1057
|
-
minWidth: 0
|
|
1058
|
-
},
|
|
1226
|
+
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'}`,
|
|
1059
1227
|
children: layout.panels.map((panel, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(PanelHost, {
|
|
1060
1228
|
panel: panel,
|
|
1061
1229
|
registerReorder: reorder.register,
|
|
@@ -1076,9 +1244,10 @@ function createPanelLayoutView(ContentPanel, ColorScope, ScrollArea, ScrollBar,
|
|
|
1076
1244
|
visibilityReady: visibilityReady && trackById.has(panel.id),
|
|
1077
1245
|
index: index,
|
|
1078
1246
|
getSize: () => resize.size(panel.id),
|
|
1079
|
-
modelSize: () => modelTrackSize(panel.id),
|
|
1080
1247
|
vertical: vertical,
|
|
1081
|
-
|
|
1248
|
+
shellWidth: shellWidth,
|
|
1249
|
+
safeAreaTop: (parentScreen?.topInset ?? 0) > 0 || vertical && visible[0]?.id !== panel.id ? 0 : safeArea.top,
|
|
1250
|
+
naturalHeight: vertical && (document || layout.mode === 'flow') && panel.height === undefined && dimensions[panel.id] === undefined,
|
|
1082
1251
|
track: trackById.get(panel.id) ?? {
|
|
1083
1252
|
...CSS_TRACK,
|
|
1084
1253
|
id: panel.id,
|
|
@@ -1086,6 +1255,7 @@ function createPanelLayoutView(ContentPanel, ColorScope, ScrollArea, ScrollBar,
|
|
|
1086
1255
|
},
|
|
1087
1256
|
alone: visible.length === 1,
|
|
1088
1257
|
document: document,
|
|
1258
|
+
documentRestorationOwner: canRestoreDocument && panel.id === primaryId,
|
|
1089
1259
|
joined: joined,
|
|
1090
1260
|
gap: actualGap,
|
|
1091
1261
|
hasNext: visible[visible.length - 1]?.id !== panel.id,
|
|
@@ -1112,80 +1282,83 @@ function createPanelLayoutView(ContentPanel, ColorScope, ScrollArea, ScrollBar,
|
|
|
1112
1282
|
testID: testID ? `${testID}-scroll` : undefined,
|
|
1113
1283
|
children: row
|
|
1114
1284
|
});
|
|
1115
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
1116
|
-
value:
|
|
1117
|
-
children: /*#__PURE__*/(0, _jsxRuntime.
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
bloomPanelGroup: cssScope,
|
|
1128
|
-
bloomPanelOrdering: reorder.ordering ? 'true' : undefined
|
|
1129
|
-
}
|
|
1130
|
-
} : {}),
|
|
1131
|
-
testID: testID,
|
|
1132
|
-
onLayout: cssScope ? undefined : group.onLayout,
|
|
1133
|
-
style: [{
|
|
1134
|
-
minWidth: 0,
|
|
1135
|
-
alignSelf: 'stretch',
|
|
1136
|
-
// Horizontal document panels reserve inside their own surface.
|
|
1137
|
-
// A bounded group reserves the bottom bar, or — when the app keeps
|
|
1138
|
-
// the bar over its content — fills under it and what scrolls clears
|
|
1139
|
-
// it (`useBottomEdgeInset`, the panel scroller, the vertical deck).
|
|
1140
|
-
paddingBottom: document ? vertical ? region?.bottomReserve ?? 0 : 0 : region?.underBottomBar ? 0 : bottomEdge,
|
|
1285
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(PanelWindowInsetsContext.Provider, {
|
|
1286
|
+
value: windowInsets,
|
|
1287
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_PanelDropZones.PanelDropProvider, {
|
|
1288
|
+
value: drop,
|
|
1289
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_PanelOrderBoundary.PanelOrderBoundary, {
|
|
1290
|
+
ids: layout.panels.map(panel => panel.id),
|
|
1291
|
+
rootRef: rootRef,
|
|
1292
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ServerStyleSheet.ServerStyleSheet, {
|
|
1293
|
+
id: cssScope ?? '',
|
|
1294
|
+
css: cssRules
|
|
1295
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styledPrimitives.StyledView, {
|
|
1296
|
+
ref: rootRef,
|
|
1141
1297
|
...(cssScope ? {
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1298
|
+
dataSet: {
|
|
1299
|
+
bloomPanelGroup: cssScope,
|
|
1300
|
+
bloomPanelOrdering: reorder.ordering ? 'true' : undefined
|
|
1301
|
+
}
|
|
1302
|
+
} : {}),
|
|
1303
|
+
testID: testID,
|
|
1304
|
+
onLayout: cssScope ? undefined : group.onLayout,
|
|
1305
|
+
style: [{
|
|
1306
|
+
minWidth: 0,
|
|
1307
|
+
alignSelf: 'stretch',
|
|
1308
|
+
// Horizontal document panels reserve inside their own surface.
|
|
1309
|
+
// A bounded group reserves the bottom bar, or — when the app keeps
|
|
1310
|
+
// the bar over its content — fills under it and what scrolls clears
|
|
1311
|
+
// it (`useBottomEdgeInset`, the panel scroller, the vertical deck).
|
|
1312
|
+
paddingBottom: document ? vertical && visible.length > 1 ? region?.bottomReserve ?? 0 : 0 : region?.underBottomBar ? 0 : bottomEdge,
|
|
1313
|
+
...(cssScope ? {
|
|
1314
|
+
containerType: document ? 'inline-size' : 'size',
|
|
1315
|
+
containerName: `${cssScope}-group`
|
|
1316
|
+
} : {})
|
|
1317
|
+
}, document ? {} : FILL],
|
|
1318
|
+
children: [_reactNative.Platform.OS === 'web' && restoration && !ancestorHost.restoresDocument ? /*#__PURE__*/(0, _jsxRuntime.jsx)(DocumentRestoration, {
|
|
1319
|
+
enabled: document && ownsDocumentRestoration
|
|
1320
|
+
}) : null, joined && !surfaceOwned ? /*#__PURE__*/(0, _jsxRuntime.jsx)(ContentPanel, {
|
|
1321
|
+
appearance: layout.appearance === 'plain' ? 'plain' : undefined,
|
|
1322
|
+
framed: cssScope && !eligibilityFromGroup ? true : region?.framed ?? true,
|
|
1323
|
+
fill: !document,
|
|
1324
|
+
scrollable: false,
|
|
1325
|
+
overlaySizing: document ? 'viewport' : 'panel',
|
|
1326
|
+
overlayInset: document ? region?.viewportInset : undefined,
|
|
1327
|
+
surfaceStyle: groupWindowChrome && platformWindow ? [FILL, (0, _geometry.windowEdgeTopCorners)(platformWindow.metrics)] : FILL,
|
|
1328
|
+
contentStyle: FILL,
|
|
1329
|
+
children: content
|
|
1330
|
+
}) : content, layout.onPanelOrderChange ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.Text, {
|
|
1331
|
+
accessibilityLiveRegion: "polite",
|
|
1332
|
+
"aria-live": "polite",
|
|
1333
|
+
style: {
|
|
1334
|
+
position: 'absolute',
|
|
1335
|
+
width: 1,
|
|
1336
|
+
height: 1,
|
|
1337
|
+
overflow: 'hidden',
|
|
1338
|
+
opacity: 0
|
|
1339
|
+
},
|
|
1340
|
+
children: reorder.announcement
|
|
1341
|
+
}) : null, documentHorizontal ? /*#__PURE__*/(0, _jsxRuntime.jsx)(ScrollBar, {
|
|
1342
|
+
target: "document",
|
|
1343
|
+
horizontal: true,
|
|
1344
|
+
offset: bottomEdge
|
|
1345
|
+
}) : null, documentHorizontal && layout.trailingAction ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_styledPrimitives.StyledView, {
|
|
1346
|
+
dataSet: {
|
|
1347
|
+
bloomDeckTrailing: cssScope ?? undefined
|
|
1348
|
+
},
|
|
1349
|
+
testID: testID ? `${testID}-trailing-action` : undefined,
|
|
1350
|
+
children: layout.trailingAction
|
|
1351
|
+
}) : null]
|
|
1352
|
+
})]
|
|
1353
|
+
})
|
|
1181
1354
|
})
|
|
1182
1355
|
});
|
|
1183
1356
|
}
|
|
1184
1357
|
function PanelLayoutView(props) {
|
|
1185
1358
|
const region = (0, _appShellRegion.useAppShellRegion)();
|
|
1186
1359
|
const cssScope = (0, _react.useContext)(_panelLayoutCss.PanelCssContext);
|
|
1187
|
-
const handedWindowChrome = (0,
|
|
1188
|
-
const platformWindow = (0,
|
|
1360
|
+
const handedWindowChrome = (0, _context7.useWindowChrome)();
|
|
1361
|
+
const platformWindow = (0, _context6.usePlatformWindow)();
|
|
1189
1362
|
if (props.layout.retain) return /*#__PURE__*/(0, _jsxRuntime.jsx)(_RetainedPanelLayout.RetainedPanelLayout, {
|
|
1190
1363
|
layout: props.layout,
|
|
1191
1364
|
gap: props.gap,
|
|
@@ -1194,7 +1367,7 @@ function createPanelLayoutView(ContentPanel, ColorScope, ScrollArea, ScrollBar,
|
|
|
1194
1367
|
if (props.layout.header === undefined) return /*#__PURE__*/(0, _jsxRuntime.jsx)(PanelLayoutTracks, {
|
|
1195
1368
|
...props
|
|
1196
1369
|
});
|
|
1197
|
-
const document = props.layout.flow === 'document' && props.layout.mode !== 'deck' && _reactNative.Platform.OS === 'web';
|
|
1370
|
+
const document = props.layout.flow === 'document' && props.layout.mode !== 'deck' && props.layout.mode !== 'flow' && _reactNative.Platform.OS === 'web';
|
|
1198
1371
|
const joined = props.layout.appearance === 'joined' || props.layout.appearance === 'plain';
|
|
1199
1372
|
const workspace = /*#__PURE__*/(0, _jsxRuntime.jsx)(Screen, {
|
|
1200
1373
|
scroll: "none",
|