@vlrc-fe/components 3.0.3 → 3.0.4
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/CHANGELOG.md +17 -0
- package/README.md +10 -1
- package/bin/registry.mjs +1124 -0
- package/bin/vlrc.mjs +102 -7
- package/dist/ConfirmModal.cjs +276 -1
- package/dist/ConfirmModal.js +119 -103
- package/dist/DataTable/DataTable.cjs +203 -1
- package/dist/DataTable/DataTable.js +161 -120
- package/dist/DataTable/components/DataTableColumnHeader.cjs +214 -1
- package/dist/DataTable/components/DataTableColumnHeader.d.ts +3 -3
- package/dist/DataTable/components/DataTableColumnHeader.d.ts.map +1 -1
- package/dist/DataTable/components/DataTableColumnHeader.js +201 -103
- package/dist/DataTable/components/DataTableFacetedFilter.cjs +332 -1
- package/dist/DataTable/components/DataTableFacetedFilter.d.ts +3 -3
- package/dist/DataTable/components/DataTableFacetedFilter.d.ts.map +1 -1
- package/dist/DataTable/components/DataTableFacetedFilter.js +285 -181
- package/dist/DataTable/components/DataTablePagination.cjs +200 -1
- package/dist/DataTable/components/DataTablePagination.js +188 -91
- package/dist/DataTable/components/DataTableRowActions.cjs +172 -1
- package/dist/DataTable/components/DataTableRowActions.js +161 -62
- package/dist/DataTable/components/DataTableTable.cjs +100 -1
- package/dist/DataTable/components/DataTableTable.js +87 -35
- package/dist/DataTable/components/DataTableToolbar.cjs +112 -1
- package/dist/DataTable/components/DataTableToolbar.js +106 -44
- package/dist/DataTable/components/DataTableViewOptions.cjs +113 -1
- package/dist/DataTable/components/DataTableViewOptions.js +105 -44
- package/dist/DataTable/render/createColumns.cjs +84 -1
- package/dist/DataTable/render/createColumns.js +65 -44
- package/dist/DataTable/render/defaults.cjs +38 -1
- package/dist/DataTable/render/defaults.js +18 -13
- package/dist/Dropdown/Dropdown.cjs +255 -1
- package/dist/Dropdown/Dropdown.js +138 -108
- package/dist/Form/Form.cjs +439 -1
- package/dist/Form/Form.js +417 -206
- package/dist/Form/FormDatePicker/FormDatePicker.cjs +84 -1
- package/dist/Form/FormDatePicker/FormDatePicker.js +68 -65
- package/dist/Form/FormDatePicker/MonthPickerPanel.cjs +217 -1
- package/dist/Form/FormDatePicker/MonthPickerPanel.js +194 -101
- package/dist/Form/FormDatePicker/RangeDatePicker.cjs +144 -1
- package/dist/Form/FormDatePicker/RangeDatePicker.js +94 -77
- package/dist/Form/FormDatePicker/SingleDatePicker.cjs +191 -1
- package/dist/Form/FormDatePicker/SingleDatePicker.js +144 -114
- package/dist/Form/FormDatePicker/TimeInput.cjs +172 -1
- package/dist/Form/FormDatePicker/TimeInput.js +162 -79
- package/dist/Form/FormDatePicker/TimePicker.cjs +107 -1
- package/dist/Form/FormDatePicker/TimePicker.js +58 -43
- package/dist/Form/FormDatePicker/YearPickerPanel.cjs +184 -1
- package/dist/Form/FormDatePicker/YearPickerPanel.js +164 -84
- package/dist/Form/FormDatePicker/types.cjs +10 -1
- package/dist/Form/FormDatePicker/types.js +8 -3
- package/dist/Form/FormDatePicker/useFormDatePicker.cjs +70 -1
- package/dist/Form/FormDatePicker/useFormDatePicker.js +58 -31
- package/dist/Form/FormFileUpload/FileUpload.cjs +603 -1
- package/dist/Form/FormFileUpload/FileUpload.js +452 -306
- package/dist/Form/FormFileUpload/index.cjs +175 -1
- package/dist/Form/FormFileUpload/index.js +164 -50
- package/dist/Form/FormMultiSelect/FormMultiSelect.cjs +46 -1
- package/dist/Form/FormMultiSelect/FormMultiSelect.js +42 -22
- package/dist/Form/FormNumberInput/FormNumberInput.cjs +71 -1
- package/dist/Form/FormNumberInput/FormNumberInput.js +60 -58
- package/dist/Form/FormNumberInput/StepperControls.cjs +104 -1
- package/dist/Form/FormNumberInput/StepperControls.js +78 -43
- package/dist/Form/FormNumberInput/useFormNumberInput.cjs +72 -1
- package/dist/Form/FormNumberInput/useFormNumberInput.js +68 -39
- package/dist/Form/FormRadioGroup/FormRadio.cjs +65 -1
- package/dist/Form/FormRadioGroup/FormRadio.js +38 -38
- package/dist/Form/FormRadioGroup/useFormRadio.cjs +38 -1
- package/dist/Form/FormRadioGroup/useFormRadio.js +27 -16
- package/dist/Form/FormSelect/FormSelect.cjs +46 -1
- package/dist/Form/FormSelect/FormSelect.js +40 -26
- package/dist/Form/FormSelect/useFormSelect.cjs +58 -1
- package/dist/Form/FormSelect/useFormSelect.js +52 -43
- package/dist/Icons/Icons.cjs +155 -1
- package/dist/Icons/Icons.js +142 -142
- package/dist/Modal.cjs +135 -1
- package/dist/Modal.js +67 -54
- package/dist/MultiSelect/MultiSelect.cjs +211 -1
- package/dist/MultiSelect/MultiSelect.js +127 -117
- package/dist/MultiSelect/renderers.cjs +571 -1
- package/dist/MultiSelect/renderers.js +508 -309
- package/dist/MultiSelect/useMultiSelect.cjs +243 -1
- package/dist/MultiSelect/useMultiSelect.js +207 -127
- package/dist/MultiSelect/utils.cjs +123 -1
- package/dist/MultiSelect/utils.js +79 -51
- package/dist/Select/BaseSelect.cjs +265 -1
- package/dist/Select/BaseSelect.js +165 -126
- package/dist/Select/MultiSelectTags.cjs +129 -1
- package/dist/Select/MultiSelectTags.js +82 -56
- package/dist/Typography/Blockquote.cjs +79 -1
- package/dist/Typography/Blockquote.js +40 -38
- package/dist/Typography/Code.cjs +131 -1
- package/dist/Typography/Code.js +64 -58
- package/dist/Typography/Link.cjs +141 -1
- package/dist/Typography/Link.d.ts +1 -2
- package/dist/Typography/Link.d.ts.map +1 -1
- package/dist/Typography/Link.js +74 -63
- package/dist/Typography/Paragraph.cjs +226 -1
- package/dist/Typography/Paragraph.d.ts +1 -2
- package/dist/Typography/Paragraph.d.ts.map +1 -1
- package/dist/Typography/Paragraph.js +119 -107
- package/dist/Typography/Text.cjs +224 -1
- package/dist/Typography/Text.d.ts +1 -2
- package/dist/Typography/Text.d.ts.map +1 -1
- package/dist/Typography/Text.js +117 -100
- package/dist/Typography/Title.cjs +220 -1
- package/dist/Typography/Title.d.ts +1 -2
- package/dist/Typography/Title.d.ts.map +1 -1
- package/dist/Typography/Title.js +125 -103
- package/dist/Typography/Typography.cjs +17 -1
- package/dist/Typography/Typography.js +14 -14
- package/dist/Typography/index.d.ts +1 -1
- package/dist/Typography/index.d.ts.map +1 -1
- package/dist/Typography/index.js +13 -13
- package/dist/Typography/tooltip.cjs +42 -1
- package/dist/Typography/tooltip.js +34 -14
- package/dist/Typography/types.cjs +20 -1
- package/dist/Typography/types.js +5 -2
- package/dist/Typography/utils.cjs +52 -1
- package/dist/Typography/utils.js +48 -21
- package/dist/Typography/weightStyles.cjs +58 -1
- package/dist/Typography/weightStyles.js +26 -25
- package/dist/_virtual/_rolldown/runtime.cjs +32 -1
- package/dist/_virtual/_rolldown/runtime.js +9 -7
- package/dist/assets/stylex.css +135 -1
- package/dist/astryx.cjs +18 -1
- package/dist/astryx.d.ts.map +1 -1
- package/dist/astryx.js +2 -1
- package/dist/index.cjs +789 -1
- package/dist/index.js +122 -118
- package/dist/layout/Box.cjs +203 -1
- package/dist/layout/Box.d.ts +8 -8
- package/dist/layout/Box.d.ts.map +1 -1
- package/dist/layout/Box.js +138 -49
- package/dist/layout/Center.cjs +51 -1
- package/dist/layout/Center.d.ts +3 -3
- package/dist/layout/Center.d.ts.map +1 -1
- package/dist/layout/Center.js +49 -20
- package/dist/layout/Container.cjs +81 -1
- package/dist/layout/Container.d.ts +8 -8
- package/dist/layout/Container.d.ts.map +1 -1
- package/dist/layout/Container.js +34 -30
- package/dist/layout/Stack.cjs +237 -1
- package/dist/layout/Stack.d.ts +9 -9
- package/dist/layout/Stack.d.ts.map +1 -1
- package/dist/layout/Stack.js +220 -75
- package/dist/layout/index.js +9 -9
- package/dist/lazyLoad.cjs +13 -1
- package/dist/lazyLoad.js +9 -9
- package/dist/node_modules/.pnpm/@floating-ui_core@1.8.0/node_modules/@floating-ui/core/dist/floating-ui.core.cjs +551 -1
- package/dist/node_modules/.pnpm/@floating-ui_core@1.8.0/node_modules/@floating-ui/core/dist/floating-ui.core.js +440 -234
- package/dist/node_modules/.pnpm/@floating-ui_dom@1.8.0/node_modules/@floating-ui/dom/dist/floating-ui.dom.cjs +546 -1
- package/dist/node_modules/.pnpm/@floating-ui_dom@1.8.0/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +452 -236
- package/dist/node_modules/.pnpm/@floating-ui_react-dom@2.1.9_react-dom@19.3.1_react@19.3.1__react@19.3.1/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.cjs +330 -1
- package/dist/node_modules/.pnpm/@floating-ui_react-dom@2.1.9_react-dom@19.3.1_react@19.3.1__react@19.3.1/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +272 -164
- package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.12/node_modules/@floating-ui/utils/dist/floating-ui.utils.cjs +150 -1
- package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.12/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.cjs +132 -1
- package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.12/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +90 -74
- package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.12/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +92 -67
- package/dist/node_modules/.pnpm/@radix-ui_number@1.1.3/node_modules/@radix-ui/number/dist/index.cjs +11 -1
- package/dist/node_modules/.pnpm/@radix-ui_number@1.1.3/node_modules/@radix-ui/number/dist/index.js +8 -7
- package/dist/node_modules/.pnpm/@radix-ui_primitive@1.1.7/node_modules/@radix-ui/primitive/dist/index.cjs +48 -1
- package/dist/node_modules/.pnpm/@radix-ui_primitive@1.1.7/node_modules/@radix-ui/primitive/dist/index.js +34 -31
- package/dist/node_modules/.pnpm/@radix-ui_react-alert-dialog@1.1.23_@types_react-dom@19.3.0_@types_react@19.3.0__@types_023ac3f94ac95798b92bc4b7f556cbda/node_modules/@radix-ui/react-alert-dialog/dist/index.cjs +145 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-alert-dialog@1.1.23_@types_react-dom@19.3.0_@types_react@19.3.0__@types_023ac3f94ac95798b92bc4b7f556cbda/node_modules/@radix-ui/react-alert-dialog/dist/index.js +111 -73
- package/dist/node_modules/.pnpm/@radix-ui_react-aspect-ratio@1.1.15_@types_react-dom@19.3.0_@types_react@19.3.0__@types_3fe40fa8e2833eaf8803b46e02e4c30f/node_modules/@radix-ui/react-aspect-ratio/dist/index.cjs +38 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-aspect-ratio@1.1.15_@types_react-dom@19.3.0_@types_react@19.3.0__@types_3fe40fa8e2833eaf8803b46e02e4c30f/node_modules/@radix-ui/react-aspect-ratio/dist/index.js +19 -16
- package/dist/node_modules/.pnpm/@radix-ui_react-avatar@1.2.6_@types_react-dom@19.3.0_@types_react@19.3.0__@types_react@_c3568bdf5c60d38014d320037c857c95/node_modules/@radix-ui/react-avatar/dist/index.cjs +126 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-avatar@1.2.6_@types_react-dom@19.3.0_@types_react@19.3.0__@types_react@_c3568bdf5c60d38014d320037c857c95/node_modules/@radix-ui/react-avatar/dist/index.js +103 -72
- package/dist/node_modules/.pnpm/@radix-ui_react-collapsible@1.1.20_@types_react-dom@19.3.0_@types_react@19.3.0__@types__75f9b408b6aa016f78c6c390e6f84227/node_modules/@radix-ui/react-collapsible/dist/index.cjs +134 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-collapsible@1.1.20_@types_react-dom@19.3.0_@types_react@19.3.0__@types__75f9b408b6aa016f78c6c390e6f84227/node_modules/@radix-ui/react-collapsible/dist/index.js +113 -79
- package/dist/node_modules/.pnpm/@radix-ui_react-collection@1.1.15_@types_react-dom@19.3.0_@types_react@19.3.0__@types_r_5961dc5beb3cb19a205dfdbd3304cbe5/node_modules/@radix-ui/react-collection/dist/index.cjs +541 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-collection@1.1.15_@types_react-dom@19.3.0_@types_react@19.3.0__@types_r_5961dc5beb3cb19a205dfdbd3304cbe5/node_modules/@radix-ui/react-collection/dist/index.js +459 -331
- package/dist/node_modules/.pnpm/@radix-ui_react-compose-refs@1.1.5_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-compose-refs/dist/index.cjs +39 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-compose-refs@1.1.5_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-compose-refs/dist/index.js +26 -22
- package/dist/node_modules/.pnpm/@radix-ui_react-context-menu@2.3.7_@types_react-dom@19.3.0_@types_react@19.3.0__@types__30d9c1a1570dd32a7a328fd93feebae9/node_modules/@radix-ui/react-context-menu/dist/index.cjs +304 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-context-menu@2.3.7_@types_react-dom@19.3.0_@types_react@19.3.0__@types__30d9c1a1570dd32a7a328fd93feebae9/node_modules/@radix-ui/react-context-menu/dist/index.js +234 -160
- package/dist/node_modules/.pnpm/@radix-ui_react-context@1.2.2_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-context/dist/index.cjs +108 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-context@1.2.2_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-context/dist/index.js +82 -67
- package/dist/node_modules/.pnpm/@radix-ui_react-direction@1.1.4_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-direction/dist/index.cjs +19 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-direction@1.1.4_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-direction/dist/index.js +12 -10
- package/dist/node_modules/.pnpm/@radix-ui_react-dismissable-layer@1.1.19_@types_react-dom@19.3.0_@types_react@19.3.0__@_221317ca07dfdaa6590fc49e548d4242/node_modules/@radix-ui/react-dismissable-layer/dist/index.cjs +275 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-dismissable-layer@1.1.19_@types_react-dom@19.3.0_@types_react@19.3.0__@_221317ca07dfdaa6590fc49e548d4242/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +228 -127
- package/dist/node_modules/.pnpm/@radix-ui_react-focus-guards@1.1.6_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-focus-guards/dist/index.cjs +53 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-focus-guards@1.1.6_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-focus-guards/dist/index.js +40 -22
- package/dist/node_modules/.pnpm/@radix-ui_react-focus-scope@1.1.16_@types_react-dom@19.3.0_@types_react@19.3.0__@types__3593711fa410ee31279d746c57990974/node_modules/@radix-ui/react-focus-scope/dist/index.cjs +215 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-focus-scope@1.1.16_@types_react-dom@19.3.0_@types_react@19.3.0__@types__3593711fa410ee31279d746c57990974/node_modules/@radix-ui/react-focus-scope/dist/index.js +171 -117
- package/dist/node_modules/.pnpm/@radix-ui_react-hover-card@1.1.23_@types_react-dom@19.3.0_@types_react@19.3.0__@types_r_a8ac333b78a7741970303e37358b886d/node_modules/@radix-ui/react-hover-card/dist/index.cjs +219 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-hover-card@1.1.23_@types_react-dom@19.3.0_@types_react@19.3.0__@types_r_a8ac333b78a7741970303e37358b886d/node_modules/@radix-ui/react-hover-card/dist/index.js +178 -118
- package/dist/node_modules/.pnpm/@radix-ui_react-id@1.1.4_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-id/dist/index.cjs +22 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-id@1.1.4_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-id/dist/index.js +17 -13
- package/dist/node_modules/.pnpm/@radix-ui_react-menu@2.1.24_@types_react-dom@19.3.0_@types_react@19.3.0__@types_react@1_bd1746795e703f342b2f4982589d4efb/node_modules/@radix-ui/react-menu/dist/index.cjs +802 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-menu@2.1.24_@types_react-dom@19.3.0_@types_react@19.3.0__@types_react@1_bd1746795e703f342b2f4982589d4efb/node_modules/@radix-ui/react-menu/dist/index.js +648 -422
- package/dist/node_modules/.pnpm/@radix-ui_react-menubar@1.1.24_@types_react-dom@19.3.0_@types_react@19.3.0__@types_reac_b8d55f7c7c6b477421e3cc1ba6fb334b/node_modules/@radix-ui/react-menubar/dist/index.cjs +410 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-menubar@1.1.24_@types_react-dom@19.3.0_@types_react@19.3.0__@types_reac_b8d55f7c7c6b477421e3cc1ba6fb334b/node_modules/@radix-ui/react-menubar/dist/index.js +313 -212
- package/dist/node_modules/.pnpm/@radix-ui_react-navigation-menu@1.2.22_@types_react-dom@19.3.0_@types_react@19.3.0__@ty_fde94e4aef42debd49119dde2ad3b250/node_modules/@radix-ui/react-navigation-menu/dist/index.cjs +741 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-navigation-menu@1.2.22_@types_react-dom@19.3.0_@types_react@19.3.0__@ty_fde94e4aef42debd49119dde2ad3b250/node_modules/@radix-ui/react-navigation-menu/dist/index.js +602 -417
- package/dist/node_modules/.pnpm/@radix-ui_react-popper@1.3.7_@types_react-dom@19.3.0_@types_react@19.3.0__@types_react@_ca4fb1e7b10e21399fbf7b38c61d930c/node_modules/@radix-ui/react-popper/dist/index.cjs +246 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-popper@1.3.7_@types_react-dom@19.3.0_@types_react@19.3.0__@types_react@_ca4fb1e7b10e21399fbf7b38c61d930c/node_modules/@radix-ui/react-popper/dist/index.js +195 -121
- package/dist/node_modules/.pnpm/@radix-ui_react-portal@1.1.17_@types_react-dom@19.3.0_@types_react@19.3.0__@types_react_dcf9598b366f9d4cb930092169158fb6/node_modules/@radix-ui/react-portal/dist/index.cjs +27 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-portal@1.1.17_@types_react-dom@19.3.0_@types_react@19.3.0__@types_react_dcf9598b366f9d4cb930092169158fb6/node_modules/@radix-ui/react-portal/dist/index.js +20 -17
- package/dist/node_modules/.pnpm/@radix-ui_react-presence@1.1.10_@types_react-dom@19.3.0_@types_react@19.3.0__@types_rea_d7b4951725c0f0b9fd732151cb937913/node_modules/@radix-ui/react-presence/dist/index.cjs +148 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-presence@1.1.10_@types_react-dom@19.3.0_@types_react@19.3.0__@types_rea_d7b4951725c0f0b9fd732151cb937913/node_modules/@radix-ui/react-presence/dist/index.js +115 -67
- package/dist/node_modules/.pnpm/@radix-ui_react-primitive@2.1.10_@types_react-dom@19.3.0_@types_react@19.3.0__@types_re_b879c40dbdb8ea08e1db9842f10f20a8/node_modules/@radix-ui/react-primitive/dist/index.cjs +55 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-primitive@2.1.10_@types_react-dom@19.3.0_@types_react@19.3.0__@types_re_b879c40dbdb8ea08e1db9842f10f20a8/node_modules/@radix-ui/react-primitive/dist/index.js +27 -21
- package/dist/node_modules/.pnpm/@radix-ui_react-roving-focus@1.1.19_@types_react-dom@19.3.0_@types_react@19.3.0__@types_43a41e6ed06e4781ce7b1fb0f0076623/node_modules/@radix-ui/react-roving-focus/dist/index.cjs +223 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-roving-focus@1.1.19_@types_react-dom@19.3.0_@types_react@19.3.0__@types_43a41e6ed06e4781ce7b1fb0f0076623/node_modules/@radix-ui/react-roving-focus/dist/index.js +179 -131
- package/dist/node_modules/.pnpm/@radix-ui_react-slider@1.4.7_@types_react-dom@19.3.0_@types_react@19.3.0__@types_react@_0a49b18268a9d1d70ad7e785633a1513/node_modules/@radix-ui/react-slider/dist/index.cjs +576 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-slider@1.4.7_@types_react-dom@19.3.0_@types_react@19.3.0__@types_react@_0a49b18268a9d1d70ad7e785633a1513/node_modules/@radix-ui/react-slider/dist/index.js +437 -308
- package/dist/node_modules/.pnpm/@radix-ui_react-switch@1.3.7_@types_react-dom@19.3.0_@types_react@19.3.0__@types_react@_f8723a7bd506c0f648804ec2dc0f18e3/node_modules/@radix-ui/react-switch/dist/index.cjs +202 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-switch@1.3.7_@types_react-dom@19.3.0_@types_react@19.3.0__@types_react@_f8723a7bd506c0f648804ec2dc0f18e3/node_modules/@radix-ui/react-switch/dist/index.js +160 -125
- package/dist/node_modules/.pnpm/@radix-ui_react-tabs@1.1.21_@types_react-dom@19.3.0_@types_react@19.3.0__@types_react@1_2c04ca1fb5fd914a25ee24a303bd8469/node_modules/@radix-ui/react-tabs/dist/index.cjs +159 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-tabs@1.1.21_@types_react-dom@19.3.0_@types_react@19.3.0__@types_react@1_2c04ca1fb5fd914a25ee24a303bd8469/node_modules/@radix-ui/react-tabs/dist/index.js +125 -93
- package/dist/node_modules/.pnpm/@radix-ui_react-toggle-group@1.1.19_@types_react-dom@19.3.0_@types_react@19.3.0__@types_e645c0ca626436d86b14232bd158d09b/node_modules/@radix-ui/react-toggle-group/dist/index.cjs +158 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-toggle-group@1.1.19_@types_react-dom@19.3.0_@types_react@19.3.0__@types_e645c0ca626436d86b14232bd158d09b/node_modules/@radix-ui/react-toggle-group/dist/index.js +128 -98
- package/dist/node_modules/.pnpm/@radix-ui_react-toggle@1.1.18_@types_react-dom@19.3.0_@types_react@19.3.0__@types_react_f121473145ec675e8ab50657e8e97e06/node_modules/@radix-ui/react-toggle/dist/index.cjs +39 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-toggle@1.1.18_@types_react-dom@19.3.0_@types_react@19.3.0__@types_react_f121473145ec675e8ab50657e8e97e06/node_modules/@radix-ui/react-toggle/dist/index.js +29 -24
- package/dist/node_modules/.pnpm/@radix-ui_react-use-callback-ref@1.1.4_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-use-callback-ref/dist/index.cjs +19 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-use-callback-ref@1.1.4_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +13 -11
- package/dist/node_modules/.pnpm/@radix-ui_react-use-controllable-state@1.2.6_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-use-controllable-state/dist/index.cjs +109 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-use-controllable-state@1.2.6_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +91 -68
- package/dist/node_modules/.pnpm/@radix-ui_react-use-effect-event@0.0.5_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-use-effect-event/dist/index.cjs +28 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-use-effect-event@0.0.5_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-use-effect-event/dist/index.js +22 -17
- package/dist/node_modules/.pnpm/@radix-ui_react-use-is-hydrated@0.1.3_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-use-is-hydrated/dist/index.cjs +33 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-use-is-hydrated@0.1.3_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-use-is-hydrated/dist/index.js +25 -19
- package/dist/node_modules/.pnpm/@radix-ui_react-use-layout-effect@1.1.4_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-use-layout-effect/dist/index.cjs +7 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-use-layout-effect@1.1.4_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +3 -3
- package/dist/node_modules/.pnpm/@radix-ui_react-use-previous@1.1.4_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-use-previous/dist/index.cjs +25 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-use-previous@1.1.4_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-use-previous/dist/index.js +18 -11
- package/dist/node_modules/.pnpm/@radix-ui_react-use-size@1.1.4_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-use-size/dist/index.cjs +47 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-use-size@1.1.4_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-use-size/dist/index.js +38 -28
- package/dist/node_modules/.pnpm/@radix-ui_react-visually-hidden@1.2.11_@types_react-dom@19.3.0_@types_react@19.3.0__@ty_ef452cff5863a129db7ebc4b37ab07c3/node_modules/@radix-ui/react-visually-hidden/dist/index.cjs +38 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-visually-hidden@1.2.11_@types_react-dom@19.3.0_@types_react@19.3.0__@ty_ef452cff5863a129db7ebc4b37ab07c3/node_modules/@radix-ui/react-visually-hidden/dist/index.js +19 -15
- package/dist/node_modules/.pnpm/aria-hidden@1.2.6/node_modules/aria-hidden/dist/es2015/index.cjs +106 -1
- package/dist/node_modules/.pnpm/aria-hidden@1.2.6/node_modules/aria-hidden/dist/es2015/index.js +95 -34
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/addLeadingZeros.cjs +5 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/addLeadingZeros.js +3 -3
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/defaultOptions.cjs +6 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/defaultOptions.js +4 -4
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/format/formatters.cjs +423 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/format/formatters.js +237 -202
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/format/lightFormatters.cjs +45 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/format/lightFormatters.js +35 -32
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/format/longFormatters.cjs +42 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/format/longFormatters.js +37 -32
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.cjs +20 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js +18 -5
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/normalizeDates.cjs +7 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/normalizeDates.js +5 -5
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/protectedTokens.cjs +27 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/protectedTokens.js +15 -12
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/constants.cjs +45 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/constants.js +41 -4
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/constructFrom.cjs +45 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/constructFrom.js +42 -4
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/differenceInCalendarDays.cjs +49 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/differenceInCalendarDays.js +46 -8
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/format.cjs +358 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/format.js +341 -45
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/getDayOfYear.cjs +31 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/getDayOfYear.js +28 -7
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/getISOWeek.cjs +35 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/getISOWeek.js +32 -8
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/getISOWeekYear.cjs +44 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/getISOWeekYear.js +41 -11
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/getWeek.cjs +49 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/getWeek.js +46 -8
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/getWeekYear.cjs +61 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/getWeekYear.js +58 -12
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/isDate.cjs +38 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/isDate.js +35 -3
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/isValid.cjs +39 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/isValid.js +36 -5
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/_lib/buildFormatLongFn.cjs +8 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/_lib/buildFormatLongFn.js +5 -5
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/_lib/buildLocalizeFn.cjs +50 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +45 -11
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/_lib/buildMatchFn.cjs +27 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/_lib/buildMatchFn.js +20 -14
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/_lib/buildMatchPatternFn.cjs +18 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js +13 -12
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/en-US/_lib/formatDistance.cjs +77 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/en-US/_lib/formatDistance.js +14 -5
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/en-US/_lib/formatLong.cjs +31 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/en-US/_lib/formatLong.js +6 -6
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/en-US/_lib/formatRelative.cjs +11 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/en-US/_lib/formatRelative.js +4 -3
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/en-US/_lib/localize.cjs +210 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/en-US/_lib/localize.js +197 -188
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/en-US/_lib/match.cjs +122 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/en-US/_lib/match.js +12 -12
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/en-US.cjs +28 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/en-US.js +20 -12
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/startOfDay.cjs +34 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/startOfDay.js +31 -5
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/startOfISOWeek.cjs +37 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/startOfISOWeek.js +32 -5
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/startOfISOWeekYear.cjs +41 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/startOfISOWeekYear.js +38 -7
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/startOfWeek.cjs +45 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/startOfWeek.js +42 -6
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/startOfWeekYear.cjs +56 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/startOfWeekYear.js +53 -8
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/startOfYear.cjs +35 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/startOfYear.js +32 -5
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/toDate.cjs +45 -1
- package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/toDate.js +42 -4
- package/dist/node_modules/.pnpm/embla-carousel-react@8.6.0_react@19.3.1/node_modules/embla-carousel-react/esm/embla-carousel-react.esm.cjs +34 -1
- package/dist/node_modules/.pnpm/embla-carousel-react@8.6.0_react@19.3.1/node_modules/embla-carousel-react/esm/embla-carousel-react.esm.js +32 -21
- package/dist/node_modules/.pnpm/embla-carousel-reactive-utils@8.6.0_embla-carousel@8.6.0/node_modules/embla-carousel-reactive-utils/esm/embla-carousel-reactive-utils.esm.cjs +39 -1
- package/dist/node_modules/.pnpm/embla-carousel-reactive-utils@8.6.0_embla-carousel@8.6.0/node_modules/embla-carousel-reactive-utils/esm/embla-carousel-reactive-utils.esm.js +27 -20
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/embla-carousel.esm.cjs +1391 -1
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/embla-carousel.esm.js +1178 -803
- package/dist/node_modules/.pnpm/get-nonce@1.0.1/node_modules/get-nonce/dist/es2015/index.cjs +7 -1
- package/dist/node_modules/.pnpm/get-nonce@1.0.1/node_modules/get-nonce/dist/es2015/index.js +3 -4
- package/dist/node_modules/.pnpm/input-otp@1.4.2_react-dom@19.3.1_react@19.3.1__react@19.3.1/node_modules/input-otp/dist/index.cjs +369 -2
- package/dist/node_modules/.pnpm/input-otp@1.4.2_react-dom@19.3.1_react@19.3.1__react@19.3.1/node_modules/input-otp/dist/index.js +282 -238
- package/dist/node_modules/.pnpm/react-hook-form@7.83.0_react@19.3.1/node_modules/react-hook-form/dist/index.esm.cjs +625 -1
- package/dist/node_modules/.pnpm/react-hook-form@7.83.0_react@19.3.1/node_modules/react-hook-form/dist/index.esm.js +545 -276
- package/dist/node_modules/.pnpm/react-number-format@5.4.5_react-dom@19.3.1_react@19.3.1__react@19.3.1/node_modules/react-number-format/dist/react-number-format.es.cjs +1033 -9
- package/dist/node_modules/.pnpm/react-number-format@5.4.5_react-dom@19.3.1_react@19.3.1__react@19.3.1/node_modules/react-number-format/dist/react-number-format.es.js +898 -460
- package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll-bar/dist/es2015/component.cjs +47 -38
- package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll-bar/dist/es2015/component.js +38 -64
- package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll-bar/dist/es2015/constants.cjs +13 -1
- package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll-bar/dist/es2015/constants.js +9 -2
- package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll-bar/dist/es2015/index.cjs +4 -1
- package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll-bar/dist/es2015/utils.cjs +36 -1
- package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll-bar/dist/es2015/utils.js +25 -16
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.2_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll/dist/es2015/Combination.cjs +15 -1
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.2_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll/dist/es2015/Combination.js +10 -10
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.2_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll/dist/es2015/SideEffect.cjs +167 -4
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.2_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll/dist/es2015/SideEffect.js +144 -93
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.2_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll/dist/es2015/UI.cjs +63 -1
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.2_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll/dist/es2015/UI.js +45 -35
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.2_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.cjs +14 -1
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.2_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js +11 -9
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.2_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll/dist/es2015/handleScroll.cjs +84 -1
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.2_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +75 -43
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.2_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll/dist/es2015/medium.cjs +3 -1
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.2_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll/dist/es2015/medium.js +3 -3
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.2_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll/dist/es2015/sidecar.cjs +6 -1
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.2_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll/dist/es2015/sidecar.js +5 -5
- package/dist/node_modules/.pnpm/react-resizable-panels@2.1.9_react-dom@19.3.1_react@19.3.1__react@19.3.1/node_modules/react-resizable-panels/dist/react-resizable-panels.browser.esm.cjs +1617 -1
- package/dist/node_modules/.pnpm/react-resizable-panels@2.1.9_react-dom@19.3.1_react@19.3.1__react@19.3.1/node_modules/react-resizable-panels/dist/react-resizable-panels.browser.esm.js +1332 -874
- package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@19.3.0_react@19.3.1/node_modules/react-style-singleton/dist/es2015/component.cjs +18 -1
- package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@19.3.0_react@19.3.1/node_modules/react-style-singleton/dist/es2015/component.js +15 -7
- package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@19.3.0_react@19.3.1/node_modules/react-style-singleton/dist/es2015/hook.cjs +26 -1
- package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@19.3.0_react@19.3.1/node_modules/react-style-singleton/dist/es2015/hook.js +20 -10
- package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@19.3.0_react@19.3.1/node_modules/react-style-singleton/dist/es2015/index.cjs +4 -1
- package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@19.3.0_react@19.3.1/node_modules/react-style-singleton/dist/es2015/singleton.cjs +40 -1
- package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@19.3.0_react@19.3.1/node_modules/react-style-singleton/dist/es2015/singleton.js +29 -16
- package/dist/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.cjs +36 -1
- package/dist/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.js +25 -14
- package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@19.3.0_react@19.3.1/node_modules/use-callback-ref/dist/es2015/assignRef.cjs +20 -1
- package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@19.3.0_react@19.3.1/node_modules/use-callback-ref/dist/es2015/assignRef.js +18 -3
- package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@19.3.0_react@19.3.1/node_modules/use-callback-ref/dist/es2015/useMergeRef.cjs +46 -1
- package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@19.3.0_react@19.3.1/node_modules/use-callback-ref/dist/es2015/useMergeRef.js +38 -19
- package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@19.3.0_react@19.3.1/node_modules/use-callback-ref/dist/es2015/useRef.cjs +39 -1
- package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@19.3.0_react@19.3.1/node_modules/use-callback-ref/dist/es2015/useRef.js +29 -11
- package/dist/node_modules/.pnpm/use-sidecar@1.1.3_@types_react@19.3.0_react@19.3.1/node_modules/use-sidecar/dist/es2015/exports.cjs +18 -1
- package/dist/node_modules/.pnpm/use-sidecar@1.1.3_@types_react@19.3.0_react@19.3.1/node_modules/use-sidecar/dist/es2015/exports.js +13 -12
- package/dist/node_modules/.pnpm/use-sidecar@1.1.3_@types_react@19.3.0_react@19.3.1/node_modules/use-sidecar/dist/es2015/medium.cjs +81 -1
- package/dist/node_modules/.pnpm/use-sidecar@1.1.3_@types_react@19.3.0_react@19.3.1/node_modules/use-sidecar/dist/es2015/medium.js +58 -45
- package/dist/node_modules/.pnpm/vaul@1.1.2_@types_react-dom@19.3.0_@types_react@19.3.0__@types_react@19.3.0_react-dom@19.3.1_react@19.3.1__react@19.3.1/node_modules/vaul/dist/index.cjs +1252 -3
- package/dist/node_modules/.pnpm/vaul@1.1.2_@types_react-dom@19.3.0_@types_react@19.3.0__@types_react@19.3.0_react-dom@19.3.1_react@19.3.1__react@19.3.1/node_modules/vaul/dist/index.js +1003 -648
- package/dist/theme/index.cjs +63 -1
- package/dist/theme/index.js +31 -31
- package/dist/theme/spacing.cjs +93 -1
- package/dist/theme/spacing.js +52 -26
- package/dist/theme/tokens.stylex.cjs +210 -1
- package/dist/theme/tokens.stylex.js +58 -26
- package/dist/theme/types.cjs +13 -1
- package/dist/theme/types.js +4 -3
- package/dist/theme/width.cjs +39 -1
- package/dist/theme/width.js +16 -4
- package/dist/theme/zIndex.cjs +64 -1
- package/dist/theme/zIndex.js +44 -15
- package/dist/theme.css +135 -1
- package/dist/ui/accordion.cjs +431 -1
- package/dist/ui/accordion.d.ts +10 -10
- package/dist/ui/accordion.d.ts.map +1 -1
- package/dist/ui/accordion.js +276 -136
- package/dist/ui/action-bar.cjs +274 -1
- package/dist/ui/action-bar.d.ts +11 -11
- package/dist/ui/action-bar.d.ts.map +1 -1
- package/dist/ui/action-bar.js +204 -98
- package/dist/ui/alert-dialog.cjs +538 -1
- package/dist/ui/alert-dialog.d.ts +19 -19
- package/dist/ui/alert-dialog.d.ts.map +1 -1
- package/dist/ui/alert-dialog.js +459 -167
- package/dist/ui/alert.cjs +163 -1
- package/dist/ui/alert.d.ts +7 -7
- package/dist/ui/alert.d.ts.map +1 -1
- package/dist/ui/alert.js +111 -50
- package/dist/ui/aspect-ratio.cjs +25 -1
- package/dist/ui/aspect-ratio.d.ts +2 -2
- package/dist/ui/aspect-ratio.d.ts.map +1 -1
- package/dist/ui/aspect-ratio.js +22 -12
- package/dist/ui/avatar.cjs +341 -1
- package/dist/ui/avatar.d.ts +10 -10
- package/dist/ui/avatar.d.ts.map +1 -1
- package/dist/ui/avatar.js +226 -114
- package/dist/ui/badge-overflow.cjs +66 -1
- package/dist/ui/badge-overflow.d.ts +5 -5
- package/dist/ui/badge-overflow.d.ts.map +1 -1
- package/dist/ui/badge-overflow.js +34 -27
- package/dist/ui/badge.cjs +167 -1
- package/dist/ui/badge.d.ts +3 -3
- package/dist/ui/badge.d.ts.map +1 -1
- package/dist/ui/badge.js +48 -42
- package/dist/ui/breadcrumb.cjs +508 -1
- package/dist/ui/breadcrumb.d.ts +15 -15
- package/dist/ui/breadcrumb.d.ts.map +1 -1
- package/dist/ui/breadcrumb.js +386 -159
- package/dist/ui/button.cjs +425 -1
- package/dist/ui/button.d.ts +3 -3
- package/dist/ui/button.d.ts.map +1 -1
- package/dist/ui/button.js +137 -117
- package/dist/ui/calendar.cjs +626 -1
- package/dist/ui/calendar.d.ts +5 -5
- package/dist/ui/calendar.d.ts.map +1 -1
- package/dist/ui/calendar.js +309 -192
- package/dist/ui/card.cjs +401 -1
- package/dist/ui/card.d.ts +15 -15
- package/dist/ui/card.d.ts.map +1 -1
- package/dist/ui/card.js +300 -119
- package/dist/ui/carousel.cjs +333 -1
- package/dist/ui/carousel.d.ts +10 -10
- package/dist/ui/carousel.d.ts.map +1 -1
- package/dist/ui/carousel.js +245 -126
- package/dist/ui/checkbox.cjs +167 -1
- package/dist/ui/checkbox.d.ts +4 -4
- package/dist/ui/checkbox.d.ts.map +1 -1
- package/dist/ui/checkbox.js +66 -58
- package/dist/ui/circular-progress.cjs +139 -1
- package/dist/ui/circular-progress.d.ts +4 -4
- package/dist/ui/circular-progress.d.ts.map +1 -1
- package/dist/ui/circular-progress.js +65 -52
- package/dist/ui/code-block.cjs +819 -0
- package/dist/ui/code-block.d.ts +81 -0
- package/dist/ui/code-block.d.ts.map +1 -0
- package/dist/ui/code-block.js +809 -0
- package/dist/ui/collapsible.cjs +65 -1
- package/dist/ui/collapsible.d.ts +4 -4
- package/dist/ui/collapsible.d.ts.map +1 -1
- package/dist/ui/collapsible.js +58 -28
- package/dist/ui/command.cjs +556 -1
- package/dist/ui/command.d.ts +19 -19
- package/dist/ui/command.d.ts.map +1 -1
- package/dist/ui/command.js +432 -163
- package/dist/ui/compare-slider.cjs +170 -1
- package/dist/ui/compare-slider.d.ts +7 -7
- package/dist/ui/compare-slider.d.ts.map +1 -1
- package/dist/ui/compare-slider.js +106 -72
- package/dist/ui/context-menu.cjs +811 -1
- package/dist/ui/context-menu.d.ts +26 -26
- package/dist/ui/context-menu.d.ts.map +1 -1
- package/dist/ui/context-menu.js +693 -228
- package/dist/ui/copy-button.cjs +94 -1
- package/dist/ui/copy-button.d.ts +1 -2
- package/dist/ui/copy-button.d.ts.map +1 -1
- package/dist/ui/copy-button.js +56 -44
- package/dist/ui/dialog.cjs +409 -1
- package/dist/ui/dialog.d.ts +18 -18
- package/dist/ui/dialog.d.ts.map +1 -1
- package/dist/ui/dialog.js +317 -131
- package/dist/ui/drawer.cjs +476 -1
- package/dist/ui/drawer.d.ts +17 -17
- package/dist/ui/drawer.d.ts.map +1 -1
- package/dist/ui/drawer.js +394 -151
- package/dist/ui/dropdown-menu.cjs +638 -1
- package/dist/ui/dropdown-menu.d.ts +26 -26
- package/dist/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/ui/dropdown-menu.js +511 -208
- package/dist/ui/editable.cjs +608 -1
- package/dist/ui/editable.d.ts +14 -14
- package/dist/ui/editable.d.ts.map +1 -1
- package/dist/ui/editable.js +478 -218
- package/dist/ui/empty.cjs +310 -1
- package/dist/ui/empty.d.ts +15 -15
- package/dist/ui/empty.d.ts.map +1 -1
- package/dist/ui/empty.js +277 -107
- package/dist/ui/field.cjs +621 -1
- package/dist/ui/field.d.ts +21 -21
- package/dist/ui/field.d.ts.map +1 -1
- package/dist/ui/field.js +468 -198
- package/dist/ui/file-upload-adapters.cjs +289 -1
- package/dist/ui/file-upload-adapters.d.ts +1 -2
- package/dist/ui/file-upload-adapters.d.ts.map +1 -1
- package/dist/ui/file-upload-adapters.js +244 -170
- package/dist/ui/file-upload.cjs +1481 -1
- package/dist/ui/file-upload.d.ts +22 -22
- package/dist/ui/file-upload.d.ts.map +1 -1
- package/dist/ui/file-upload.js +1064 -598
- package/dist/ui/flex.cjs +203 -1
- package/dist/ui/flex.d.ts +6 -6
- package/dist/ui/flex.d.ts.map +1 -1
- package/dist/ui/flex.js +111 -92
- package/dist/ui/form.cjs +454 -1
- package/dist/ui/form.d.ts +11 -11
- package/dist/ui/form.d.ts.map +1 -1
- package/dist/ui/form.js +421 -135
- package/dist/ui/gauge.cjs +127 -1
- package/dist/ui/gauge.d.ts +6 -6
- package/dist/ui/gauge.d.ts.map +1 -1
- package/dist/ui/gauge.js +61 -52
- package/dist/ui/grid.cjs +224 -1
- package/dist/ui/grid.d.ts +7 -7
- package/dist/ui/grid.d.ts.map +1 -1
- package/dist/ui/grid.js +125 -94
- package/dist/ui/hover-card.cjs +86 -1
- package/dist/ui/hover-card.d.ts +6 -6
- package/dist/ui/hover-card.d.ts.map +1 -1
- package/dist/ui/hover-card.js +57 -36
- package/dist/ui/index.d.ts +4 -0
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/input-group.cjs +328 -1
- package/dist/ui/input-group.d.ts +12 -12
- package/dist/ui/input-group.d.ts.map +1 -1
- package/dist/ui/input-group.js +207 -105
- package/dist/ui/input-otp.cjs +312 -1
- package/dist/ui/input-otp.d.ts +10 -10
- package/dist/ui/input-otp.d.ts.map +1 -1
- package/dist/ui/input-otp.js +217 -94
- package/dist/ui/input.cjs +388 -1
- package/dist/ui/input.d.ts +3 -3
- package/dist/ui/input.d.ts.map +1 -1
- package/dist/ui/input.js +137 -119
- package/dist/ui/item.cjs +585 -1
- package/dist/ui/item.d.ts +20 -20
- package/dist/ui/item.d.ts.map +1 -1
- package/dist/ui/item.js +460 -162
- package/dist/ui/kbd.cjs +115 -1
- package/dist/ui/kbd.d.ts +5 -5
- package/dist/ui/kbd.d.ts.map +1 -1
- package/dist/ui/kbd.js +42 -37
- package/dist/ui/label.cjs +67 -1
- package/dist/ui/label.d.ts +4 -4
- package/dist/ui/label.d.ts.map +1 -1
- package/dist/ui/label.js +51 -21
- package/dist/ui/marker.cjs +294 -0
- package/dist/ui/marker.d.ts +22 -0
- package/dist/ui/marker.d.ts.map +1 -0
- package/dist/ui/marker.js +290 -0
- package/dist/ui/masonry.cjs +58 -1
- package/dist/ui/masonry.d.ts +4 -4
- package/dist/ui/masonry.d.ts.map +1 -1
- package/dist/ui/masonry.js +41 -36
- package/dist/ui/menubar.cjs +908 -1
- package/dist/ui/menubar.d.ts +29 -29
- package/dist/ui/menubar.d.ts.map +1 -1
- package/dist/ui/menubar.js +737 -251
- package/dist/ui/navigation-menu.cjs +560 -1
- package/dist/ui/navigation-menu.d.ts +18 -18
- package/dist/ui/navigation-menu.d.ts.map +1 -1
- package/dist/ui/navigation-menu.js +442 -148
- package/dist/ui/pagination.cjs +575 -1
- package/dist/ui/pagination.d.ts +13 -13
- package/dist/ui/pagination.d.ts.map +1 -1
- package/dist/ui/pagination.js +422 -172
- package/dist/ui/popover.cjs +93 -1
- package/dist/ui/popover.d.ts +7 -7
- package/dist/ui/popover.d.ts.map +1 -1
- package/dist/ui/popover.js +61 -42
- package/dist/ui/progress.cjs +33 -1
- package/dist/ui/progress.d.ts +3 -3
- package/dist/ui/progress.d.ts.map +1 -1
- package/dist/ui/progress.js +19 -17
- package/dist/ui/questionnaire.cjs +679 -0
- package/dist/ui/questionnaire.d.ts +101 -0
- package/dist/ui/questionnaire.d.ts.map +1 -0
- package/dist/ui/questionnaire.js +667 -0
- package/dist/ui/radio-group.cjs +221 -1
- package/dist/ui/radio-group.d.ts +6 -6
- package/dist/ui/radio-group.d.ts.map +1 -1
- package/dist/ui/radio-group.js +125 -74
- package/dist/ui/rating.cjs +191 -1
- package/dist/ui/rating.d.ts +3 -3
- package/dist/ui/rating.d.ts.map +1 -1
- package/dist/ui/rating.js +96 -78
- package/dist/ui/resizable.cjs +175 -1
- package/dist/ui/resizable.d.ts +7 -7
- package/dist/ui/resizable.d.ts.map +1 -1
- package/dist/ui/resizable.js +150 -54
- package/dist/ui/responsive-dialog.cjs +400 -1
- package/dist/ui/responsive-dialog.d.ts +17 -17
- package/dist/ui/responsive-dialog.d.ts.map +1 -1
- package/dist/ui/responsive-dialog.js +372 -155
- package/dist/ui/row-col.cjs +510 -1
- package/dist/ui/row-col.d.ts +11 -11
- package/dist/ui/row-col.d.ts.map +1 -1
- package/dist/ui/row-col.js +238 -205
- package/dist/ui/scroll-area.cjs +142 -1
- package/dist/ui/scroll-area.d.ts +6 -6
- package/dist/ui/scroll-area.d.ts.map +1 -1
- package/dist/ui/scroll-area.js +103 -47
- package/dist/ui/segmented.cjs +170 -1
- package/dist/ui/segmented.d.ts +5 -5
- package/dist/ui/segmented.d.ts.map +1 -1
- package/dist/ui/segmented.js +75 -62
- package/dist/ui/select.cjs +484 -1
- package/dist/ui/select.d.ts +17 -17
- package/dist/ui/select.d.ts.map +1 -1
- package/dist/ui/select.js +353 -160
- package/dist/ui/separator.cjs +44 -1
- package/dist/ui/separator.d.ts +4 -4
- package/dist/ui/separator.d.ts.map +1 -1
- package/dist/ui/separator.js +17 -17
- package/dist/ui/sheet.cjs +460 -1
- package/dist/ui/sheet.d.ts +16 -16
- package/dist/ui/sheet.d.ts.map +1 -1
- package/dist/ui/sheet.js +329 -141
- package/dist/ui/sidebar.cjs +1453 -1
- package/dist/ui/sidebar.d.ts +48 -48
- package/dist/ui/sidebar.d.ts.map +1 -1
- package/dist/ui/sidebar.js +1057 -438
- package/dist/ui/signature-pad.cjs +740 -0
- package/dist/ui/signature-pad.d.ts +107 -0
- package/dist/ui/signature-pad.d.ts.map +1 -0
- package/dist/ui/signature-pad.js +730 -0
- package/dist/ui/skeleton.cjs +62 -1
- package/dist/ui/skeleton.d.ts +3 -3
- package/dist/ui/skeleton.d.ts.map +1 -1
- package/dist/ui/skeleton.js +50 -20
- package/dist/ui/slider.cjs +47 -1
- package/dist/ui/slider.d.ts +4 -4
- package/dist/ui/slider.d.ts.map +1 -1
- package/dist/ui/slider.js +27 -26
- package/dist/ui/sonner.cjs +28 -1
- package/dist/ui/sonner.js +24 -22
- package/dist/ui/spinner.cjs +73 -1
- package/dist/ui/spinner.d.ts +3 -3
- package/dist/ui/spinner.d.ts.map +1 -1
- package/dist/ui/spinner.js +29 -28
- package/dist/ui/stat.cjs +334 -1
- package/dist/ui/stat.d.ts +15 -15
- package/dist/ui/stat.d.ts.map +1 -1
- package/dist/ui/stat.js +271 -130
- package/dist/ui/stepper.cjs +785 -1
- package/dist/ui/stepper.d.ts +24 -24
- package/dist/ui/stepper.d.ts.map +1 -1
- package/dist/ui/stepper.js +594 -281
- package/dist/ui/switch.cjs +203 -1
- package/dist/ui/switch.d.ts +4 -4
- package/dist/ui/switch.d.ts.map +1 -1
- package/dist/ui/switch.js +83 -72
- package/dist/ui/table.cjs +435 -1
- package/dist/ui/table.d.ts +17 -17
- package/dist/ui/table.d.ts.map +1 -1
- package/dist/ui/table.js +369 -129
- package/dist/ui/tabs.cjs +340 -1
- package/dist/ui/tabs.d.ts +10 -10
- package/dist/ui/tabs.d.ts.map +1 -1
- package/dist/ui/tabs.js +204 -95
- package/dist/ui/tags-input.cjs +585 -1
- package/dist/ui/tags-input.d.ts +13 -13
- package/dist/ui/tags-input.d.ts.map +1 -1
- package/dist/ui/tags-input.js +446 -221
- package/dist/ui/textarea.cjs +119 -1
- package/dist/ui/textarea.d.ts +3 -3
- package/dist/ui/textarea.d.ts.map +1 -1
- package/dist/ui/textarea.js +37 -33
- package/dist/ui/timeline.cjs +583 -1
- package/dist/ui/timeline.d.ts +22 -22
- package/dist/ui/timeline.d.ts.map +1 -1
- package/dist/ui/timeline.js +409 -198
- package/dist/ui/toggle-group.cjs +128 -1
- package/dist/ui/toggle-group.d.ts +7 -7
- package/dist/ui/toggle-group.d.ts.map +1 -1
- package/dist/ui/toggle-group.js +92 -41
- package/dist/ui/toggle.cjs +145 -1
- package/dist/ui/toggle.d.ts +4 -4
- package/dist/ui/toggle.d.ts.map +1 -1
- package/dist/ui/toggle.js +38 -34
- package/dist/ui/tooltip.cjs +81 -1
- package/dist/ui/tooltip.d.ts +7 -7
- package/dist/ui/tooltip.d.ts.map +1 -1
- package/dist/ui/tooltip.js +50 -37
- package/dist/ui/useBreakpoint.cjs +91 -1
- package/dist/ui/useBreakpoint.js +66 -43
- package/dist/utils.cjs +9 -1
- package/dist/utils.js +4 -4
- package/package.json +10 -2
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { createContext
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
import { createContext, createElement, forwardRef, useCallback, useContext, useEffect, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
3
3
|
// ../../node_modules/.pnpm/react-resizable-panels@2.1.9_react-dom@19.3.1_react@19.3.1__react@19.3.1/node_modules/react-resizable-panels/dist/react-resizable-panels.browser.esm.js
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
var
|
|
4
|
+
var PanelGroupContext = createContext(null);
|
|
5
|
+
PanelGroupContext.displayName = "PanelGroupContext";
|
|
6
|
+
var DATA_ATTRIBUTES = {
|
|
7
7
|
group: "data-panel-group",
|
|
8
8
|
groupDirection: "data-panel-group-direction",
|
|
9
9
|
groupId: "data-panel-group-id",
|
|
@@ -16,1127 +16,1585 @@ var p = {
|
|
|
16
16
|
resizeHandleEnabled: "data-panel-resize-handle-enabled",
|
|
17
17
|
resizeHandleId: "data-panel-resize-handle-id",
|
|
18
18
|
resizeHandleState: "data-resize-handle-state"
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
19
|
+
};
|
|
20
|
+
var PRECISION = 10;
|
|
21
|
+
var useIsomorphicLayoutEffect = useLayoutEffect;
|
|
22
|
+
var useId$1 = React$1["useId".toString()];
|
|
23
|
+
var wrappedUseId = typeof useId$1 === "function" ? useId$1 : () => null;
|
|
24
|
+
var counter = 0;
|
|
25
|
+
function useUniqueId(idFromParams = null) {
|
|
26
|
+
const idFromUseId = wrappedUseId();
|
|
27
|
+
const idRef = useRef(idFromParams || idFromUseId || null);
|
|
28
|
+
if (idRef.current === null) idRef.current = "" + counter++;
|
|
29
|
+
return idFromParams !== null && idFromParams !== void 0 ? idFromParams : idRef.current;
|
|
30
|
+
}
|
|
31
|
+
function PanelWithForwardedRef({ children, className: classNameFromProps = "", collapsedSize, collapsible, defaultSize, forwardedRef, id: idFromProps, maxSize, minSize, onCollapse, onExpand, onResize, order, style: styleFromProps, tagName: Type = "div", ...rest }) {
|
|
32
|
+
const context = useContext(PanelGroupContext);
|
|
33
|
+
if (context === null) throw Error(`Panel components must be rendered within a PanelGroup container`);
|
|
34
|
+
const { collapsePanel, expandPanel, getPanelSize, getPanelStyle, groupId, isPanelCollapsed, reevaluatePanelConstraints, registerPanel, resizePanel, unregisterPanel } = context;
|
|
35
|
+
const panelId = useUniqueId(idFromProps);
|
|
36
|
+
const panelDataRef = useRef({
|
|
28
37
|
callbacks: {
|
|
29
|
-
onCollapse
|
|
30
|
-
onExpand
|
|
31
|
-
onResize
|
|
38
|
+
onCollapse,
|
|
39
|
+
onExpand,
|
|
40
|
+
onResize
|
|
32
41
|
},
|
|
33
42
|
constraints: {
|
|
34
|
-
collapsedSize
|
|
35
|
-
collapsible
|
|
36
|
-
defaultSize
|
|
37
|
-
maxSize
|
|
38
|
-
minSize
|
|
43
|
+
collapsedSize,
|
|
44
|
+
collapsible,
|
|
45
|
+
defaultSize,
|
|
46
|
+
maxSize,
|
|
47
|
+
minSize
|
|
39
48
|
},
|
|
40
|
-
id:
|
|
41
|
-
idIsFromProps:
|
|
42
|
-
order
|
|
49
|
+
id: panelId,
|
|
50
|
+
idIsFromProps: idFromProps !== void 0,
|
|
51
|
+
order
|
|
43
52
|
});
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
53
|
+
useRef({ didLogMissingDefaultSizeWarning: false });
|
|
54
|
+
useIsomorphicLayoutEffect(() => {
|
|
55
|
+
const { callbacks, constraints } = panelDataRef.current;
|
|
56
|
+
const prevConstraints = { ...constraints };
|
|
57
|
+
panelDataRef.current.id = panelId;
|
|
58
|
+
panelDataRef.current.idIsFromProps = idFromProps !== void 0;
|
|
59
|
+
panelDataRef.current.order = order;
|
|
60
|
+
callbacks.onCollapse = onCollapse;
|
|
61
|
+
callbacks.onExpand = onExpand;
|
|
62
|
+
callbacks.onResize = onResize;
|
|
63
|
+
constraints.collapsedSize = collapsedSize;
|
|
64
|
+
constraints.collapsible = collapsible;
|
|
65
|
+
constraints.defaultSize = defaultSize;
|
|
66
|
+
constraints.maxSize = maxSize;
|
|
67
|
+
constraints.minSize = minSize;
|
|
68
|
+
if (prevConstraints.collapsedSize !== constraints.collapsedSize || prevConstraints.collapsible !== constraints.collapsible || prevConstraints.maxSize !== constraints.maxSize || prevConstraints.minSize !== constraints.minSize) reevaluatePanelConstraints(panelDataRef.current, prevConstraints);
|
|
69
|
+
});
|
|
70
|
+
useIsomorphicLayoutEffect(() => {
|
|
71
|
+
const panelData = panelDataRef.current;
|
|
72
|
+
registerPanel(panelData);
|
|
73
|
+
return () => {
|
|
74
|
+
unregisterPanel(panelData);
|
|
51
75
|
};
|
|
52
76
|
}, [
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
])
|
|
77
|
+
order,
|
|
78
|
+
panelId,
|
|
79
|
+
registerPanel,
|
|
80
|
+
unregisterPanel
|
|
81
|
+
]);
|
|
82
|
+
useImperativeHandle(forwardedRef, () => ({
|
|
58
83
|
collapse: () => {
|
|
59
|
-
|
|
84
|
+
collapsePanel(panelDataRef.current);
|
|
60
85
|
},
|
|
61
|
-
expand: (
|
|
62
|
-
|
|
86
|
+
expand: (minSize) => {
|
|
87
|
+
expandPanel(panelDataRef.current, minSize);
|
|
63
88
|
},
|
|
64
89
|
getId() {
|
|
65
|
-
return
|
|
90
|
+
return panelId;
|
|
66
91
|
},
|
|
67
92
|
getSize() {
|
|
68
|
-
return
|
|
93
|
+
return getPanelSize(panelDataRef.current);
|
|
69
94
|
},
|
|
70
95
|
isCollapsed() {
|
|
71
|
-
return
|
|
96
|
+
return isPanelCollapsed(panelDataRef.current);
|
|
72
97
|
},
|
|
73
98
|
isExpanded() {
|
|
74
|
-
return !
|
|
99
|
+
return !isPanelCollapsed(panelDataRef.current);
|
|
75
100
|
},
|
|
76
|
-
resize: (
|
|
77
|
-
|
|
101
|
+
resize: (size) => {
|
|
102
|
+
resizePanel(panelDataRef.current, size);
|
|
78
103
|
}
|
|
79
104
|
}), [
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
105
|
+
collapsePanel,
|
|
106
|
+
expandPanel,
|
|
107
|
+
getPanelSize,
|
|
108
|
+
isPanelCollapsed,
|
|
109
|
+
panelId,
|
|
110
|
+
resizePanel
|
|
86
111
|
]);
|
|
87
|
-
|
|
88
|
-
return
|
|
89
|
-
...
|
|
90
|
-
children
|
|
91
|
-
className:
|
|
92
|
-
id:
|
|
112
|
+
const style = getPanelStyle(panelDataRef.current, defaultSize);
|
|
113
|
+
return createElement(Type, {
|
|
114
|
+
...rest,
|
|
115
|
+
children,
|
|
116
|
+
className: classNameFromProps,
|
|
117
|
+
id: panelId,
|
|
93
118
|
style: {
|
|
94
|
-
...
|
|
95
|
-
...
|
|
119
|
+
...style,
|
|
120
|
+
...styleFromProps
|
|
96
121
|
},
|
|
97
|
-
[
|
|
98
|
-
[
|
|
99
|
-
[
|
|
100
|
-
[
|
|
101
|
-
[
|
|
122
|
+
[DATA_ATTRIBUTES.groupId]: groupId,
|
|
123
|
+
[DATA_ATTRIBUTES.panel]: "",
|
|
124
|
+
[DATA_ATTRIBUTES.panelCollapsible]: collapsible || void 0,
|
|
125
|
+
[DATA_ATTRIBUTES.panelId]: panelId,
|
|
126
|
+
[DATA_ATTRIBUTES.panelSize]: parseFloat("" + style.flexGrow).toFixed(1)
|
|
102
127
|
});
|
|
103
128
|
}
|
|
104
|
-
var
|
|
105
|
-
...
|
|
106
|
-
forwardedRef:
|
|
129
|
+
var Panel = forwardRef((props, ref) => createElement(PanelWithForwardedRef, {
|
|
130
|
+
...props,
|
|
131
|
+
forwardedRef: ref
|
|
107
132
|
}));
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
133
|
+
PanelWithForwardedRef.displayName = "Panel";
|
|
134
|
+
Panel.displayName = "forwardRef(Panel)";
|
|
135
|
+
var currentCursorStyle = null;
|
|
136
|
+
var enabled = true;
|
|
137
|
+
var prevRuleIndex = -1;
|
|
138
|
+
var styleElement = null;
|
|
139
|
+
function getCursorStyle(state, constraintFlags) {
|
|
140
|
+
if (constraintFlags) {
|
|
141
|
+
const horizontalMin = (constraintFlags & EXCEEDED_HORIZONTAL_MIN) !== 0;
|
|
142
|
+
const horizontalMax = (constraintFlags & EXCEEDED_HORIZONTAL_MAX) !== 0;
|
|
143
|
+
const verticalMin = (constraintFlags & EXCEEDED_VERTICAL_MIN) !== 0;
|
|
144
|
+
const verticalMax = (constraintFlags & EXCEEDED_VERTICAL_MAX) !== 0;
|
|
145
|
+
if (horizontalMin) {
|
|
146
|
+
if (verticalMin) return "se-resize";
|
|
147
|
+
else if (verticalMax) return "ne-resize";
|
|
148
|
+
else return "e-resize";
|
|
149
|
+
} else if (horizontalMax) {
|
|
150
|
+
if (verticalMin) return "sw-resize";
|
|
151
|
+
else if (verticalMax) return "nw-resize";
|
|
152
|
+
else return "w-resize";
|
|
153
|
+
} else if (verticalMin) return "s-resize";
|
|
154
|
+
else if (verticalMax) return "n-resize";
|
|
117
155
|
}
|
|
118
|
-
switch (
|
|
156
|
+
switch (state) {
|
|
119
157
|
case "horizontal": return "ew-resize";
|
|
120
158
|
case "intersection": return "move";
|
|
121
159
|
case "vertical": return "ns-resize";
|
|
122
160
|
}
|
|
123
161
|
}
|
|
124
|
-
function
|
|
125
|
-
|
|
162
|
+
function resetGlobalCursorStyle() {
|
|
163
|
+
if (styleElement !== null) {
|
|
164
|
+
document.head.removeChild(styleElement);
|
|
165
|
+
currentCursorStyle = null;
|
|
166
|
+
styleElement = null;
|
|
167
|
+
prevRuleIndex = -1;
|
|
168
|
+
}
|
|
126
169
|
}
|
|
127
|
-
function
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
170
|
+
function setGlobalCursorStyle(state, constraintFlags) {
|
|
171
|
+
var _styleElement$sheet$i, _styleElement$sheet2;
|
|
172
|
+
if (!enabled) return;
|
|
173
|
+
const style = getCursorStyle(state, constraintFlags);
|
|
174
|
+
if (currentCursorStyle === style) return;
|
|
175
|
+
currentCursorStyle = style;
|
|
176
|
+
if (styleElement === null) {
|
|
177
|
+
styleElement = document.createElement("style");
|
|
178
|
+
document.head.appendChild(styleElement);
|
|
179
|
+
}
|
|
180
|
+
if (prevRuleIndex >= 0) {
|
|
181
|
+
var _styleElement$sheet;
|
|
182
|
+
(_styleElement$sheet = styleElement.sheet) === null || _styleElement$sheet === void 0 || _styleElement$sheet.removeRule(prevRuleIndex);
|
|
136
183
|
}
|
|
184
|
+
prevRuleIndex = (_styleElement$sheet$i = (_styleElement$sheet2 = styleElement.sheet) === null || _styleElement$sheet2 === void 0 ? void 0 : _styleElement$sheet2.insertRule(`*{cursor: ${style} !important;}`)) !== null && _styleElement$sheet$i !== void 0 ? _styleElement$sheet$i : -1;
|
|
137
185
|
}
|
|
138
|
-
function
|
|
139
|
-
return
|
|
186
|
+
function isKeyDown(event) {
|
|
187
|
+
return event.type === "keydown";
|
|
140
188
|
}
|
|
141
|
-
function
|
|
142
|
-
return
|
|
189
|
+
function isPointerEvent(event) {
|
|
190
|
+
return event.type.startsWith("pointer");
|
|
143
191
|
}
|
|
144
|
-
function
|
|
145
|
-
return
|
|
192
|
+
function isMouseEvent(event) {
|
|
193
|
+
return event.type.startsWith("mouse");
|
|
146
194
|
}
|
|
147
|
-
function
|
|
148
|
-
if (
|
|
149
|
-
if (
|
|
150
|
-
x:
|
|
151
|
-
y:
|
|
195
|
+
function getResizeEventCoordinates(event) {
|
|
196
|
+
if (isPointerEvent(event)) {
|
|
197
|
+
if (event.isPrimary) return {
|
|
198
|
+
x: event.clientX,
|
|
199
|
+
y: event.clientY
|
|
152
200
|
};
|
|
153
|
-
} else if (
|
|
154
|
-
x:
|
|
155
|
-
y:
|
|
201
|
+
} else if (isMouseEvent(event)) return {
|
|
202
|
+
x: event.clientX,
|
|
203
|
+
y: event.clientY
|
|
156
204
|
};
|
|
157
205
|
return {
|
|
158
206
|
x: Infinity,
|
|
159
207
|
y: Infinity
|
|
160
208
|
};
|
|
161
209
|
}
|
|
162
|
-
function
|
|
163
|
-
if (typeof matchMedia
|
|
164
|
-
}
|
|
165
|
-
function
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
210
|
+
function getInputType() {
|
|
211
|
+
if (typeof matchMedia === "function") return matchMedia("(pointer:coarse)").matches ? "coarse" : "fine";
|
|
212
|
+
}
|
|
213
|
+
function intersects(rectOne, rectTwo, strict) {
|
|
214
|
+
if (strict) return rectOne.x < rectTwo.x + rectTwo.width && rectOne.x + rectOne.width > rectTwo.x && rectOne.y < rectTwo.y + rectTwo.height && rectOne.y + rectOne.height > rectTwo.y;
|
|
215
|
+
else return rectOne.x <= rectTwo.x + rectTwo.width && rectOne.x + rectOne.width >= rectTwo.x && rectOne.y <= rectTwo.y + rectTwo.height && rectOne.y + rectOne.height >= rectTwo.y;
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Determine which of two nodes appears in front of the other —
|
|
219
|
+
* if `a` is in front, returns 1, otherwise returns -1
|
|
220
|
+
* @param {HTMLElement | SVGElement} a
|
|
221
|
+
* @param {HTMLElement | SVGElement} b
|
|
222
|
+
*/
|
|
223
|
+
function compare(a, b) {
|
|
224
|
+
if (a === b) throw new Error("Cannot compare node with itself");
|
|
225
|
+
const ancestors = {
|
|
226
|
+
a: get_ancestors(a),
|
|
227
|
+
b: get_ancestors(b)
|
|
179
228
|
};
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
229
|
+
let common_ancestor;
|
|
230
|
+
while (ancestors.a.at(-1) === ancestors.b.at(-1)) {
|
|
231
|
+
a = ancestors.a.pop();
|
|
232
|
+
b = ancestors.b.pop();
|
|
233
|
+
common_ancestor = a;
|
|
234
|
+
}
|
|
235
|
+
assert(common_ancestor, "Stacking order can only be calculated for elements with a common ancestor");
|
|
236
|
+
const z_indexes = {
|
|
237
|
+
a: get_z_index(find_stacking_context(ancestors.a)),
|
|
238
|
+
b: get_z_index(find_stacking_context(ancestors.b))
|
|
239
|
+
};
|
|
240
|
+
if (z_indexes.a === z_indexes.b) {
|
|
241
|
+
const children = common_ancestor.childNodes;
|
|
242
|
+
const furthest_ancestors = {
|
|
243
|
+
a: ancestors.a.at(-1),
|
|
244
|
+
b: ancestors.b.at(-1)
|
|
245
|
+
};
|
|
246
|
+
let i = children.length;
|
|
247
|
+
while (i--) {
|
|
248
|
+
const child = children[i];
|
|
249
|
+
if (child === furthest_ancestors.a) return 1;
|
|
250
|
+
if (child === furthest_ancestors.b) return -1;
|
|
189
251
|
}
|
|
190
252
|
}
|
|
191
|
-
return Math.sign(
|
|
192
|
-
}
|
|
193
|
-
var
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
253
|
+
return Math.sign(z_indexes.a - z_indexes.b);
|
|
254
|
+
}
|
|
255
|
+
var props = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
|
|
256
|
+
/** @param {HTMLElement | SVGElement} node */
|
|
257
|
+
function is_flex_item(node) {
|
|
258
|
+
var _get_parent;
|
|
259
|
+
const display = getComputedStyle((_get_parent = get_parent(node)) !== null && _get_parent !== void 0 ? _get_parent : node).display;
|
|
260
|
+
return display === "flex" || display === "inline-flex";
|
|
261
|
+
}
|
|
262
|
+
/** @param {HTMLElement | SVGElement} node */
|
|
263
|
+
function creates_stacking_context(node) {
|
|
264
|
+
const style = getComputedStyle(node);
|
|
265
|
+
if (style.position === "fixed") return true;
|
|
266
|
+
if (style.zIndex !== "auto" && (style.position !== "static" || is_flex_item(node))) return true;
|
|
267
|
+
if (+style.opacity < 1) return true;
|
|
268
|
+
if ("transform" in style && style.transform !== "none") return true;
|
|
269
|
+
if ("webkitTransform" in style && style.webkitTransform !== "none") return true;
|
|
270
|
+
if ("mixBlendMode" in style && style.mixBlendMode !== "normal") return true;
|
|
271
|
+
if ("filter" in style && style.filter !== "none") return true;
|
|
272
|
+
if ("webkitFilter" in style && style.webkitFilter !== "none") return true;
|
|
273
|
+
if ("isolation" in style && style.isolation === "isolate") return true;
|
|
274
|
+
if (props.test(style.willChange)) return true;
|
|
275
|
+
if (style.webkitOverflowScrolling === "touch") return true;
|
|
276
|
+
return false;
|
|
277
|
+
}
|
|
278
|
+
/** @param {(HTMLElement| SVGElement)[]} nodes */
|
|
279
|
+
function find_stacking_context(nodes) {
|
|
280
|
+
let i = nodes.length;
|
|
281
|
+
while (i--) {
|
|
282
|
+
const node = nodes[i];
|
|
283
|
+
assert(node, "Missing node");
|
|
284
|
+
if (creates_stacking_context(node)) return node;
|
|
207
285
|
}
|
|
208
286
|
return null;
|
|
209
287
|
}
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
288
|
+
/** @param {HTMLElement | SVGElement} node */
|
|
289
|
+
function get_z_index(node) {
|
|
290
|
+
return node && Number(getComputedStyle(node).zIndex) || 0;
|
|
291
|
+
}
|
|
292
|
+
/** @param {HTMLElement} node */
|
|
293
|
+
function get_ancestors(node) {
|
|
294
|
+
const ancestors = [];
|
|
295
|
+
while (node) {
|
|
296
|
+
ancestors.push(node);
|
|
297
|
+
node = get_parent(node);
|
|
298
|
+
}
|
|
299
|
+
return ancestors;
|
|
300
|
+
}
|
|
301
|
+
/** @param {HTMLElement} node */
|
|
302
|
+
function get_parent(node) {
|
|
303
|
+
const { parentNode } = node;
|
|
304
|
+
if (parentNode && parentNode instanceof ShadowRoot) return parentNode.host;
|
|
305
|
+
return parentNode;
|
|
306
|
+
}
|
|
307
|
+
var EXCEEDED_HORIZONTAL_MIN = 1;
|
|
308
|
+
var EXCEEDED_HORIZONTAL_MAX = 2;
|
|
309
|
+
var EXCEEDED_VERTICAL_MIN = 4;
|
|
310
|
+
var EXCEEDED_VERTICAL_MAX = 8;
|
|
311
|
+
var isCoarsePointer = getInputType() === "coarse";
|
|
312
|
+
var intersectingHandles = [];
|
|
313
|
+
var isPointerDown = false;
|
|
314
|
+
var ownerDocumentCounts = /* @__PURE__ */ new Map();
|
|
315
|
+
var panelConstraintFlags = /* @__PURE__ */ new Map();
|
|
316
|
+
var registeredResizeHandlers = /* @__PURE__ */ new Set();
|
|
317
|
+
function registerResizeHandle(resizeHandleId, element, direction, hitAreaMargins, setResizeHandlerState) {
|
|
318
|
+
var _ownerDocumentCounts$;
|
|
319
|
+
const { ownerDocument } = element;
|
|
320
|
+
const data = {
|
|
321
|
+
direction,
|
|
322
|
+
element,
|
|
323
|
+
hitAreaMargins,
|
|
324
|
+
setResizeHandlerState
|
|
325
|
+
};
|
|
326
|
+
const count = (_ownerDocumentCounts$ = ownerDocumentCounts.get(ownerDocument)) !== null && _ownerDocumentCounts$ !== void 0 ? _ownerDocumentCounts$ : 0;
|
|
327
|
+
ownerDocumentCounts.set(ownerDocument, count + 1);
|
|
328
|
+
registeredResizeHandlers.add(data);
|
|
329
|
+
updateListeners();
|
|
330
|
+
return function unregisterResizeHandle() {
|
|
331
|
+
var _ownerDocumentCounts$2;
|
|
332
|
+
panelConstraintFlags.delete(resizeHandleId);
|
|
333
|
+
registeredResizeHandlers.delete(data);
|
|
334
|
+
const count = (_ownerDocumentCounts$2 = ownerDocumentCounts.get(ownerDocument)) !== null && _ownerDocumentCounts$2 !== void 0 ? _ownerDocumentCounts$2 : 1;
|
|
335
|
+
ownerDocumentCounts.set(ownerDocument, count - 1);
|
|
336
|
+
updateListeners();
|
|
337
|
+
if (count === 1) ownerDocumentCounts.delete(ownerDocument);
|
|
338
|
+
if (intersectingHandles.includes(data)) {
|
|
339
|
+
const index = intersectingHandles.indexOf(data);
|
|
340
|
+
if (index >= 0) intersectingHandles.splice(index, 1);
|
|
341
|
+
updateCursor();
|
|
342
|
+
setResizeHandlerState("up", true, null);
|
|
236
343
|
}
|
|
237
344
|
};
|
|
238
345
|
}
|
|
239
|
-
function
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
if (
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
346
|
+
function handlePointerDown(event) {
|
|
347
|
+
const { target } = event;
|
|
348
|
+
const { x, y } = getResizeEventCoordinates(event);
|
|
349
|
+
isPointerDown = true;
|
|
350
|
+
recalculateIntersectingHandles({
|
|
351
|
+
target,
|
|
352
|
+
x,
|
|
353
|
+
y
|
|
354
|
+
});
|
|
355
|
+
updateListeners();
|
|
356
|
+
if (intersectingHandles.length > 0) {
|
|
357
|
+
updateResizeHandlerStates("down", event);
|
|
358
|
+
event.preventDefault();
|
|
359
|
+
if (!isWithinResizeHandle(target)) event.stopImmediatePropagation();
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
function handlePointerMove(event) {
|
|
363
|
+
const { x, y } = getResizeEventCoordinates(event);
|
|
364
|
+
if (isPointerDown && event.buttons === 0) {
|
|
365
|
+
isPointerDown = false;
|
|
366
|
+
updateResizeHandlerStates("up", event);
|
|
367
|
+
}
|
|
368
|
+
if (!isPointerDown) {
|
|
369
|
+
const { target } = event;
|
|
370
|
+
recalculateIntersectingHandles({
|
|
371
|
+
target,
|
|
372
|
+
x,
|
|
373
|
+
y
|
|
255
374
|
});
|
|
256
375
|
}
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
for (; t;) {
|
|
270
|
-
if (t.hasAttribute(p.resizeHandle)) return !0;
|
|
271
|
-
t = t.parentElement;
|
|
376
|
+
updateResizeHandlerStates("move", event);
|
|
377
|
+
updateCursor();
|
|
378
|
+
if (intersectingHandles.length > 0) event.preventDefault();
|
|
379
|
+
}
|
|
380
|
+
function handlePointerUp(event) {
|
|
381
|
+
const { target } = event;
|
|
382
|
+
const { x, y } = getResizeEventCoordinates(event);
|
|
383
|
+
panelConstraintFlags.clear();
|
|
384
|
+
isPointerDown = false;
|
|
385
|
+
if (intersectingHandles.length > 0) {
|
|
386
|
+
event.preventDefault();
|
|
387
|
+
if (!isWithinResizeHandle(target)) event.stopImmediatePropagation();
|
|
272
388
|
}
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
389
|
+
updateResizeHandlerStates("up", event);
|
|
390
|
+
recalculateIntersectingHandles({
|
|
391
|
+
target,
|
|
392
|
+
x,
|
|
393
|
+
y
|
|
394
|
+
});
|
|
395
|
+
updateCursor();
|
|
396
|
+
updateListeners();
|
|
397
|
+
}
|
|
398
|
+
function isWithinResizeHandle(element) {
|
|
399
|
+
let currentElement = element;
|
|
400
|
+
while (currentElement) {
|
|
401
|
+
if (currentElement.hasAttribute(DATA_ATTRIBUTES.resizeHandle)) return true;
|
|
402
|
+
currentElement = currentElement.parentElement;
|
|
403
|
+
}
|
|
404
|
+
return false;
|
|
405
|
+
}
|
|
406
|
+
function recalculateIntersectingHandles({ target, x, y }) {
|
|
407
|
+
intersectingHandles.splice(0);
|
|
408
|
+
let targetElement = null;
|
|
409
|
+
if (target instanceof HTMLElement || target instanceof SVGElement) targetElement = target;
|
|
410
|
+
registeredResizeHandlers.forEach((data) => {
|
|
411
|
+
const { element: dragHandleElement, hitAreaMargins } = data;
|
|
412
|
+
const dragHandleRect = dragHandleElement.getBoundingClientRect();
|
|
413
|
+
const { bottom, left, right, top } = dragHandleRect;
|
|
414
|
+
const margin = isCoarsePointer ? hitAreaMargins.coarse : hitAreaMargins.fine;
|
|
415
|
+
if (x >= left - margin && x <= right + margin && y >= top - margin && y <= bottom + margin) {
|
|
416
|
+
if (targetElement !== null && document.contains(targetElement) && dragHandleElement !== targetElement && !dragHandleElement.contains(targetElement) && !targetElement.contains(dragHandleElement) && compare(targetElement, dragHandleElement) > 0) {
|
|
417
|
+
let currentElement = targetElement;
|
|
418
|
+
let didIntersect = false;
|
|
419
|
+
while (currentElement) {
|
|
420
|
+
if (currentElement.contains(dragHandleElement)) break;
|
|
421
|
+
else if (intersects(currentElement.getBoundingClientRect(), dragHandleRect, true)) {
|
|
422
|
+
didIntersect = true;
|
|
286
423
|
break;
|
|
287
424
|
}
|
|
288
|
-
|
|
425
|
+
currentElement = currentElement.parentElement;
|
|
289
426
|
}
|
|
290
|
-
if (
|
|
427
|
+
if (didIntersect) return;
|
|
291
428
|
}
|
|
292
|
-
|
|
429
|
+
intersectingHandles.push(data);
|
|
293
430
|
}
|
|
294
431
|
});
|
|
295
432
|
}
|
|
296
|
-
function
|
|
297
|
-
|
|
433
|
+
function reportConstraintsViolation(resizeHandleId, flag) {
|
|
434
|
+
panelConstraintFlags.set(resizeHandleId, flag);
|
|
298
435
|
}
|
|
299
|
-
function
|
|
300
|
-
let
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
436
|
+
function updateCursor() {
|
|
437
|
+
let intersectsHorizontal = false;
|
|
438
|
+
let intersectsVertical = false;
|
|
439
|
+
intersectingHandles.forEach((data) => {
|
|
440
|
+
const { direction } = data;
|
|
441
|
+
if (direction === "horizontal") intersectsHorizontal = true;
|
|
442
|
+
else intersectsVertical = true;
|
|
443
|
+
});
|
|
444
|
+
let constraintFlags = 0;
|
|
445
|
+
panelConstraintFlags.forEach((flag) => {
|
|
446
|
+
constraintFlags |= flag;
|
|
304
447
|
});
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
}
|
|
310
|
-
var
|
|
311
|
-
function
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
448
|
+
if (intersectsHorizontal && intersectsVertical) setGlobalCursorStyle("intersection", constraintFlags);
|
|
449
|
+
else if (intersectsHorizontal) setGlobalCursorStyle("horizontal", constraintFlags);
|
|
450
|
+
else if (intersectsVertical) setGlobalCursorStyle("vertical", constraintFlags);
|
|
451
|
+
else resetGlobalCursorStyle();
|
|
452
|
+
}
|
|
453
|
+
var listenersAbortController = new AbortController();
|
|
454
|
+
function updateListeners() {
|
|
455
|
+
listenersAbortController.abort();
|
|
456
|
+
listenersAbortController = new AbortController();
|
|
457
|
+
const options = {
|
|
458
|
+
capture: true,
|
|
459
|
+
signal: listenersAbortController.signal
|
|
316
460
|
};
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
461
|
+
if (!registeredResizeHandlers.size) return;
|
|
462
|
+
if (isPointerDown) {
|
|
463
|
+
if (intersectingHandles.length > 0) ownerDocumentCounts.forEach((count, ownerDocument) => {
|
|
464
|
+
const { body } = ownerDocument;
|
|
465
|
+
if (count > 0) {
|
|
466
|
+
body.addEventListener("contextmenu", handlePointerUp, options);
|
|
467
|
+
body.addEventListener("pointerleave", handlePointerMove, options);
|
|
468
|
+
body.addEventListener("pointermove", handlePointerMove, options);
|
|
469
|
+
}
|
|
470
|
+
});
|
|
471
|
+
window.addEventListener("pointerup", handlePointerUp, options);
|
|
472
|
+
window.addEventListener("pointercancel", handlePointerUp, options);
|
|
473
|
+
} else ownerDocumentCounts.forEach((count, ownerDocument) => {
|
|
474
|
+
const { body } = ownerDocument;
|
|
475
|
+
if (count > 0) {
|
|
476
|
+
body.addEventListener("pointerdown", handlePointerDown, options);
|
|
477
|
+
body.addEventListener("pointermove", handlePointerMove, options);
|
|
478
|
+
}
|
|
479
|
+
});
|
|
324
480
|
}
|
|
325
|
-
function
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
481
|
+
function updateResizeHandlerStates(action, event) {
|
|
482
|
+
registeredResizeHandlers.forEach((data) => {
|
|
483
|
+
const { setResizeHandlerState } = data;
|
|
484
|
+
setResizeHandlerState(action, intersectingHandles.includes(data), event);
|
|
329
485
|
});
|
|
330
486
|
}
|
|
331
|
-
function
|
|
332
|
-
|
|
333
|
-
return
|
|
487
|
+
function useForceUpdate() {
|
|
488
|
+
const [_, setCount] = useState(0);
|
|
489
|
+
return useCallback(() => setCount((prevCount) => prevCount + 1), []);
|
|
334
490
|
}
|
|
335
|
-
function
|
|
336
|
-
if (!
|
|
491
|
+
function assert(expectedCondition, message) {
|
|
492
|
+
if (!expectedCondition) {
|
|
493
|
+
console.error(message);
|
|
494
|
+
throw Error(message);
|
|
495
|
+
}
|
|
337
496
|
}
|
|
338
|
-
function
|
|
339
|
-
|
|
497
|
+
function fuzzyCompareNumbers(actual, expected, fractionDigits = PRECISION) {
|
|
498
|
+
if (actual.toFixed(fractionDigits) === expected.toFixed(fractionDigits)) return 0;
|
|
499
|
+
else return actual > expected ? 1 : -1;
|
|
340
500
|
}
|
|
341
|
-
function
|
|
342
|
-
return
|
|
501
|
+
function fuzzyNumbersEqual$1(actual, expected, fractionDigits = PRECISION) {
|
|
502
|
+
return fuzzyCompareNumbers(actual, expected, fractionDigits) === 0;
|
|
343
503
|
}
|
|
344
|
-
function
|
|
345
|
-
return
|
|
504
|
+
function fuzzyNumbersEqual(actual, expected, fractionDigits) {
|
|
505
|
+
return fuzzyCompareNumbers(actual, expected, fractionDigits) === 0;
|
|
346
506
|
}
|
|
347
|
-
function
|
|
348
|
-
if (
|
|
349
|
-
for (let
|
|
350
|
-
|
|
351
|
-
|
|
507
|
+
function fuzzyLayoutsEqual(actual, expected, fractionDigits) {
|
|
508
|
+
if (actual.length !== expected.length) return false;
|
|
509
|
+
for (let index = 0; index < actual.length; index++) {
|
|
510
|
+
const actualSize = actual[index];
|
|
511
|
+
const expectedSize = expected[index];
|
|
512
|
+
if (!fuzzyNumbersEqual(actualSize, expectedSize, fractionDigits)) return false;
|
|
352
513
|
}
|
|
353
|
-
return
|
|
354
|
-
}
|
|
355
|
-
function
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
let { collapsedSize
|
|
359
|
-
if (
|
|
360
|
-
if (
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
514
|
+
return true;
|
|
515
|
+
}
|
|
516
|
+
function resizePanel({ panelConstraints: panelConstraintsArray, panelIndex, size }) {
|
|
517
|
+
const panelConstraints = panelConstraintsArray[panelIndex];
|
|
518
|
+
assert(panelConstraints != null, `Panel constraints not found for index ${panelIndex}`);
|
|
519
|
+
let { collapsedSize = 0, collapsible, maxSize = 100, minSize = 0 } = panelConstraints;
|
|
520
|
+
if (fuzzyCompareNumbers(size, minSize) < 0) {
|
|
521
|
+
if (collapsible) {
|
|
522
|
+
const halfwayPoint = (collapsedSize + minSize) / 2;
|
|
523
|
+
if (fuzzyCompareNumbers(size, halfwayPoint) < 0) size = collapsedSize;
|
|
524
|
+
else size = minSize;
|
|
525
|
+
} else size = minSize;
|
|
364
526
|
}
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
527
|
+
size = Math.min(maxSize, size);
|
|
528
|
+
size = parseFloat(size.toFixed(PRECISION));
|
|
529
|
+
return size;
|
|
530
|
+
}
|
|
531
|
+
function adjustLayoutByDelta({ delta, initialLayout, panelConstraints: panelConstraintsArray, pivotIndices, prevLayout, trigger }) {
|
|
532
|
+
if (fuzzyNumbersEqual(delta, 0)) return initialLayout;
|
|
533
|
+
const nextLayout = [...initialLayout];
|
|
534
|
+
const [firstPivotIndex, secondPivotIndex] = pivotIndices;
|
|
535
|
+
assert(firstPivotIndex != null, "Invalid first pivot index");
|
|
536
|
+
assert(secondPivotIndex != null, "Invalid second pivot index");
|
|
537
|
+
let deltaApplied = 0;
|
|
538
|
+
if (trigger === "keyboard") {
|
|
373
539
|
{
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
540
|
+
const index = delta < 0 ? secondPivotIndex : firstPivotIndex;
|
|
541
|
+
const panelConstraints = panelConstraintsArray[index];
|
|
542
|
+
assert(panelConstraints, `Panel constraints not found for index ${index}`);
|
|
543
|
+
const { collapsedSize = 0, collapsible, minSize = 0 } = panelConstraints;
|
|
544
|
+
if (collapsible) {
|
|
545
|
+
const prevSize = initialLayout[index];
|
|
546
|
+
assert(prevSize != null, `Previous layout not found for panel index ${index}`);
|
|
547
|
+
if (fuzzyNumbersEqual(prevSize, collapsedSize)) {
|
|
548
|
+
const localDelta = minSize - prevSize;
|
|
549
|
+
if (fuzzyCompareNumbers(localDelta, Math.abs(delta)) > 0) delta = delta < 0 ? 0 - localDelta : localDelta;
|
|
382
550
|
}
|
|
383
551
|
}
|
|
384
552
|
}
|
|
385
553
|
{
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
554
|
+
const index = delta < 0 ? firstPivotIndex : secondPivotIndex;
|
|
555
|
+
const panelConstraints = panelConstraintsArray[index];
|
|
556
|
+
assert(panelConstraints, `No panel constraints found for index ${index}`);
|
|
557
|
+
const { collapsedSize = 0, collapsible, minSize = 0 } = panelConstraints;
|
|
558
|
+
if (collapsible) {
|
|
559
|
+
const prevSize = initialLayout[index];
|
|
560
|
+
assert(prevSize != null, `Previous layout not found for panel index ${index}`);
|
|
561
|
+
if (fuzzyNumbersEqual(prevSize, minSize)) {
|
|
562
|
+
const localDelta = prevSize - collapsedSize;
|
|
563
|
+
if (fuzzyCompareNumbers(localDelta, Math.abs(delta)) > 0) delta = delta < 0 ? 0 - localDelta : localDelta;
|
|
394
564
|
}
|
|
395
565
|
}
|
|
396
566
|
}
|
|
397
567
|
}
|
|
398
568
|
{
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
569
|
+
const increment = delta < 0 ? 1 : -1;
|
|
570
|
+
let index = delta < 0 ? secondPivotIndex : firstPivotIndex;
|
|
571
|
+
let maxAvailableDelta = 0;
|
|
572
|
+
while (true) {
|
|
573
|
+
const prevSize = initialLayout[index];
|
|
574
|
+
assert(prevSize != null, `Previous layout not found for panel index ${index}`);
|
|
575
|
+
const delta = resizePanel({
|
|
576
|
+
panelConstraints: panelConstraintsArray,
|
|
577
|
+
panelIndex: index,
|
|
406
578
|
size: 100
|
|
407
|
-
}) -
|
|
408
|
-
|
|
579
|
+
}) - prevSize;
|
|
580
|
+
maxAvailableDelta += delta;
|
|
581
|
+
index += increment;
|
|
582
|
+
if (index < 0 || index >= panelConstraintsArray.length) break;
|
|
409
583
|
}
|
|
410
|
-
|
|
411
|
-
|
|
584
|
+
const minAbsDelta = Math.min(Math.abs(delta), Math.abs(maxAvailableDelta));
|
|
585
|
+
delta = delta < 0 ? 0 - minAbsDelta : minAbsDelta;
|
|
412
586
|
}
|
|
413
587
|
{
|
|
414
|
-
let
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
588
|
+
let index = delta < 0 ? firstPivotIndex : secondPivotIndex;
|
|
589
|
+
while (index >= 0 && index < panelConstraintsArray.length) {
|
|
590
|
+
const deltaRemaining = Math.abs(delta) - Math.abs(deltaApplied);
|
|
591
|
+
const prevSize = initialLayout[index];
|
|
592
|
+
assert(prevSize != null, `Previous layout not found for panel index ${index}`);
|
|
593
|
+
const unsafeSize = prevSize - deltaRemaining;
|
|
594
|
+
const safeSize = resizePanel({
|
|
595
|
+
panelConstraints: panelConstraintsArray,
|
|
596
|
+
panelIndex: index,
|
|
597
|
+
size: unsafeSize
|
|
422
598
|
});
|
|
423
|
-
if (!
|
|
424
|
-
|
|
599
|
+
if (!fuzzyNumbersEqual(prevSize, safeSize)) {
|
|
600
|
+
deltaApplied += prevSize - safeSize;
|
|
601
|
+
nextLayout[index] = safeSize;
|
|
602
|
+
if (deltaApplied.toPrecision(3).localeCompare(Math.abs(delta).toPrecision(3), void 0, { numeric: true }) >= 0) break;
|
|
603
|
+
}
|
|
604
|
+
if (delta < 0) index--;
|
|
605
|
+
else index++;
|
|
425
606
|
}
|
|
426
607
|
}
|
|
427
|
-
if (
|
|
608
|
+
if (fuzzyLayoutsEqual(prevLayout, nextLayout)) return prevLayout;
|
|
428
609
|
{
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
610
|
+
const pivotIndex = delta < 0 ? secondPivotIndex : firstPivotIndex;
|
|
611
|
+
const prevSize = initialLayout[pivotIndex];
|
|
612
|
+
assert(prevSize != null, `Previous layout not found for panel index ${pivotIndex}`);
|
|
613
|
+
const unsafeSize = prevSize + deltaApplied;
|
|
614
|
+
const safeSize = resizePanel({
|
|
615
|
+
panelConstraints: panelConstraintsArray,
|
|
616
|
+
panelIndex: pivotIndex,
|
|
617
|
+
size: unsafeSize
|
|
435
618
|
});
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
619
|
+
nextLayout[pivotIndex] = safeSize;
|
|
620
|
+
if (!fuzzyNumbersEqual(safeSize, unsafeSize)) {
|
|
621
|
+
let deltaRemaining = unsafeSize - safeSize;
|
|
622
|
+
let index = delta < 0 ? secondPivotIndex : firstPivotIndex;
|
|
623
|
+
while (index >= 0 && index < panelConstraintsArray.length) {
|
|
624
|
+
const prevSize = nextLayout[index];
|
|
625
|
+
assert(prevSize != null, `Previous layout not found for panel index ${index}`);
|
|
626
|
+
const unsafeSize = prevSize + deltaRemaining;
|
|
627
|
+
const safeSize = resizePanel({
|
|
628
|
+
panelConstraints: panelConstraintsArray,
|
|
629
|
+
panelIndex: index,
|
|
630
|
+
size: unsafeSize
|
|
445
631
|
});
|
|
446
|
-
if (
|
|
447
|
-
|
|
632
|
+
if (!fuzzyNumbersEqual(prevSize, safeSize)) {
|
|
633
|
+
deltaRemaining -= safeSize - prevSize;
|
|
634
|
+
nextLayout[index] = safeSize;
|
|
635
|
+
}
|
|
636
|
+
if (fuzzyNumbersEqual(deltaRemaining, 0)) break;
|
|
637
|
+
if (delta > 0) index--;
|
|
638
|
+
else index++;
|
|
448
639
|
}
|
|
449
640
|
}
|
|
450
641
|
}
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
642
|
+
if (!fuzzyNumbersEqual(nextLayout.reduce((total, size) => size + total, 0), 100)) return prevLayout;
|
|
643
|
+
return nextLayout;
|
|
644
|
+
}
|
|
645
|
+
function calculateAriaValues({ layout, panelsArray, pivotIndices }) {
|
|
646
|
+
let currentMinSize = 0;
|
|
647
|
+
let currentMaxSize = 100;
|
|
648
|
+
let totalMinSize = 0;
|
|
649
|
+
let totalMaxSize = 0;
|
|
650
|
+
const firstIndex = pivotIndices[0];
|
|
651
|
+
assert(firstIndex != null, "No pivot index found");
|
|
652
|
+
panelsArray.forEach((panelData, index) => {
|
|
653
|
+
const { constraints } = panelData;
|
|
654
|
+
const { maxSize = 100, minSize = 0 } = constraints;
|
|
655
|
+
if (index === firstIndex) {
|
|
656
|
+
currentMinSize = minSize;
|
|
657
|
+
currentMaxSize = maxSize;
|
|
658
|
+
} else {
|
|
659
|
+
totalMinSize += minSize;
|
|
660
|
+
totalMaxSize += maxSize;
|
|
661
|
+
}
|
|
662
|
+
});
|
|
663
|
+
return {
|
|
664
|
+
valueMax: Math.min(currentMaxSize, 100 - totalMinSize),
|
|
665
|
+
valueMin: Math.max(currentMinSize, 100 - totalMaxSize),
|
|
666
|
+
valueNow: layout[firstIndex]
|
|
462
667
|
};
|
|
463
668
|
}
|
|
464
|
-
function
|
|
465
|
-
return Array.from(
|
|
466
|
-
}
|
|
467
|
-
function
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
}
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
669
|
+
function getResizeHandleElementsForGroup(groupId, scope = document) {
|
|
670
|
+
return Array.from(scope.querySelectorAll(`[${DATA_ATTRIBUTES.resizeHandleId}][data-panel-group-id="${groupId}"]`));
|
|
671
|
+
}
|
|
672
|
+
function getResizeHandleElementIndex(groupId, id, scope = document) {
|
|
673
|
+
const index = getResizeHandleElementsForGroup(groupId, scope).findIndex((handle) => handle.getAttribute(DATA_ATTRIBUTES.resizeHandleId) === id);
|
|
674
|
+
return index !== null && index !== void 0 ? index : null;
|
|
675
|
+
}
|
|
676
|
+
function determinePivotIndices(groupId, dragHandleId, panelGroupElement) {
|
|
677
|
+
const index = getResizeHandleElementIndex(groupId, dragHandleId, panelGroupElement);
|
|
678
|
+
return index != null ? [index, index + 1] : [-1, -1];
|
|
679
|
+
}
|
|
680
|
+
function getPanelGroupElement(id, rootElement = document) {
|
|
681
|
+
var _dataset;
|
|
682
|
+
if (rootElement instanceof HTMLElement && (rootElement === null || rootElement === void 0 ? void 0 : (_dataset = rootElement.dataset) === null || _dataset === void 0 ? void 0 : _dataset.panelGroupId) == id) return rootElement;
|
|
683
|
+
const element = rootElement.querySelector(`[data-panel-group][data-panel-group-id="${id}"]`);
|
|
684
|
+
if (element) return element;
|
|
685
|
+
return null;
|
|
686
|
+
}
|
|
687
|
+
function getResizeHandleElement(id, scope = document) {
|
|
688
|
+
const element = scope.querySelector(`[${DATA_ATTRIBUTES.resizeHandleId}="${id}"]`);
|
|
689
|
+
if (element) return element;
|
|
690
|
+
return null;
|
|
691
|
+
}
|
|
692
|
+
function getResizeHandlePanelIds(groupId, handleId, panelsArray, scope = document) {
|
|
693
|
+
var _panelsArray$index$id, _panelsArray$index, _panelsArray$id, _panelsArray;
|
|
694
|
+
const handle = getResizeHandleElement(handleId, scope);
|
|
695
|
+
const handles = getResizeHandleElementsForGroup(groupId, scope);
|
|
696
|
+
const index = handle ? handles.indexOf(handle) : -1;
|
|
697
|
+
return [(_panelsArray$index$id = (_panelsArray$index = panelsArray[index]) === null || _panelsArray$index === void 0 ? void 0 : _panelsArray$index.id) !== null && _panelsArray$index$id !== void 0 ? _panelsArray$index$id : null, (_panelsArray$id = (_panelsArray = panelsArray[index + 1]) === null || _panelsArray === void 0 ? void 0 : _panelsArray.id) !== null && _panelsArray$id !== void 0 ? _panelsArray$id : null];
|
|
698
|
+
}
|
|
699
|
+
function useWindowSplitterPanelGroupBehavior({ committedValuesRef, eagerValuesRef, groupId, layout, panelDataArray, panelGroupElement, setLayout }) {
|
|
700
|
+
useRef({ didWarnAboutMissingResizeHandle: false });
|
|
701
|
+
useIsomorphicLayoutEffect(() => {
|
|
702
|
+
if (!panelGroupElement) return;
|
|
703
|
+
const resizeHandleElements = getResizeHandleElementsForGroup(groupId, panelGroupElement);
|
|
704
|
+
for (let index = 0; index < panelDataArray.length - 1; index++) {
|
|
705
|
+
const { valueMax, valueMin, valueNow } = calculateAriaValues({
|
|
706
|
+
layout,
|
|
707
|
+
panelsArray: panelDataArray,
|
|
708
|
+
pivotIndices: [index, index + 1]
|
|
709
|
+
});
|
|
710
|
+
const resizeHandleElement = resizeHandleElements[index];
|
|
711
|
+
if (resizeHandleElement == null);
|
|
712
|
+
else {
|
|
713
|
+
const panelData = panelDataArray[index];
|
|
714
|
+
assert(panelData, `No panel data found for index "${index}"`);
|
|
715
|
+
resizeHandleElement.setAttribute("aria-controls", panelData.id);
|
|
716
|
+
resizeHandleElement.setAttribute("aria-valuemax", "" + Math.round(valueMax));
|
|
717
|
+
resizeHandleElement.setAttribute("aria-valuemin", "" + Math.round(valueMin));
|
|
718
|
+
resizeHandleElement.setAttribute("aria-valuenow", valueNow != null ? "" + Math.round(valueNow) : "");
|
|
497
719
|
}
|
|
498
720
|
}
|
|
499
721
|
return () => {
|
|
500
|
-
|
|
501
|
-
|
|
722
|
+
resizeHandleElements.forEach((resizeHandleElement, index) => {
|
|
723
|
+
resizeHandleElement.removeAttribute("aria-controls");
|
|
724
|
+
resizeHandleElement.removeAttribute("aria-valuemax");
|
|
725
|
+
resizeHandleElement.removeAttribute("aria-valuemin");
|
|
726
|
+
resizeHandleElement.removeAttribute("aria-valuenow");
|
|
502
727
|
});
|
|
503
728
|
};
|
|
504
729
|
}, [
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
])
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
730
|
+
groupId,
|
|
731
|
+
layout,
|
|
732
|
+
panelDataArray,
|
|
733
|
+
panelGroupElement
|
|
734
|
+
]);
|
|
735
|
+
useEffect(() => {
|
|
736
|
+
if (!panelGroupElement) return;
|
|
737
|
+
const eagerValues = eagerValuesRef.current;
|
|
738
|
+
assert(eagerValues, `Eager values not found`);
|
|
739
|
+
const { panelDataArray } = eagerValues;
|
|
740
|
+
assert(getPanelGroupElement(groupId, panelGroupElement) != null, `No group found for id "${groupId}"`);
|
|
741
|
+
const handles = getResizeHandleElementsForGroup(groupId, panelGroupElement);
|
|
742
|
+
assert(handles, `No resize handles found for group id "${groupId}"`);
|
|
743
|
+
const cleanupFunctions = handles.map((handle) => {
|
|
744
|
+
const handleId = handle.getAttribute(DATA_ATTRIBUTES.resizeHandleId);
|
|
745
|
+
assert(handleId, `Resize handle element has no handle id attribute`);
|
|
746
|
+
const [idBefore, idAfter] = getResizeHandlePanelIds(groupId, handleId, panelDataArray, panelGroupElement);
|
|
747
|
+
if (idBefore == null || idAfter == null) return () => {};
|
|
748
|
+
const onKeyDown = (event) => {
|
|
749
|
+
if (event.defaultPrevented) return;
|
|
750
|
+
switch (event.key) {
|
|
524
751
|
case "Enter": {
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
if (
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
752
|
+
event.preventDefault();
|
|
753
|
+
const index = panelDataArray.findIndex((panelData) => panelData.id === idBefore);
|
|
754
|
+
if (index >= 0) {
|
|
755
|
+
const panelData = panelDataArray[index];
|
|
756
|
+
assert(panelData, `No panel data found for index ${index}`);
|
|
757
|
+
const size = layout[index];
|
|
758
|
+
const { collapsedSize = 0, collapsible, minSize = 0 } = panelData.constraints;
|
|
759
|
+
if (size != null && collapsible) {
|
|
760
|
+
const nextLayout = adjustLayoutByDelta({
|
|
761
|
+
delta: fuzzyNumbersEqual(size, collapsedSize) ? minSize - collapsedSize : collapsedSize - size,
|
|
762
|
+
initialLayout: layout,
|
|
763
|
+
panelConstraints: panelDataArray.map((panelData) => panelData.constraints),
|
|
764
|
+
pivotIndices: determinePivotIndices(groupId, handleId, panelGroupElement),
|
|
765
|
+
prevLayout: layout,
|
|
538
766
|
trigger: "keyboard"
|
|
539
767
|
});
|
|
540
|
-
|
|
768
|
+
if (layout !== nextLayout) setLayout(nextLayout);
|
|
541
769
|
}
|
|
542
770
|
}
|
|
543
771
|
break;
|
|
544
772
|
}
|
|
545
773
|
}
|
|
546
774
|
};
|
|
547
|
-
|
|
548
|
-
|
|
775
|
+
handle.addEventListener("keydown", onKeyDown);
|
|
776
|
+
return () => {
|
|
777
|
+
handle.removeEventListener("keydown", onKeyDown);
|
|
549
778
|
};
|
|
550
779
|
});
|
|
551
780
|
return () => {
|
|
552
|
-
|
|
781
|
+
cleanupFunctions.forEach((cleanupFunction) => cleanupFunction());
|
|
553
782
|
};
|
|
554
783
|
}, [
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
784
|
+
panelGroupElement,
|
|
785
|
+
committedValuesRef,
|
|
786
|
+
eagerValuesRef,
|
|
787
|
+
groupId,
|
|
788
|
+
layout,
|
|
789
|
+
panelDataArray,
|
|
790
|
+
setLayout
|
|
562
791
|
]);
|
|
563
792
|
}
|
|
564
|
-
function
|
|
565
|
-
if (
|
|
566
|
-
for (let
|
|
567
|
-
return
|
|
568
|
-
}
|
|
569
|
-
function
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
let
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
793
|
+
function areEqual(arrayA, arrayB) {
|
|
794
|
+
if (arrayA.length !== arrayB.length) return false;
|
|
795
|
+
for (let index = 0; index < arrayA.length; index++) if (arrayA[index] !== arrayB[index]) return false;
|
|
796
|
+
return true;
|
|
797
|
+
}
|
|
798
|
+
function getResizeEventCursorPosition(direction, event) {
|
|
799
|
+
const isHorizontal = direction === "horizontal";
|
|
800
|
+
const { x, y } = getResizeEventCoordinates(event);
|
|
801
|
+
return isHorizontal ? x : y;
|
|
802
|
+
}
|
|
803
|
+
function calculateDragOffsetPercentage(event, dragHandleId, direction, initialDragState, panelGroupElement) {
|
|
804
|
+
const isHorizontal = direction === "horizontal";
|
|
805
|
+
const handleElement = getResizeHandleElement(dragHandleId, panelGroupElement);
|
|
806
|
+
assert(handleElement, `No resize handle element found for id "${dragHandleId}"`);
|
|
807
|
+
const groupId = handleElement.getAttribute(DATA_ATTRIBUTES.groupId);
|
|
808
|
+
assert(groupId, `Resize handle element has no group id attribute`);
|
|
809
|
+
let { initialCursorPosition } = initialDragState;
|
|
810
|
+
const cursorPosition = getResizeEventCursorPosition(direction, event);
|
|
811
|
+
const groupElement = getPanelGroupElement(groupId, panelGroupElement);
|
|
812
|
+
assert(groupElement, `No group element found for id "${groupId}"`);
|
|
813
|
+
const groupRect = groupElement.getBoundingClientRect();
|
|
814
|
+
const groupSizeInPixels = isHorizontal ? groupRect.width : groupRect.height;
|
|
815
|
+
return (cursorPosition - initialCursorPosition) / groupSizeInPixels * 100;
|
|
816
|
+
}
|
|
817
|
+
function calculateDeltaPercentage(event, dragHandleId, direction, initialDragState, keyboardResizeBy, panelGroupElement) {
|
|
818
|
+
if (isKeyDown(event)) {
|
|
819
|
+
const isHorizontal = direction === "horizontal";
|
|
820
|
+
let delta = 0;
|
|
821
|
+
if (event.shiftKey) delta = 100;
|
|
822
|
+
else if (keyboardResizeBy != null) delta = keyboardResizeBy;
|
|
823
|
+
else delta = 10;
|
|
824
|
+
let movement = 0;
|
|
825
|
+
switch (event.key) {
|
|
589
826
|
case "ArrowDown":
|
|
590
|
-
|
|
827
|
+
movement = isHorizontal ? 0 : delta;
|
|
591
828
|
break;
|
|
592
829
|
case "ArrowLeft":
|
|
593
|
-
|
|
830
|
+
movement = isHorizontal ? -delta : 0;
|
|
594
831
|
break;
|
|
595
832
|
case "ArrowRight":
|
|
596
|
-
|
|
833
|
+
movement = isHorizontal ? delta : 0;
|
|
597
834
|
break;
|
|
598
835
|
case "ArrowUp":
|
|
599
|
-
|
|
836
|
+
movement = isHorizontal ? 0 : -delta;
|
|
600
837
|
break;
|
|
601
838
|
case "End":
|
|
602
|
-
|
|
839
|
+
movement = 100;
|
|
603
840
|
break;
|
|
604
|
-
case "Home":
|
|
841
|
+
case "Home": movement = -100;
|
|
605
842
|
}
|
|
606
|
-
return
|
|
843
|
+
return movement;
|
|
844
|
+
} else {
|
|
845
|
+
if (initialDragState == null) return 0;
|
|
846
|
+
return calculateDragOffsetPercentage(event, dragHandleId, direction, initialDragState, panelGroupElement);
|
|
607
847
|
}
|
|
608
|
-
|
|
609
|
-
}
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
848
|
+
}
|
|
849
|
+
function calculateUnsafeDefaultLayout({ panelDataArray }) {
|
|
850
|
+
const layout = Array(panelDataArray.length);
|
|
851
|
+
const panelConstraintsArray = panelDataArray.map((panelData) => panelData.constraints);
|
|
852
|
+
let numPanelsWithSizes = 0;
|
|
853
|
+
let remainingSize = 100;
|
|
854
|
+
for (let index = 0; index < panelDataArray.length; index++) {
|
|
855
|
+
const panelConstraints = panelConstraintsArray[index];
|
|
856
|
+
assert(panelConstraints, `Panel constraints not found for index ${index}`);
|
|
857
|
+
const { defaultSize } = panelConstraints;
|
|
858
|
+
if (defaultSize != null) {
|
|
859
|
+
numPanelsWithSizes++;
|
|
860
|
+
layout[index] = defaultSize;
|
|
861
|
+
remainingSize -= defaultSize;
|
|
862
|
+
}
|
|
617
863
|
}
|
|
618
|
-
for (let
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
if (
|
|
623
|
-
|
|
624
|
-
|
|
864
|
+
for (let index = 0; index < panelDataArray.length; index++) {
|
|
865
|
+
const panelConstraints = panelConstraintsArray[index];
|
|
866
|
+
assert(panelConstraints, `Panel constraints not found for index ${index}`);
|
|
867
|
+
const { defaultSize } = panelConstraints;
|
|
868
|
+
if (defaultSize != null) continue;
|
|
869
|
+
const numRemainingPanels = panelDataArray.length - numPanelsWithSizes;
|
|
870
|
+
const size = remainingSize / numRemainingPanels;
|
|
871
|
+
numPanelsWithSizes++;
|
|
872
|
+
layout[index] = size;
|
|
873
|
+
remainingSize -= size;
|
|
625
874
|
}
|
|
626
|
-
return
|
|
627
|
-
}
|
|
628
|
-
function
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
875
|
+
return layout;
|
|
876
|
+
}
|
|
877
|
+
function callPanelCallbacks(panelsArray, layout, panelIdToLastNotifiedSizeMap) {
|
|
878
|
+
layout.forEach((size, index) => {
|
|
879
|
+
const panelData = panelsArray[index];
|
|
880
|
+
assert(panelData, `Panel data not found for index ${index}`);
|
|
881
|
+
const { callbacks, constraints, id: panelId } = panelData;
|
|
882
|
+
const { collapsedSize = 0, collapsible } = constraints;
|
|
883
|
+
const lastNotifiedSize = panelIdToLastNotifiedSizeMap[panelId];
|
|
884
|
+
if (lastNotifiedSize == null || size !== lastNotifiedSize) {
|
|
885
|
+
panelIdToLastNotifiedSizeMap[panelId] = size;
|
|
886
|
+
const { onCollapse, onExpand, onResize } = callbacks;
|
|
887
|
+
if (onResize) onResize(size, lastNotifiedSize);
|
|
888
|
+
if (collapsible && (onCollapse || onExpand)) {
|
|
889
|
+
if (onExpand && (lastNotifiedSize == null || fuzzyNumbersEqual$1(lastNotifiedSize, collapsedSize)) && !fuzzyNumbersEqual$1(size, collapsedSize)) onExpand();
|
|
890
|
+
if (onCollapse && (lastNotifiedSize == null || !fuzzyNumbersEqual$1(lastNotifiedSize, collapsedSize)) && fuzzyNumbersEqual$1(size, collapsedSize)) onCollapse();
|
|
891
|
+
}
|
|
637
892
|
}
|
|
638
893
|
});
|
|
639
894
|
}
|
|
640
|
-
function
|
|
641
|
-
if (
|
|
642
|
-
for (let
|
|
643
|
-
return
|
|
644
|
-
}
|
|
645
|
-
function
|
|
646
|
-
|
|
647
|
-
|
|
895
|
+
function compareLayouts(a, b) {
|
|
896
|
+
if (a.length !== b.length) return false;
|
|
897
|
+
else for (let index = 0; index < a.length; index++) if (a[index] != b[index]) return false;
|
|
898
|
+
return true;
|
|
899
|
+
}
|
|
900
|
+
function computePanelFlexBoxStyle({ defaultSize, dragState, layout, panelData, panelIndex, precision = 3 }) {
|
|
901
|
+
const size = layout[panelIndex];
|
|
902
|
+
let flexGrow;
|
|
903
|
+
if (size == null) flexGrow = defaultSize != void 0 ? defaultSize.toPrecision(precision) : "1";
|
|
904
|
+
else if (panelData.length === 1) flexGrow = "1";
|
|
905
|
+
else flexGrow = size.toPrecision(precision);
|
|
906
|
+
return {
|
|
648
907
|
flexBasis: 0,
|
|
649
|
-
flexGrow
|
|
908
|
+
flexGrow,
|
|
650
909
|
flexShrink: 1,
|
|
651
910
|
overflow: "hidden",
|
|
652
|
-
pointerEvents:
|
|
911
|
+
pointerEvents: dragState !== null ? "none" : void 0
|
|
653
912
|
};
|
|
654
913
|
}
|
|
655
|
-
function
|
|
656
|
-
let
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
914
|
+
function debounce(callback, durationMs = 10) {
|
|
915
|
+
let timeoutId = null;
|
|
916
|
+
let callable = (...args) => {
|
|
917
|
+
if (timeoutId !== null) clearTimeout(timeoutId);
|
|
918
|
+
timeoutId = setTimeout(() => {
|
|
919
|
+
callback(...args);
|
|
920
|
+
}, durationMs);
|
|
661
921
|
};
|
|
922
|
+
return callable;
|
|
662
923
|
}
|
|
663
|
-
function
|
|
924
|
+
function initializeDefaultStorage(storageObject) {
|
|
664
925
|
try {
|
|
665
|
-
if (typeof localStorage
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
926
|
+
if (typeof localStorage !== "undefined") {
|
|
927
|
+
storageObject.getItem = (name) => {
|
|
928
|
+
return localStorage.getItem(name);
|
|
929
|
+
};
|
|
930
|
+
storageObject.setItem = (name, value) => {
|
|
931
|
+
localStorage.setItem(name, value);
|
|
932
|
+
};
|
|
933
|
+
} else throw new Error("localStorage not supported in this environment");
|
|
934
|
+
} catch (error) {
|
|
935
|
+
console.error(error);
|
|
936
|
+
storageObject.getItem = () => null;
|
|
937
|
+
storageObject.setItem = () => {};
|
|
671
938
|
}
|
|
672
939
|
}
|
|
673
|
-
function
|
|
674
|
-
return `react-resizable-panels:${
|
|
940
|
+
function getPanelGroupKey(autoSaveId) {
|
|
941
|
+
return `react-resizable-panels:${autoSaveId}`;
|
|
675
942
|
}
|
|
676
|
-
function
|
|
677
|
-
return
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
943
|
+
function getPanelKey(panels) {
|
|
944
|
+
return panels.map((panel) => {
|
|
945
|
+
const { constraints, id, idIsFromProps, order } = panel;
|
|
946
|
+
if (idIsFromProps) return id;
|
|
947
|
+
else return order ? `${order}:${JSON.stringify(constraints)}` : JSON.stringify(constraints);
|
|
948
|
+
}).sort((a, b) => a.localeCompare(b)).join(",");
|
|
681
949
|
}
|
|
682
|
-
function
|
|
950
|
+
function loadSerializedPanelGroupState(autoSaveId, storage) {
|
|
683
951
|
try {
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
952
|
+
const panelGroupKey = getPanelGroupKey(autoSaveId);
|
|
953
|
+
const serialized = storage.getItem(panelGroupKey);
|
|
954
|
+
if (serialized) {
|
|
955
|
+
const parsed = JSON.parse(serialized);
|
|
956
|
+
if (typeof parsed === "object" && parsed != null) return parsed;
|
|
688
957
|
}
|
|
689
|
-
} catch {}
|
|
958
|
+
} catch (error) {}
|
|
690
959
|
return null;
|
|
691
960
|
}
|
|
692
|
-
function
|
|
693
|
-
|
|
694
|
-
}
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
961
|
+
function loadPanelGroupState(autoSaveId, panels, storage) {
|
|
962
|
+
var _loadSerializedPanelG, _state$panelKey;
|
|
963
|
+
return (_state$panelKey = ((_loadSerializedPanelG = loadSerializedPanelGroupState(autoSaveId, storage)) !== null && _loadSerializedPanelG !== void 0 ? _loadSerializedPanelG : {})[getPanelKey(panels)]) !== null && _state$panelKey !== void 0 ? _state$panelKey : null;
|
|
964
|
+
}
|
|
965
|
+
function savePanelGroupState(autoSaveId, panels, panelSizesBeforeCollapse, sizes, storage) {
|
|
966
|
+
var _loadSerializedPanelG2;
|
|
967
|
+
const panelGroupKey = getPanelGroupKey(autoSaveId);
|
|
968
|
+
const panelKey = getPanelKey(panels);
|
|
969
|
+
const state = (_loadSerializedPanelG2 = loadSerializedPanelGroupState(autoSaveId, storage)) !== null && _loadSerializedPanelG2 !== void 0 ? _loadSerializedPanelG2 : {};
|
|
970
|
+
state[panelKey] = {
|
|
971
|
+
expandToSizes: Object.fromEntries(panelSizesBeforeCollapse.entries()),
|
|
972
|
+
layout: sizes
|
|
700
973
|
};
|
|
701
974
|
try {
|
|
702
|
-
|
|
703
|
-
} catch (
|
|
704
|
-
console.error(
|
|
975
|
+
storage.setItem(panelGroupKey, JSON.stringify(state));
|
|
976
|
+
} catch (error) {
|
|
977
|
+
console.error(error);
|
|
705
978
|
}
|
|
706
979
|
}
|
|
707
|
-
function
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
if (
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
980
|
+
function validatePanelGroupLayout({ layout: prevLayout, panelConstraints }) {
|
|
981
|
+
const nextLayout = [...prevLayout];
|
|
982
|
+
const nextLayoutTotalSize = nextLayout.reduce((accumulated, current) => accumulated + current, 0);
|
|
983
|
+
if (nextLayout.length !== panelConstraints.length) throw Error(`Invalid ${panelConstraints.length} panel layout: ${nextLayout.map((size) => `${size}%`).join(", ")}`);
|
|
984
|
+
else if (!fuzzyNumbersEqual(nextLayoutTotalSize, 100) && nextLayout.length > 0) for (let index = 0; index < panelConstraints.length; index++) {
|
|
985
|
+
const unsafeSize = nextLayout[index];
|
|
986
|
+
assert(unsafeSize != null, `No layout data found for index ${index}`);
|
|
987
|
+
const safeSize = 100 / nextLayoutTotalSize * unsafeSize;
|
|
988
|
+
nextLayout[index] = safeSize;
|
|
715
989
|
}
|
|
716
|
-
let
|
|
717
|
-
for (let
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
panelConstraints
|
|
722
|
-
panelIndex:
|
|
723
|
-
size:
|
|
990
|
+
let remainingSize = 0;
|
|
991
|
+
for (let index = 0; index < panelConstraints.length; index++) {
|
|
992
|
+
const unsafeSize = nextLayout[index];
|
|
993
|
+
assert(unsafeSize != null, `No layout data found for index ${index}`);
|
|
994
|
+
const safeSize = resizePanel({
|
|
995
|
+
panelConstraints,
|
|
996
|
+
panelIndex: index,
|
|
997
|
+
size: unsafeSize
|
|
724
998
|
});
|
|
725
|
-
|
|
999
|
+
if (unsafeSize != safeSize) {
|
|
1000
|
+
remainingSize += unsafeSize - safeSize;
|
|
1001
|
+
nextLayout[index] = safeSize;
|
|
1002
|
+
}
|
|
726
1003
|
}
|
|
727
|
-
if (!
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
1004
|
+
if (!fuzzyNumbersEqual(remainingSize, 0)) for (let index = 0; index < panelConstraints.length; index++) {
|
|
1005
|
+
const prevSize = nextLayout[index];
|
|
1006
|
+
assert(prevSize != null, `No layout data found for index ${index}`);
|
|
1007
|
+
const unsafeSize = prevSize + remainingSize;
|
|
1008
|
+
const safeSize = resizePanel({
|
|
1009
|
+
panelConstraints,
|
|
1010
|
+
panelIndex: index,
|
|
1011
|
+
size: unsafeSize
|
|
734
1012
|
});
|
|
735
|
-
if (
|
|
1013
|
+
if (prevSize !== safeSize) {
|
|
1014
|
+
remainingSize -= safeSize - prevSize;
|
|
1015
|
+
nextLayout[index] = safeSize;
|
|
1016
|
+
if (fuzzyNumbersEqual(remainingSize, 0)) break;
|
|
1017
|
+
}
|
|
736
1018
|
}
|
|
737
|
-
return
|
|
738
|
-
}
|
|
739
|
-
var
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
1019
|
+
return nextLayout;
|
|
1020
|
+
}
|
|
1021
|
+
var LOCAL_STORAGE_DEBOUNCE_INTERVAL = 100;
|
|
1022
|
+
var defaultStorage = {
|
|
1023
|
+
getItem: (name) => {
|
|
1024
|
+
initializeDefaultStorage(defaultStorage);
|
|
1025
|
+
return defaultStorage.getItem(name);
|
|
1026
|
+
},
|
|
1027
|
+
setItem: (name, value) => {
|
|
1028
|
+
initializeDefaultStorage(defaultStorage);
|
|
1029
|
+
defaultStorage.setItem(name, value);
|
|
743
1030
|
}
|
|
744
|
-
}
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
1031
|
+
};
|
|
1032
|
+
var debounceMap = {};
|
|
1033
|
+
function PanelGroupWithForwardedRef({ autoSaveId = null, children, className: classNameFromProps = "", direction, forwardedRef, id: idFromProps = null, onLayout = null, keyboardResizeBy = null, storage = defaultStorage, style: styleFromProps, tagName: Type = "div", ...rest }) {
|
|
1034
|
+
const groupId = useUniqueId(idFromProps);
|
|
1035
|
+
const panelGroupElementRef = useRef(null);
|
|
1036
|
+
const [dragState, setDragState] = useState(null);
|
|
1037
|
+
const [layout, setLayout] = useState([]);
|
|
1038
|
+
const forceUpdate = useForceUpdate();
|
|
1039
|
+
const panelIdToLastNotifiedSizeMapRef = useRef({});
|
|
1040
|
+
const panelSizeBeforeCollapseRef = useRef(/* @__PURE__ */ new Map());
|
|
1041
|
+
const prevDeltaRef = useRef(0);
|
|
1042
|
+
const committedValuesRef = useRef({
|
|
1043
|
+
autoSaveId,
|
|
1044
|
+
direction,
|
|
1045
|
+
dragState,
|
|
1046
|
+
id: groupId,
|
|
1047
|
+
keyboardResizeBy,
|
|
1048
|
+
onLayout,
|
|
1049
|
+
storage
|
|
1050
|
+
});
|
|
1051
|
+
const eagerValuesRef = useRef({
|
|
1052
|
+
layout,
|
|
756
1053
|
panelDataArray: [],
|
|
757
|
-
panelDataArrayChanged:
|
|
1054
|
+
panelDataArrayChanged: false
|
|
758
1055
|
});
|
|
759
|
-
|
|
760
|
-
didLogIdAndOrderWarning:
|
|
761
|
-
didLogPanelConstraintsWarning:
|
|
1056
|
+
useRef({
|
|
1057
|
+
didLogIdAndOrderWarning: false,
|
|
1058
|
+
didLogPanelConstraintsWarning: false,
|
|
762
1059
|
prevPanelIds: []
|
|
763
|
-
})
|
|
764
|
-
|
|
1060
|
+
});
|
|
1061
|
+
useImperativeHandle(forwardedRef, () => ({
|
|
1062
|
+
getId: () => committedValuesRef.current.id,
|
|
765
1063
|
getLayout: () => {
|
|
766
|
-
|
|
767
|
-
return
|
|
1064
|
+
const { layout } = eagerValuesRef.current;
|
|
1065
|
+
return layout;
|
|
768
1066
|
},
|
|
769
|
-
setLayout: (
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
1067
|
+
setLayout: (unsafeLayout) => {
|
|
1068
|
+
const { onLayout } = committedValuesRef.current;
|
|
1069
|
+
const { layout: prevLayout, panelDataArray } = eagerValuesRef.current;
|
|
1070
|
+
const safeLayout = validatePanelGroupLayout({
|
|
1071
|
+
layout: unsafeLayout,
|
|
1072
|
+
panelConstraints: panelDataArray.map((panelData) => panelData.constraints)
|
|
773
1073
|
});
|
|
774
|
-
|
|
1074
|
+
if (!areEqual(prevLayout, safeLayout)) {
|
|
1075
|
+
setLayout(safeLayout);
|
|
1076
|
+
eagerValuesRef.current.layout = safeLayout;
|
|
1077
|
+
if (onLayout) onLayout(safeLayout);
|
|
1078
|
+
callPanelCallbacks(panelDataArray, safeLayout, panelIdToLastNotifiedSizeMapRef.current);
|
|
1079
|
+
}
|
|
775
1080
|
}
|
|
776
|
-
}), [])
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
committedValuesRef
|
|
780
|
-
|
|
781
|
-
groupId
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
1081
|
+
}), []);
|
|
1082
|
+
useIsomorphicLayoutEffect(() => {
|
|
1083
|
+
committedValuesRef.current.autoSaveId = autoSaveId;
|
|
1084
|
+
committedValuesRef.current.direction = direction;
|
|
1085
|
+
committedValuesRef.current.dragState = dragState;
|
|
1086
|
+
committedValuesRef.current.id = groupId;
|
|
1087
|
+
committedValuesRef.current.onLayout = onLayout;
|
|
1088
|
+
committedValuesRef.current.storage = storage;
|
|
1089
|
+
});
|
|
1090
|
+
useWindowSplitterPanelGroupBehavior({
|
|
1091
|
+
committedValuesRef,
|
|
1092
|
+
eagerValuesRef,
|
|
1093
|
+
groupId,
|
|
1094
|
+
layout,
|
|
1095
|
+
panelDataArray: eagerValuesRef.current.panelDataArray,
|
|
1096
|
+
setLayout,
|
|
1097
|
+
panelGroupElement: panelGroupElementRef.current
|
|
1098
|
+
});
|
|
1099
|
+
useEffect(() => {
|
|
1100
|
+
const { panelDataArray } = eagerValuesRef.current;
|
|
1101
|
+
if (autoSaveId) {
|
|
1102
|
+
if (layout.length === 0 || layout.length !== panelDataArray.length) return;
|
|
1103
|
+
let debouncedSave = debounceMap[autoSaveId];
|
|
1104
|
+
if (debouncedSave == null) {
|
|
1105
|
+
debouncedSave = debounce(savePanelGroupState, LOCAL_STORAGE_DEBOUNCE_INTERVAL);
|
|
1106
|
+
debounceMap[autoSaveId] = debouncedSave;
|
|
1107
|
+
}
|
|
1108
|
+
const clonedPanelDataArray = [...panelDataArray];
|
|
1109
|
+
const clonedPanelSizesBeforeCollapse = new Map(panelSizeBeforeCollapseRef.current);
|
|
1110
|
+
debouncedSave(autoSaveId, clonedPanelDataArray, clonedPanelSizesBeforeCollapse, layout, storage);
|
|
794
1111
|
}
|
|
795
1112
|
}, [
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
])
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
1113
|
+
autoSaveId,
|
|
1114
|
+
layout,
|
|
1115
|
+
storage
|
|
1116
|
+
]);
|
|
1117
|
+
useEffect(() => {});
|
|
1118
|
+
const collapsePanel = useCallback((panelData) => {
|
|
1119
|
+
const { onLayout } = committedValuesRef.current;
|
|
1120
|
+
const { layout: prevLayout, panelDataArray } = eagerValuesRef.current;
|
|
1121
|
+
if (panelData.constraints.collapsible) {
|
|
1122
|
+
const panelConstraintsArray = panelDataArray.map((panelData) => panelData.constraints);
|
|
1123
|
+
const { collapsedSize = 0, panelSize, pivotIndices } = panelDataHelper(panelDataArray, panelData, prevLayout);
|
|
1124
|
+
assert(panelSize != null, `Panel size not found for panel "${panelData.id}"`);
|
|
1125
|
+
if (!fuzzyNumbersEqual$1(panelSize, collapsedSize)) {
|
|
1126
|
+
panelSizeBeforeCollapseRef.current.set(panelData.id, panelSize);
|
|
1127
|
+
const nextLayout = adjustLayoutByDelta({
|
|
1128
|
+
delta: findPanelDataIndex(panelDataArray, panelData) === panelDataArray.length - 1 ? panelSize - collapsedSize : collapsedSize - panelSize,
|
|
1129
|
+
initialLayout: prevLayout,
|
|
1130
|
+
panelConstraints: panelConstraintsArray,
|
|
1131
|
+
pivotIndices,
|
|
1132
|
+
prevLayout,
|
|
812
1133
|
trigger: "imperative-api"
|
|
813
1134
|
});
|
|
814
|
-
|
|
1135
|
+
if (!compareLayouts(prevLayout, nextLayout)) {
|
|
1136
|
+
setLayout(nextLayout);
|
|
1137
|
+
eagerValuesRef.current.layout = nextLayout;
|
|
1138
|
+
if (onLayout) onLayout(nextLayout);
|
|
1139
|
+
callPanelCallbacks(panelDataArray, nextLayout, panelIdToLastNotifiedSizeMapRef.current);
|
|
1140
|
+
}
|
|
815
1141
|
}
|
|
816
1142
|
}
|
|
817
|
-
}, [])
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
1143
|
+
}, []);
|
|
1144
|
+
const expandPanel = useCallback((panelData, minSizeOverride) => {
|
|
1145
|
+
const { onLayout } = committedValuesRef.current;
|
|
1146
|
+
const { layout: prevLayout, panelDataArray } = eagerValuesRef.current;
|
|
1147
|
+
if (panelData.constraints.collapsible) {
|
|
1148
|
+
const panelConstraintsArray = panelDataArray.map((panelData) => panelData.constraints);
|
|
1149
|
+
const { collapsedSize = 0, panelSize = 0, minSize: minSizeFromProps = 0, pivotIndices } = panelDataHelper(panelDataArray, panelData, prevLayout);
|
|
1150
|
+
const minSize = minSizeOverride !== null && minSizeOverride !== void 0 ? minSizeOverride : minSizeFromProps;
|
|
1151
|
+
if (fuzzyNumbersEqual$1(panelSize, collapsedSize)) {
|
|
1152
|
+
const prevPanelSize = panelSizeBeforeCollapseRef.current.get(panelData.id);
|
|
1153
|
+
const baseSize = prevPanelSize != null && prevPanelSize >= minSize ? prevPanelSize : minSize;
|
|
1154
|
+
const nextLayout = adjustLayoutByDelta({
|
|
1155
|
+
delta: findPanelDataIndex(panelDataArray, panelData) === panelDataArray.length - 1 ? panelSize - baseSize : baseSize - panelSize,
|
|
1156
|
+
initialLayout: prevLayout,
|
|
1157
|
+
panelConstraints: panelConstraintsArray,
|
|
1158
|
+
pivotIndices,
|
|
1159
|
+
prevLayout,
|
|
828
1160
|
trigger: "imperative-api"
|
|
829
1161
|
});
|
|
830
|
-
|
|
1162
|
+
if (!compareLayouts(prevLayout, nextLayout)) {
|
|
1163
|
+
setLayout(nextLayout);
|
|
1164
|
+
eagerValuesRef.current.layout = nextLayout;
|
|
1165
|
+
if (onLayout) onLayout(nextLayout);
|
|
1166
|
+
callPanelCallbacks(panelDataArray, nextLayout, panelIdToLastNotifiedSizeMapRef.current);
|
|
1167
|
+
}
|
|
831
1168
|
}
|
|
832
1169
|
}
|
|
833
|
-
}, [])
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
return
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
1170
|
+
}, []);
|
|
1171
|
+
const getPanelSize = useCallback((panelData) => {
|
|
1172
|
+
const { layout, panelDataArray } = eagerValuesRef.current;
|
|
1173
|
+
const { panelSize } = panelDataHelper(panelDataArray, panelData, layout);
|
|
1174
|
+
assert(panelSize != null, `Panel size not found for panel "${panelData.id}"`);
|
|
1175
|
+
return panelSize;
|
|
1176
|
+
}, []);
|
|
1177
|
+
const getPanelStyle = useCallback((panelData, defaultSize) => {
|
|
1178
|
+
const { panelDataArray } = eagerValuesRef.current;
|
|
1179
|
+
const panelIndex = findPanelDataIndex(panelDataArray, panelData);
|
|
1180
|
+
return computePanelFlexBoxStyle({
|
|
1181
|
+
defaultSize,
|
|
1182
|
+
dragState,
|
|
1183
|
+
layout,
|
|
1184
|
+
panelData: panelDataArray,
|
|
1185
|
+
panelIndex
|
|
844
1186
|
});
|
|
845
|
-
}, [
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
return
|
|
851
|
-
}, [])
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
}, [
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
1187
|
+
}, [dragState, layout]);
|
|
1188
|
+
const isPanelCollapsed = useCallback((panelData) => {
|
|
1189
|
+
const { layout, panelDataArray } = eagerValuesRef.current;
|
|
1190
|
+
const { collapsedSize = 0, collapsible, panelSize } = panelDataHelper(panelDataArray, panelData, layout);
|
|
1191
|
+
assert(panelSize != null, `Panel size not found for panel "${panelData.id}"`);
|
|
1192
|
+
return collapsible === true && fuzzyNumbersEqual$1(panelSize, collapsedSize);
|
|
1193
|
+
}, []);
|
|
1194
|
+
const isPanelExpanded = useCallback((panelData) => {
|
|
1195
|
+
const { layout, panelDataArray } = eagerValuesRef.current;
|
|
1196
|
+
const { collapsedSize = 0, collapsible, panelSize } = panelDataHelper(panelDataArray, panelData, layout);
|
|
1197
|
+
assert(panelSize != null, `Panel size not found for panel "${panelData.id}"`);
|
|
1198
|
+
return !collapsible || fuzzyCompareNumbers(panelSize, collapsedSize) > 0;
|
|
1199
|
+
}, []);
|
|
1200
|
+
const registerPanel = useCallback((panelData) => {
|
|
1201
|
+
const { panelDataArray } = eagerValuesRef.current;
|
|
1202
|
+
panelDataArray.push(panelData);
|
|
1203
|
+
panelDataArray.sort((panelA, panelB) => {
|
|
1204
|
+
const orderA = panelA.order;
|
|
1205
|
+
const orderB = panelB.order;
|
|
1206
|
+
if (orderA == null && orderB == null) return 0;
|
|
1207
|
+
else if (orderA == null) return -1;
|
|
1208
|
+
else if (orderB == null) return 1;
|
|
1209
|
+
else return orderA - orderB;
|
|
1210
|
+
});
|
|
1211
|
+
eagerValuesRef.current.panelDataArrayChanged = true;
|
|
1212
|
+
forceUpdate();
|
|
1213
|
+
}, [forceUpdate]);
|
|
1214
|
+
useIsomorphicLayoutEffect(() => {
|
|
1215
|
+
if (eagerValuesRef.current.panelDataArrayChanged) {
|
|
1216
|
+
eagerValuesRef.current.panelDataArrayChanged = false;
|
|
1217
|
+
const { autoSaveId, onLayout, storage } = committedValuesRef.current;
|
|
1218
|
+
const { layout: prevLayout, panelDataArray } = eagerValuesRef.current;
|
|
1219
|
+
let unsafeLayout = null;
|
|
1220
|
+
if (autoSaveId) {
|
|
1221
|
+
const state = loadPanelGroupState(autoSaveId, panelDataArray, storage);
|
|
1222
|
+
if (state) {
|
|
1223
|
+
panelSizeBeforeCollapseRef.current = new Map(Object.entries(state.expandToSizes));
|
|
1224
|
+
unsafeLayout = state.layout;
|
|
1225
|
+
}
|
|
865
1226
|
}
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
layout:
|
|
869
|
-
panelConstraints:
|
|
1227
|
+
if (unsafeLayout == null) unsafeLayout = calculateUnsafeDefaultLayout({ panelDataArray });
|
|
1228
|
+
const nextLayout = validatePanelGroupLayout({
|
|
1229
|
+
layout: unsafeLayout,
|
|
1230
|
+
panelConstraints: panelDataArray.map((panelData) => panelData.constraints)
|
|
870
1231
|
});
|
|
871
|
-
|
|
1232
|
+
if (!areEqual(prevLayout, nextLayout)) {
|
|
1233
|
+
setLayout(nextLayout);
|
|
1234
|
+
eagerValuesRef.current.layout = nextLayout;
|
|
1235
|
+
if (onLayout) onLayout(nextLayout);
|
|
1236
|
+
callPanelCallbacks(panelDataArray, nextLayout, panelIdToLastNotifiedSizeMapRef.current);
|
|
1237
|
+
}
|
|
872
1238
|
}
|
|
873
|
-
})
|
|
874
|
-
|
|
1239
|
+
});
|
|
1240
|
+
useIsomorphicLayoutEffect(() => {
|
|
1241
|
+
const eagerValues = eagerValuesRef.current;
|
|
875
1242
|
return () => {
|
|
876
|
-
|
|
1243
|
+
eagerValues.layout = [];
|
|
877
1244
|
};
|
|
878
1245
|
}, []);
|
|
879
|
-
|
|
880
|
-
let
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
1246
|
+
const registerResizeHandle = useCallback((dragHandleId) => {
|
|
1247
|
+
let isRTL = false;
|
|
1248
|
+
const panelGroupElement = panelGroupElementRef.current;
|
|
1249
|
+
if (panelGroupElement) {
|
|
1250
|
+
if (window.getComputedStyle(panelGroupElement, null).getPropertyValue("direction") === "rtl") isRTL = true;
|
|
1251
|
+
}
|
|
1252
|
+
return function resizeHandler(event) {
|
|
1253
|
+
event.preventDefault();
|
|
1254
|
+
const panelGroupElement = panelGroupElementRef.current;
|
|
1255
|
+
if (!panelGroupElement) return () => null;
|
|
1256
|
+
const { direction, dragState, id: groupId, keyboardResizeBy, onLayout } = committedValuesRef.current;
|
|
1257
|
+
const { layout: prevLayout, panelDataArray } = eagerValuesRef.current;
|
|
1258
|
+
const { initialLayout } = dragState !== null && dragState !== void 0 ? dragState : {};
|
|
1259
|
+
const pivotIndices = determinePivotIndices(groupId, dragHandleId, panelGroupElement);
|
|
1260
|
+
let delta = calculateDeltaPercentage(event, dragHandleId, direction, dragState, keyboardResizeBy, panelGroupElement);
|
|
1261
|
+
const isHorizontal = direction === "horizontal";
|
|
1262
|
+
if (isHorizontal && isRTL) delta = -delta;
|
|
1263
|
+
const panelConstraints = panelDataArray.map((panelData) => panelData.constraints);
|
|
1264
|
+
const nextLayout = adjustLayoutByDelta({
|
|
1265
|
+
delta,
|
|
1266
|
+
initialLayout: initialLayout !== null && initialLayout !== void 0 ? initialLayout : prevLayout,
|
|
1267
|
+
panelConstraints,
|
|
1268
|
+
pivotIndices,
|
|
1269
|
+
prevLayout,
|
|
1270
|
+
trigger: isKeyDown(event) ? "keyboard" : "mouse-or-touch"
|
|
1271
|
+
});
|
|
1272
|
+
const layoutChanged = !compareLayouts(prevLayout, nextLayout);
|
|
1273
|
+
if (isPointerEvent(event) || isMouseEvent(event)) {
|
|
1274
|
+
if (prevDeltaRef.current != delta) {
|
|
1275
|
+
prevDeltaRef.current = delta;
|
|
1276
|
+
if (!layoutChanged && delta !== 0) {
|
|
1277
|
+
if (isHorizontal) reportConstraintsViolation(dragHandleId, delta < 0 ? EXCEEDED_HORIZONTAL_MIN : EXCEEDED_HORIZONTAL_MAX);
|
|
1278
|
+
else reportConstraintsViolation(dragHandleId, delta < 0 ? EXCEEDED_VERTICAL_MIN : EXCEEDED_VERTICAL_MAX);
|
|
1279
|
+
} else reportConstraintsViolation(dragHandleId, 0);
|
|
1280
|
+
}
|
|
1281
|
+
}
|
|
1282
|
+
if (layoutChanged) {
|
|
1283
|
+
setLayout(nextLayout);
|
|
1284
|
+
eagerValuesRef.current.layout = nextLayout;
|
|
1285
|
+
if (onLayout) onLayout(nextLayout);
|
|
1286
|
+
callPanelCallbacks(panelDataArray, nextLayout, panelIdToLastNotifiedSizeMapRef.current);
|
|
1287
|
+
}
|
|
896
1288
|
};
|
|
897
|
-
}, [])
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
1289
|
+
}, []);
|
|
1290
|
+
const resizePanel = useCallback((panelData, unsafePanelSize) => {
|
|
1291
|
+
const { onLayout } = committedValuesRef.current;
|
|
1292
|
+
const { layout: prevLayout, panelDataArray } = eagerValuesRef.current;
|
|
1293
|
+
const panelConstraintsArray = panelDataArray.map((panelData) => panelData.constraints);
|
|
1294
|
+
const { panelSize, pivotIndices } = panelDataHelper(panelDataArray, panelData, prevLayout);
|
|
1295
|
+
assert(panelSize != null, `Panel size not found for panel "${panelData.id}"`);
|
|
1296
|
+
const nextLayout = adjustLayoutByDelta({
|
|
1297
|
+
delta: findPanelDataIndex(panelDataArray, panelData) === panelDataArray.length - 1 ? panelSize - unsafePanelSize : unsafePanelSize - panelSize,
|
|
1298
|
+
initialLayout: prevLayout,
|
|
1299
|
+
panelConstraints: panelConstraintsArray,
|
|
1300
|
+
pivotIndices,
|
|
1301
|
+
prevLayout,
|
|
906
1302
|
trigger: "imperative-api"
|
|
907
1303
|
});
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
1304
|
+
if (!compareLayouts(prevLayout, nextLayout)) {
|
|
1305
|
+
setLayout(nextLayout);
|
|
1306
|
+
eagerValuesRef.current.layout = nextLayout;
|
|
1307
|
+
if (onLayout) onLayout(nextLayout);
|
|
1308
|
+
callPanelCallbacks(panelDataArray, nextLayout, panelIdToLastNotifiedSizeMapRef.current);
|
|
1309
|
+
}
|
|
1310
|
+
}, []);
|
|
1311
|
+
const reevaluatePanelConstraints = useCallback((panelData, prevConstraints) => {
|
|
1312
|
+
const { layout, panelDataArray } = eagerValuesRef.current;
|
|
1313
|
+
const { collapsedSize: prevCollapsedSize = 0, collapsible: prevCollapsible } = prevConstraints;
|
|
1314
|
+
const { collapsedSize: nextCollapsedSize = 0, collapsible: nextCollapsible, maxSize: nextMaxSize = 100, minSize: nextMinSize = 0 } = panelData.constraints;
|
|
1315
|
+
const { panelSize: prevPanelSize } = panelDataHelper(panelDataArray, panelData, layout);
|
|
1316
|
+
if (prevPanelSize == null) return;
|
|
1317
|
+
if (prevCollapsible && nextCollapsible && fuzzyNumbersEqual$1(prevPanelSize, prevCollapsedSize)) {
|
|
1318
|
+
if (!fuzzyNumbersEqual$1(prevCollapsedSize, nextCollapsedSize)) resizePanel(panelData, nextCollapsedSize);
|
|
1319
|
+
} else if (prevPanelSize < nextMinSize) resizePanel(panelData, nextMinSize);
|
|
1320
|
+
else if (prevPanelSize > nextMaxSize) resizePanel(panelData, nextMaxSize);
|
|
1321
|
+
}, [resizePanel]);
|
|
1322
|
+
const startDragging = useCallback((dragHandleId, event) => {
|
|
1323
|
+
const { direction } = committedValuesRef.current;
|
|
1324
|
+
const { layout } = eagerValuesRef.current;
|
|
1325
|
+
if (!panelGroupElementRef.current) return;
|
|
1326
|
+
const handleElement = getResizeHandleElement(dragHandleId, panelGroupElementRef.current);
|
|
1327
|
+
assert(handleElement, `Drag handle element not found for id "${dragHandleId}"`);
|
|
1328
|
+
const initialCursorPosition = getResizeEventCursorPosition(direction, event);
|
|
1329
|
+
setDragState({
|
|
1330
|
+
dragHandleId,
|
|
1331
|
+
dragHandleRect: handleElement.getBoundingClientRect(),
|
|
1332
|
+
initialCursorPosition,
|
|
1333
|
+
initialLayout: layout
|
|
923
1334
|
});
|
|
924
|
-
}, [])
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
1335
|
+
}, []);
|
|
1336
|
+
const stopDragging = useCallback(() => {
|
|
1337
|
+
setDragState(null);
|
|
1338
|
+
}, []);
|
|
1339
|
+
const unregisterPanel = useCallback((panelData) => {
|
|
1340
|
+
const { panelDataArray } = eagerValuesRef.current;
|
|
1341
|
+
const index = findPanelDataIndex(panelDataArray, panelData);
|
|
1342
|
+
if (index >= 0) {
|
|
1343
|
+
panelDataArray.splice(index, 1);
|
|
1344
|
+
delete panelIdToLastNotifiedSizeMapRef.current[panelData.id];
|
|
1345
|
+
eagerValuesRef.current.panelDataArrayChanged = true;
|
|
1346
|
+
forceUpdate();
|
|
1347
|
+
}
|
|
1348
|
+
}, [forceUpdate]);
|
|
1349
|
+
const context = useMemo(() => ({
|
|
1350
|
+
collapsePanel,
|
|
1351
|
+
direction,
|
|
1352
|
+
dragState,
|
|
1353
|
+
expandPanel,
|
|
1354
|
+
getPanelSize,
|
|
1355
|
+
getPanelStyle,
|
|
1356
|
+
groupId,
|
|
1357
|
+
isPanelCollapsed,
|
|
1358
|
+
isPanelExpanded,
|
|
1359
|
+
reevaluatePanelConstraints,
|
|
1360
|
+
registerPanel,
|
|
1361
|
+
registerResizeHandle,
|
|
1362
|
+
resizePanel,
|
|
1363
|
+
startDragging,
|
|
1364
|
+
stopDragging,
|
|
1365
|
+
unregisterPanel,
|
|
1366
|
+
panelGroupElement: panelGroupElementRef.current
|
|
947
1367
|
}), [
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
])
|
|
1368
|
+
collapsePanel,
|
|
1369
|
+
dragState,
|
|
1370
|
+
direction,
|
|
1371
|
+
expandPanel,
|
|
1372
|
+
getPanelSize,
|
|
1373
|
+
getPanelStyle,
|
|
1374
|
+
groupId,
|
|
1375
|
+
isPanelCollapsed,
|
|
1376
|
+
isPanelExpanded,
|
|
1377
|
+
reevaluatePanelConstraints,
|
|
1378
|
+
registerPanel,
|
|
1379
|
+
registerResizeHandle,
|
|
1380
|
+
resizePanel,
|
|
1381
|
+
startDragging,
|
|
1382
|
+
stopDragging,
|
|
1383
|
+
unregisterPanel
|
|
1384
|
+
]);
|
|
1385
|
+
const style = {
|
|
965
1386
|
display: "flex",
|
|
966
|
-
flexDirection:
|
|
1387
|
+
flexDirection: direction === "horizontal" ? "row" : "column",
|
|
967
1388
|
height: "100%",
|
|
968
1389
|
overflow: "hidden",
|
|
969
1390
|
width: "100%"
|
|
970
1391
|
};
|
|
971
|
-
return
|
|
972
|
-
...
|
|
973
|
-
children
|
|
974
|
-
className:
|
|
975
|
-
id:
|
|
976
|
-
ref:
|
|
1392
|
+
return createElement(PanelGroupContext.Provider, { value: context }, createElement(Type, {
|
|
1393
|
+
...rest,
|
|
1394
|
+
children,
|
|
1395
|
+
className: classNameFromProps,
|
|
1396
|
+
id: idFromProps,
|
|
1397
|
+
ref: panelGroupElementRef,
|
|
977
1398
|
style: {
|
|
978
|
-
...
|
|
979
|
-
...
|
|
1399
|
+
...style,
|
|
1400
|
+
...styleFromProps
|
|
980
1401
|
},
|
|
981
|
-
[
|
|
982
|
-
[
|
|
983
|
-
[
|
|
1402
|
+
[DATA_ATTRIBUTES.group]: "",
|
|
1403
|
+
[DATA_ATTRIBUTES.groupDirection]: direction,
|
|
1404
|
+
[DATA_ATTRIBUTES.groupId]: groupId
|
|
984
1405
|
}));
|
|
985
1406
|
}
|
|
986
|
-
var
|
|
987
|
-
...
|
|
988
|
-
forwardedRef:
|
|
1407
|
+
var PanelGroup = forwardRef((props, ref) => createElement(PanelGroupWithForwardedRef, {
|
|
1408
|
+
...props,
|
|
1409
|
+
forwardedRef: ref
|
|
989
1410
|
}));
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
1411
|
+
PanelGroupWithForwardedRef.displayName = "PanelGroup";
|
|
1412
|
+
PanelGroup.displayName = "forwardRef(PanelGroup)";
|
|
1413
|
+
function findPanelDataIndex(panelDataArray, panelData) {
|
|
1414
|
+
return panelDataArray.findIndex((prevPanelData) => prevPanelData === panelData || prevPanelData.id === panelData.id);
|
|
1415
|
+
}
|
|
1416
|
+
function panelDataHelper(panelDataArray, panelData, layout) {
|
|
1417
|
+
const panelIndex = findPanelDataIndex(panelDataArray, panelData);
|
|
1418
|
+
const pivotIndices = panelIndex === panelDataArray.length - 1 ? [panelIndex - 1, panelIndex] : [panelIndex, panelIndex + 1];
|
|
1419
|
+
const panelSize = layout[panelIndex];
|
|
996
1420
|
return {
|
|
997
|
-
...
|
|
998
|
-
panelSize
|
|
999
|
-
pivotIndices
|
|
1421
|
+
...panelData.constraints,
|
|
1422
|
+
panelSize,
|
|
1423
|
+
pivotIndices
|
|
1000
1424
|
};
|
|
1001
1425
|
}
|
|
1002
|
-
function
|
|
1003
|
-
|
|
1004
|
-
if (
|
|
1005
|
-
|
|
1006
|
-
if (
|
|
1007
|
-
|
|
1008
|
-
if (
|
|
1426
|
+
function useWindowSplitterResizeHandlerBehavior({ disabled, handleId, resizeHandler, panelGroupElement }) {
|
|
1427
|
+
useEffect(() => {
|
|
1428
|
+
if (disabled || resizeHandler == null || panelGroupElement == null) return;
|
|
1429
|
+
const handleElement = getResizeHandleElement(handleId, panelGroupElement);
|
|
1430
|
+
if (handleElement == null) return;
|
|
1431
|
+
const onKeyDown = (event) => {
|
|
1432
|
+
if (event.defaultPrevented) return;
|
|
1433
|
+
switch (event.key) {
|
|
1009
1434
|
case "ArrowDown":
|
|
1010
1435
|
case "ArrowLeft":
|
|
1011
1436
|
case "ArrowRight":
|
|
1012
1437
|
case "ArrowUp":
|
|
1013
1438
|
case "End":
|
|
1014
1439
|
case "Home":
|
|
1015
|
-
|
|
1440
|
+
event.preventDefault();
|
|
1441
|
+
resizeHandler(event);
|
|
1016
1442
|
break;
|
|
1017
1443
|
case "F6": {
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1444
|
+
event.preventDefault();
|
|
1445
|
+
const groupId = handleElement.getAttribute(DATA_ATTRIBUTES.groupId);
|
|
1446
|
+
assert(groupId, `No group element found for id "${groupId}"`);
|
|
1447
|
+
const handles = getResizeHandleElementsForGroup(groupId, panelGroupElement);
|
|
1448
|
+
const index = getResizeHandleElementIndex(groupId, handleId, panelGroupElement);
|
|
1449
|
+
assert(index !== null, `No resize element found for id "${handleId}"`);
|
|
1450
|
+
handles[event.shiftKey ? index > 0 ? index - 1 : handles.length - 1 : index + 1 < handles.length ? index + 1 : 0].focus();
|
|
1023
1451
|
break;
|
|
1024
1452
|
}
|
|
1025
1453
|
}
|
|
1026
1454
|
};
|
|
1027
|
-
|
|
1028
|
-
|
|
1455
|
+
handleElement.addEventListener("keydown", onKeyDown);
|
|
1456
|
+
return () => {
|
|
1457
|
+
handleElement.removeEventListener("keydown", onKeyDown);
|
|
1029
1458
|
};
|
|
1030
1459
|
}, [
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1460
|
+
panelGroupElement,
|
|
1461
|
+
disabled,
|
|
1462
|
+
handleId,
|
|
1463
|
+
resizeHandler
|
|
1035
1464
|
]);
|
|
1036
1465
|
}
|
|
1037
|
-
function
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1466
|
+
function PanelResizeHandle({ children = null, className: classNameFromProps = "", disabled = false, hitAreaMargins, id: idFromProps, onBlur, onClick, onDragging, onFocus, onPointerDown, onPointerUp, style: styleFromProps = {}, tabIndex = 0, tagName: Type = "div", ...rest }) {
|
|
1467
|
+
var _hitAreaMargins$coars, _hitAreaMargins$fine;
|
|
1468
|
+
const elementRef = useRef(null);
|
|
1469
|
+
const callbacksRef = useRef({
|
|
1470
|
+
onClick,
|
|
1471
|
+
onDragging,
|
|
1472
|
+
onPointerDown,
|
|
1473
|
+
onPointerUp
|
|
1043
1474
|
});
|
|
1044
|
-
|
|
1045
|
-
|
|
1475
|
+
useEffect(() => {
|
|
1476
|
+
callbacksRef.current.onClick = onClick;
|
|
1477
|
+
callbacksRef.current.onDragging = onDragging;
|
|
1478
|
+
callbacksRef.current.onPointerDown = onPointerDown;
|
|
1479
|
+
callbacksRef.current.onPointerUp = onPointerUp;
|
|
1046
1480
|
});
|
|
1047
|
-
|
|
1048
|
-
if (
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1481
|
+
const panelGroupContext = useContext(PanelGroupContext);
|
|
1482
|
+
if (panelGroupContext === null) throw Error(`PanelResizeHandle components must be rendered within a PanelGroup container`);
|
|
1483
|
+
const { direction, groupId, registerResizeHandle: registerResizeHandleWithParentGroup, startDragging, stopDragging, panelGroupElement } = panelGroupContext;
|
|
1484
|
+
const resizeHandleId = useUniqueId(idFromProps);
|
|
1485
|
+
const [state, setState] = useState("inactive");
|
|
1486
|
+
const [isFocused, setIsFocused] = useState(false);
|
|
1487
|
+
const [resizeHandler, setResizeHandler] = useState(null);
|
|
1488
|
+
const committedValuesRef = useRef({ state });
|
|
1489
|
+
useIsomorphicLayoutEffect(() => {
|
|
1490
|
+
committedValuesRef.current.state = state;
|
|
1491
|
+
});
|
|
1492
|
+
useEffect(() => {
|
|
1493
|
+
if (disabled) setResizeHandler(null);
|
|
1054
1494
|
else {
|
|
1055
|
-
|
|
1056
|
-
|
|
1495
|
+
const resizeHandler = registerResizeHandleWithParentGroup(resizeHandleId);
|
|
1496
|
+
setResizeHandler(() => resizeHandler);
|
|
1057
1497
|
}
|
|
1058
1498
|
}, [
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1499
|
+
disabled,
|
|
1500
|
+
resizeHandleId,
|
|
1501
|
+
registerResizeHandleWithParentGroup
|
|
1062
1502
|
]);
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1503
|
+
const coarseHitAreaMargins = (_hitAreaMargins$coars = hitAreaMargins === null || hitAreaMargins === void 0 ? void 0 : hitAreaMargins.coarse) !== null && _hitAreaMargins$coars !== void 0 ? _hitAreaMargins$coars : 15;
|
|
1504
|
+
const fineHitAreaMargins = (_hitAreaMargins$fine = hitAreaMargins === null || hitAreaMargins === void 0 ? void 0 : hitAreaMargins.fine) !== null && _hitAreaMargins$fine !== void 0 ? _hitAreaMargins$fine : 5;
|
|
1505
|
+
useEffect(() => {
|
|
1506
|
+
if (disabled || resizeHandler == null) return;
|
|
1507
|
+
const element = elementRef.current;
|
|
1508
|
+
assert(element, "Element ref not attached");
|
|
1509
|
+
let didMove = false;
|
|
1510
|
+
const setResizeHandlerState = (action, isActive, event) => {
|
|
1511
|
+
if (!isActive) {
|
|
1512
|
+
setState("inactive");
|
|
1513
|
+
return;
|
|
1514
|
+
}
|
|
1515
|
+
switch (action) {
|
|
1075
1516
|
case "down": {
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1517
|
+
setState("drag");
|
|
1518
|
+
didMove = false;
|
|
1519
|
+
assert(event, "Expected event to be defined for \"down\" action");
|
|
1520
|
+
startDragging(resizeHandleId, event);
|
|
1521
|
+
const { onDragging, onPointerDown } = callbacksRef.current;
|
|
1522
|
+
onDragging === null || onDragging === void 0 || onDragging(true);
|
|
1523
|
+
onPointerDown === null || onPointerDown === void 0 || onPointerDown();
|
|
1079
1524
|
break;
|
|
1080
1525
|
}
|
|
1081
1526
|
case "move": {
|
|
1082
|
-
|
|
1083
|
-
|
|
1527
|
+
const { state } = committedValuesRef.current;
|
|
1528
|
+
didMove = true;
|
|
1529
|
+
if (state !== "drag") setState("hover");
|
|
1530
|
+
assert(event, "Expected event to be defined for \"move\" action");
|
|
1531
|
+
resizeHandler(event);
|
|
1084
1532
|
break;
|
|
1085
1533
|
}
|
|
1086
1534
|
case "up": {
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1535
|
+
setState("hover");
|
|
1536
|
+
stopDragging();
|
|
1537
|
+
const { onClick, onDragging, onPointerUp } = callbacksRef.current;
|
|
1538
|
+
onDragging === null || onDragging === void 0 || onDragging(false);
|
|
1539
|
+
onPointerUp === null || onPointerUp === void 0 || onPointerUp();
|
|
1540
|
+
if (!didMove) onClick === null || onClick === void 0 || onClick();
|
|
1090
1541
|
break;
|
|
1091
1542
|
}
|
|
1092
1543
|
}
|
|
1093
|
-
}
|
|
1544
|
+
};
|
|
1545
|
+
return registerResizeHandle(resizeHandleId, element, direction, {
|
|
1546
|
+
coarse: coarseHitAreaMargins,
|
|
1547
|
+
fine: fineHitAreaMargins
|
|
1548
|
+
}, setResizeHandlerState);
|
|
1094
1549
|
}, [
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
])
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1550
|
+
coarseHitAreaMargins,
|
|
1551
|
+
direction,
|
|
1552
|
+
disabled,
|
|
1553
|
+
fineHitAreaMargins,
|
|
1554
|
+
registerResizeHandleWithParentGroup,
|
|
1555
|
+
resizeHandleId,
|
|
1556
|
+
resizeHandler,
|
|
1557
|
+
startDragging,
|
|
1558
|
+
stopDragging
|
|
1559
|
+
]);
|
|
1560
|
+
useWindowSplitterResizeHandlerBehavior({
|
|
1561
|
+
disabled,
|
|
1562
|
+
handleId: resizeHandleId,
|
|
1563
|
+
resizeHandler,
|
|
1564
|
+
panelGroupElement
|
|
1109
1565
|
});
|
|
1110
|
-
|
|
1566
|
+
const style = {
|
|
1111
1567
|
touchAction: "none",
|
|
1112
1568
|
userSelect: "none"
|
|
1113
1569
|
};
|
|
1114
|
-
return
|
|
1115
|
-
...
|
|
1116
|
-
children
|
|
1117
|
-
className:
|
|
1118
|
-
id:
|
|
1570
|
+
return createElement(Type, {
|
|
1571
|
+
...rest,
|
|
1572
|
+
children,
|
|
1573
|
+
className: classNameFromProps,
|
|
1574
|
+
id: idFromProps,
|
|
1119
1575
|
onBlur: () => {
|
|
1120
|
-
|
|
1576
|
+
setIsFocused(false);
|
|
1577
|
+
onBlur === null || onBlur === void 0 || onBlur();
|
|
1121
1578
|
},
|
|
1122
1579
|
onFocus: () => {
|
|
1123
|
-
|
|
1580
|
+
setIsFocused(true);
|
|
1581
|
+
onFocus === null || onFocus === void 0 || onFocus();
|
|
1124
1582
|
},
|
|
1125
|
-
ref:
|
|
1583
|
+
ref: elementRef,
|
|
1126
1584
|
role: "separator",
|
|
1127
1585
|
style: {
|
|
1128
|
-
...
|
|
1129
|
-
...
|
|
1586
|
+
...style,
|
|
1587
|
+
...styleFromProps
|
|
1130
1588
|
},
|
|
1131
|
-
tabIndex
|
|
1132
|
-
[
|
|
1133
|
-
[
|
|
1134
|
-
[
|
|
1135
|
-
[
|
|
1136
|
-
[
|
|
1137
|
-
[
|
|
1138
|
-
[
|
|
1589
|
+
tabIndex,
|
|
1590
|
+
[DATA_ATTRIBUTES.groupDirection]: direction,
|
|
1591
|
+
[DATA_ATTRIBUTES.groupId]: groupId,
|
|
1592
|
+
[DATA_ATTRIBUTES.resizeHandle]: "",
|
|
1593
|
+
[DATA_ATTRIBUTES.resizeHandleActive]: state === "drag" ? "pointer" : isFocused ? "keyboard" : void 0,
|
|
1594
|
+
[DATA_ATTRIBUTES.resizeHandleEnabled]: !disabled,
|
|
1595
|
+
[DATA_ATTRIBUTES.resizeHandleId]: resizeHandleId,
|
|
1596
|
+
[DATA_ATTRIBUTES.resizeHandleState]: state
|
|
1139
1597
|
});
|
|
1140
1598
|
}
|
|
1141
|
-
|
|
1142
|
-
export {
|
|
1599
|
+
PanelResizeHandle.displayName = "PanelResizeHandle";
|
|
1600
|
+
export { DATA_ATTRIBUTES, Panel, PanelGroup, PanelResizeHandle, assert, getPanelGroupElement, getResizeHandleElement, getResizeHandleElementIndex, getResizeHandleElementsForGroup, getResizeHandlePanelIds, intersects };
|