@womp/kookie-ui 0.7.0 → 0.8.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/components.css +538 -493
- package/dist/cjs/components/_internal/base-menu.utils.js +1 -1
- package/dist/cjs/components/_internal/base-menu.utils.js.map +3 -3
- package/dist/cjs/components/_internal/menu-context.js +1 -1
- package/dist/cjs/components/_internal/menu-context.js.map +3 -3
- package/dist/cjs/components/_internal/shell-bottom.d.ts +6 -7
- package/dist/cjs/components/_internal/shell-bottom.d.ts.map +1 -1
- package/dist/cjs/components/_internal/shell-bottom.js +1 -1
- package/dist/cjs/components/_internal/shell-bottom.js.map +4 -4
- package/dist/cjs/components/_internal/shell-handles.d.ts +9 -0
- package/dist/cjs/components/_internal/shell-handles.d.ts.map +1 -1
- package/dist/cjs/components/_internal/shell-handles.js +1 -1
- package/dist/cjs/components/_internal/shell-handles.js.map +3 -3
- package/dist/cjs/components/_internal/shell-inspector.d.ts +4 -6
- package/dist/cjs/components/_internal/shell-inspector.d.ts.map +1 -1
- package/dist/cjs/components/_internal/shell-inspector.js +1 -1
- package/dist/cjs/components/_internal/shell-inspector.js.map +4 -4
- package/dist/cjs/components/_internal/shell-pane.d.ts +70 -0
- package/dist/cjs/components/_internal/shell-pane.d.ts.map +1 -0
- package/dist/cjs/components/_internal/shell-pane.js +2 -0
- package/dist/cjs/components/_internal/shell-pane.js.map +7 -0
- package/dist/cjs/components/_internal/shell-resizable.d.ts +48 -0
- package/dist/cjs/components/_internal/shell-resizable.d.ts.map +1 -0
- package/dist/cjs/components/_internal/shell-resizable.js +2 -0
- package/dist/cjs/components/_internal/shell-resizable.js.map +7 -0
- package/dist/cjs/components/_internal/shell-resize.d.ts +11 -3
- package/dist/cjs/components/_internal/shell-resize.d.ts.map +1 -1
- package/dist/cjs/components/_internal/shell-resize.js +1 -1
- package/dist/cjs/components/_internal/shell-resize.js.map +2 -2
- package/dist/cjs/components/_internal/shell-rest.d.ts +27 -0
- package/dist/cjs/components/_internal/shell-rest.d.ts.map +1 -0
- package/dist/cjs/components/_internal/shell-rest.js +2 -0
- package/dist/cjs/components/_internal/shell-rest.js.map +7 -0
- package/dist/cjs/components/_internal/shell-sidebar.d.ts +7 -12
- package/dist/cjs/components/_internal/shell-sidebar.d.ts.map +1 -1
- package/dist/cjs/components/_internal/shell-sidebar.js +1 -1
- package/dist/cjs/components/_internal/shell-sidebar.js.map +4 -4
- package/dist/cjs/components/_internal/shell-store.d.ts +99 -0
- package/dist/cjs/components/_internal/shell-store.d.ts.map +1 -0
- package/dist/cjs/components/_internal/shell-store.js +2 -0
- package/dist/cjs/components/_internal/shell-store.js.map +7 -0
- package/dist/cjs/components/context-menu.js +1 -1
- package/dist/cjs/components/context-menu.js.map +3 -3
- package/dist/cjs/components/dropdown-menu.js +1 -1
- package/dist/cjs/components/dropdown-menu.js.map +3 -3
- package/dist/cjs/components/index.js +5 -5
- package/dist/cjs/components/index.js.map +4 -4
- package/dist/cjs/components/schemas/index.js +1 -1
- package/dist/cjs/components/schemas/index.js.map +3 -3
- package/dist/cjs/components/schemas/shell.schema.d.ts +277 -229
- package/dist/cjs/components/schemas/shell.schema.d.ts.map +1 -1
- package/dist/cjs/components/schemas/shell.schema.js +1 -1
- package/dist/cjs/components/schemas/shell.schema.js.map +3 -3
- package/dist/cjs/components/shell.context.d.ts +25 -114
- package/dist/cjs/components/shell.context.d.ts.map +1 -1
- package/dist/cjs/components/shell.context.js +1 -1
- package/dist/cjs/components/shell.context.js.map +4 -4
- package/dist/cjs/components/shell.d.ts +42 -21
- package/dist/cjs/components/shell.d.ts.map +1 -1
- package/dist/cjs/components/shell.hooks.d.ts +7 -23
- package/dist/cjs/components/shell.hooks.d.ts.map +1 -1
- package/dist/cjs/components/shell.hooks.js +1 -1
- package/dist/cjs/components/shell.hooks.js.map +4 -4
- package/dist/cjs/components/shell.js +1 -1
- package/dist/cjs/components/shell.js.map +4 -4
- package/dist/cjs/components/shell.types.d.ts +19 -2
- package/dist/cjs/components/shell.types.d.ts.map +1 -1
- package/dist/cjs/components/shell.types.js +1 -1
- package/dist/cjs/components/shell.types.js.map +3 -3
- package/dist/cjs/components/sidebar.js.map +3 -3
- package/dist/cjs/hooks/use-breakpoint.d.ts +5 -0
- package/dist/cjs/hooks/use-breakpoint.d.ts.map +1 -1
- package/dist/cjs/hooks/use-breakpoint.js +1 -1
- package/dist/cjs/hooks/use-breakpoint.js.map +3 -3
- package/dist/cjs/index.js +5 -5
- package/dist/cjs/index.js.map +4 -4
- package/dist/esm/{chunk-HJU4I34X.js → chunk-25X75TI7.js} +2 -2
- package/dist/esm/{chunk-4XKK32M4.js → chunk-26I257HE.js} +2 -2
- package/dist/esm/chunk-2EQWBT2S.js +2 -0
- package/dist/esm/chunk-2EQWBT2S.js.map +7 -0
- package/dist/esm/{chunk-GLERJXVS.js → chunk-2Q7BJ7YG.js} +2 -2
- package/dist/esm/{chunk-CJ27XP5Z.js → chunk-3AOFY2B4.js} +2 -2
- package/dist/esm/chunk-3J6AUDID.js +2 -0
- package/dist/esm/chunk-3J6AUDID.js.map +7 -0
- package/dist/esm/{chunk-7EWFBWBS.js → chunk-3PTSRBVY.js} +2 -2
- package/dist/esm/chunk-3XSB7YIM.js +2 -0
- package/dist/esm/{chunk-FMBECDL4.js.map → chunk-3XSB7YIM.js.map} +3 -3
- package/dist/esm/{chunk-O2U6RJTB.js → chunk-44JZYS7A.js} +2 -2
- package/dist/esm/{chunk-CTA5ODAO.js → chunk-4WU2WKUJ.js} +2 -2
- package/dist/esm/{chunk-KZWNGWIM.js → chunk-5M7STAH3.js} +2 -2
- package/dist/esm/{chunk-5WRCK4R7.js → chunk-5TAHT6VC.js} +2 -2
- package/dist/esm/{chunk-RNTCHVFI.js → chunk-6J6YX2VX.js} +2 -2
- package/dist/esm/{chunk-AGSSWWFI.js → chunk-7FKKGUHK.js} +2 -2
- package/dist/esm/{chunk-WHFJ4JUN.js → chunk-7NYODT3Z.js} +2 -2
- package/dist/esm/{chunk-NVDXXGVW.js → chunk-7PMMYHZV.js} +2 -2
- package/dist/esm/chunk-A2XVR7GL.js +2 -0
- package/dist/esm/chunk-A2XVR7GL.js.map +7 -0
- package/dist/esm/chunk-ADXZNG4F.js +2 -0
- package/dist/esm/chunk-ADXZNG4F.js.map +7 -0
- package/dist/esm/chunk-AGNIFHOE.js +2 -0
- package/dist/esm/chunk-AGNIFHOE.js.map +7 -0
- package/dist/esm/{chunk-KJUDZCYK.js → chunk-AIHQ3MVK.js} +2 -2
- package/dist/esm/{chunk-UBOOUDS4.js → chunk-AO32NT75.js} +2 -2
- package/dist/esm/chunk-BZZXXZ3O.js +2 -0
- package/dist/esm/chunk-BZZXXZ3O.js.map +7 -0
- package/dist/esm/{chunk-JDGJSNWT.js → chunk-C5RVO3C3.js} +2 -2
- package/dist/esm/{chunk-IHK3H2OM.js → chunk-CBNTPHYK.js} +2 -2
- package/dist/esm/{chunk-BBJUB52V.js → chunk-CRBOJ7N7.js} +2 -2
- package/dist/esm/{chunk-VHECAEUP.js → chunk-DCIQHXAR.js} +2 -2
- package/dist/esm/{chunk-43A5GUSI.js → chunk-EHBAK3LQ.js} +2 -2
- package/dist/esm/{chunk-K3UAS7RW.js → chunk-F3AXE27Q.js} +2 -2
- package/dist/esm/{chunk-KFR3CK24.js → chunk-FB3PD4Z3.js} +2 -2
- package/dist/esm/{chunk-MCPRXVKZ.js → chunk-FEAOFF77.js} +2 -2
- package/dist/esm/{chunk-VZSQATP6.js → chunk-G4YKBAZT.js} +2 -2
- package/dist/esm/{chunk-ECXGQQJB.js → chunk-GDAKJS64.js} +2 -2
- package/dist/esm/{chunk-VR7ZAFYN.js → chunk-GGSJXOKR.js} +2 -2
- package/dist/esm/chunk-GM7KMQDI.js +2 -0
- package/dist/esm/chunk-GMHA5CFH.js +2 -0
- package/dist/esm/chunk-GMHA5CFH.js.map +7 -0
- package/dist/esm/{chunk-CESYMTJQ.js → chunk-H4GR4262.js} +2 -2
- package/dist/esm/{chunk-WXQIIKWV.js → chunk-HBIF43PT.js} +2 -2
- package/dist/esm/chunk-HCNO7PX6.js +2 -0
- package/dist/esm/chunk-HCNO7PX6.js.map +7 -0
- package/dist/esm/{chunk-2264DHUW.js → chunk-HMSSFU6I.js} +2 -2
- package/dist/esm/chunk-HWQ3NTJP.js +2 -0
- package/dist/esm/chunk-HWQ3NTJP.js.map +7 -0
- package/dist/esm/{chunk-S5C5YRBS.js → chunk-IDUVJJYG.js} +2 -2
- package/dist/esm/{chunk-CIYF56YS.js → chunk-IK3MQHA5.js} +2 -2
- package/dist/esm/{chunk-CKMMUHKE.js → chunk-JDEBKA56.js} +2 -2
- package/dist/esm/{chunk-E67CIG6A.js → chunk-JDWCQ2XP.js} +2 -2
- package/dist/esm/{chunk-L3BWTV7I.js → chunk-JQSZF3E2.js} +2 -2
- package/dist/esm/{chunk-MEO7MJMQ.js → chunk-JQW4XYBS.js} +2 -2
- package/dist/esm/{chunk-KMPE7TJ6.js → chunk-JRFZ535T.js} +2 -2
- package/dist/esm/{chunk-CDG5WH4U.js → chunk-KEEPKI2X.js} +2 -2
- package/dist/esm/{chunk-GAV3NHYL.js → chunk-KV4SZP3F.js} +2 -2
- package/dist/esm/{chunk-FG7XM7KJ.js → chunk-LJCUPAOI.js} +2 -2
- package/dist/esm/{chunk-N4GTDLRD.js → chunk-MBCQA7UZ.js} +2 -2
- package/dist/esm/chunk-MM5IHQFM.js +2 -0
- package/dist/esm/{chunk-Y5RCH23Z.js → chunk-NQXRWBQM.js} +2 -2
- package/dist/esm/{chunk-CSKZZOI2.js → chunk-NTNMJX5M.js} +2 -2
- package/dist/esm/{chunk-V27ZAN3E.js → chunk-NV3P2CKH.js} +2 -2
- package/dist/esm/{chunk-4ME6O27S.js → chunk-O4CSXNST.js} +2 -2
- package/dist/esm/chunk-ODCVOXEV.js +2 -0
- package/dist/esm/{chunk-W2FOBR5Q.js → chunk-OEEF6KJG.js} +2 -2
- package/dist/esm/{chunk-ABSKRHVM.js → chunk-OJSOX3AX.js} +2 -2
- package/dist/esm/{chunk-JGLAE5G7.js → chunk-OQU2SKLN.js} +2 -2
- package/dist/esm/{chunk-PZ7OYATT.js → chunk-OTKQN2KY.js} +2 -2
- package/dist/esm/{chunk-QWVU2TW4.js → chunk-P27KV2LS.js} +2 -2
- package/dist/esm/{chunk-JUY7CBSL.js → chunk-PBFSBHBS.js} +2 -2
- package/dist/esm/{chunk-DSJY5RI3.js → chunk-PDUHBDFC.js} +2 -2
- package/dist/esm/{chunk-MTOLKA6S.js → chunk-POG3YABW.js} +2 -2
- package/dist/esm/chunk-PYHEBG5I.js +2 -0
- package/dist/esm/chunk-PYHEBG5I.js.map +7 -0
- package/dist/esm/{chunk-GO7OHBHW.js → chunk-PYXMGEO7.js} +2 -2
- package/dist/esm/{chunk-VNH7BJOA.js → chunk-QEGEUD4D.js} +2 -2
- package/dist/esm/chunk-QEL55MLF.js +2 -0
- package/dist/esm/{chunk-MS5J4MF6.js → chunk-QJVAS7AK.js} +2 -2
- package/dist/esm/chunk-ROSWI2CL.js +2 -0
- package/dist/esm/chunk-ROSWI2CL.js.map +7 -0
- package/dist/esm/{chunk-KCWESYMR.js → chunk-RY67WG3O.js} +2 -2
- package/dist/esm/{chunk-IFM4EMZB.js → chunk-TLGXIWAS.js} +2 -2
- package/dist/esm/{chunk-6FLLFCBU.js → chunk-UBSLEGQZ.js} +2 -2
- package/dist/esm/{chunk-VBI3AWPT.js → chunk-UNWPH3SO.js} +2 -2
- package/dist/esm/chunk-V5ZSDDVZ.js +2 -0
- package/dist/esm/chunk-V5ZSDDVZ.js.map +7 -0
- package/dist/esm/{chunk-X7V3V3W4.js → chunk-VTIL55SR.js} +2 -2
- package/dist/esm/{chunk-ALWNS44Q.js → chunk-W2LD2YE6.js} +2 -2
- package/dist/esm/{chunk-2I7QRVJ5.js → chunk-WGWUEU4K.js} +2 -2
- package/dist/esm/{chunk-EPTYNVCU.js → chunk-WIDJYVZF.js} +2 -2
- package/dist/esm/{chunk-OLAWVEAI.js → chunk-WJBOOAIO.js} +2 -2
- package/dist/esm/{chunk-7FC7HF76.js → chunk-WQCB7KSH.js} +2 -2
- package/dist/esm/{chunk-YBSRX63K.js → chunk-WZFVTC7P.js} +2 -2
- package/dist/esm/chunk-XDDKT4NF.js +2 -0
- package/dist/esm/{chunk-KFA53SVQ.js → chunk-YA5DF67M.js} +2 -2
- package/dist/esm/chunk-YA5DF67M.js.map +7 -0
- package/dist/esm/chunk-YAQBIO2B.js +2 -0
- package/dist/esm/chunk-YAQBIO2B.js.map +7 -0
- package/dist/esm/{chunk-OFUNVHZ5.js → chunk-YG66IRW4.js} +2 -2
- package/dist/esm/{chunk-WGYUWEQV.js → chunk-YVSM2LGS.js} +2 -2
- package/dist/esm/{chunk-4NTGF22C.js → chunk-Z7AZNMNX.js} +2 -2
- package/dist/esm/chunk-ZJ33QP5N.js +2 -0
- package/dist/esm/{chunk-OGXZHAQL.js → chunk-ZW26J2SA.js} +2 -2
- package/dist/esm/components/_internal/base-button.js +1 -1
- package/dist/esm/components/_internal/base-menu.utils.js +1 -1
- package/dist/esm/components/_internal/menu-context.js +1 -1
- package/dist/esm/components/_internal/shell-bottom.d.ts +6 -7
- package/dist/esm/components/_internal/shell-bottom.d.ts.map +1 -1
- package/dist/esm/components/_internal/shell-bottom.js +1 -1
- package/dist/esm/components/_internal/shell-handles.d.ts +9 -0
- package/dist/esm/components/_internal/shell-handles.d.ts.map +1 -1
- package/dist/esm/components/_internal/shell-handles.js +1 -1
- package/dist/esm/components/_internal/shell-inspector.d.ts +4 -6
- package/dist/esm/components/_internal/shell-inspector.d.ts.map +1 -1
- package/dist/esm/components/_internal/shell-inspector.js +1 -1
- package/dist/esm/components/_internal/shell-pane.d.ts +70 -0
- package/dist/esm/components/_internal/shell-pane.d.ts.map +1 -0
- package/dist/esm/components/_internal/shell-pane.js +2 -0
- package/dist/esm/components/_internal/shell-resizable.d.ts +48 -0
- package/dist/esm/components/_internal/shell-resizable.d.ts.map +1 -0
- package/dist/esm/components/_internal/shell-resizable.js +2 -0
- package/dist/esm/components/_internal/shell-resizable.js.map +7 -0
- package/dist/esm/components/_internal/shell-resize.d.ts +11 -3
- package/dist/esm/components/_internal/shell-resize.d.ts.map +1 -1
- package/dist/esm/components/_internal/shell-resize.js +1 -1
- package/dist/esm/components/_internal/shell-rest.d.ts +27 -0
- package/dist/esm/components/_internal/shell-rest.d.ts.map +1 -0
- package/dist/esm/components/_internal/shell-rest.js +2 -0
- package/dist/esm/components/_internal/shell-rest.js.map +7 -0
- package/dist/esm/components/_internal/shell-sidebar.d.ts +7 -12
- package/dist/esm/components/_internal/shell-sidebar.d.ts.map +1 -1
- package/dist/esm/components/_internal/shell-sidebar.js +1 -1
- package/dist/esm/components/_internal/shell-store.d.ts +99 -0
- package/dist/esm/components/_internal/shell-store.d.ts.map +1 -0
- package/dist/esm/components/_internal/shell-store.js +2 -0
- package/dist/esm/components/_internal/shell-store.js.map +7 -0
- package/dist/esm/components/accordion.js +1 -1
- package/dist/esm/components/alert-dialog.js +1 -1
- package/dist/esm/components/avatar.js +1 -1
- package/dist/esm/components/badge.js +1 -1
- package/dist/esm/components/blockquote.js +1 -1
- package/dist/esm/components/blockquote.props.js +1 -1
- package/dist/esm/components/box.js +1 -1
- package/dist/esm/components/button.js +1 -1
- package/dist/esm/components/callout.js +1 -1
- package/dist/esm/components/card.js +1 -1
- package/dist/esm/components/chatbar.js +1 -1
- package/dist/esm/components/checkbox-cards.js +1 -1
- package/dist/esm/components/checkbox-group.js +1 -1
- package/dist/esm/components/checkbox.js +1 -1
- package/dist/esm/components/code.js +1 -1
- package/dist/esm/components/code.props.js +1 -1
- package/dist/esm/components/combobox.js +1 -1
- package/dist/esm/components/container.js +1 -1
- package/dist/esm/components/context-menu.js +1 -1
- package/dist/esm/components/data-list.js +1 -1
- package/dist/esm/components/dialog.js +1 -1
- package/dist/esm/components/dropdown-menu.js +1 -1
- package/dist/esm/components/em.js +1 -1
- package/dist/esm/components/em.props.js +1 -1
- package/dist/esm/components/flex.js +1 -1
- package/dist/esm/components/grid.js +1 -1
- package/dist/esm/components/heading.js +1 -1
- package/dist/esm/components/heading.props.js +1 -1
- package/dist/esm/components/hover-card.js +1 -1
- package/dist/esm/components/icon-button.js +1 -1
- package/dist/esm/components/image.js +1 -1
- package/dist/esm/components/index.js +1 -1
- package/dist/esm/components/inset.js +1 -1
- package/dist/esm/components/kbd.js +1 -1
- package/dist/esm/components/link.js +1 -1
- package/dist/esm/components/link.props.js +1 -1
- package/dist/esm/components/navbar.js +1 -1
- package/dist/esm/components/popover.js +1 -1
- package/dist/esm/components/progress.js +1 -1
- package/dist/esm/components/quote.js +1 -1
- package/dist/esm/components/quote.props.js +1 -1
- package/dist/esm/components/radio-cards.js +1 -1
- package/dist/esm/components/radio-group.js +1 -1
- package/dist/esm/components/radio.js +1 -1
- package/dist/esm/components/schemas/index.js +1 -1
- package/dist/esm/components/schemas/shell.schema.d.ts +277 -229
- package/dist/esm/components/schemas/shell.schema.d.ts.map +1 -1
- package/dist/esm/components/schemas/shell.schema.js +1 -1
- package/dist/esm/components/scroll-area.js +1 -1
- package/dist/esm/components/section.js +1 -1
- package/dist/esm/components/segmented-control.js +1 -1
- package/dist/esm/components/select.js +1 -1
- package/dist/esm/components/separator.js +1 -1
- package/dist/esm/components/sheet.js +1 -1
- package/dist/esm/components/shell.context.d.ts +25 -114
- package/dist/esm/components/shell.context.d.ts.map +1 -1
- package/dist/esm/components/shell.context.js +1 -1
- package/dist/esm/components/shell.d.ts +42 -21
- package/dist/esm/components/shell.d.ts.map +1 -1
- package/dist/esm/components/shell.hooks.d.ts +7 -23
- package/dist/esm/components/shell.hooks.d.ts.map +1 -1
- package/dist/esm/components/shell.hooks.js +1 -1
- package/dist/esm/components/shell.js +1 -1
- package/dist/esm/components/shell.types.d.ts +19 -2
- package/dist/esm/components/shell.types.d.ts.map +1 -1
- package/dist/esm/components/shell.types.js +1 -1
- package/dist/esm/components/sidebar.js +1 -1
- package/dist/esm/components/skeleton.js +1 -1
- package/dist/esm/components/slider.js +1 -1
- package/dist/esm/components/spinner.js +1 -1
- package/dist/esm/components/strong.js +1 -1
- package/dist/esm/components/strong.props.js +1 -1
- package/dist/esm/components/switch.js +1 -1
- package/dist/esm/components/tab-nav.js +1 -1
- package/dist/esm/components/table.js +1 -1
- package/dist/esm/components/tabs.js +1 -1
- package/dist/esm/components/text-area.js +1 -1
- package/dist/esm/components/text-field.js +1 -1
- package/dist/esm/components/text.js +1 -1
- package/dist/esm/components/text.props.js +1 -1
- package/dist/esm/components/theme-panel.js +1 -1
- package/dist/esm/components/toggle-button.js +1 -1
- package/dist/esm/components/toggle-icon-button.js +1 -1
- package/dist/esm/components/toolbar.js +1 -1
- package/dist/esm/components/tooltip.js +1 -1
- package/dist/esm/components/user-card.js +1 -1
- package/dist/esm/components/virtual-menu.js +1 -1
- package/dist/esm/helpers/extract-props.js +1 -1
- package/dist/esm/helpers/get-margin-styles.js +1 -1
- package/dist/esm/helpers/get-responsive-styles.js +1 -1
- package/dist/esm/helpers/index.js +1 -1
- package/dist/esm/hooks/index.js +1 -1
- package/dist/esm/hooks/use-breakpoint.d.ts +5 -0
- package/dist/esm/hooks/use-breakpoint.d.ts.map +1 -1
- package/dist/esm/hooks/use-breakpoint.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/props/index.js +1 -1
- package/package.json +7 -2
- package/schemas/index.json +1655 -0
- package/schemas/shell-bottom.d.ts +2 -0
- package/schemas/shell-bottom.json +180 -76
- package/schemas/shell-content.d.ts +2 -0
- package/schemas/shell-content.json +11 -5
- package/schemas/shell-handle.d.ts +2 -0
- package/schemas/shell-handle.json +7 -5
- package/schemas/shell-header.d.ts +2 -0
- package/schemas/shell-header.json +9 -10
- package/schemas/shell-inspector.d.ts +2 -0
- package/schemas/shell-inspector.json +183 -79
- package/schemas/shell-panel.d.ts +2 -0
- package/schemas/shell-panel.json +180 -76
- package/schemas/shell-rail.d.ts +2 -0
- package/schemas/shell-rail.json +137 -64
- package/schemas/shell-root.d.ts +2 -0
- package/schemas/shell-root.json +11 -9
- package/schemas/shell-sidebar.d.ts +2 -0
- package/schemas/shell-sidebar.json +274 -85
- package/schemas/shell-trigger.d.ts +2 -0
- package/schemas/shell-trigger.json +29 -17
- package/src/components/_internal/shell-bottom.tsx +92 -361
- package/src/components/_internal/shell-handles.tsx +193 -108
- package/src/components/_internal/shell-inspector.tsx +93 -360
- package/src/components/_internal/shell-pane.tsx +283 -0
- package/src/components/_internal/shell-resizable.tsx +263 -0
- package/src/components/_internal/shell-resize.tsx +11 -3
- package/src/components/_internal/shell-rest.ts +45 -0
- package/src/components/_internal/shell-sidebar.tsx +130 -441
- package/src/components/_internal/shell-store.tsx +204 -0
- package/src/components/schemas/shell.schema.ts +162 -153
- package/src/components/shell.context.tsx +112 -124
- package/src/components/shell.css +637 -496
- package/src/components/shell.hooks.ts +12 -170
- package/src/components/shell.tsx +566 -1497
- package/src/components/shell.types.ts +22 -2
- package/src/hooks/use-breakpoint.ts +9 -0
- package/styles.css +538 -493
- package/dist/cjs/components/_internal/shell-prop-helpers.d.ts +0 -7
- package/dist/cjs/components/_internal/shell-prop-helpers.d.ts.map +0 -1
- package/dist/cjs/components/_internal/shell-prop-helpers.js +0 -2
- package/dist/cjs/components/_internal/shell-prop-helpers.js.map +0 -7
- package/dist/esm/chunk-2SZZ75RJ.js +0 -2
- package/dist/esm/chunk-2SZZ75RJ.js.map +0 -7
- package/dist/esm/chunk-4JQZUQY7.js +0 -2
- package/dist/esm/chunk-5LXFJMFB.js +0 -2
- package/dist/esm/chunk-5LXFJMFB.js.map +0 -7
- package/dist/esm/chunk-CECQNGUL.js +0 -2
- package/dist/esm/chunk-CECQNGUL.js.map +0 -7
- package/dist/esm/chunk-CEIK5U6C.js +0 -2
- package/dist/esm/chunk-CEIK5U6C.js.map +0 -7
- package/dist/esm/chunk-EE2IH2GL.js +0 -2
- package/dist/esm/chunk-EE2IH2GL.js.map +0 -7
- package/dist/esm/chunk-FMBECDL4.js +0 -2
- package/dist/esm/chunk-HSAG7C53.js +0 -2
- package/dist/esm/chunk-JJKQ7CGI.js +0 -2
- package/dist/esm/chunk-KFA53SVQ.js.map +0 -7
- package/dist/esm/chunk-KRDP5SQ7.js +0 -2
- package/dist/esm/chunk-KRDP5SQ7.js.map +0 -7
- package/dist/esm/chunk-M6DJRFJZ.js +0 -2
- package/dist/esm/chunk-M6DJRFJZ.js.map +0 -7
- package/dist/esm/chunk-MCQCG6AS.js +0 -2
- package/dist/esm/chunk-NIQT45PJ.js +0 -2
- package/dist/esm/chunk-NNO7M466.js +0 -2
- package/dist/esm/chunk-NNO7M466.js.map +0 -7
- package/dist/esm/chunk-SNHEJU2S.js +0 -2
- package/dist/esm/chunk-SNHEJU2S.js.map +0 -7
- package/dist/esm/chunk-TLWTUKKL.js +0 -2
- package/dist/esm/chunk-TLWTUKKL.js.map +0 -7
- package/dist/esm/chunk-XI5YXUCK.js +0 -2
- package/dist/esm/components/_internal/shell-prop-helpers.d.ts +0 -7
- package/dist/esm/components/_internal/shell-prop-helpers.d.ts.map +0 -1
- package/dist/esm/components/_internal/shell-prop-helpers.js +0 -2
- package/src/components/_internal/shell-prop-helpers.ts +0 -54
- /package/dist/esm/{chunk-HJU4I34X.js.map → chunk-25X75TI7.js.map} +0 -0
- /package/dist/esm/{chunk-4XKK32M4.js.map → chunk-26I257HE.js.map} +0 -0
- /package/dist/esm/{chunk-GLERJXVS.js.map → chunk-2Q7BJ7YG.js.map} +0 -0
- /package/dist/esm/{chunk-CJ27XP5Z.js.map → chunk-3AOFY2B4.js.map} +0 -0
- /package/dist/esm/{chunk-7EWFBWBS.js.map → chunk-3PTSRBVY.js.map} +0 -0
- /package/dist/esm/{chunk-O2U6RJTB.js.map → chunk-44JZYS7A.js.map} +0 -0
- /package/dist/esm/{chunk-CTA5ODAO.js.map → chunk-4WU2WKUJ.js.map} +0 -0
- /package/dist/esm/{chunk-KZWNGWIM.js.map → chunk-5M7STAH3.js.map} +0 -0
- /package/dist/esm/{chunk-5WRCK4R7.js.map → chunk-5TAHT6VC.js.map} +0 -0
- /package/dist/esm/{chunk-RNTCHVFI.js.map → chunk-6J6YX2VX.js.map} +0 -0
- /package/dist/esm/{chunk-AGSSWWFI.js.map → chunk-7FKKGUHK.js.map} +0 -0
- /package/dist/esm/{chunk-WHFJ4JUN.js.map → chunk-7NYODT3Z.js.map} +0 -0
- /package/dist/esm/{chunk-NVDXXGVW.js.map → chunk-7PMMYHZV.js.map} +0 -0
- /package/dist/esm/{chunk-KJUDZCYK.js.map → chunk-AIHQ3MVK.js.map} +0 -0
- /package/dist/esm/{chunk-UBOOUDS4.js.map → chunk-AO32NT75.js.map} +0 -0
- /package/dist/esm/{chunk-JDGJSNWT.js.map → chunk-C5RVO3C3.js.map} +0 -0
- /package/dist/esm/{chunk-IHK3H2OM.js.map → chunk-CBNTPHYK.js.map} +0 -0
- /package/dist/esm/{chunk-BBJUB52V.js.map → chunk-CRBOJ7N7.js.map} +0 -0
- /package/dist/esm/{chunk-VHECAEUP.js.map → chunk-DCIQHXAR.js.map} +0 -0
- /package/dist/esm/{chunk-43A5GUSI.js.map → chunk-EHBAK3LQ.js.map} +0 -0
- /package/dist/esm/{chunk-K3UAS7RW.js.map → chunk-F3AXE27Q.js.map} +0 -0
- /package/dist/esm/{chunk-KFR3CK24.js.map → chunk-FB3PD4Z3.js.map} +0 -0
- /package/dist/esm/{chunk-MCPRXVKZ.js.map → chunk-FEAOFF77.js.map} +0 -0
- /package/dist/esm/{chunk-VZSQATP6.js.map → chunk-G4YKBAZT.js.map} +0 -0
- /package/dist/esm/{chunk-ECXGQQJB.js.map → chunk-GDAKJS64.js.map} +0 -0
- /package/dist/esm/{chunk-VR7ZAFYN.js.map → chunk-GGSJXOKR.js.map} +0 -0
- /package/dist/esm/{chunk-4JQZUQY7.js.map → chunk-GM7KMQDI.js.map} +0 -0
- /package/dist/esm/{chunk-CESYMTJQ.js.map → chunk-H4GR4262.js.map} +0 -0
- /package/dist/esm/{chunk-WXQIIKWV.js.map → chunk-HBIF43PT.js.map} +0 -0
- /package/dist/esm/{chunk-2264DHUW.js.map → chunk-HMSSFU6I.js.map} +0 -0
- /package/dist/esm/{chunk-S5C5YRBS.js.map → chunk-IDUVJJYG.js.map} +0 -0
- /package/dist/esm/{chunk-CIYF56YS.js.map → chunk-IK3MQHA5.js.map} +0 -0
- /package/dist/esm/{chunk-CKMMUHKE.js.map → chunk-JDEBKA56.js.map} +0 -0
- /package/dist/esm/{chunk-E67CIG6A.js.map → chunk-JDWCQ2XP.js.map} +0 -0
- /package/dist/esm/{chunk-L3BWTV7I.js.map → chunk-JQSZF3E2.js.map} +0 -0
- /package/dist/esm/{chunk-MEO7MJMQ.js.map → chunk-JQW4XYBS.js.map} +0 -0
- /package/dist/esm/{chunk-KMPE7TJ6.js.map → chunk-JRFZ535T.js.map} +0 -0
- /package/dist/esm/{chunk-CDG5WH4U.js.map → chunk-KEEPKI2X.js.map} +0 -0
- /package/dist/esm/{chunk-GAV3NHYL.js.map → chunk-KV4SZP3F.js.map} +0 -0
- /package/dist/esm/{chunk-FG7XM7KJ.js.map → chunk-LJCUPAOI.js.map} +0 -0
- /package/dist/esm/{chunk-N4GTDLRD.js.map → chunk-MBCQA7UZ.js.map} +0 -0
- /package/dist/esm/{chunk-JJKQ7CGI.js.map → chunk-MM5IHQFM.js.map} +0 -0
- /package/dist/esm/{chunk-Y5RCH23Z.js.map → chunk-NQXRWBQM.js.map} +0 -0
- /package/dist/esm/{chunk-CSKZZOI2.js.map → chunk-NTNMJX5M.js.map} +0 -0
- /package/dist/esm/{chunk-V27ZAN3E.js.map → chunk-NV3P2CKH.js.map} +0 -0
- /package/dist/esm/{chunk-4ME6O27S.js.map → chunk-O4CSXNST.js.map} +0 -0
- /package/dist/esm/{chunk-HSAG7C53.js.map → chunk-ODCVOXEV.js.map} +0 -0
- /package/dist/esm/{chunk-W2FOBR5Q.js.map → chunk-OEEF6KJG.js.map} +0 -0
- /package/dist/esm/{chunk-ABSKRHVM.js.map → chunk-OJSOX3AX.js.map} +0 -0
- /package/dist/esm/{chunk-JGLAE5G7.js.map → chunk-OQU2SKLN.js.map} +0 -0
- /package/dist/esm/{chunk-PZ7OYATT.js.map → chunk-OTKQN2KY.js.map} +0 -0
- /package/dist/esm/{chunk-QWVU2TW4.js.map → chunk-P27KV2LS.js.map} +0 -0
- /package/dist/esm/{chunk-JUY7CBSL.js.map → chunk-PBFSBHBS.js.map} +0 -0
- /package/dist/esm/{chunk-DSJY5RI3.js.map → chunk-PDUHBDFC.js.map} +0 -0
- /package/dist/esm/{chunk-MTOLKA6S.js.map → chunk-POG3YABW.js.map} +0 -0
- /package/dist/esm/{chunk-GO7OHBHW.js.map → chunk-PYXMGEO7.js.map} +0 -0
- /package/dist/esm/{chunk-VNH7BJOA.js.map → chunk-QEGEUD4D.js.map} +0 -0
- /package/dist/esm/{chunk-MCQCG6AS.js.map → chunk-QEL55MLF.js.map} +0 -0
- /package/dist/esm/{chunk-MS5J4MF6.js.map → chunk-QJVAS7AK.js.map} +0 -0
- /package/dist/esm/{chunk-KCWESYMR.js.map → chunk-RY67WG3O.js.map} +0 -0
- /package/dist/esm/{chunk-IFM4EMZB.js.map → chunk-TLGXIWAS.js.map} +0 -0
- /package/dist/esm/{chunk-6FLLFCBU.js.map → chunk-UBSLEGQZ.js.map} +0 -0
- /package/dist/esm/{chunk-VBI3AWPT.js.map → chunk-UNWPH3SO.js.map} +0 -0
- /package/dist/esm/{chunk-X7V3V3W4.js.map → chunk-VTIL55SR.js.map} +0 -0
- /package/dist/esm/{chunk-ALWNS44Q.js.map → chunk-W2LD2YE6.js.map} +0 -0
- /package/dist/esm/{chunk-2I7QRVJ5.js.map → chunk-WGWUEU4K.js.map} +0 -0
- /package/dist/esm/{chunk-EPTYNVCU.js.map → chunk-WIDJYVZF.js.map} +0 -0
- /package/dist/esm/{chunk-OLAWVEAI.js.map → chunk-WJBOOAIO.js.map} +0 -0
- /package/dist/esm/{chunk-7FC7HF76.js.map → chunk-WQCB7KSH.js.map} +0 -0
- /package/dist/esm/{chunk-YBSRX63K.js.map → chunk-WZFVTC7P.js.map} +0 -0
- /package/dist/esm/{chunk-XI5YXUCK.js.map → chunk-XDDKT4NF.js.map} +0 -0
- /package/dist/esm/{chunk-OFUNVHZ5.js.map → chunk-YG66IRW4.js.map} +0 -0
- /package/dist/esm/{chunk-WGYUWEQV.js.map → chunk-YVSM2LGS.js.map} +0 -0
- /package/dist/esm/{chunk-4NTGF22C.js.map → chunk-Z7AZNMNX.js.map} +0 -0
- /package/dist/esm/{chunk-NIQT45PJ.js.map → chunk-ZJ33QP5N.js.map} +0 -0
- /package/dist/esm/{chunk-OGXZHAQL.js.map → chunk-ZW26J2SA.js.map} +0 -0
- /package/dist/esm/components/_internal/{shell-prop-helpers.js.map → shell-pane.js.map} +0 -0
|
@@ -2,16 +2,26 @@ import * as React from 'react';
|
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import { usePaneResize } from './shell-resize.js';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* The resize handle: the WAI-ARIA window splitter. `role="separator"` with a
|
|
7
|
+
* value, focusable because it is operable, `aria-controls` naming its pane.
|
|
8
|
+
*
|
|
9
|
+
* A drag writes the size variable directly on the pane and sets no React
|
|
10
|
+
* state, so nothing re-renders per move. `onResize` is called at most once per
|
|
11
|
+
* animation frame, and once more with the final size when the drag ends. The
|
|
12
|
+
* direction and the ceiling are read once, when the drag starts.
|
|
13
|
+
*/
|
|
5
14
|
export const PaneHandle = React.forwardRef<HTMLDivElement, React.ComponentPropsWithoutRef<'div'>>(({ className, children, ...props }, ref) => {
|
|
6
15
|
const {
|
|
7
16
|
containerRef,
|
|
17
|
+
controls,
|
|
8
18
|
cssVarName,
|
|
9
19
|
minSize,
|
|
10
20
|
maxSize,
|
|
11
21
|
defaultSize,
|
|
12
22
|
orientation,
|
|
13
23
|
edge,
|
|
14
|
-
|
|
24
|
+
growth,
|
|
15
25
|
onResize,
|
|
16
26
|
onResizeStart,
|
|
17
27
|
onResizeEnd,
|
|
@@ -24,53 +34,118 @@ export const PaneHandle = React.forwardRef<HTMLDivElement, React.ComponentPropsW
|
|
|
24
34
|
requestToggle,
|
|
25
35
|
} = usePaneResize();
|
|
26
36
|
|
|
37
|
+
const handleRef = React.useRef<HTMLDivElement | null>(null);
|
|
38
|
+
const setRef = React.useCallback(
|
|
39
|
+
(node: HTMLDivElement | null) => {
|
|
40
|
+
handleRef.current = node;
|
|
41
|
+
if (typeof ref === 'function') ref(node);
|
|
42
|
+
else if (ref) (ref as React.MutableRefObject<HTMLDivElement | null>).current = node;
|
|
43
|
+
},
|
|
44
|
+
[ref],
|
|
45
|
+
);
|
|
46
|
+
|
|
27
47
|
const activeCleanupRef = React.useRef<(() => void) | null>(null);
|
|
28
48
|
React.useEffect(
|
|
29
49
|
() => () => {
|
|
30
|
-
|
|
31
|
-
activeCleanupRef.current?.();
|
|
32
|
-
} catch {}
|
|
50
|
+
activeCleanupRef.current?.();
|
|
33
51
|
activeCleanupRef.current = null;
|
|
34
52
|
},
|
|
35
53
|
[],
|
|
36
54
|
);
|
|
37
55
|
|
|
38
|
-
|
|
56
|
+
/** The pane's size as the stylesheet sees it. Read at the edges of a gesture, never during one. */
|
|
57
|
+
const readSize = React.useCallback(() => {
|
|
58
|
+
const container = containerRef.current;
|
|
59
|
+
if (!container) return defaultSize;
|
|
60
|
+
const parsed = Number.parseFloat(getComputedStyle(container).getPropertyValue(cssVarName));
|
|
61
|
+
return Number.isFinite(parsed) ? parsed : defaultSize;
|
|
62
|
+
}, [containerRef, cssVarName, defaultSize]);
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* The largest size a resize may reach: the stated maximum, and never so
|
|
66
|
+
* large that the handle leaves the frame. The room is measured from the
|
|
67
|
+
* pane's anchored edge, which does not move, to the far edge of the frame,
|
|
68
|
+
* so a pane that starts after a Rail has less room than the frame's width.
|
|
69
|
+
* Without the cap a pane with a generous `maxSize` could be resized until
|
|
70
|
+
* its own handle was off screen.
|
|
71
|
+
*/
|
|
72
|
+
const ceiling = React.useCallback(() => {
|
|
73
|
+
const container = containerRef.current;
|
|
74
|
+
const handle = handleRef.current;
|
|
75
|
+
const frame = container?.closest('.rt-ShellRoot')?.getBoundingClientRect();
|
|
76
|
+
if (!container || !frame || !handle) return maxSize;
|
|
77
|
+
const pane = container.getBoundingClientRect();
|
|
78
|
+
const hitBox = handle.getBoundingClientRect();
|
|
79
|
+
const sign = growth(getComputedStyle(container).direction === 'rtl');
|
|
80
|
+
let room: number;
|
|
81
|
+
if (orientation === 'vertical') room = sign > 0 ? frame.right - pane.left : pane.right - frame.left;
|
|
82
|
+
else room = sign > 0 ? frame.bottom - pane.top : pane.bottom - frame.top;
|
|
83
|
+
const hit = orientation === 'vertical' ? hitBox.width : hitBox.height;
|
|
84
|
+
if (!(frame.width > 0 && frame.height > 0) || !Number.isFinite(room)) return maxSize;
|
|
85
|
+
return Math.max(minSize, Math.min(maxSize, Math.round(room - hit)));
|
|
86
|
+
}, [containerRef, growth, maxSize, minSize, orientation]);
|
|
87
|
+
|
|
88
|
+
// The announced maximum is what a resize can reach now, not only the prop.
|
|
89
|
+
const announceCeiling = () => {
|
|
90
|
+
handleRef.current?.setAttribute('aria-valuemax', String(ceiling()));
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
// The announced value is seeded from the real size once the pane has a box.
|
|
94
|
+
React.useLayoutEffect(() => {
|
|
95
|
+
handleRef.current?.setAttribute('aria-valuenow', String(Math.round(readSize())));
|
|
96
|
+
}, [readSize]);
|
|
97
|
+
|
|
98
|
+
const write = (container: HTMLElement, size: number) => {
|
|
99
|
+
container.style.setProperty(cssVarName, `${size}px`);
|
|
100
|
+
handleRef.current?.setAttribute('aria-valuenow', String(Math.round(size)));
|
|
101
|
+
};
|
|
39
102
|
|
|
40
|
-
// Generate accessible label from target
|
|
41
103
|
const targetLabel = target.charAt(0).toUpperCase() + target.slice(1);
|
|
42
|
-
const ariaLabel = `Resize ${targetLabel} pane`;
|
|
43
104
|
|
|
44
105
|
return (
|
|
106
|
+
// A focusable separator with a value is the WAI-ARIA window splitter, an
|
|
107
|
+
// interactive widget; jsx-a11y classes every separator as static.
|
|
108
|
+
// eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
|
|
45
109
|
<div
|
|
46
|
-
{
|
|
47
|
-
ref={ref}
|
|
110
|
+
ref={setRef}
|
|
48
111
|
className={classNames('rt-ShellResizer', className)}
|
|
49
112
|
data-orientation={orientation}
|
|
50
113
|
data-edge={edge}
|
|
51
|
-
role="
|
|
52
|
-
|
|
53
|
-
|
|
114
|
+
role="separator"
|
|
115
|
+
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
|
|
116
|
+
tabIndex={0}
|
|
117
|
+
aria-label={`Resize ${targetLabel} pane`}
|
|
118
|
+
aria-controls={controls}
|
|
119
|
+
aria-orientation={orientation}
|
|
54
120
|
aria-valuemin={minSize}
|
|
55
121
|
aria-valuemax={maxSize}
|
|
56
|
-
|
|
57
|
-
tabIndex={0}
|
|
122
|
+
{...props}
|
|
58
123
|
onPointerDown={(e) => {
|
|
59
|
-
|
|
60
|
-
e.preventDefault();
|
|
124
|
+
props.onPointerDown?.(e);
|
|
61
125
|
const container = containerRef.current;
|
|
126
|
+
if (!container || e.defaultPrevented || e.button !== 0) return;
|
|
127
|
+
e.preventDefault();
|
|
62
128
|
const handleEl = e.currentTarget as HTMLElement;
|
|
63
129
|
const pointerId = e.pointerId;
|
|
64
|
-
|
|
65
|
-
activeCleanupRef.current?.();
|
|
66
|
-
} catch {}
|
|
67
|
-
container.setAttribute('data-resizing', '');
|
|
130
|
+
activeCleanupRef.current?.();
|
|
68
131
|
try {
|
|
69
132
|
handleEl.setPointerCapture(pointerId);
|
|
70
|
-
} catch {
|
|
133
|
+
} catch {
|
|
134
|
+
// Capture can fail for a pointer that is already gone; the window listeners below still carry the drag.
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// Everything a move needs is read here, once.
|
|
138
|
+
const startStyle = getComputedStyle(container);
|
|
139
|
+
const parsedStart = Number.parseFloat(startStyle.getPropertyValue(cssVarName));
|
|
140
|
+
const startSize = Number.isFinite(parsedStart) ? parsedStart : defaultSize;
|
|
71
141
|
const startClient = orientation === 'vertical' ? e.clientX : e.clientY;
|
|
72
|
-
const
|
|
73
|
-
const
|
|
142
|
+
const sign = growth(startStyle.direction === 'rtl');
|
|
143
|
+
const cap = ceiling();
|
|
144
|
+
handleEl.setAttribute('aria-valuemax', String(cap));
|
|
145
|
+
const clamp = (v: number) => Math.min(Math.max(v, minSize), cap);
|
|
146
|
+
|
|
147
|
+
container.setAttribute('data-resizing', '');
|
|
148
|
+
handleEl.setAttribute('data-dragging', '');
|
|
74
149
|
const body = document.body;
|
|
75
150
|
const prevCursor = body.style.cursor;
|
|
76
151
|
const prevUserSelect = body.style.userSelect;
|
|
@@ -78,20 +153,29 @@ export const PaneHandle = React.forwardRef<HTMLDivElement, React.ComponentPropsW
|
|
|
78
153
|
body.style.userSelect = 'none';
|
|
79
154
|
onResizeStart?.(startSize);
|
|
80
155
|
|
|
81
|
-
|
|
82
|
-
//
|
|
83
|
-
//
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
156
|
+
let current = startSize;
|
|
157
|
+
// The unclamped size, so `collapseThreshold` is compared before the
|
|
158
|
+
// clamp: a threshold below `minSize` can then still collapse the pane.
|
|
159
|
+
let raw = startSize;
|
|
160
|
+
let frame = 0;
|
|
161
|
+
let pending: number | null = null;
|
|
162
|
+
const flush = () => {
|
|
163
|
+
frame = 0;
|
|
164
|
+
if (pending === null) return;
|
|
165
|
+
const size = pending;
|
|
166
|
+
pending = null;
|
|
167
|
+
onResize?.(size);
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
// The move handler listens on the handle, the document and the window,
|
|
171
|
+
// so a drag survives environments where pointer events do not reach
|
|
172
|
+
// all three. One movement can therefore arrive several times: once per
|
|
173
|
+
// node it propagates through, and again as the compatibility mouse
|
|
174
|
+
// event. Only the first copy does any work.
|
|
88
175
|
let lastHandledMove: Event | null = null;
|
|
89
176
|
let seenPointerEvent = false;
|
|
90
|
-
|
|
91
177
|
const shouldHandle = (ev: Event, pointerType: string) => {
|
|
92
178
|
if (ev.type === pointerType) seenPointerEvent = true;
|
|
93
|
-
// Once pointer events are known to work, the mouse fallbacks are
|
|
94
|
-
// duplicates of an event we have already handled.
|
|
95
179
|
else if (seenPointerEvent) return false;
|
|
96
180
|
return true;
|
|
97
181
|
};
|
|
@@ -100,17 +184,22 @@ export const PaneHandle = React.forwardRef<HTMLDivElement, React.ComponentPropsW
|
|
|
100
184
|
if (!shouldHandle(ev, 'pointermove')) return;
|
|
101
185
|
if (ev === lastHandledMove) return;
|
|
102
186
|
lastHandledMove = ev;
|
|
103
|
-
|
|
104
187
|
const client = orientation === 'vertical' ? ev.clientX : ev.clientY;
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
188
|
+
raw = startSize + (client - startClient) * sign;
|
|
189
|
+
current = clamp(raw);
|
|
190
|
+
write(container, current);
|
|
191
|
+
pending = current;
|
|
192
|
+
if (!frame) frame = requestAnimationFrame(flush);
|
|
109
193
|
};
|
|
194
|
+
|
|
110
195
|
const cleanup = () => {
|
|
196
|
+
if (frame) cancelAnimationFrame(frame);
|
|
197
|
+
frame = 0;
|
|
111
198
|
try {
|
|
112
199
|
handleEl.releasePointerCapture(pointerId);
|
|
113
|
-
} catch {
|
|
200
|
+
} catch {
|
|
201
|
+
// Already released.
|
|
202
|
+
}
|
|
114
203
|
window.removeEventListener('pointermove', handleMove as EventListener);
|
|
115
204
|
document.removeEventListener('pointermove', handleMove as EventListener);
|
|
116
205
|
window.removeEventListener('mousemove', handleMove as EventListener);
|
|
@@ -125,43 +214,60 @@ export const PaneHandle = React.forwardRef<HTMLDivElement, React.ComponentPropsW
|
|
|
125
214
|
window.removeEventListener('keydown', handleKey as EventListener);
|
|
126
215
|
handleEl.removeEventListener('lostpointercapture', handleUp as EventListener);
|
|
127
216
|
container.removeAttribute('data-resizing');
|
|
217
|
+
handleEl.removeAttribute('data-dragging');
|
|
128
218
|
body.style.cursor = prevCursor;
|
|
129
219
|
body.style.userSelect = prevUserSelect;
|
|
130
220
|
activeCleanupRef.current = null;
|
|
131
221
|
};
|
|
222
|
+
|
|
132
223
|
let finished = false;
|
|
133
224
|
const handleUp = () => {
|
|
134
225
|
if (finished) return;
|
|
135
226
|
finished = true;
|
|
227
|
+
// The last move's size is delivered now rather than on the next frame.
|
|
228
|
+
if (frame) cancelAnimationFrame(frame);
|
|
229
|
+
flush();
|
|
230
|
+
|
|
231
|
+
if (collapsible && typeof collapseThreshold === 'number' && raw <= collapseThreshold) {
|
|
232
|
+
// A drag past the threshold closes the pane and keeps no size: the
|
|
233
|
+
// pane opens again at the size it had before the drag. The drag
|
|
234
|
+
// still ends, at that size, so a consumer that started something
|
|
235
|
+
// in onResizeStart can stop it.
|
|
236
|
+
write(container, startSize);
|
|
237
|
+
onResize?.(startSize);
|
|
238
|
+
cleanup();
|
|
239
|
+
requestCollapse?.();
|
|
240
|
+
onResizeEnd?.(startSize);
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
136
243
|
|
|
137
|
-
|
|
138
|
-
let snapped = finalSize;
|
|
244
|
+
let settled = current;
|
|
139
245
|
if (snapPoints && snapPoints.length) {
|
|
140
|
-
const nearest = snapPoints.reduce((acc, p) => (Math.abs(p -
|
|
141
|
-
if (Math.abs(nearest -
|
|
142
|
-
|
|
143
|
-
container
|
|
144
|
-
|
|
145
|
-
onResize?.(snapped);
|
|
246
|
+
const nearest = snapPoints.reduce((acc, p) => (Math.abs(p - current) < Math.abs(acc - current) ? p : acc), snapPoints[0]);
|
|
247
|
+
if (Math.abs(nearest - current) <= snapTolerance) {
|
|
248
|
+
settled = clamp(nearest);
|
|
249
|
+
write(container, settled);
|
|
250
|
+
onResize?.(settled);
|
|
146
251
|
}
|
|
147
252
|
}
|
|
148
|
-
|
|
149
|
-
requestCollapse?.();
|
|
150
|
-
}
|
|
151
|
-
onResizeEnd?.(snapped);
|
|
253
|
+
onResizeEnd?.(settled);
|
|
152
254
|
cleanup();
|
|
153
255
|
};
|
|
256
|
+
|
|
154
257
|
const handleKey = (kev: KeyboardEvent) => {
|
|
155
|
-
if (kev.key
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
258
|
+
if (kev.key !== 'Escape') return;
|
|
259
|
+
if (frame) cancelAnimationFrame(frame);
|
|
260
|
+
frame = 0;
|
|
261
|
+
pending = null;
|
|
262
|
+
write(container, startSize);
|
|
263
|
+
onResize?.(startSize);
|
|
264
|
+
finished = true;
|
|
265
|
+
onResizeEnd?.(startSize);
|
|
266
|
+
cleanup();
|
|
161
267
|
};
|
|
268
|
+
|
|
162
269
|
window.addEventListener('pointermove', handleMove as EventListener);
|
|
163
270
|
document.addEventListener('pointermove', handleMove as EventListener);
|
|
164
|
-
// Fallbacks for environments that don't fully support PointerEvent on window
|
|
165
271
|
window.addEventListener('mousemove', handleMove as EventListener);
|
|
166
272
|
document.addEventListener('mousemove', handleMove as EventListener);
|
|
167
273
|
handleEl.addEventListener('pointermove', handleMove as EventListener);
|
|
@@ -175,60 +281,39 @@ export const PaneHandle = React.forwardRef<HTMLDivElement, React.ComponentPropsW
|
|
|
175
281
|
handleEl.addEventListener('lostpointercapture', handleUp as EventListener);
|
|
176
282
|
activeCleanupRef.current = cleanup;
|
|
177
283
|
}}
|
|
178
|
-
onDoubleClick={() => {
|
|
179
|
-
|
|
284
|
+
onDoubleClick={(e) => {
|
|
285
|
+
props.onDoubleClick?.(e);
|
|
286
|
+
if (!e.defaultPrevented && collapsible) requestToggle?.();
|
|
287
|
+
}}
|
|
288
|
+
onFocus={(e) => {
|
|
289
|
+
props.onFocus?.(e);
|
|
290
|
+
announceCeiling();
|
|
180
291
|
}}
|
|
181
292
|
onKeyDown={(e) => {
|
|
182
|
-
|
|
293
|
+
props.onKeyDown?.(e);
|
|
183
294
|
const container = containerRef.current;
|
|
184
|
-
|
|
185
|
-
const
|
|
186
|
-
|
|
187
|
-
const
|
|
188
|
-
const
|
|
189
|
-
let
|
|
190
|
-
if (
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
else if (e.key === 'ArrowUp') delta = -step;
|
|
201
|
-
}
|
|
202
|
-
if (e.key === 'Home') {
|
|
203
|
-
e.preventDefault();
|
|
204
|
-
onResizeStart?.(current);
|
|
205
|
-
const next = clamp(minSize);
|
|
206
|
-
container.style.setProperty(cssVarName, `${next}px`);
|
|
207
|
-
(e.currentTarget as HTMLElement).setAttribute('aria-valuenow', String(next));
|
|
208
|
-
onResize?.(next);
|
|
209
|
-
onResizeEnd?.(next);
|
|
210
|
-
return;
|
|
211
|
-
}
|
|
212
|
-
if (e.key === 'End') {
|
|
213
|
-
e.preventDefault();
|
|
214
|
-
onResizeStart?.(current);
|
|
215
|
-
const next = clamp(maxSize);
|
|
216
|
-
container.style.setProperty(cssVarName, `${next}px`);
|
|
217
|
-
(e.currentTarget as HTMLElement).setAttribute('aria-valuenow', String(next));
|
|
218
|
-
onResize?.(next);
|
|
219
|
-
onResizeEnd?.(next);
|
|
220
|
-
return;
|
|
221
|
-
}
|
|
222
|
-
if (delta !== 0) {
|
|
223
|
-
e.preventDefault();
|
|
224
|
-
onResizeStart?.(current);
|
|
225
|
-
const signedDelta = orientation === 'vertical' ? (edge === 'start' ? -delta : delta) : delta;
|
|
226
|
-
const next = clamp(current + signedDelta);
|
|
227
|
-
container.style.setProperty(cssVarName, `${next}px`);
|
|
228
|
-
(e.currentTarget as HTMLElement).setAttribute('aria-valuenow', String(next));
|
|
229
|
-
onResize?.(next);
|
|
230
|
-
onResizeEnd?.(next);
|
|
295
|
+
if (!container || e.defaultPrevented) return;
|
|
296
|
+
const current = readSize();
|
|
297
|
+
// The keys reach as far as a drag does: the frame caps both.
|
|
298
|
+
const cap = ceiling();
|
|
299
|
+
const clamp = (v: number) => Math.min(Math.max(v, minSize), cap);
|
|
300
|
+
let next: number | undefined;
|
|
301
|
+
if (e.key === 'Home') next = clamp(minSize);
|
|
302
|
+
else if (e.key === 'End') next = clamp(cap);
|
|
303
|
+
else {
|
|
304
|
+
// The key moves the boundary along its axis; the pane grows or
|
|
305
|
+
// shrinks the way a drag in that direction would, so Bottom's
|
|
306
|
+
// ArrowUp grows it and an end-anchored pane mirrors in RTL.
|
|
307
|
+
const along = orientation === 'vertical' ? (e.key === 'ArrowRight' ? 1 : e.key === 'ArrowLeft' ? -1 : 0) : e.key === 'ArrowDown' ? 1 : e.key === 'ArrowUp' ? -1 : 0;
|
|
308
|
+
if (along === 0) return;
|
|
309
|
+
const step = e.shiftKey ? 32 : 8;
|
|
310
|
+
next = clamp(current + along * step * growth(getComputedStyle(container).direction === 'rtl'));
|
|
231
311
|
}
|
|
312
|
+
e.preventDefault();
|
|
313
|
+
onResizeStart?.(current);
|
|
314
|
+
write(container, next);
|
|
315
|
+
onResize?.(next);
|
|
316
|
+
onResizeEnd?.(next);
|
|
232
317
|
}}
|
|
233
318
|
>
|
|
234
319
|
{children}
|