@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
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* accessibility tree, so showing it again is one style change with no relayout
|
|
14
14
|
* of its content.
|
|
15
15
|
*/
|
|
16
|
-
import { useCallback, useMemo, useRef, useState, type ReactNode } from 'react';
|
|
16
|
+
import { useCallback, useLayoutEffect, useMemo, useRef, useState, type ReactNode } from 'react';
|
|
17
17
|
import { View, type LayoutChangeEvent, type ViewStyle } from 'react-native';
|
|
18
18
|
import { useIsRtl } from '../hooks/use-is-rtl';
|
|
19
19
|
import { ResizeHandle } from '../layout/ResizeHandle';
|
|
@@ -107,6 +107,12 @@ function RetainedHost({
|
|
|
107
107
|
testID?: string;
|
|
108
108
|
}) {
|
|
109
109
|
const shown = box !== undefined;
|
|
110
|
+
const wasPresent = useRef(panel.visible !== false);
|
|
111
|
+
useLayoutEffect(() => {
|
|
112
|
+
const present = panel.visible !== false;
|
|
113
|
+
if (wasPresent.current && !present) panel.onExitComplete?.();
|
|
114
|
+
wasPresent.current = present;
|
|
115
|
+
}, [panel.visible, panel.onExitComplete]);
|
|
110
116
|
const value = useMemo(
|
|
111
117
|
() => ({
|
|
112
118
|
id: panel.id,
|
|
@@ -18,6 +18,7 @@ import type { AppShellPanelLayout } from './panel-layout-types';
|
|
|
18
18
|
const PANEL_MATERIAL = '[data-bloom-panel-material]';
|
|
19
19
|
|
|
20
20
|
export const PanelCssContext = createContext<string | null>(null);
|
|
21
|
+
export const PanelResponsiveScopeContext = createContext<string | null>(null);
|
|
21
22
|
export const PanelCssLayoutContext = createContext<{
|
|
22
23
|
layout: AppShellPanelLayout;
|
|
23
24
|
gap: number;
|
|
@@ -34,6 +35,8 @@ export function panelLayoutCss(
|
|
|
34
35
|
widths: Readonly<Record<string, number>> = {},
|
|
35
36
|
heights: Readonly<Record<string, number>> = {},
|
|
36
37
|
fillWidth = false,
|
|
38
|
+
responsiveScope = scope,
|
|
39
|
+
fixedEnvelope = false,
|
|
37
40
|
) {
|
|
38
41
|
const root = `[data-bloom-layout="${scope}"]`;
|
|
39
42
|
const group = `[data-bloom-panel-group="${scope}"]`;
|
|
@@ -42,7 +45,7 @@ export function panelLayoutCss(
|
|
|
42
45
|
`${group} [data-bloom-panel-owner="${scope}"][data-bloom-panel-index="${index}"]`;
|
|
43
46
|
const liveSize = (index: number, fallback: string) =>
|
|
44
47
|
`var(${panelSizeProperty(scope, index)}, ${fallback})`;
|
|
45
|
-
const deck = layout.mode === 'deck';
|
|
48
|
+
const deck = layout.mode === 'deck' || layout.mode === 'flow';
|
|
46
49
|
const ordered = layout.transition === 'exit-before-enter';
|
|
47
50
|
const geometryDelay = ordered ? 150 : 0;
|
|
48
51
|
const fadeMs = ordered ? 150 : 380;
|
|
@@ -63,7 +66,7 @@ export function panelLayoutCss(
|
|
|
63
66
|
.map((property) => `${property} 380ms cubic-bezier(.4,0,.2,1) ${geometryDelay}ms`)
|
|
64
67
|
.join(',');
|
|
65
68
|
const document = layout.flow === 'document' && !deck;
|
|
66
|
-
const pageDeck = deck && layout.horizontalScroll !== 'contained';
|
|
69
|
+
const pageDeck = deck && layout.mode !== 'flow' && layout.horizontalScroll !== 'contained';
|
|
67
70
|
const thresholds = new Set<number>([0]);
|
|
68
71
|
for (const panel of layout.panels) {
|
|
69
72
|
if (panel.hideBelow !== undefined) thresholds.add(breakpointPx(panel.hideBelow));
|
|
@@ -87,7 +90,7 @@ ${root} [data-bloom-reading-content="${scope}"]{width:100%!important;flex-basis:
|
|
|
87
90
|
${row}{gap:0!important}
|
|
88
91
|
${group} [data-bloom-panel-owner="${scope}"][data-bloom-panel-index]{interpolate-size:allow-keywords;transition:${geometryTransitions},opacity ${ordered ? 150 : 380}ms cubic-bezier(.4,0,.2,1) var(--bloom-panel-fade-delay,0ms),scale 150ms ease var(--bloom-panel-fade-delay,0ms),display 380ms allow-discrete ${geometryDelay}ms;transition-behavior:allow-discrete}
|
|
89
92
|
${group} [data-bloom-panel-owner="${scope}"][data-bloom-panel-index]{--bloom-surface-presence-ms:${fadeMs}ms}
|
|
90
|
-
${group} [data-bloom-panel-owner="${scope}"][data-bloom-panel-index] ${PANEL_MATERIAL}>*{opacity:var(--bloom-surface-presence,1);transition:opacity
|
|
93
|
+
${group} [data-bloom-panel-owner="${scope}"][data-bloom-panel-index] ${PANEL_MATERIAL}>*{opacity:var(--bloom-surface-presence,1);transition:opacity var(--bloom-surface-presence-ms,${fadeMs}ms) cubic-bezier(.4,0,.2,1) var(--bloom-panel-fade-delay,0ms)}
|
|
91
94
|
${group}:not([data-bloom-panel-ready]) [data-bloom-panel-owner="${scope}"][data-bloom-panel-index],${root}:not(:has(${group}[data-bloom-panel-ready])) :is([data-bloom-reading-envelope="${scope}"],[data-bloom-shell-frame="${scope}"],[data-bloom-shell-nav="${scope}"]){transition:none!important}
|
|
92
95
|
${group}[data-bloom-panel-resizing] [data-bloom-panel-owner="${scope}"][data-bloom-panel-index],${root}:has(${group}[data-bloom-panel-resizing]) [data-bloom-reading-envelope="${scope}"]{transition:none!important}
|
|
93
96
|
${group}[data-bloom-panel-resizing]{user-select:none;cursor:col-resize}
|
|
@@ -118,7 +121,7 @@ ${group}[data-bloom-panel-resizing="vertical"]{cursor:row-resize}
|
|
|
118
121
|
const envelope = deck ? '100%' : `${panelEnvelope(layout, lower, gap)}px`;
|
|
119
122
|
let rules = `${root} [data-bloom-reading-envelope="${scope}"]{--bloom-reading-envelope:${envelope}}\n${row}{flex-direction:${vertical ? 'column' : 'row'}!important;--bloom-panel-axis:${axis}}\n`;
|
|
120
123
|
const hidden = (index: number) =>
|
|
121
|
-
`${item(index)}{--bloom-panel-visible:0;--bloom-panel-fade-delay:0ms;scale:${ordered ? 0.98 : 1};flex:0 0 0px!important;display:none!important;width:
|
|
124
|
+
`${item(index)}{--bloom-panel-visible:0;--bloom-panel-fade-delay:0ms;scale:${ordered ? 0.98 : 1};flex:0 0 0px!important;display:none!important;width:${vertical ? '100%' : '0px'}!important;height:auto!important;max-width:none!important;max-height:none!important;min-width:0!important;min-height:0!important;--bloom-surface-presence:0;margin:0!important;contain:size;overflow:hidden!important;pointer-events:none!important}\n${item(index)} [data-bloom-panel-owner]{--bloom-surface-presence:0!important;--bloom-surface-presence-ms:${fadeMs}ms!important;--bloom-panel-fade-delay:0ms!important}\n${item(index)}:not(:has(${PANEL_MATERIAL})){opacity:0!important}\n`;
|
|
122
125
|
for (let index = 0; index < layout.panels.length; index++) {
|
|
123
126
|
const p = layout.panels[index]!;
|
|
124
127
|
rules += `${item(index)}{--bloom-panel-floating:${p.floating && lower < breakpointPx(p.floating.below) ? 1 : 0}}\n`;
|
|
@@ -130,33 +133,43 @@ ${group}[data-bloom-panel-resizing="vertical"]{cursor:row-resize}
|
|
|
130
133
|
const dim = vertical ? (heights[p.id] ?? p.height) : (widths[p.id] ?? p.width);
|
|
131
134
|
const min = vertical ? p.minHeight : p.minWidth;
|
|
132
135
|
const max = vertical ? p.maxHeight : p.maxWidth;
|
|
133
|
-
const natural = vertical && document;
|
|
134
|
-
const
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
136
|
+
const natural = vertical && (document || layout.mode === 'flow');
|
|
137
|
+
const soleSplit = !deck && !natural && shown.length === 1;
|
|
138
|
+
// A percentage basis resolves to intrinsic content in an indefinite
|
|
139
|
+
// document column, and to its viewport in a bounded column. Keeping this
|
|
140
|
+
// basis across owner changes avoids an auto -> length interpolation that
|
|
141
|
+
// briefly collapses the persistent pane to its minimum.
|
|
142
|
+
const soleDocument = document && vertical && shown.length === 1 && dim === undefined;
|
|
143
|
+
const basis =
|
|
144
|
+
forced || soleSplit || soleDocument
|
|
145
|
+
? natural && !soleDocument
|
|
146
|
+
? 'auto'
|
|
147
|
+
: '100%'
|
|
148
|
+
: dim !== undefined
|
|
149
|
+
? `${dim}px`
|
|
142
150
|
: natural
|
|
143
151
|
? 'auto'
|
|
144
|
-
:
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
152
|
+
: deck
|
|
153
|
+
? `${DEFAULT_PANEL_WIDTH}px`
|
|
154
|
+
: '0px';
|
|
155
|
+
const grow =
|
|
156
|
+
forced || soleSplit || soleDocument
|
|
157
|
+
? 1
|
|
158
|
+
: natural
|
|
159
|
+
? 0
|
|
160
|
+
: deck
|
|
161
|
+
? Math.max(0, p.span ?? 0)
|
|
162
|
+
: fixedEnvelope && dim !== undefined && p.span === undefined
|
|
163
|
+
? 0
|
|
164
|
+
: flexible && dim !== undefined
|
|
165
|
+
? 0
|
|
166
|
+
: (p.span ?? 1);
|
|
167
|
+
rules += `${item(index)}{--bloom-panel-alone-display:${shown.length === 1 ? 'flex' : 'none'};--bloom-panel-multiple-display:${shown.length === 1 ? 'none' : 'flex'};--bloom-panel-visible:1;--bloom-surface-presence:1;--bloom-panel-fade-delay:${ordered ? 530 : 0}ms;scale:1;display:flex!important;flex:var(${panelGrowProperty(scope, index)}, ${grow}) ${deck || natural ? 0 : 1} ${liveSize(index, basis)}!important;width:${vertical ? '100%' : pageDeck ? (forced ? 'calc(var(--bloom-deck-viewport) - var(--bloom-frame-end))' : liveSize(index, `${dim ?? DEFAULT_PANEL_WIDTH}px`)) : dim !== undefined && !forced ? `${dim}px` : 'auto'}!important;height:auto!important;min-width:${vertical || forced ? 0 : (min ?? 0)}px!important;max-width:${vertical || forced ? '100%' : max === undefined ? (deck ? 'none' : '100%') : `${max}px`}!important;min-height:${vertical && !forced ? (min ?? 0) : 0}px!important;max-height:${vertical && !forced && max !== undefined ? `${max}px` : 'none'}!important;opacity:1!important;margin-inline-start:${!vertical && position > 0 ? gap : 0}px!important;margin-top:${vertical && position > 0 ? gap : 0}px!important}\n`;
|
|
155
168
|
const entering = item(index).replace(
|
|
156
169
|
group,
|
|
157
170
|
`${group}[data-bloom-panel-ready]:not([data-bloom-panel-ordering])`,
|
|
158
171
|
);
|
|
159
|
-
rules += `@starting-style{${entering}{scale:${ordered ? 0.98 : 1};flex:0 0 0px!important;width:${vertical ? '100%' : '0px'}!important;min-width:0!important;min-height:0!important;--bloom-surface-presence:0;margin-inline-start:0!important;margin-top:0!important}${entering}:not(:has(${PANEL_MATERIAL})){opacity:0!important}}\n`;
|
|
172
|
+
rules += `@starting-style{${entering}{scale:${ordered ? 0.98 : 1};flex:0 0 0px!important;width:${vertical ? '100%' : '0px'}!important;min-width:0!important;min-height:0!important;--bloom-surface-presence:0;margin-inline-start:0!important;margin-top:0!important}${entering} [data-bloom-panel-owner]{--bloom-surface-presence:0!important}${entering}:not(:has(${PANEL_MATERIAL})){opacity:0!important}}\n`;
|
|
160
173
|
}
|
|
161
174
|
if (pageDeck && !vertical) {
|
|
162
175
|
const trackWidths = shown.map((panel) =>
|
|
@@ -213,11 +226,12 @@ ${row}{width:100%!important;min-width:0!important}
|
|
|
213
226
|
rules +=
|
|
214
227
|
p.id === active?.id
|
|
215
228
|
? `${item(index)}{--bloom-panel-alone-display:flex;--bloom-panel-multiple-display:none;--bloom-panel-visible:1;display:flex!important;flex:1 1 0px!important;min-width:0!important;min-height:0!important;max-width:100%!important;max-height:none!important;margin:0!important;opacity:1!important;--bloom-surface-presence:1}`
|
|
216
|
-
: hidden(index)
|
|
229
|
+
: hidden(index) +
|
|
230
|
+
(p.floating?.whenConstrained ? `${item(index)}{--bloom-panel-floating:1}` : '');
|
|
217
231
|
});
|
|
218
232
|
rules += '}\n';
|
|
219
233
|
}
|
|
220
|
-
css += `@container ${
|
|
234
|
+
css += `@container ${responsiveScope} ${query}{${rules}}\n`;
|
|
221
235
|
}
|
|
222
236
|
return css;
|
|
223
237
|
}
|
|
@@ -46,7 +46,13 @@ export interface AppShellPanelDefinition extends Omit<AppShellPanelProps, 'child
|
|
|
46
46
|
reorderLabel?: string;
|
|
47
47
|
/** Explicit semantic visibility, independent of responsive eligibility. */
|
|
48
48
|
visible?: boolean;
|
|
49
|
+
/** Actual exit completion; release payload after visible becomes false. Reopening cancels it. */
|
|
50
|
+
onExitComplete?: () => void;
|
|
51
|
+
/** Vertical resize gestures stop at measured content; initial layout stays unchanged. */
|
|
52
|
+
resizeMaxHeight?: 'content';
|
|
49
53
|
content?: ReactNode;
|
|
54
|
+
/** A transparent, independently composed group. Keep its id and child ids stable. */
|
|
55
|
+
group?: AppShellPanelLayout;
|
|
50
56
|
/** Host controls composed into the route Screen's existing PageHeader actions. */
|
|
51
57
|
headerActions?: ReactNode;
|
|
52
58
|
/** Panel footer composed below the route Screen bottom bar, measured and pinned by that Screen. */
|
|
@@ -102,8 +108,11 @@ export interface AppShellPanelLayout {
|
|
|
102
108
|
onViewportScroll?: (offset: { x: number; y: number }) => void;
|
|
103
109
|
/** Commit a full ID permutation after a handle drag or keyboard move. The host applies this order. */
|
|
104
110
|
onPanelOrderChange?: (ids: readonly string[]) => void;
|
|
105
|
-
|
|
106
|
-
|
|
111
|
+
/** Split divides available space; flow grows and scrolls along its axis. */
|
|
112
|
+
mode?: 'split' | 'flow' | 'deck';
|
|
113
|
+
/** Nested split only: let its sole inline panel use the web document scroll. */
|
|
114
|
+
singlePanelFlow?: 'document';
|
|
115
|
+
/** Simultaneous by default. Opt into exit-before-enter to stage outgoing, geometry and incoming motion. */
|
|
107
116
|
transition?: 'simultaneous' | 'exit-before-enter';
|
|
108
117
|
/** Web horizontal decks use the document scrollbar by default. Native remains native-scrolling. */
|
|
109
118
|
horizontalScroll?: 'document' | 'contained';
|
|
@@ -60,118 +60,12 @@ export function panelEnvelope(layout: AppShellPanelLayout, shellWidth: number, g
|
|
|
60
60
|
);
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
export interface ResolvedPanelTrack {
|
|
64
|
-
id: string;
|
|
65
|
-
width: number;
|
|
66
|
-
visible: boolean;
|
|
67
|
-
gap: number;
|
|
68
|
-
/** Responsive presentation, independent of its open intent. */
|
|
69
|
-
floating?: boolean;
|
|
70
|
-
}
|
|
71
|
-
export function resolvePanelTracks(
|
|
72
|
-
layout: AppShellPanelLayout,
|
|
73
|
-
available: number,
|
|
74
|
-
shellWidth: number,
|
|
75
|
-
gap: number,
|
|
76
|
-
widths: Readonly<Record<string, number>> = {},
|
|
77
|
-
): ResolvedPanelTrack[] {
|
|
78
|
-
const axis = resolvePanelAxis(layout, shellWidth);
|
|
79
|
-
const eligible = eligiblePanels(layout, shellWidth).map((panel) => panelForAxis(panel, axis));
|
|
80
|
-
const natural = axis === 'vertical' && layout.flow === 'document' && layout.mode !== 'deck';
|
|
81
|
-
const deck = layout.mode === 'deck' || natural;
|
|
82
|
-
const minimum =
|
|
83
|
-
eligible.reduce((sum, panel) => sum + panelMinimum(panel), 0) +
|
|
84
|
-
Math.max(0, eligible.length - 1) * gap;
|
|
85
|
-
const compact =
|
|
86
|
-
layout.mode !== 'deck' &&
|
|
87
|
-
((layout.collapseBelow !== undefined && shellWidth < breakpointPx(layout.collapseBelow)) ||
|
|
88
|
-
(!natural && available < minimum));
|
|
89
|
-
const active =
|
|
90
|
-
eligible.find((panel) => panel.id === (layout.expandedPanel ?? layout.activePanel)) ??
|
|
91
|
-
eligible[0];
|
|
92
|
-
const shown =
|
|
93
|
-
layout.expandedPanel || compact
|
|
94
|
-
? eligible.filter((panel) => panel.id === active?.id)
|
|
95
|
-
: eligible;
|
|
96
|
-
const room = Math.max(0, available - Math.max(0, shown.length - 1) * gap);
|
|
97
|
-
// A flexible split track grows from a zero basis, as the CSS compositor's
|
|
98
|
-
// `flex: <span> 1 0px` does: its share is proportional to its span, and only
|
|
99
|
-
// a min/max boundary freezes it. Starting it at its minimum gave native a
|
|
100
|
-
// `min + share` split that the browser never drew.
|
|
101
|
-
const fromZero = (panel: AppShellPanelDefinition) =>
|
|
102
|
-
!deck &&
|
|
103
|
-
!natural &&
|
|
104
|
-
widths[panel.id] === undefined &&
|
|
105
|
-
panel.width === undefined &&
|
|
106
|
-
shown.length > 1 &&
|
|
107
|
-
!layout.expandedPanel;
|
|
108
|
-
const sizes = shown.map((panel) =>
|
|
109
|
-
fromZero(panel)
|
|
110
|
-
? 0
|
|
111
|
-
: clampPanelWidth(
|
|
112
|
-
panel,
|
|
113
|
-
positive(
|
|
114
|
-
widths[panel.id],
|
|
115
|
-
positive(panel.width, deck && !natural ? DEFAULT_PANEL_WIDTH : panelMinimum(panel)),
|
|
116
|
-
),
|
|
117
|
-
),
|
|
118
|
-
);
|
|
119
|
-
if ((!deck || layout.expandedPanel) && shown.length === 1) sizes[0] = available;
|
|
120
|
-
else if (!deck || (!natural && shown.some((panel) => (panel.span ?? 0) > 0))) {
|
|
121
|
-
// Water-fill available room, freezing tracks at their min/max boundaries.
|
|
122
|
-
for (let pass = 0; pass <= shown.length; pass++) {
|
|
123
|
-
const delta = room - sizes.reduce((sum, value) => sum + value, 0);
|
|
124
|
-
if (Math.abs(delta) < 0.01) break;
|
|
125
|
-
// Deck columns may opt into spare room, but never shrink to fit:
|
|
126
|
-
// overflow remains owned by the compositor's horizontal viewport.
|
|
127
|
-
if (deck && delta < 0) break;
|
|
128
|
-
let candidates = shown
|
|
129
|
-
.map((panel, index) => ({ panel, index }))
|
|
130
|
-
.filter(({ panel }) => !deck || (panel.span ?? 0) > 0)
|
|
131
|
-
.filter(({ panel, index }) =>
|
|
132
|
-
delta > 0 ? sizes[index]! < panelMaximum(panel) : sizes[index]! > panelMinimum(panel),
|
|
133
|
-
);
|
|
134
|
-
if (delta > 0 && !deck) {
|
|
135
|
-
const flexible = candidates.filter(
|
|
136
|
-
({ panel }) => panel.width === undefined && widths[panel.id] === undefined,
|
|
137
|
-
);
|
|
138
|
-
if (flexible.length) candidates = flexible;
|
|
139
|
-
}
|
|
140
|
-
const weight = candidates.reduce(
|
|
141
|
-
(sum, { panel }) => sum + Math.max(Number.EPSILON, positive(panel.span, 1)),
|
|
142
|
-
0,
|
|
143
|
-
);
|
|
144
|
-
if (!weight) break;
|
|
145
|
-
candidates.forEach(({ panel, index }) => {
|
|
146
|
-
sizes[index] = clampPanelWidth(
|
|
147
|
-
panel,
|
|
148
|
-
sizes[index]! + (delta * Math.max(Number.EPSILON, positive(panel.span, 1))) / weight,
|
|
149
|
-
);
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
shown.forEach((panel, index) => {
|
|
154
|
-
if (sizes[index]! < panelMinimum(panel)) sizes[index] = panelMinimum(panel);
|
|
155
|
-
});
|
|
156
|
-
return layout.panels.map((panel) => {
|
|
157
|
-
const index = shown.findIndex((candidate) => candidate.id === panel.id);
|
|
158
|
-
return {
|
|
159
|
-
id: panel.id,
|
|
160
|
-
width: index < 0 ? 0 : sizes[index]!,
|
|
161
|
-
visible: index >= 0,
|
|
162
|
-
gap: index > 0 ? gap : 0,
|
|
163
|
-
...(panel.floating ? { floating: shellWidth < breakpointPx(panel.floating.below) } : {}),
|
|
164
|
-
};
|
|
165
|
-
});
|
|
166
|
-
}
|
|
167
|
-
|
|
168
63
|
/**
|
|
169
64
|
* A track as native flex lays it out: what `panelLayoutCss` writes for the web,
|
|
170
|
-
* as Yoga's flex values along the group's axis.
|
|
171
|
-
* Yoga divides
|
|
172
|
-
*
|
|
173
|
-
*
|
|
174
|
-
* so `shellWidth` and `room` may be quantized (`quantizeWidth`).
|
|
65
|
+
* as Yoga's flex values along the group's axis. Room only selects semantic
|
|
66
|
+
* capacity/floating states. Yoga divides the room continuously; React hears
|
|
67
|
+
* only threshold changes (shell breakpoints and group minimum capacity), so
|
|
68
|
+
* `shellWidth` and `room` may be quantized (`quantizeWidth`).
|
|
175
69
|
*/
|
|
176
70
|
export interface PanelFlexTrack {
|
|
177
71
|
id: string;
|
|
@@ -195,6 +89,8 @@ export interface PanelFlexTrack {
|
|
|
195
89
|
export function panelLayoutWidthThresholds(layout: AppShellPanelLayout): number[] {
|
|
196
90
|
const thresholds = new Set<number>([0]);
|
|
197
91
|
for (const panel of layout.panels) {
|
|
92
|
+
if (panel.group)
|
|
93
|
+
for (const threshold of panelLayoutWidthThresholds(panel.group)) thresholds.add(threshold);
|
|
198
94
|
if (panel.hideBelow !== undefined) thresholds.add(breakpointPx(panel.hideBelow));
|
|
199
95
|
if (panel.floating) thresholds.add(breakpointPx(panel.floating.below));
|
|
200
96
|
}
|
|
@@ -223,112 +119,8 @@ export function panelLayoutMinimum(
|
|
|
223
119
|
}
|
|
224
120
|
|
|
225
121
|
/**
|
|
226
|
-
*
|
|
227
|
-
*
|
|
228
|
-
* growing from a zero basis. Yoga instead starts a track at its minimum and
|
|
229
|
-
* divides what is left (its flex basis is bounded by min and max), which would
|
|
230
|
-
* draw `min + share`. So native gives Yoga the CSS answer piecewise: a track
|
|
231
|
-
* held at its minimum is a fixed track of that size, and every other track
|
|
232
|
-
* grows from zero with no minimum; which tracks are held changes only at
|
|
233
|
-
* thresholds of the room (`flexibleRoomThresholds`), where React redraws.
|
|
234
|
-
*/
|
|
235
|
-
interface FlexibleTrack {
|
|
236
|
-
id: string;
|
|
237
|
-
span: number;
|
|
238
|
-
min: number;
|
|
239
|
-
max: number;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
/** Below this a track's minimum and its share are the same size (px). */
|
|
243
|
-
const HELD_TOLERANCE = 1e-6;
|
|
244
|
-
|
|
245
|
-
/** What `λ` fills `available` (the water level), and the room each breakpoint needs. */
|
|
246
|
-
function waterLevel(tracks: readonly FlexibleTrack[], available: number): number {
|
|
247
|
-
const filled = (level: number) =>
|
|
248
|
-
tracks.reduce(
|
|
249
|
-
(sum, track) => sum + Math.min(track.max, Math.max(track.min, level * track.span)),
|
|
250
|
-
0,
|
|
251
|
-
);
|
|
252
|
-
const breakpoints = [
|
|
253
|
-
0,
|
|
254
|
-
...tracks.flatMap((track) => [track.min / track.span, track.max / track.span]),
|
|
255
|
-
]
|
|
256
|
-
.filter((level) => Number.isFinite(level))
|
|
257
|
-
.sort((a, b) => a - b);
|
|
258
|
-
// The highest level that fills no more than `available`: on a stretch where
|
|
259
|
-
// every track is held (filling does not grow), the level is that stretch's
|
|
260
|
-
// end, so a room exactly at a threshold holds no track that it fills.
|
|
261
|
-
let low = 0;
|
|
262
|
-
for (const level of breakpoints) {
|
|
263
|
-
if (filled(level) > available) {
|
|
264
|
-
const from = filled(low);
|
|
265
|
-
return low + ((available - from) / (filled(level) - from)) * (level - low);
|
|
266
|
-
}
|
|
267
|
-
low = level;
|
|
268
|
-
}
|
|
269
|
-
const free = tracks.filter((track) => !Number.isFinite(track.max));
|
|
270
|
-
const span = free.reduce((sum, track) => sum + track.span, 0);
|
|
271
|
-
return span > 0 ? low + (available - filled(low)) / span : low;
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
/** The split's shown tracks and what of the room is theirs to divide, as `resolvePanelFlex` decides them. */
|
|
275
|
-
function splitShape(
|
|
276
|
-
layout: AppShellPanelLayout,
|
|
277
|
-
shellWidth: number,
|
|
278
|
-
gap: number,
|
|
279
|
-
dimensions: Readonly<Record<string, number>>,
|
|
280
|
-
) {
|
|
281
|
-
const axis = resolvePanelAxis(layout, shellWidth);
|
|
282
|
-
const eligible = eligiblePanels(layout, shellWidth).map((panel) => panelForAxis(panel, axis));
|
|
283
|
-
const own = (panel: AppShellPanelDefinition) => dimensions[panel.id] ?? panel.width;
|
|
284
|
-
const flexible: FlexibleTrack[] = eligible
|
|
285
|
-
.filter((panel) => own(panel) === undefined)
|
|
286
|
-
.map((panel) => ({
|
|
287
|
-
id: panel.id,
|
|
288
|
-
span: Math.max(Number.EPSILON, positive(panel.span, 1)),
|
|
289
|
-
min: panelMinimum(panel),
|
|
290
|
-
max: panelMaximum(panel),
|
|
291
|
-
}));
|
|
292
|
-
const fixed =
|
|
293
|
-
eligible
|
|
294
|
-
.filter((panel) => own(panel) !== undefined)
|
|
295
|
-
.reduce((sum, panel) => sum + clampPanelWidth(panel, own(panel)!), 0) +
|
|
296
|
-
Math.max(0, eligible.length - 1) * gap;
|
|
297
|
-
return { flexible, fixed };
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
/**
|
|
301
|
-
* The room at which a flexible track with a minimum stops being held at it
|
|
302
|
-
* (`waterLevel` reaching `min / span`), for the group's size classes: between
|
|
303
|
-
* two of these, which tracks are held does not change, and Yoga divides the
|
|
304
|
-
* room alone.
|
|
305
|
-
*/
|
|
306
|
-
export function flexibleRoomThresholds(
|
|
307
|
-
layout: AppShellPanelLayout,
|
|
308
|
-
shellWidth: number,
|
|
309
|
-
gap: number,
|
|
310
|
-
dimensions: Readonly<Record<string, number>> = {},
|
|
311
|
-
): number[] {
|
|
312
|
-
if (layout.mode === 'deck' || layout.expandedPanel) return [];
|
|
313
|
-
const { flexible, fixed } = splitShape(layout, shellWidth, gap, dimensions);
|
|
314
|
-
if (flexible.length < 2) return [];
|
|
315
|
-
return flexible
|
|
316
|
-
.filter((track) => track.min > 0)
|
|
317
|
-
.map(
|
|
318
|
-
(held) =>
|
|
319
|
-
fixed +
|
|
320
|
-
flexible.reduce(
|
|
321
|
-
(sum, track) =>
|
|
322
|
-
sum + Math.min(track.max, Math.max(track.min, (held.min / held.span) * track.span)),
|
|
323
|
-
0,
|
|
324
|
-
),
|
|
325
|
-
);
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
/**
|
|
329
|
-
* Each panel's flex along the group's axis, decided as `resolvePanelTracks`
|
|
330
|
-
* decides which tracks show (eligibility, collapse, the active one alone in too
|
|
331
|
-
* little room) and sized as the CSS compositor sizes them: a flexible split
|
|
122
|
+
* Each panel's declarative flex constraints and responsive eligibility.
|
|
123
|
+
* The native engine distributes the actual room: a flexible split
|
|
332
124
|
* track grows by its span from a zero basis; one with a width of its own keeps
|
|
333
125
|
* it beside flexible ones and grows by its span when none is; a deck column
|
|
334
126
|
* keeps its width and takes spare room only by an explicit span; a track shown
|
|
@@ -344,13 +136,15 @@ export function resolvePanelFlex(
|
|
|
344
136
|
const axis = resolvePanelAxis(layout, shellWidth);
|
|
345
137
|
const vertical = axis === 'vertical';
|
|
346
138
|
const eligible = eligiblePanels(layout, shellWidth).map((panel) => panelForAxis(panel, axis));
|
|
347
|
-
const natural =
|
|
348
|
-
|
|
139
|
+
const natural =
|
|
140
|
+
vertical && (layout.mode === 'flow' || (layout.flow === 'document' && layout.mode !== 'deck'));
|
|
141
|
+
const deck = layout.mode === 'deck' || layout.mode === 'flow' || natural;
|
|
349
142
|
const minimum =
|
|
350
143
|
eligible.reduce((sum, panel) => sum + panelMinimum(panel), 0) +
|
|
351
144
|
Math.max(0, eligible.length - 1) * gap;
|
|
352
145
|
const compact =
|
|
353
146
|
layout.mode !== 'deck' &&
|
|
147
|
+
layout.mode !== 'flow' &&
|
|
354
148
|
((layout.collapseBelow !== undefined && shellWidth < breakpointPx(layout.collapseBelow)) ||
|
|
355
149
|
(!natural && room < minimum));
|
|
356
150
|
const active =
|
|
@@ -360,26 +154,14 @@ export function resolvePanelFlex(
|
|
|
360
154
|
const shown = forced ? eligible.filter((panel) => panel.id === active?.id) : eligible;
|
|
361
155
|
const own = (panel: AppShellPanelDefinition) => dimensions[panel.id] ?? panel.width;
|
|
362
156
|
const flexible = shown.some((panel) => own(panel) === undefined);
|
|
363
|
-
// Two or more flexible split tracks: those the room holds at their minimum
|
|
364
|
-
// (`waterLevel`, `flexibleRoomThresholds`).
|
|
365
|
-
const held = new Set<string>();
|
|
366
|
-
let regime = false;
|
|
367
|
-
if (!forced && !deck) {
|
|
368
|
-
const shape = splitShape(layout, shellWidth, gap, dimensions);
|
|
369
|
-
if (shape.flexible.length > 1 && shape.flexible.some((track) => track.min > 0)) {
|
|
370
|
-
regime = true;
|
|
371
|
-
const level = waterLevel(shape.flexible, Math.max(0, room - shape.fixed));
|
|
372
|
-
// A room exactly at a threshold (a size class's lower bound is one) is
|
|
373
|
-
// past it: the track there no longer needs holding. Rounding must not
|
|
374
|
-
// say otherwise.
|
|
375
|
-
for (const track of shape.flexible)
|
|
376
|
-
if (track.min > level * track.span + HELD_TOLERANCE) held.add(track.id);
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
157
|
return layout.panels.map((declared) => {
|
|
380
158
|
const position = shown.findIndex((candidate) => candidate.id === declared.id);
|
|
381
159
|
const floating = declared.floating
|
|
382
|
-
? {
|
|
160
|
+
? {
|
|
161
|
+
floating:
|
|
162
|
+
shellWidth < breakpointPx(declared.floating.below) ||
|
|
163
|
+
(!!declared.floating.whenConstrained && compact && declared.id !== active?.id),
|
|
164
|
+
}
|
|
383
165
|
: {};
|
|
384
166
|
if (position < 0)
|
|
385
167
|
return {
|
|
@@ -409,19 +191,6 @@ export function resolvePanelFlex(
|
|
|
409
191
|
max: Number.POSITIVE_INFINITY,
|
|
410
192
|
gap: leading,
|
|
411
193
|
};
|
|
412
|
-
// Held at its minimum by the room: a fixed track of that size.
|
|
413
|
-
if (held.has(panel.id))
|
|
414
|
-
return {
|
|
415
|
-
id: declared.id,
|
|
416
|
-
visible: true,
|
|
417
|
-
...floating,
|
|
418
|
-
grow: 0,
|
|
419
|
-
shrink: 0,
|
|
420
|
-
basis: panelMinimum(panel),
|
|
421
|
-
min: panelMinimum(panel),
|
|
422
|
-
max: panelMinimum(panel),
|
|
423
|
-
gap: leading,
|
|
424
|
-
};
|
|
425
194
|
const basis =
|
|
426
195
|
dimension !== undefined
|
|
427
196
|
? clampPanelWidth(panel, dimension)
|
|
@@ -443,9 +212,8 @@ export function resolvePanelFlex(
|
|
|
443
212
|
shrink: deck ? 0 : 1,
|
|
444
213
|
basis,
|
|
445
214
|
...(natural && dimension === undefined ? { basisAuto: true } : {}),
|
|
446
|
-
//
|
|
447
|
-
|
|
448
|
-
min: dimension === undefined && !deck && regime ? 0 : panelMinimum(panel),
|
|
215
|
+
// Min/max remain native flex constraints; no JS water-fill distribution.
|
|
216
|
+
min: panelMinimum(panel),
|
|
449
217
|
max: panelMaximum(panel),
|
|
450
218
|
gap: leading,
|
|
451
219
|
};
|
|
@@ -467,6 +235,23 @@ export function resizePanelPair(
|
|
|
467
235
|
return { [first.id]: width, [second.id]: total - width };
|
|
468
236
|
}
|
|
469
237
|
|
|
238
|
+
/** A gesture may reduce an oversized pane, but cannot grow its excess back. */
|
|
239
|
+
export function panelContentResizeLimit(
|
|
240
|
+
panel: AppShellPanelDefinition,
|
|
241
|
+
currentSize: number,
|
|
242
|
+
contentMaximum: number | undefined,
|
|
243
|
+
): AppShellPanelDefinition {
|
|
244
|
+
if (contentMaximum === undefined || !Number.isFinite(contentMaximum) || contentMaximum < 0)
|
|
245
|
+
return panel;
|
|
246
|
+
return {
|
|
247
|
+
...panel,
|
|
248
|
+
maxWidth: Math.min(
|
|
249
|
+
panelMaximum(panel),
|
|
250
|
+
Math.max(panelMinimum(panel), currentSize, contentMaximum),
|
|
251
|
+
),
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
|
|
470
255
|
/** Committed weights override descriptor spans, in the resolver and the CSS compiler alike. */
|
|
471
256
|
export function applyPanelSpans(
|
|
472
257
|
layout: AppShellPanelLayout,
|
|
@@ -499,19 +284,27 @@ export function isFlexiblePanel(
|
|
|
499
284
|
* The weights that draw a resized pair of flexible tracks at the sizes it
|
|
500
285
|
* settled on. The pair keeps its combined span, so every other track keeps its
|
|
501
286
|
* share; the split is the settled pixel ratio, so the proportion survives the
|
|
502
|
-
* region growing or shrinking.
|
|
287
|
+
* region growing or shrinking. Native Yoga allocates free space beyond each
|
|
288
|
+
* minimum, so its gesture commit converts only that free portion to weights.
|
|
289
|
+
* This conversion runs once per gesture; it does not distribute layout.
|
|
503
290
|
*/
|
|
504
291
|
export function splitPairSpans(
|
|
505
292
|
first: AppShellPanelDefinition,
|
|
506
293
|
second: AppShellPanelDefinition,
|
|
507
294
|
firstSize: number,
|
|
508
295
|
secondSize: number,
|
|
296
|
+
minimumBasis = false,
|
|
509
297
|
): Record<string, number> {
|
|
510
298
|
const total = positive(first.span, 1) + positive(second.span, 1);
|
|
511
|
-
const
|
|
299
|
+
const firstFree = minimumBasis ? Math.max(0, firstSize - panelMinimum(first)) : firstSize;
|
|
300
|
+
const secondFree = minimumBasis ? Math.max(0, secondSize - panelMinimum(second)) : secondSize;
|
|
301
|
+
const pixels = firstFree + secondFree;
|
|
512
302
|
if (!(pixels > 0) || !(total > 0)) return {};
|
|
513
|
-
const share = Math.max(0, Math.min(1,
|
|
514
|
-
return {
|
|
303
|
+
const share = Math.max(0, Math.min(1, firstFree / pixels));
|
|
304
|
+
return {
|
|
305
|
+
[first.id]: minimumBasis ? Math.max(Number.EPSILON, total * share) : total * share,
|
|
306
|
+
[second.id]: minimumBasis ? Math.max(Number.EPSILON, total * (1 - share)) : total * (1 - share),
|
|
307
|
+
};
|
|
515
308
|
}
|
|
516
309
|
|
|
517
310
|
/** A panel along the window's top edge, away from the controls: its header moves the window. */
|
|
@@ -525,7 +318,7 @@ export const WINDOW_TOP_EDGE: WindowChrome = { leading: 0 };
|
|
|
525
318
|
*/
|
|
526
319
|
export function panelWindowChrome(
|
|
527
320
|
chrome: WindowChrome | null,
|
|
528
|
-
tracks: readonly Pick<
|
|
321
|
+
tracks: readonly Pick<PanelFlexTrack, 'visible' | 'floating'>[],
|
|
529
322
|
vertical: boolean,
|
|
530
323
|
): (WindowChrome | null)[] {
|
|
531
324
|
const shown = (index: number) => !!tracks[index]?.visible && !tracks[index]?.floating;
|