@vlrc-fe/components 3.0.3 → 3.0.5
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 +29 -0
- package/README.md +10 -1
- package/bin/registry.mjs +1124 -0
- package/bin/vlrc.mjs +102 -7
- package/dist/ConfirmModal.cjs +268 -1
- package/dist/ConfirmModal.d.ts +5 -21
- package/dist/ConfirmModal.d.ts.map +1 -1
- package/dist/ConfirmModal.js +120 -111
- 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 +131 -1
- package/dist/Modal.d.ts +2 -14
- package/dist/Modal.d.ts.map +1 -1
- package/dist/Modal.js +63 -54
- package/dist/MultiSelect/MultiSelect.cjs +210 -1
- package/dist/MultiSelect/MultiSelect.d.ts.map +1 -1
- package/dist/MultiSelect/MultiSelect.js +126 -117
- package/dist/MultiSelect/renderers.cjs +571 -1
- package/dist/MultiSelect/renderers.js +508 -309
- package/dist/MultiSelect/useMultiSelect.cjs +244 -1
- package/dist/MultiSelect/useMultiSelect.d.ts.map +1 -1
- package/dist/MultiSelect/useMultiSelect.js +208 -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 +139 -1
- package/dist/Typography/Link.d.ts +1 -2
- package/dist/Typography/Link.d.ts.map +1 -1
- package/dist/Typography/Link.js +73 -64
- package/dist/Typography/Paragraph.cjs +224 -1
- package/dist/Typography/Paragraph.d.ts +1 -2
- package/dist/Typography/Paragraph.d.ts.map +1 -1
- package/dist/Typography/Paragraph.js +118 -108
- package/dist/Typography/Text.cjs +223 -1
- package/dist/Typography/Text.d.ts +1 -2
- package/dist/Typography/Text.d.ts.map +1 -1
- package/dist/Typography/Text.js +117 -101
- 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 +126 -104
- package/dist/Typography/Typography.cjs +17 -1
- package/dist/Typography/Typography.d.ts +8 -4
- package/dist/Typography/Typography.d.ts.map +1 -1
- package/dist/Typography/Typography.js +14 -14
- package/dist/Typography/index.d.ts +1 -4
- package/dist/Typography/index.d.ts.map +1 -1
- package/dist/Typography/index.js +10 -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.d.ts +4 -0
- package/dist/Typography/types.d.ts.map +1 -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 +167 -9
- package/dist/astryx.cjs +9 -1
- package/dist/astryx.d.ts +0 -1
- package/dist/astryx.d.ts.map +1 -1
- package/dist/astryx.js +0 -1
- package/dist/index.cjs +779 -1
- package/dist/index.d.ts +2 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +119 -118
- package/dist/layout/Box.cjs +180 -1
- package/dist/layout/Box.d.ts +6 -8
- package/dist/layout/Box.d.ts.map +1 -1
- package/dist/layout/Box.js +116 -50
- package/dist/layout/Center.cjs +40 -1
- package/dist/layout/Center.d.ts +3 -3
- package/dist/layout/Center.d.ts.map +1 -1
- package/dist/layout/Center.js +39 -21
- package/dist/layout/Container.cjs +92 -1
- package/dist/layout/Container.d.ts +6 -8
- package/dist/layout/Container.d.ts.map +1 -1
- package/dist/layout/Container.js +46 -31
- package/dist/layout/Stack.cjs +199 -1
- package/dist/layout/Stack.d.ts +9 -9
- package/dist/layout/Stack.d.ts.map +1 -1
- package/dist/layout/Stack.js +186 -79
- package/dist/layout/index.d.ts +1 -1
- package/dist/layout/index.js +9 -9
- package/dist/lazyLoad.cjs +13 -1
- package/dist/lazyLoad.d.ts.map +1 -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 +62 -1
- package/dist/theme/zIndex.d.ts +4 -4
- package/dist/theme/zIndex.d.ts.map +1 -1
- package/dist/theme/zIndex.js +44 -15
- package/dist/theme.css +167 -9
- 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 +24 -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 -13
- package/dist/ui/avatar.cjs +340 -1
- package/dist/ui/avatar.d.ts +10 -10
- package/dist/ui/avatar.d.ts.map +1 -1
- package/dist/ui/avatar.js +226 -115
- 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 +625 -1
- package/dist/ui/calendar.d.ts +5 -5
- package/dist/ui/calendar.d.ts.map +1 -1
- package/dist/ui/calendar.js +309 -193
- 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 +332 -1
- package/dist/ui/carousel.d.ts +10 -10
- package/dist/ui/carousel.d.ts.map +1 -1
- package/dist/ui/carousel.js +245 -127
- package/dist/ui/checkbox.cjs +163 -1
- package/dist/ui/checkbox.d.ts +4 -4
- package/dist/ui/checkbox.d.ts.map +1 -1
- package/dist/ui/checkbox.js +62 -58
- package/dist/ui/circular-progress.cjs +144 -1
- package/dist/ui/circular-progress.d.ts +5 -5
- package/dist/ui/circular-progress.d.ts.map +1 -1
- package/dist/ui/circular-progress.js +85 -67
- package/dist/ui/code-block.cjs +823 -0
- package/dist/ui/code-block.d.ts +89 -0
- package/dist/ui/code-block.d.ts.map +1 -0
- package/dist/ui/code-block.js +813 -0
- package/dist/ui/collapsible.cjs +64 -1
- package/dist/ui/collapsible.d.ts +4 -4
- package/dist/ui/collapsible.d.ts.map +1 -1
- package/dist/ui/collapsible.js +58 -29
- 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 +169 -1
- package/dist/ui/compare-slider.d.ts +8 -7
- package/dist/ui/compare-slider.d.ts.map +1 -1
- package/dist/ui/compare-slider.js +106 -73
- package/dist/ui/context-menu.cjs +810 -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 -229
- package/dist/ui/copy-button.cjs +93 -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 -45
- package/dist/ui/dialog.cjs +411 -1
- package/dist/ui/dialog.d.ts +18 -18
- package/dist/ui/dialog.d.ts.map +1 -1
- package/dist/ui/dialog.js +319 -131
- package/dist/ui/drawer.cjs +478 -1
- package/dist/ui/drawer.d.ts +17 -17
- package/dist/ui/drawer.d.ts.map +1 -1
- package/dist/ui/drawer.js +396 -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 +609 -1
- package/dist/ui/editable.d.ts +14 -14
- package/dist/ui/editable.d.ts.map +1 -1
- package/dist/ui/editable.js +479 -218
- package/dist/ui/empty.cjs +295 -1
- package/dist/ui/empty.d.ts +15 -15
- package/dist/ui/empty.d.ts.map +1 -1
- package/dist/ui/empty.js +267 -112
- 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 +1480 -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 -599
- package/dist/ui/flex.cjs +202 -1
- package/dist/ui/flex.d.ts +7 -6
- package/dist/ui/flex.d.ts.map +1 -1
- package/dist/ui/flex.js +111 -93
- package/dist/ui/form.cjs +453 -1
- package/dist/ui/form.d.ts +11 -11
- package/dist/ui/form.d.ts.map +1 -1
- package/dist/ui/form.js +421 -136
- package/dist/ui/gauge.cjs +125 -1
- package/dist/ui/gauge.d.ts +7 -6
- package/dist/ui/gauge.d.ts.map +1 -1
- package/dist/ui/gauge.js +60 -53
- package/dist/ui/grid.cjs +224 -1
- package/dist/ui/grid.d.ts +11 -7
- package/dist/ui/grid.d.ts.map +1 -1
- package/dist/ui/grid.js +126 -96
- package/dist/ui/hover-card.cjs +85 -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 -37
- package/dist/ui/index.d.ts +4 -0
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/input-group.cjs +322 -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 +203 -107
- 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 +297 -0
- package/dist/ui/marker.d.ts +25 -0
- package/dist/ui/marker.d.ts.map +1 -0
- package/dist/ui/marker.js +293 -0
- package/dist/ui/masonry.cjs +56 -1
- package/dist/ui/masonry.d.ts +4 -4
- package/dist/ui/masonry.d.ts.map +1 -1
- package/dist/ui/masonry.js +40 -37
- package/dist/ui/menubar.cjs +907 -1
- package/dist/ui/menubar.d.ts +29 -29
- package/dist/ui/menubar.d.ts.map +1 -1
- package/dist/ui/menubar.js +737 -252
- 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 +34 -1
- package/dist/ui/progress.d.ts +3 -3
- package/dist/ui/progress.d.ts.map +1 -1
- package/dist/ui/progress.js +21 -18
- package/dist/ui/questionnaire.cjs +682 -0
- package/dist/ui/questionnaire.d.ts +111 -0
- package/dist/ui/questionnaire.d.ts.map +1 -0
- package/dist/ui/questionnaire.js +670 -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 +190 -1
- package/dist/ui/rating.d.ts +4 -3
- package/dist/ui/rating.d.ts.map +1 -1
- package/dist/ui/rating.js +96 -79
- package/dist/ui/resizable.cjs +174 -1
- package/dist/ui/resizable.d.ts +7 -7
- package/dist/ui/resizable.d.ts.map +1 -1
- package/dist/ui/resizable.js +150 -55
- 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 +508 -1
- package/dist/ui/row-col.d.ts +13 -11
- package/dist/ui/row-col.d.ts.map +1 -1
- package/dist/ui/row-col.js +238 -207
- package/dist/ui/scroll-area.cjs +129 -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 +92 -49
- package/dist/ui/segmented.cjs +169 -1
- package/dist/ui/segmented.d.ts +6 -5
- package/dist/ui/segmented.d.ts.map +1 -1
- package/dist/ui/segmented.js +75 -63
- 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 +462 -1
- package/dist/ui/sheet.d.ts +16 -16
- package/dist/ui/sheet.d.ts.map +1 -1
- package/dist/ui/sheet.js +331 -141
- package/dist/ui/sidebar.cjs +1452 -1
- package/dist/ui/sidebar.d.ts +48 -48
- package/dist/ui/sidebar.d.ts.map +1 -1
- package/dist/ui/sidebar.js +1057 -439
- package/dist/ui/signature-pad.cjs +741 -0
- package/dist/ui/signature-pad.d.ts +115 -0
- package/dist/ui/signature-pad.d.ts.map +1 -0
- package/dist/ui/signature-pad.js +731 -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 +320 -1
- package/dist/ui/stat.d.ts +15 -15
- package/dist/ui/stat.d.ts.map +1 -1
- package/dist/ui/stat.js +275 -148
- 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 +199 -1
- package/dist/ui/switch.d.ts +4 -4
- package/dist/ui/switch.d.ts.map +1 -1
- package/dist/ui/switch.js +79 -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 +4 -1
- package/dist/utils.d.ts +2 -12
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +3 -6
- package/package.json +10 -2
|
@@ -1,868 +1,1187 @@
|
|
|
1
1
|
// ../../node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/embla-carousel.esm.js
|
|
2
|
-
function
|
|
3
|
-
return typeof
|
|
2
|
+
function isNumber(subject) {
|
|
3
|
+
return typeof subject === "number";
|
|
4
4
|
}
|
|
5
|
-
function
|
|
6
|
-
return typeof
|
|
5
|
+
function isString(subject) {
|
|
6
|
+
return typeof subject === "string";
|
|
7
7
|
}
|
|
8
|
-
function
|
|
9
|
-
return typeof
|
|
8
|
+
function isBoolean(subject) {
|
|
9
|
+
return typeof subject === "boolean";
|
|
10
10
|
}
|
|
11
|
-
function
|
|
12
|
-
return Object.prototype.toString.call(
|
|
11
|
+
function isObject(subject) {
|
|
12
|
+
return Object.prototype.toString.call(subject) === "[object Object]";
|
|
13
13
|
}
|
|
14
|
-
function
|
|
15
|
-
return Math.abs(
|
|
14
|
+
function mathAbs(n) {
|
|
15
|
+
return Math.abs(n);
|
|
16
16
|
}
|
|
17
|
-
function
|
|
18
|
-
return Math.sign(
|
|
17
|
+
function mathSign(n) {
|
|
18
|
+
return Math.sign(n);
|
|
19
19
|
}
|
|
20
|
-
function
|
|
21
|
-
return
|
|
20
|
+
function deltaAbs(valueB, valueA) {
|
|
21
|
+
return mathAbs(valueB - valueA);
|
|
22
22
|
}
|
|
23
|
-
function
|
|
24
|
-
|
|
23
|
+
function factorAbs(valueB, valueA) {
|
|
24
|
+
if (valueB === 0 || valueA === 0) return 0;
|
|
25
|
+
if (mathAbs(valueB) <= mathAbs(valueA)) return 0;
|
|
26
|
+
return mathAbs(deltaAbs(mathAbs(valueB), mathAbs(valueA)) / valueB);
|
|
25
27
|
}
|
|
26
|
-
function
|
|
27
|
-
return Math.round(
|
|
28
|
+
function roundToTwoDecimals(num) {
|
|
29
|
+
return Math.round(num * 100) / 100;
|
|
28
30
|
}
|
|
29
|
-
function
|
|
30
|
-
return
|
|
31
|
+
function arrayKeys(array) {
|
|
32
|
+
return objectKeys(array).map(Number);
|
|
31
33
|
}
|
|
32
|
-
function
|
|
33
|
-
return
|
|
34
|
+
function arrayLast(array) {
|
|
35
|
+
return array[arrayLastIndex(array)];
|
|
34
36
|
}
|
|
35
|
-
function
|
|
36
|
-
return Math.max(0,
|
|
37
|
+
function arrayLastIndex(array) {
|
|
38
|
+
return Math.max(0, array.length - 1);
|
|
37
39
|
}
|
|
38
|
-
function
|
|
39
|
-
return
|
|
40
|
+
function arrayIsLastIndex(array, index) {
|
|
41
|
+
return index === arrayLastIndex(array);
|
|
40
42
|
}
|
|
41
|
-
function
|
|
42
|
-
return Array.from(Array(
|
|
43
|
+
function arrayFromNumber(n, startAt = 0) {
|
|
44
|
+
return Array.from(Array(n), (_, i) => startAt + i);
|
|
43
45
|
}
|
|
44
|
-
function
|
|
45
|
-
return Object.keys(
|
|
46
|
+
function objectKeys(object) {
|
|
47
|
+
return Object.keys(object);
|
|
46
48
|
}
|
|
47
|
-
function
|
|
48
|
-
return [
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
function objectsMergeDeep(objectA, objectB) {
|
|
50
|
+
return [objectA, objectB].reduce((mergedObjects, currentObject) => {
|
|
51
|
+
objectKeys(currentObject).forEach((key) => {
|
|
52
|
+
const valueA = mergedObjects[key];
|
|
53
|
+
const valueB = currentObject[key];
|
|
54
|
+
mergedObjects[key] = isObject(valueA) && isObject(valueB) ? objectsMergeDeep(valueA, valueB) : valueB;
|
|
55
|
+
});
|
|
56
|
+
return mergedObjects;
|
|
57
|
+
}, {});
|
|
52
58
|
}
|
|
53
|
-
function
|
|
54
|
-
return
|
|
59
|
+
function isMouseEvent(evt, ownerWindow) {
|
|
60
|
+
return typeof ownerWindow.MouseEvent !== "undefined" && evt instanceof ownerWindow.MouseEvent;
|
|
55
61
|
}
|
|
56
|
-
function
|
|
57
|
-
|
|
58
|
-
start
|
|
59
|
-
center
|
|
60
|
-
end
|
|
62
|
+
function Alignment(align, viewSize) {
|
|
63
|
+
const predefined = {
|
|
64
|
+
start,
|
|
65
|
+
center,
|
|
66
|
+
end
|
|
61
67
|
};
|
|
62
|
-
function
|
|
68
|
+
function start() {
|
|
63
69
|
return 0;
|
|
64
70
|
}
|
|
65
|
-
function
|
|
66
|
-
return
|
|
71
|
+
function center(n) {
|
|
72
|
+
return end(n) / 2;
|
|
67
73
|
}
|
|
68
|
-
function
|
|
69
|
-
return
|
|
74
|
+
function end(n) {
|
|
75
|
+
return viewSize - n;
|
|
70
76
|
}
|
|
71
|
-
function
|
|
72
|
-
|
|
77
|
+
function measure(n, index) {
|
|
78
|
+
if (isString(align)) return predefined[align](n);
|
|
79
|
+
return align(viewSize, n, index);
|
|
73
80
|
}
|
|
74
|
-
return { measure
|
|
81
|
+
return { measure };
|
|
75
82
|
}
|
|
76
|
-
function
|
|
77
|
-
let
|
|
78
|
-
function
|
|
79
|
-
let
|
|
80
|
-
if ("addEventListener" in
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
83
|
+
function EventStore() {
|
|
84
|
+
let listeners = [];
|
|
85
|
+
function add(node, type, handler, options = { passive: true }) {
|
|
86
|
+
let removeListener;
|
|
87
|
+
if ("addEventListener" in node) {
|
|
88
|
+
node.addEventListener(type, handler, options);
|
|
89
|
+
removeListener = () => node.removeEventListener(type, handler, options);
|
|
90
|
+
} else {
|
|
91
|
+
const legacyMediaQueryList = node;
|
|
92
|
+
legacyMediaQueryList.addListener(handler);
|
|
93
|
+
removeListener = () => legacyMediaQueryList.removeListener(handler);
|
|
84
94
|
}
|
|
85
|
-
|
|
95
|
+
listeners.push(removeListener);
|
|
96
|
+
return self;
|
|
86
97
|
}
|
|
87
|
-
function
|
|
88
|
-
|
|
98
|
+
function clear() {
|
|
99
|
+
listeners = listeners.filter((remove) => remove());
|
|
89
100
|
}
|
|
90
|
-
|
|
91
|
-
add
|
|
92
|
-
clear
|
|
101
|
+
const self = {
|
|
102
|
+
add,
|
|
103
|
+
clear
|
|
93
104
|
};
|
|
94
|
-
return
|
|
105
|
+
return self;
|
|
95
106
|
}
|
|
96
|
-
function
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
107
|
+
function Animations(ownerDocument, ownerWindow, update, render) {
|
|
108
|
+
const documentVisibleHandler = EventStore();
|
|
109
|
+
const fixedTimeStep = 1e3 / 60;
|
|
110
|
+
let lastTimeStamp = null;
|
|
111
|
+
let accumulatedTime = 0;
|
|
112
|
+
let animationId = 0;
|
|
113
|
+
function init() {
|
|
114
|
+
documentVisibleHandler.add(ownerDocument, "visibilitychange", () => {
|
|
115
|
+
if (ownerDocument.hidden) reset();
|
|
101
116
|
});
|
|
102
117
|
}
|
|
103
|
-
function
|
|
104
|
-
|
|
118
|
+
function destroy() {
|
|
119
|
+
stop();
|
|
120
|
+
documentVisibleHandler.clear();
|
|
105
121
|
}
|
|
106
|
-
function
|
|
107
|
-
if (!
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
122
|
+
function animate(timeStamp) {
|
|
123
|
+
if (!animationId) return;
|
|
124
|
+
if (!lastTimeStamp) {
|
|
125
|
+
lastTimeStamp = timeStamp;
|
|
126
|
+
update();
|
|
127
|
+
update();
|
|
128
|
+
}
|
|
129
|
+
const timeElapsed = timeStamp - lastTimeStamp;
|
|
130
|
+
lastTimeStamp = timeStamp;
|
|
131
|
+
accumulatedTime += timeElapsed;
|
|
132
|
+
while (accumulatedTime >= fixedTimeStep) {
|
|
133
|
+
update();
|
|
134
|
+
accumulatedTime -= fixedTimeStep;
|
|
135
|
+
}
|
|
136
|
+
render(accumulatedTime / fixedTimeStep);
|
|
137
|
+
if (animationId) animationId = ownerWindow.requestAnimationFrame(animate);
|
|
112
138
|
}
|
|
113
|
-
function
|
|
114
|
-
|
|
139
|
+
function start() {
|
|
140
|
+
if (animationId) return;
|
|
141
|
+
animationId = ownerWindow.requestAnimationFrame(animate);
|
|
115
142
|
}
|
|
116
|
-
function
|
|
117
|
-
|
|
143
|
+
function stop() {
|
|
144
|
+
ownerWindow.cancelAnimationFrame(animationId);
|
|
145
|
+
lastTimeStamp = null;
|
|
146
|
+
accumulatedTime = 0;
|
|
147
|
+
animationId = 0;
|
|
118
148
|
}
|
|
119
|
-
function
|
|
120
|
-
|
|
149
|
+
function reset() {
|
|
150
|
+
lastTimeStamp = null;
|
|
151
|
+
accumulatedTime = 0;
|
|
121
152
|
}
|
|
122
153
|
return {
|
|
123
|
-
init
|
|
124
|
-
destroy
|
|
125
|
-
start
|
|
126
|
-
stop
|
|
127
|
-
update
|
|
128
|
-
render
|
|
154
|
+
init,
|
|
155
|
+
destroy,
|
|
156
|
+
start,
|
|
157
|
+
stop,
|
|
158
|
+
update,
|
|
159
|
+
render
|
|
129
160
|
};
|
|
130
161
|
}
|
|
131
|
-
function
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
return
|
|
142
|
-
}
|
|
143
|
-
function
|
|
144
|
-
|
|
162
|
+
function Axis(axis, contentDirection) {
|
|
163
|
+
const isRightToLeft = contentDirection === "rtl";
|
|
164
|
+
const isVertical = axis === "y";
|
|
165
|
+
const scroll = isVertical ? "y" : "x";
|
|
166
|
+
const cross = isVertical ? "x" : "y";
|
|
167
|
+
const sign = !isVertical && isRightToLeft ? -1 : 1;
|
|
168
|
+
const startEdge = getStartEdge();
|
|
169
|
+
const endEdge = getEndEdge();
|
|
170
|
+
function measureSize(nodeRect) {
|
|
171
|
+
const { height, width } = nodeRect;
|
|
172
|
+
return isVertical ? height : width;
|
|
173
|
+
}
|
|
174
|
+
function getStartEdge() {
|
|
175
|
+
if (isVertical) return "top";
|
|
176
|
+
return isRightToLeft ? "right" : "left";
|
|
177
|
+
}
|
|
178
|
+
function getEndEdge() {
|
|
179
|
+
if (isVertical) return "bottom";
|
|
180
|
+
return isRightToLeft ? "left" : "right";
|
|
181
|
+
}
|
|
182
|
+
function direction(n) {
|
|
183
|
+
return n * sign;
|
|
145
184
|
}
|
|
146
185
|
return {
|
|
147
|
-
scroll
|
|
148
|
-
cross
|
|
149
|
-
startEdge
|
|
150
|
-
endEdge
|
|
151
|
-
measureSize
|
|
152
|
-
direction
|
|
186
|
+
scroll,
|
|
187
|
+
cross,
|
|
188
|
+
startEdge,
|
|
189
|
+
endEdge,
|
|
190
|
+
measureSize,
|
|
191
|
+
direction
|
|
153
192
|
};
|
|
154
193
|
}
|
|
155
|
-
function
|
|
156
|
-
|
|
157
|
-
function
|
|
158
|
-
return
|
|
194
|
+
function Limit(min = 0, max = 0) {
|
|
195
|
+
const length = mathAbs(min - max);
|
|
196
|
+
function reachedMin(n) {
|
|
197
|
+
return n < min;
|
|
159
198
|
}
|
|
160
|
-
function
|
|
161
|
-
return
|
|
199
|
+
function reachedMax(n) {
|
|
200
|
+
return n > max;
|
|
162
201
|
}
|
|
163
|
-
function
|
|
164
|
-
return
|
|
202
|
+
function reachedAny(n) {
|
|
203
|
+
return reachedMin(n) || reachedMax(n);
|
|
165
204
|
}
|
|
166
|
-
function
|
|
167
|
-
|
|
205
|
+
function constrain(n) {
|
|
206
|
+
if (!reachedAny(n)) return n;
|
|
207
|
+
return reachedMin(n) ? min : max;
|
|
168
208
|
}
|
|
169
|
-
function
|
|
170
|
-
|
|
209
|
+
function removeOffset(n) {
|
|
210
|
+
if (!length) return n;
|
|
211
|
+
return n - length * Math.ceil((n - max) / length);
|
|
171
212
|
}
|
|
172
213
|
return {
|
|
173
|
-
length
|
|
174
|
-
max
|
|
175
|
-
min
|
|
176
|
-
constrain
|
|
177
|
-
reachedAny
|
|
178
|
-
reachedMax
|
|
179
|
-
reachedMin
|
|
180
|
-
removeOffset
|
|
214
|
+
length,
|
|
215
|
+
max,
|
|
216
|
+
min,
|
|
217
|
+
constrain,
|
|
218
|
+
reachedAny,
|
|
219
|
+
reachedMax,
|
|
220
|
+
reachedMin,
|
|
221
|
+
removeOffset
|
|
181
222
|
};
|
|
182
223
|
}
|
|
183
|
-
function
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
return
|
|
196
|
-
}
|
|
197
|
-
function
|
|
198
|
-
return
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
get
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
224
|
+
function Counter(max, start, loop) {
|
|
225
|
+
const { constrain } = Limit(0, max);
|
|
226
|
+
const loopEnd = max + 1;
|
|
227
|
+
let counter = withinLimit(start);
|
|
228
|
+
function withinLimit(n) {
|
|
229
|
+
return !loop ? constrain(n) : mathAbs((loopEnd + n) % loopEnd);
|
|
230
|
+
}
|
|
231
|
+
function get() {
|
|
232
|
+
return counter;
|
|
233
|
+
}
|
|
234
|
+
function set(n) {
|
|
235
|
+
counter = withinLimit(n);
|
|
236
|
+
return self;
|
|
237
|
+
}
|
|
238
|
+
function add(n) {
|
|
239
|
+
return clone().set(get() + n);
|
|
240
|
+
}
|
|
241
|
+
function clone() {
|
|
242
|
+
return Counter(max, get(), loop);
|
|
243
|
+
}
|
|
244
|
+
const self = {
|
|
245
|
+
get,
|
|
246
|
+
set,
|
|
247
|
+
add,
|
|
248
|
+
clone
|
|
205
249
|
};
|
|
206
|
-
return
|
|
250
|
+
return self;
|
|
207
251
|
}
|
|
208
|
-
function
|
|
209
|
-
|
|
252
|
+
function DragHandler(axis, rootNode, ownerDocument, ownerWindow, target, dragTracker, location, animation, scrollTo, scrollBody, scrollTarget, index, eventHandler, percentOfView, dragFree, dragThreshold, skipSnaps, baseFriction, watchDrag) {
|
|
253
|
+
const { cross: crossAxis, direction } = axis;
|
|
254
|
+
const focusNodes = [
|
|
210
255
|
"INPUT",
|
|
211
256
|
"SELECT",
|
|
212
257
|
"TEXTAREA"
|
|
213
|
-
]
|
|
258
|
+
];
|
|
259
|
+
const nonPassiveEvent = { passive: false };
|
|
260
|
+
const initEvents = EventStore();
|
|
261
|
+
const dragEvents = EventStore();
|
|
262
|
+
const goToNextThreshold = Limit(50, 225).constrain(percentOfView.measure(20));
|
|
263
|
+
const snapForceBoost = {
|
|
214
264
|
mouse: 300,
|
|
215
265
|
touch: 400
|
|
216
|
-
}
|
|
266
|
+
};
|
|
267
|
+
const freeForceBoost = {
|
|
217
268
|
mouse: 500,
|
|
218
269
|
touch: 600
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
270
|
+
};
|
|
271
|
+
const baseSpeed = dragFree ? 43 : 25;
|
|
272
|
+
let isMoving = false;
|
|
273
|
+
let startScroll = 0;
|
|
274
|
+
let startCross = 0;
|
|
275
|
+
let pointerIsDown = false;
|
|
276
|
+
let preventScroll = false;
|
|
277
|
+
let preventClick = false;
|
|
278
|
+
let isMouse = false;
|
|
279
|
+
function init(emblaApi) {
|
|
280
|
+
if (!watchDrag) return;
|
|
281
|
+
function downIfAllowed(evt) {
|
|
282
|
+
if (isBoolean(watchDrag) || watchDrag(emblaApi, evt)) down(evt);
|
|
283
|
+
}
|
|
284
|
+
const node = rootNode;
|
|
285
|
+
initEvents.add(node, "dragstart", (evt) => evt.preventDefault(), nonPassiveEvent).add(node, "touchmove", () => void 0, nonPassiveEvent).add(node, "touchend", () => void 0).add(node, "touchstart", downIfAllowed).add(node, "mousedown", downIfAllowed).add(node, "touchcancel", up).add(node, "contextmenu", up).add(node, "click", click, true);
|
|
286
|
+
}
|
|
287
|
+
function destroy() {
|
|
288
|
+
initEvents.clear();
|
|
289
|
+
dragEvents.clear();
|
|
290
|
+
}
|
|
291
|
+
function addDragEvents() {
|
|
292
|
+
const node = isMouse ? ownerDocument : rootNode;
|
|
293
|
+
dragEvents.add(node, "touchmove", move, nonPassiveEvent).add(node, "touchend", up).add(node, "mousemove", move, nonPassiveEvent).add(node, "mouseup", up);
|
|
294
|
+
}
|
|
295
|
+
function isFocusNode(node) {
|
|
296
|
+
const nodeName = node.nodeName || "";
|
|
297
|
+
return focusNodes.includes(nodeName);
|
|
298
|
+
}
|
|
299
|
+
function forceBoost() {
|
|
300
|
+
return (dragFree ? freeForceBoost : snapForceBoost)[isMouse ? "mouse" : "touch"];
|
|
301
|
+
}
|
|
302
|
+
function allowedForce(force, targetChanged) {
|
|
303
|
+
const next = index.add(mathSign(force) * -1);
|
|
304
|
+
const baseForce = scrollTarget.byDistance(force, !dragFree).distance;
|
|
305
|
+
if (dragFree || mathAbs(force) < goToNextThreshold) return baseForce;
|
|
306
|
+
if (skipSnaps && targetChanged) return baseForce * .5;
|
|
307
|
+
return scrollTarget.byIndex(next.get(), 0).distance;
|
|
308
|
+
}
|
|
309
|
+
function down(evt) {
|
|
310
|
+
const isMouseEvt = isMouseEvent(evt, ownerWindow);
|
|
311
|
+
isMouse = isMouseEvt;
|
|
312
|
+
preventClick = dragFree && isMouseEvt && !evt.buttons && isMoving;
|
|
313
|
+
isMoving = deltaAbs(target.get(), location.get()) >= 2;
|
|
314
|
+
if (isMouseEvt && evt.button !== 0) return;
|
|
315
|
+
if (isFocusNode(evt.target)) return;
|
|
316
|
+
pointerIsDown = true;
|
|
317
|
+
dragTracker.pointerDown(evt);
|
|
318
|
+
scrollBody.useFriction(0).useDuration(0);
|
|
319
|
+
target.set(location);
|
|
320
|
+
addDragEvents();
|
|
321
|
+
startScroll = dragTracker.readPoint(evt);
|
|
322
|
+
startCross = dragTracker.readPoint(evt, crossAxis);
|
|
323
|
+
eventHandler.emit("pointerDown");
|
|
324
|
+
}
|
|
325
|
+
function move(evt) {
|
|
326
|
+
if (!isMouseEvent(evt, ownerWindow) && evt.touches.length >= 2) return up(evt);
|
|
327
|
+
const lastScroll = dragTracker.readPoint(evt);
|
|
328
|
+
const lastCross = dragTracker.readPoint(evt, crossAxis);
|
|
329
|
+
const diffScroll = deltaAbs(lastScroll, startScroll);
|
|
330
|
+
const diffCross = deltaAbs(lastCross, startCross);
|
|
331
|
+
if (!preventScroll && !isMouse) {
|
|
332
|
+
if (!evt.cancelable) return up(evt);
|
|
333
|
+
preventScroll = diffScroll > diffCross;
|
|
334
|
+
if (!preventScroll) return up(evt);
|
|
335
|
+
}
|
|
336
|
+
const diff = dragTracker.pointerMove(evt);
|
|
337
|
+
if (diffScroll > dragThreshold) preventClick = true;
|
|
338
|
+
scrollBody.useFriction(.3).useDuration(.75);
|
|
339
|
+
animation.start();
|
|
340
|
+
target.add(direction(diff));
|
|
341
|
+
evt.preventDefault();
|
|
342
|
+
}
|
|
343
|
+
function up(evt) {
|
|
344
|
+
const targetChanged = scrollTarget.byDistance(0, false).index !== index.get();
|
|
345
|
+
const rawForce = dragTracker.pointerUp(evt) * forceBoost();
|
|
346
|
+
const force = allowedForce(direction(rawForce), targetChanged);
|
|
347
|
+
const forceFactor = factorAbs(rawForce, force);
|
|
348
|
+
const speed = baseSpeed - 10 * forceFactor;
|
|
349
|
+
const friction = baseFriction + forceFactor / 50;
|
|
350
|
+
preventScroll = false;
|
|
351
|
+
pointerIsDown = false;
|
|
352
|
+
dragEvents.clear();
|
|
353
|
+
scrollBody.useDuration(speed).useFriction(friction);
|
|
354
|
+
scrollTo.distance(force, !dragFree);
|
|
355
|
+
isMouse = false;
|
|
356
|
+
eventHandler.emit("pointerUp");
|
|
357
|
+
}
|
|
358
|
+
function click(evt) {
|
|
359
|
+
if (preventClick) {
|
|
360
|
+
evt.stopPropagation();
|
|
361
|
+
evt.preventDefault();
|
|
362
|
+
preventClick = false;
|
|
224
363
|
}
|
|
225
|
-
let i = t;
|
|
226
|
-
j.add(i, "dragstart", (e) => e.preventDefault(), A).add(i, "touchmove", () => void 0, A).add(i, "touchend", () => void 0).add(i, "touchstart", r).add(i, "mousedown", r).add(i, "touchcancel", V).add(i, "contextmenu", V).add(i, "click", de, !0);
|
|
227
|
-
}
|
|
228
|
-
function oe() {
|
|
229
|
-
j.clear(), M.clear();
|
|
230
|
-
}
|
|
231
|
-
function se() {
|
|
232
|
-
let e = R ? r : t;
|
|
233
|
-
M.add(e, "touchmove", B, A).add(e, "touchend", V).add(e, "mousemove", B, A).add(e, "mouseup", V);
|
|
234
|
-
}
|
|
235
|
-
function ce(e) {
|
|
236
|
-
let t = e.nodeName || "";
|
|
237
|
-
return k.includes(t);
|
|
238
|
-
}
|
|
239
|
-
function le() {
|
|
240
|
-
return (S ? ne : te)[R ? "mouse" : "touch"];
|
|
241
|
-
}
|
|
242
|
-
function z(e, t) {
|
|
243
|
-
let n = _.add(a(e) * -1), r = h.byDistance(e, !S).distance;
|
|
244
|
-
return S || i(e) < ee ? r : w && t ? r * .5 : h.byIndex(n.get(), 0).distance;
|
|
245
|
-
}
|
|
246
|
-
function ue(e) {
|
|
247
|
-
let t = g(e, c);
|
|
248
|
-
R = t, L = S && t && !e.buttons && ie, ie = o(l.get(), d.get()) >= 2, t && e.button !== 0 || ce(e.target) || (F = !0, u.pointerDown(e), m.useFriction(0).useDuration(0), l.set(d), se(), N = u.readPoint(e), P = u.readPoint(e, D), y.emit("pointerDown"));
|
|
249
|
-
}
|
|
250
|
-
function B(e) {
|
|
251
|
-
if (!g(e, c) && e.touches.length >= 2) return V(e);
|
|
252
|
-
let t = u.readPoint(e), n = u.readPoint(e, D), r = o(t, N), i = o(n, P);
|
|
253
|
-
if (!I && !R && (!e.cancelable || (I = r > i, !I))) return V(e);
|
|
254
|
-
let a = u.pointerMove(e);
|
|
255
|
-
r > C && (L = !0), m.useFriction(.3).useDuration(.75), f.start(), l.add(O(a)), e.preventDefault();
|
|
256
|
-
}
|
|
257
|
-
function V(e) {
|
|
258
|
-
let t = h.byDistance(0, !1).index !== _.get(), n = u.pointerUp(e) * le(), r = z(O(n), t), i = s(n, r), a = re - 10 * i, o = T + i / 50;
|
|
259
|
-
I = !1, F = !1, M.clear(), m.useDuration(a).useFriction(o), p.distance(r, !S), R = !1, y.emit("pointerUp");
|
|
260
|
-
}
|
|
261
|
-
function de(e) {
|
|
262
|
-
L &&= (e.stopPropagation(), e.preventDefault(), !1);
|
|
263
364
|
}
|
|
264
|
-
function
|
|
265
|
-
return
|
|
365
|
+
function pointerDown() {
|
|
366
|
+
return pointerIsDown;
|
|
266
367
|
}
|
|
267
368
|
return {
|
|
268
|
-
init
|
|
269
|
-
destroy
|
|
270
|
-
pointerDown
|
|
369
|
+
init,
|
|
370
|
+
destroy,
|
|
371
|
+
pointerDown
|
|
271
372
|
};
|
|
272
373
|
}
|
|
273
|
-
function
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
return
|
|
288
|
-
}
|
|
289
|
-
function
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
374
|
+
function DragTracker(axis, ownerWindow) {
|
|
375
|
+
const logInterval = 170;
|
|
376
|
+
let startEvent;
|
|
377
|
+
let lastEvent;
|
|
378
|
+
function readTime(evt) {
|
|
379
|
+
return evt.timeStamp;
|
|
380
|
+
}
|
|
381
|
+
function readPoint(evt, evtAxis) {
|
|
382
|
+
const coord = `client${(evtAxis || axis.scroll) === "x" ? "X" : "Y"}`;
|
|
383
|
+
return (isMouseEvent(evt, ownerWindow) ? evt : evt.touches[0])[coord];
|
|
384
|
+
}
|
|
385
|
+
function pointerDown(evt) {
|
|
386
|
+
startEvent = evt;
|
|
387
|
+
lastEvent = evt;
|
|
388
|
+
return readPoint(evt);
|
|
389
|
+
}
|
|
390
|
+
function pointerMove(evt) {
|
|
391
|
+
const diff = readPoint(evt) - readPoint(lastEvent);
|
|
392
|
+
const expired = readTime(evt) - readTime(startEvent) > logInterval;
|
|
393
|
+
lastEvent = evt;
|
|
394
|
+
if (expired) startEvent = evt;
|
|
395
|
+
return diff;
|
|
396
|
+
}
|
|
397
|
+
function pointerUp(evt) {
|
|
398
|
+
if (!startEvent || !lastEvent) return 0;
|
|
399
|
+
const diffDrag = readPoint(lastEvent) - readPoint(startEvent);
|
|
400
|
+
const diffTime = readTime(evt) - readTime(startEvent);
|
|
401
|
+
const expired = readTime(evt) - readTime(lastEvent) > logInterval;
|
|
402
|
+
const force = diffDrag / diffTime;
|
|
403
|
+
return diffTime && !expired && mathAbs(force) > .1 ? force : 0;
|
|
293
404
|
}
|
|
294
405
|
return {
|
|
295
|
-
pointerDown
|
|
296
|
-
pointerMove
|
|
297
|
-
pointerUp
|
|
298
|
-
readPoint
|
|
406
|
+
pointerDown,
|
|
407
|
+
pointerMove,
|
|
408
|
+
pointerUp,
|
|
409
|
+
readPoint
|
|
299
410
|
};
|
|
300
411
|
}
|
|
301
|
-
function
|
|
302
|
-
function
|
|
303
|
-
|
|
412
|
+
function NodeRects() {
|
|
413
|
+
function measure(node) {
|
|
414
|
+
const { offsetTop, offsetLeft, offsetWidth, offsetHeight } = node;
|
|
304
415
|
return {
|
|
305
|
-
top:
|
|
306
|
-
right:
|
|
307
|
-
bottom:
|
|
308
|
-
left:
|
|
309
|
-
width:
|
|
310
|
-
height:
|
|
416
|
+
top: offsetTop,
|
|
417
|
+
right: offsetLeft + offsetWidth,
|
|
418
|
+
bottom: offsetTop + offsetHeight,
|
|
419
|
+
left: offsetLeft,
|
|
420
|
+
width: offsetWidth,
|
|
421
|
+
height: offsetHeight
|
|
311
422
|
};
|
|
312
423
|
}
|
|
313
|
-
return { measure
|
|
424
|
+
return { measure };
|
|
314
425
|
}
|
|
315
|
-
function
|
|
316
|
-
function
|
|
317
|
-
return
|
|
426
|
+
function PercentOfView(viewSize) {
|
|
427
|
+
function measure(n) {
|
|
428
|
+
return viewSize * (n / 100);
|
|
318
429
|
}
|
|
319
|
-
return { measure
|
|
430
|
+
return { measure };
|
|
320
431
|
}
|
|
321
|
-
function
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
432
|
+
function ResizeHandler(container, eventHandler, ownerWindow, slides, axis, watchResize, nodeRects) {
|
|
433
|
+
const observeNodes = [container].concat(slides);
|
|
434
|
+
let resizeObserver;
|
|
435
|
+
let containerSize;
|
|
436
|
+
let slideSizes = [];
|
|
437
|
+
let destroyed = false;
|
|
438
|
+
function readSize(node) {
|
|
439
|
+
return axis.measureSize(nodeRects.measure(node));
|
|
440
|
+
}
|
|
441
|
+
function init(emblaApi) {
|
|
442
|
+
if (!watchResize) return;
|
|
443
|
+
containerSize = readSize(container);
|
|
444
|
+
slideSizes = slides.map(readSize);
|
|
445
|
+
function defaultCallback(entries) {
|
|
446
|
+
for (const entry of entries) {
|
|
447
|
+
if (destroyed) return;
|
|
448
|
+
const isContainer = entry.target === container;
|
|
449
|
+
const slideIndex = slides.indexOf(entry.target);
|
|
450
|
+
const lastSize = isContainer ? containerSize : slideSizes[slideIndex];
|
|
451
|
+
if (mathAbs(readSize(isContainer ? container : slides[slideIndex]) - lastSize) >= .5) {
|
|
452
|
+
emblaApi.reInit();
|
|
453
|
+
eventHandler.emit("resize");
|
|
335
454
|
break;
|
|
336
455
|
}
|
|
337
456
|
}
|
|
338
457
|
}
|
|
339
|
-
|
|
340
|
-
(
|
|
341
|
-
})
|
|
342
|
-
|
|
458
|
+
resizeObserver = new ResizeObserver((entries) => {
|
|
459
|
+
if (isBoolean(watchResize) || watchResize(emblaApi, entries)) defaultCallback(entries);
|
|
460
|
+
});
|
|
461
|
+
ownerWindow.requestAnimationFrame(() => {
|
|
462
|
+
observeNodes.forEach((node) => resizeObserver.observe(node));
|
|
343
463
|
});
|
|
344
464
|
}
|
|
345
|
-
function
|
|
346
|
-
|
|
465
|
+
function destroy() {
|
|
466
|
+
destroyed = true;
|
|
467
|
+
if (resizeObserver) resizeObserver.disconnect();
|
|
347
468
|
}
|
|
348
469
|
return {
|
|
349
|
-
init
|
|
350
|
-
destroy
|
|
470
|
+
init,
|
|
471
|
+
destroy
|
|
351
472
|
};
|
|
352
473
|
}
|
|
353
|
-
function
|
|
354
|
-
let
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
474
|
+
function ScrollBody(location, offsetLocation, previousLocation, target, baseDuration, baseFriction) {
|
|
475
|
+
let scrollVelocity = 0;
|
|
476
|
+
let scrollDirection = 0;
|
|
477
|
+
let scrollDuration = baseDuration;
|
|
478
|
+
let scrollFriction = baseFriction;
|
|
479
|
+
let rawLocation = location.get();
|
|
480
|
+
let rawLocationPrevious = 0;
|
|
481
|
+
function seek() {
|
|
482
|
+
const displacement = target.get() - location.get();
|
|
483
|
+
const isInstant = !scrollDuration;
|
|
484
|
+
let scrollDistance = 0;
|
|
485
|
+
if (isInstant) {
|
|
486
|
+
scrollVelocity = 0;
|
|
487
|
+
previousLocation.set(target);
|
|
488
|
+
location.set(target);
|
|
489
|
+
scrollDistance = displacement;
|
|
490
|
+
} else {
|
|
491
|
+
previousLocation.set(location);
|
|
492
|
+
scrollVelocity += displacement / scrollDuration;
|
|
493
|
+
scrollVelocity *= scrollFriction;
|
|
494
|
+
rawLocation += scrollVelocity;
|
|
495
|
+
location.add(scrollVelocity);
|
|
496
|
+
scrollDistance = rawLocation - rawLocationPrevious;
|
|
497
|
+
}
|
|
498
|
+
scrollDirection = mathSign(scrollDistance);
|
|
499
|
+
rawLocationPrevious = rawLocation;
|
|
500
|
+
return self;
|
|
501
|
+
}
|
|
502
|
+
function settled() {
|
|
503
|
+
return mathAbs(target.get() - offsetLocation.get()) < .001;
|
|
504
|
+
}
|
|
505
|
+
function duration() {
|
|
506
|
+
return scrollDuration;
|
|
507
|
+
}
|
|
508
|
+
function direction() {
|
|
509
|
+
return scrollDirection;
|
|
510
|
+
}
|
|
511
|
+
function velocity() {
|
|
512
|
+
return scrollVelocity;
|
|
513
|
+
}
|
|
514
|
+
function useBaseDuration() {
|
|
515
|
+
return useDuration(baseDuration);
|
|
516
|
+
}
|
|
517
|
+
function useBaseFriction() {
|
|
518
|
+
return useFriction(baseFriction);
|
|
519
|
+
}
|
|
520
|
+
function useDuration(n) {
|
|
521
|
+
scrollDuration = n;
|
|
522
|
+
return self;
|
|
523
|
+
}
|
|
524
|
+
function useFriction(n) {
|
|
525
|
+
scrollFriction = n;
|
|
526
|
+
return self;
|
|
527
|
+
}
|
|
528
|
+
const self = {
|
|
529
|
+
direction,
|
|
530
|
+
duration,
|
|
531
|
+
velocity,
|
|
532
|
+
seek,
|
|
533
|
+
settled,
|
|
534
|
+
useBaseFriction,
|
|
535
|
+
useBaseDuration,
|
|
536
|
+
useFriction,
|
|
537
|
+
useDuration
|
|
393
538
|
};
|
|
394
|
-
return
|
|
539
|
+
return self;
|
|
395
540
|
}
|
|
396
|
-
function
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
function
|
|
402
|
-
if (
|
|
403
|
-
|
|
404
|
-
|
|
541
|
+
function ScrollBounds(limit, location, target, scrollBody, percentOfView) {
|
|
542
|
+
const pullBackThreshold = percentOfView.measure(10);
|
|
543
|
+
const edgeOffsetTolerance = percentOfView.measure(50);
|
|
544
|
+
const frictionLimit = Limit(.1, .99);
|
|
545
|
+
let disabled = false;
|
|
546
|
+
function shouldConstrain() {
|
|
547
|
+
if (disabled) return false;
|
|
548
|
+
if (!limit.reachedAny(target.get())) return false;
|
|
549
|
+
if (!limit.reachedAny(location.get())) return false;
|
|
550
|
+
return true;
|
|
551
|
+
}
|
|
552
|
+
function constrain(pointerDown) {
|
|
553
|
+
if (!shouldConstrain()) return;
|
|
554
|
+
const diffToEdge = mathAbs(limit[limit.reachedMin(location.get()) ? "min" : "max"] - location.get());
|
|
555
|
+
const diffToTarget = target.get() - location.get();
|
|
556
|
+
const friction = frictionLimit.constrain(diffToEdge / edgeOffsetTolerance);
|
|
557
|
+
target.subtract(diffToTarget * friction);
|
|
558
|
+
if (!pointerDown && mathAbs(diffToTarget) < pullBackThreshold) {
|
|
559
|
+
target.set(limit.constrain(target.get()));
|
|
560
|
+
scrollBody.useDuration(25).useBaseFriction();
|
|
561
|
+
}
|
|
405
562
|
}
|
|
406
|
-
function
|
|
407
|
-
|
|
563
|
+
function toggleActive(active) {
|
|
564
|
+
disabled = !active;
|
|
408
565
|
}
|
|
409
566
|
return {
|
|
410
|
-
shouldConstrain
|
|
411
|
-
constrain
|
|
412
|
-
toggleActive
|
|
567
|
+
shouldConstrain,
|
|
568
|
+
constrain,
|
|
569
|
+
toggleActive
|
|
413
570
|
};
|
|
414
571
|
}
|
|
415
|
-
function
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
function
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
572
|
+
function ScrollContain(viewSize, contentSize, snapsAligned, containScroll, pixelTolerance) {
|
|
573
|
+
const scrollBounds = Limit(-contentSize + viewSize, 0);
|
|
574
|
+
const snapsBounded = measureBounded();
|
|
575
|
+
const scrollContainLimit = findScrollContainLimit();
|
|
576
|
+
const snapsContained = measureContained();
|
|
577
|
+
function usePixelTolerance(bound, snap) {
|
|
578
|
+
return deltaAbs(bound, snap) <= 1;
|
|
579
|
+
}
|
|
580
|
+
function findScrollContainLimit() {
|
|
581
|
+
const startSnap = snapsBounded[0];
|
|
582
|
+
const endSnap = arrayLast(snapsBounded);
|
|
583
|
+
return Limit(snapsBounded.lastIndexOf(startSnap), snapsBounded.indexOf(endSnap) + 1);
|
|
584
|
+
}
|
|
585
|
+
function measureBounded() {
|
|
586
|
+
return snapsAligned.map((snapAligned, index) => {
|
|
587
|
+
const { min, max } = scrollBounds;
|
|
588
|
+
const snap = scrollBounds.constrain(snapAligned);
|
|
589
|
+
const isFirst = !index;
|
|
590
|
+
const isLast = arrayIsLastIndex(snapsAligned, index);
|
|
591
|
+
if (isFirst) return max;
|
|
592
|
+
if (isLast) return min;
|
|
593
|
+
if (usePixelTolerance(min, snap)) return min;
|
|
594
|
+
if (usePixelTolerance(max, snap)) return max;
|
|
595
|
+
return snap;
|
|
596
|
+
}).map((scrollBound) => parseFloat(scrollBound.toFixed(3)));
|
|
597
|
+
}
|
|
598
|
+
function measureContained() {
|
|
599
|
+
if (contentSize <= viewSize + pixelTolerance) return [scrollBounds.max];
|
|
600
|
+
if (containScroll === "keepSnaps") return snapsBounded;
|
|
601
|
+
const { min, max } = scrollContainLimit;
|
|
602
|
+
return snapsBounded.slice(min, max);
|
|
435
603
|
}
|
|
436
604
|
return {
|
|
437
|
-
snapsContained
|
|
438
|
-
scrollContainLimit
|
|
605
|
+
snapsContained,
|
|
606
|
+
scrollContainLimit
|
|
439
607
|
};
|
|
440
608
|
}
|
|
441
|
-
function
|
|
442
|
-
|
|
443
|
-
return { limit:
|
|
609
|
+
function ScrollLimit(contentSize, scrollSnaps, loop) {
|
|
610
|
+
const max = scrollSnaps[0];
|
|
611
|
+
return { limit: Limit(loop ? max - contentSize : arrayLast(scrollSnaps), max) };
|
|
444
612
|
}
|
|
445
|
-
function
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
613
|
+
function ScrollLooper(contentSize, limit, location, vectors) {
|
|
614
|
+
const jointSafety = .1;
|
|
615
|
+
const { reachedMin, reachedMax } = Limit(limit.min + jointSafety, limit.max + jointSafety);
|
|
616
|
+
function shouldLoop(direction) {
|
|
617
|
+
if (direction === 1) return reachedMax(location.get());
|
|
618
|
+
if (direction === -1) return reachedMin(location.get());
|
|
619
|
+
return false;
|
|
620
|
+
}
|
|
621
|
+
function loop(direction) {
|
|
622
|
+
if (!shouldLoop(direction)) return;
|
|
623
|
+
const loopDistance = contentSize * (direction * -1);
|
|
624
|
+
vectors.forEach((v) => v.add(loopDistance));
|
|
625
|
+
}
|
|
626
|
+
return { loop };
|
|
456
627
|
}
|
|
457
|
-
function
|
|
458
|
-
|
|
459
|
-
function
|
|
460
|
-
|
|
461
|
-
return
|
|
628
|
+
function ScrollProgress(limit) {
|
|
629
|
+
const { max, length } = limit;
|
|
630
|
+
function get(n) {
|
|
631
|
+
const currentLocation = n - max;
|
|
632
|
+
return length ? currentLocation / -length : 0;
|
|
462
633
|
}
|
|
463
|
-
return { get
|
|
634
|
+
return { get };
|
|
464
635
|
}
|
|
465
|
-
function
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
636
|
+
function ScrollSnaps(axis, alignment, containerRect, slideRects, slidesToScroll) {
|
|
637
|
+
const { startEdge, endEdge } = axis;
|
|
638
|
+
const { groupSlides } = slidesToScroll;
|
|
639
|
+
const alignments = measureSizes().map(alignment.measure);
|
|
640
|
+
const snaps = measureUnaligned();
|
|
641
|
+
const snapsAligned = measureAligned();
|
|
642
|
+
function measureSizes() {
|
|
643
|
+
return groupSlides(slideRects).map((rects) => arrayLast(rects)[endEdge] - rects[0][startEdge]).map(mathAbs);
|
|
469
644
|
}
|
|
470
|
-
function
|
|
471
|
-
return
|
|
645
|
+
function measureUnaligned() {
|
|
646
|
+
return slideRects.map((rect) => containerRect[startEdge] - rect[startEdge]).map((snap) => -mathAbs(snap));
|
|
472
647
|
}
|
|
473
|
-
function
|
|
474
|
-
return
|
|
648
|
+
function measureAligned() {
|
|
649
|
+
return groupSlides(snaps).map((g) => g[0]).map((snap, index) => snap + alignments[index]);
|
|
475
650
|
}
|
|
476
651
|
return {
|
|
477
|
-
snaps
|
|
478
|
-
snapsAligned
|
|
652
|
+
snaps,
|
|
653
|
+
snapsAligned
|
|
479
654
|
};
|
|
480
655
|
}
|
|
481
|
-
function
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
656
|
+
function SlideRegistry(containSnaps, containScroll, scrollSnaps, scrollContainLimit, slidesToScroll, slideIndexes) {
|
|
657
|
+
const { groupSlides } = slidesToScroll;
|
|
658
|
+
const { min, max } = scrollContainLimit;
|
|
659
|
+
const slideRegistry = createSlideRegistry();
|
|
660
|
+
function createSlideRegistry() {
|
|
661
|
+
const groupedSlideIndexes = groupSlides(slideIndexes);
|
|
662
|
+
const doNotContain = !containSnaps || containScroll === "keepSnaps";
|
|
663
|
+
if (scrollSnaps.length === 1) return [slideIndexes];
|
|
664
|
+
if (doNotContain) return groupedSlideIndexes;
|
|
665
|
+
return groupedSlideIndexes.slice(min, max).map((group, index, groups) => {
|
|
666
|
+
const isFirst = !index;
|
|
667
|
+
const isLast = arrayIsLastIndex(groups, index);
|
|
668
|
+
if (isFirst) return arrayFromNumber(arrayLast(groups[0]) + 1);
|
|
669
|
+
if (isLast) return arrayFromNumber(arrayLastIndex(slideIndexes) - arrayLast(groups)[0] + 1, arrayLast(groups)[0]);
|
|
670
|
+
return group;
|
|
488
671
|
});
|
|
489
672
|
}
|
|
490
|
-
return { slideRegistry
|
|
673
|
+
return { slideRegistry };
|
|
491
674
|
}
|
|
492
|
-
function
|
|
493
|
-
|
|
494
|
-
function
|
|
495
|
-
return
|
|
496
|
-
}
|
|
497
|
-
function
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
675
|
+
function ScrollTarget(loop, scrollSnaps, contentSize, limit, targetVector) {
|
|
676
|
+
const { reachedAny, removeOffset, constrain } = limit;
|
|
677
|
+
function minDistance(distances) {
|
|
678
|
+
return distances.concat().sort((a, b) => mathAbs(a) - mathAbs(b))[0];
|
|
679
|
+
}
|
|
680
|
+
function findTargetSnap(target) {
|
|
681
|
+
const distance = loop ? removeOffset(target) : constrain(target);
|
|
682
|
+
const { index } = scrollSnaps.map((snap, index) => ({
|
|
683
|
+
diff: shortcut(snap - distance, 0),
|
|
684
|
+
index
|
|
685
|
+
})).sort((d1, d2) => mathAbs(d1.diff) - mathAbs(d2.diff))[0];
|
|
502
686
|
return {
|
|
503
|
-
index
|
|
504
|
-
distance
|
|
687
|
+
index,
|
|
688
|
+
distance
|
|
505
689
|
};
|
|
506
690
|
}
|
|
507
|
-
function
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
691
|
+
function shortcut(target, direction) {
|
|
692
|
+
const targets = [
|
|
693
|
+
target,
|
|
694
|
+
target + contentSize,
|
|
695
|
+
target - contentSize
|
|
512
696
|
];
|
|
513
|
-
if (!
|
|
514
|
-
if (!
|
|
515
|
-
|
|
516
|
-
|
|
697
|
+
if (!loop) return target;
|
|
698
|
+
if (!direction) return minDistance(targets);
|
|
699
|
+
const matchingTargets = targets.filter((t) => mathSign(t) === direction);
|
|
700
|
+
if (matchingTargets.length) return minDistance(matchingTargets);
|
|
701
|
+
return arrayLast(targets) - contentSize;
|
|
517
702
|
}
|
|
518
|
-
function
|
|
703
|
+
function byIndex(index, direction) {
|
|
519
704
|
return {
|
|
520
|
-
index
|
|
521
|
-
distance:
|
|
705
|
+
index,
|
|
706
|
+
distance: shortcut(scrollSnaps[index] - targetVector.get(), direction)
|
|
522
707
|
};
|
|
523
708
|
}
|
|
524
|
-
function
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
709
|
+
function byDistance(distance, snap) {
|
|
710
|
+
const target = targetVector.get() + distance;
|
|
711
|
+
const { index, distance: targetSnapDistance } = findTargetSnap(target);
|
|
712
|
+
const reachedBound = !loop && reachedAny(target);
|
|
713
|
+
if (!snap || reachedBound) return {
|
|
714
|
+
index,
|
|
715
|
+
distance
|
|
716
|
+
};
|
|
717
|
+
return {
|
|
718
|
+
index,
|
|
719
|
+
distance: distance + shortcut(scrollSnaps[index] - targetSnapDistance, 0)
|
|
532
720
|
};
|
|
533
721
|
}
|
|
534
722
|
return {
|
|
535
|
-
byDistance
|
|
536
|
-
byIndex
|
|
537
|
-
shortcut
|
|
723
|
+
byDistance,
|
|
724
|
+
byIndex,
|
|
725
|
+
shortcut
|
|
538
726
|
};
|
|
539
727
|
}
|
|
540
|
-
function
|
|
541
|
-
function
|
|
542
|
-
|
|
543
|
-
|
|
728
|
+
function ScrollTo(animation, indexCurrent, indexPrevious, scrollBody, scrollTarget, targetVector, eventHandler) {
|
|
729
|
+
function scrollTo(target) {
|
|
730
|
+
const distanceDiff = target.distance;
|
|
731
|
+
const indexDiff = target.index !== indexCurrent.get();
|
|
732
|
+
targetVector.add(distanceDiff);
|
|
733
|
+
if (distanceDiff) {
|
|
734
|
+
if (scrollBody.duration()) animation.start();
|
|
735
|
+
else {
|
|
736
|
+
animation.update();
|
|
737
|
+
animation.render(1);
|
|
738
|
+
animation.update();
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
if (indexDiff) {
|
|
742
|
+
indexPrevious.set(indexCurrent.get());
|
|
743
|
+
indexCurrent.set(target.index);
|
|
744
|
+
eventHandler.emit("select");
|
|
745
|
+
}
|
|
544
746
|
}
|
|
545
|
-
function
|
|
546
|
-
|
|
747
|
+
function distance(n, snap) {
|
|
748
|
+
scrollTo(scrollTarget.byDistance(n, snap));
|
|
547
749
|
}
|
|
548
|
-
function
|
|
549
|
-
|
|
550
|
-
|
|
750
|
+
function index(n, direction) {
|
|
751
|
+
const targetIndex = indexCurrent.clone().set(n);
|
|
752
|
+
scrollTo(scrollTarget.byIndex(targetIndex.get(), direction));
|
|
551
753
|
}
|
|
552
754
|
return {
|
|
553
|
-
distance
|
|
554
|
-
index
|
|
755
|
+
distance,
|
|
756
|
+
index
|
|
555
757
|
};
|
|
556
758
|
}
|
|
557
|
-
function
|
|
558
|
-
|
|
559
|
-
passive:
|
|
560
|
-
capture:
|
|
561
|
-
}
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
759
|
+
function SlideFocus(root, slides, slideRegistry, scrollTo, scrollBody, eventStore, eventHandler, watchFocus) {
|
|
760
|
+
const focusListenerOptions = {
|
|
761
|
+
passive: true,
|
|
762
|
+
capture: true
|
|
763
|
+
};
|
|
764
|
+
let lastTabPressTime = 0;
|
|
765
|
+
function init(emblaApi) {
|
|
766
|
+
if (!watchFocus) return;
|
|
767
|
+
function defaultCallback(index) {
|
|
768
|
+
if ((/* @__PURE__ */ new Date()).getTime() - lastTabPressTime > 10) return;
|
|
769
|
+
eventHandler.emit("slideFocusStart");
|
|
770
|
+
root.scrollLeft = 0;
|
|
771
|
+
const group = slideRegistry.findIndex((group) => group.includes(index));
|
|
772
|
+
if (!isNumber(group)) return;
|
|
773
|
+
scrollBody.useDuration(0);
|
|
774
|
+
scrollTo.index(group, 0);
|
|
775
|
+
eventHandler.emit("slideFocus");
|
|
569
776
|
}
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
777
|
+
eventStore.add(document, "keydown", registerTabPress, false);
|
|
778
|
+
slides.forEach((slide, slideIndex) => {
|
|
779
|
+
eventStore.add(slide, "focus", (evt) => {
|
|
780
|
+
if (isBoolean(watchFocus) || watchFocus(emblaApi, evt)) defaultCallback(slideIndex);
|
|
781
|
+
}, focusListenerOptions);
|
|
574
782
|
});
|
|
575
783
|
}
|
|
576
|
-
function
|
|
577
|
-
|
|
784
|
+
function registerTabPress(event) {
|
|
785
|
+
if (event.code === "Tab") lastTabPressTime = (/* @__PURE__ */ new Date()).getTime();
|
|
578
786
|
}
|
|
579
|
-
return { init
|
|
787
|
+
return { init };
|
|
580
788
|
}
|
|
581
|
-
function
|
|
582
|
-
let
|
|
583
|
-
function
|
|
584
|
-
return
|
|
789
|
+
function Vector1D(initialValue) {
|
|
790
|
+
let value = initialValue;
|
|
791
|
+
function get() {
|
|
792
|
+
return value;
|
|
585
793
|
}
|
|
586
|
-
function
|
|
587
|
-
|
|
794
|
+
function set(n) {
|
|
795
|
+
value = normalizeInput(n);
|
|
588
796
|
}
|
|
589
|
-
function
|
|
590
|
-
|
|
797
|
+
function add(n) {
|
|
798
|
+
value += normalizeInput(n);
|
|
591
799
|
}
|
|
592
|
-
function
|
|
593
|
-
|
|
800
|
+
function subtract(n) {
|
|
801
|
+
value -= normalizeInput(n);
|
|
594
802
|
}
|
|
595
|
-
function
|
|
596
|
-
return
|
|
803
|
+
function normalizeInput(n) {
|
|
804
|
+
return isNumber(n) ? n : n.get();
|
|
597
805
|
}
|
|
598
806
|
return {
|
|
599
|
-
get
|
|
600
|
-
set
|
|
601
|
-
add
|
|
602
|
-
subtract
|
|
807
|
+
get,
|
|
808
|
+
set,
|
|
809
|
+
add,
|
|
810
|
+
subtract
|
|
603
811
|
};
|
|
604
812
|
}
|
|
605
|
-
function
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
function
|
|
611
|
-
return `translate3d(
|
|
612
|
-
}
|
|
613
|
-
function
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
813
|
+
function Translate(axis, container) {
|
|
814
|
+
const translate = axis.scroll === "x" ? x : y;
|
|
815
|
+
const containerStyle = container.style;
|
|
816
|
+
let previousTarget = null;
|
|
817
|
+
let disabled = false;
|
|
818
|
+
function x(n) {
|
|
819
|
+
return `translate3d(${n}px,0px,0px)`;
|
|
820
|
+
}
|
|
821
|
+
function y(n) {
|
|
822
|
+
return `translate3d(0px,${n}px,0px)`;
|
|
823
|
+
}
|
|
824
|
+
function to(target) {
|
|
825
|
+
if (disabled) return;
|
|
826
|
+
const newTarget = roundToTwoDecimals(axis.direction(target));
|
|
827
|
+
if (newTarget === previousTarget) return;
|
|
828
|
+
containerStyle.transform = translate(newTarget);
|
|
829
|
+
previousTarget = newTarget;
|
|
830
|
+
}
|
|
831
|
+
function toggleActive(active) {
|
|
832
|
+
disabled = !active;
|
|
833
|
+
}
|
|
834
|
+
function clear() {
|
|
835
|
+
if (disabled) return;
|
|
836
|
+
containerStyle.transform = "";
|
|
837
|
+
if (!container.getAttribute("style")) container.removeAttribute("style");
|
|
623
838
|
}
|
|
624
839
|
return {
|
|
625
|
-
clear
|
|
626
|
-
to
|
|
627
|
-
toggleActive
|
|
840
|
+
clear,
|
|
841
|
+
to,
|
|
842
|
+
toggleActive
|
|
628
843
|
};
|
|
629
844
|
}
|
|
630
|
-
function
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
function
|
|
636
|
-
return
|
|
845
|
+
function SlideLooper(axis, viewSize, contentSize, slideSizes, slideSizesWithGaps, snaps, scrollSnaps, location, slides) {
|
|
846
|
+
const roundingSafety = .5;
|
|
847
|
+
const ascItems = arrayKeys(slideSizesWithGaps);
|
|
848
|
+
const descItems = arrayKeys(slideSizesWithGaps).reverse();
|
|
849
|
+
const loopPoints = startPoints().concat(endPoints());
|
|
850
|
+
function removeSlideSizes(indexes, from) {
|
|
851
|
+
return indexes.reduce((a, i) => {
|
|
852
|
+
return a - slideSizesWithGaps[i];
|
|
853
|
+
}, from);
|
|
854
|
+
}
|
|
855
|
+
function slidesInGap(indexes, gap) {
|
|
856
|
+
return indexes.reduce((a, i) => {
|
|
857
|
+
return removeSlideSizes(a, gap) > 0 ? a.concat([i]) : a;
|
|
858
|
+
}, []);
|
|
637
859
|
}
|
|
638
|
-
function
|
|
639
|
-
return
|
|
640
|
-
start:
|
|
641
|
-
end:
|
|
860
|
+
function findSlideBounds(offset) {
|
|
861
|
+
return snaps.map((snap, index) => ({
|
|
862
|
+
start: snap - slideSizes[index] + roundingSafety + offset,
|
|
863
|
+
end: snap + viewSize - roundingSafety + offset
|
|
642
864
|
}));
|
|
643
865
|
}
|
|
644
|
-
function
|
|
645
|
-
|
|
646
|
-
return
|
|
647
|
-
|
|
866
|
+
function findLoopPoints(indexes, offset, isEndEdge) {
|
|
867
|
+
const slideBounds = findSlideBounds(offset);
|
|
868
|
+
return indexes.map((index) => {
|
|
869
|
+
const initial = isEndEdge ? 0 : -contentSize;
|
|
870
|
+
const altered = isEndEdge ? contentSize : 0;
|
|
871
|
+
const boundEdge = isEndEdge ? "end" : "start";
|
|
872
|
+
const loopPoint = slideBounds[index][boundEdge];
|
|
648
873
|
return {
|
|
649
|
-
index
|
|
650
|
-
loopPoint
|
|
651
|
-
slideLocation:
|
|
652
|
-
translate:
|
|
653
|
-
target: () =>
|
|
874
|
+
index,
|
|
875
|
+
loopPoint,
|
|
876
|
+
slideLocation: Vector1D(-1),
|
|
877
|
+
translate: Translate(axis, slides[index]),
|
|
878
|
+
target: () => location.get() > loopPoint ? initial : altered
|
|
654
879
|
};
|
|
655
880
|
});
|
|
656
881
|
}
|
|
657
|
-
function
|
|
658
|
-
|
|
659
|
-
return
|
|
882
|
+
function startPoints() {
|
|
883
|
+
const gap = scrollSnaps[0];
|
|
884
|
+
return findLoopPoints(slidesInGap(descItems, gap), contentSize, false);
|
|
660
885
|
}
|
|
661
|
-
function
|
|
662
|
-
|
|
663
|
-
return
|
|
886
|
+
function endPoints() {
|
|
887
|
+
const gap = viewSize - scrollSnaps[0] - 1;
|
|
888
|
+
return findLoopPoints(slidesInGap(ascItems, gap), -contentSize, true);
|
|
664
889
|
}
|
|
665
|
-
function
|
|
666
|
-
return
|
|
890
|
+
function canLoop() {
|
|
891
|
+
return loopPoints.every(({ index }) => {
|
|
892
|
+
return removeSlideSizes(ascItems.filter((i) => i !== index), viewSize) <= .1;
|
|
893
|
+
});
|
|
667
894
|
}
|
|
668
|
-
function
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
895
|
+
function loop() {
|
|
896
|
+
loopPoints.forEach((loopPoint) => {
|
|
897
|
+
const { target, translate, slideLocation } = loopPoint;
|
|
898
|
+
const shiftLocation = target();
|
|
899
|
+
if (shiftLocation === slideLocation.get()) return;
|
|
900
|
+
translate.to(shiftLocation);
|
|
901
|
+
slideLocation.set(shiftLocation);
|
|
672
902
|
});
|
|
673
903
|
}
|
|
674
|
-
function
|
|
675
|
-
|
|
904
|
+
function clear() {
|
|
905
|
+
loopPoints.forEach((loopPoint) => loopPoint.translate.clear());
|
|
676
906
|
}
|
|
677
907
|
return {
|
|
678
|
-
canLoop
|
|
679
|
-
clear
|
|
680
|
-
loop
|
|
681
|
-
loopPoints
|
|
908
|
+
canLoop,
|
|
909
|
+
clear,
|
|
910
|
+
loop,
|
|
911
|
+
loopPoints
|
|
682
912
|
};
|
|
683
913
|
}
|
|
684
|
-
function
|
|
685
|
-
let
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
914
|
+
function SlidesHandler(container, eventHandler, watchSlides) {
|
|
915
|
+
let mutationObserver;
|
|
916
|
+
let destroyed = false;
|
|
917
|
+
function init(emblaApi) {
|
|
918
|
+
if (!watchSlides) return;
|
|
919
|
+
function defaultCallback(mutations) {
|
|
920
|
+
for (const mutation of mutations) if (mutation.type === "childList") {
|
|
921
|
+
emblaApi.reInit();
|
|
922
|
+
eventHandler.emit("slidesChanged");
|
|
691
923
|
break;
|
|
692
924
|
}
|
|
693
925
|
}
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
926
|
+
mutationObserver = new MutationObserver((mutations) => {
|
|
927
|
+
if (destroyed) return;
|
|
928
|
+
if (isBoolean(watchSlides) || watchSlides(emblaApi, mutations)) defaultCallback(mutations);
|
|
929
|
+
});
|
|
930
|
+
mutationObserver.observe(container, { childList: true });
|
|
697
931
|
}
|
|
698
|
-
function
|
|
699
|
-
|
|
932
|
+
function destroy() {
|
|
933
|
+
if (mutationObserver) mutationObserver.disconnect();
|
|
934
|
+
destroyed = true;
|
|
700
935
|
}
|
|
701
936
|
return {
|
|
702
|
-
init
|
|
703
|
-
destroy
|
|
937
|
+
init,
|
|
938
|
+
destroy
|
|
704
939
|
};
|
|
705
940
|
}
|
|
706
|
-
function
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
941
|
+
function SlidesInView(container, slides, eventHandler, threshold) {
|
|
942
|
+
const intersectionEntryMap = {};
|
|
943
|
+
let inViewCache = null;
|
|
944
|
+
let notInViewCache = null;
|
|
945
|
+
let intersectionObserver;
|
|
946
|
+
let destroyed = false;
|
|
947
|
+
function init() {
|
|
948
|
+
intersectionObserver = new IntersectionObserver((entries) => {
|
|
949
|
+
if (destroyed) return;
|
|
950
|
+
entries.forEach((entry) => {
|
|
951
|
+
const index = slides.indexOf(entry.target);
|
|
952
|
+
intersectionEntryMap[index] = entry;
|
|
953
|
+
});
|
|
954
|
+
inViewCache = null;
|
|
955
|
+
notInViewCache = null;
|
|
956
|
+
eventHandler.emit("slidesInView");
|
|
714
957
|
}, {
|
|
715
|
-
root:
|
|
716
|
-
threshold
|
|
717
|
-
})
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
958
|
+
root: container.parentElement,
|
|
959
|
+
threshold
|
|
960
|
+
});
|
|
961
|
+
slides.forEach((slide) => intersectionObserver.observe(slide));
|
|
962
|
+
}
|
|
963
|
+
function destroy() {
|
|
964
|
+
if (intersectionObserver) intersectionObserver.disconnect();
|
|
965
|
+
destroyed = true;
|
|
966
|
+
}
|
|
967
|
+
function createInViewList(inView) {
|
|
968
|
+
return objectKeys(intersectionEntryMap).reduce((list, slideIndex) => {
|
|
969
|
+
const index = parseInt(slideIndex);
|
|
970
|
+
const { isIntersecting } = intersectionEntryMap[index];
|
|
971
|
+
if (inView && isIntersecting || !inView && !isIntersecting) list.push(index);
|
|
972
|
+
return list;
|
|
726
973
|
}, []);
|
|
727
974
|
}
|
|
728
|
-
function
|
|
729
|
-
if (
|
|
730
|
-
if (!
|
|
731
|
-
|
|
732
|
-
|
|
975
|
+
function get(inView = true) {
|
|
976
|
+
if (inView && inViewCache) return inViewCache;
|
|
977
|
+
if (!inView && notInViewCache) return notInViewCache;
|
|
978
|
+
const slideIndexes = createInViewList(inView);
|
|
979
|
+
if (inView) inViewCache = slideIndexes;
|
|
980
|
+
if (!inView) notInViewCache = slideIndexes;
|
|
981
|
+
return slideIndexes;
|
|
733
982
|
}
|
|
734
983
|
return {
|
|
735
|
-
init
|
|
736
|
-
destroy
|
|
737
|
-
get
|
|
984
|
+
init,
|
|
985
|
+
destroy,
|
|
986
|
+
get
|
|
738
987
|
};
|
|
739
988
|
}
|
|
740
|
-
function
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
function
|
|
748
|
-
if (!
|
|
749
|
-
|
|
750
|
-
return
|
|
751
|
-
}
|
|
752
|
-
function
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
989
|
+
function SlideSizes(axis, containerRect, slideRects, slides, readEdgeGap, ownerWindow) {
|
|
990
|
+
const { measureSize, startEdge, endEdge } = axis;
|
|
991
|
+
const withEdgeGap = slideRects[0] && readEdgeGap;
|
|
992
|
+
const startGap = measureStartGap();
|
|
993
|
+
const endGap = measureEndGap();
|
|
994
|
+
const slideSizes = slideRects.map(measureSize);
|
|
995
|
+
const slideSizesWithGaps = measureWithGaps();
|
|
996
|
+
function measureStartGap() {
|
|
997
|
+
if (!withEdgeGap) return 0;
|
|
998
|
+
const slideRect = slideRects[0];
|
|
999
|
+
return mathAbs(containerRect[startEdge] - slideRect[startEdge]);
|
|
1000
|
+
}
|
|
1001
|
+
function measureEndGap() {
|
|
1002
|
+
if (!withEdgeGap) return 0;
|
|
1003
|
+
const style = ownerWindow.getComputedStyle(arrayLast(slides));
|
|
1004
|
+
return parseFloat(style.getPropertyValue(`margin-${endEdge}`));
|
|
1005
|
+
}
|
|
1006
|
+
function measureWithGaps() {
|
|
1007
|
+
return slideRects.map((rect, index, rects) => {
|
|
1008
|
+
const isFirst = !index;
|
|
1009
|
+
const isLast = arrayIsLastIndex(rects, index);
|
|
1010
|
+
if (isFirst) return slideSizes[index] + startGap;
|
|
1011
|
+
if (isLast) return slideSizes[index] + endGap;
|
|
1012
|
+
return rects[index + 1][startEdge] - rect[startEdge];
|
|
1013
|
+
}).map(mathAbs);
|
|
757
1014
|
}
|
|
758
1015
|
return {
|
|
759
|
-
slideSizes
|
|
760
|
-
slideSizesWithGaps
|
|
761
|
-
startGap
|
|
762
|
-
endGap
|
|
1016
|
+
slideSizes,
|
|
1017
|
+
slideSizesWithGaps,
|
|
1018
|
+
startGap,
|
|
1019
|
+
endGap
|
|
763
1020
|
};
|
|
764
1021
|
}
|
|
765
|
-
function
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
1022
|
+
function SlidesToScroll(axis, viewSize, slidesToScroll, loop, containerRect, slideRects, startGap, endGap, pixelTolerance) {
|
|
1023
|
+
const { startEdge, endEdge, direction } = axis;
|
|
1024
|
+
const groupByNumber = isNumber(slidesToScroll);
|
|
1025
|
+
function byNumber(array, groupSize) {
|
|
1026
|
+
return arrayKeys(array).filter((i) => i % groupSize === 0).map((i) => array.slice(i, i + groupSize));
|
|
1027
|
+
}
|
|
1028
|
+
function bySize(array) {
|
|
1029
|
+
if (!array.length) return [];
|
|
1030
|
+
return arrayKeys(array).reduce((groups, rectB, index) => {
|
|
1031
|
+
const rectA = arrayLast(groups) || 0;
|
|
1032
|
+
const isFirst = rectA === 0;
|
|
1033
|
+
const isLast = rectB === arrayLastIndex(array);
|
|
1034
|
+
const edgeA = containerRect[startEdge] - slideRects[rectA][startEdge];
|
|
1035
|
+
const edgeB = containerRect[startEdge] - slideRects[rectB][endEdge];
|
|
1036
|
+
const gapA = !loop && isFirst ? direction(startGap) : 0;
|
|
1037
|
+
const chunkSize = mathAbs(edgeB - (!loop && isLast ? direction(endGap) : 0) - (edgeA + gapA));
|
|
1038
|
+
if (index && chunkSize > viewSize + pixelTolerance) groups.push(rectB);
|
|
1039
|
+
if (isLast) groups.push(array.length);
|
|
1040
|
+
return groups;
|
|
1041
|
+
}, []).map((currentSize, index, groups) => {
|
|
1042
|
+
const previousSize = Math.max(groups[index - 1] || 0);
|
|
1043
|
+
return array.slice(previousSize, currentSize);
|
|
1044
|
+
});
|
|
1045
|
+
}
|
|
1046
|
+
function groupSlides(array) {
|
|
1047
|
+
return groupByNumber ? byNumber(array, slidesToScroll) : bySize(array);
|
|
1048
|
+
}
|
|
1049
|
+
return { groupSlides };
|
|
1050
|
+
}
|
|
1051
|
+
function Engine(root, container, slides, ownerDocument, ownerWindow, options, eventHandler) {
|
|
1052
|
+
const { align, axis: scrollAxis, direction, startIndex, loop, duration, dragFree, dragThreshold, inViewThreshold, slidesToScroll: groupSlides, skipSnaps, containScroll, watchResize, watchSlides, watchDrag, watchFocus } = options;
|
|
1053
|
+
const pixelTolerance = 2;
|
|
1054
|
+
const nodeRects = NodeRects();
|
|
1055
|
+
const containerRect = nodeRects.measure(container);
|
|
1056
|
+
const slideRects = slides.map(nodeRects.measure);
|
|
1057
|
+
const axis = Axis(scrollAxis, direction);
|
|
1058
|
+
const viewSize = axis.measureSize(containerRect);
|
|
1059
|
+
const percentOfView = PercentOfView(viewSize);
|
|
1060
|
+
const alignment = Alignment(align, viewSize);
|
|
1061
|
+
const containSnaps = !loop && !!containScroll;
|
|
1062
|
+
const { slideSizes, slideSizesWithGaps, startGap, endGap } = SlideSizes(axis, containerRect, slideRects, slides, loop || !!containScroll, ownerWindow);
|
|
1063
|
+
const slidesToScroll = SlidesToScroll(axis, viewSize, groupSlides, loop, containerRect, slideRects, startGap, endGap, pixelTolerance);
|
|
1064
|
+
const { snaps, snapsAligned } = ScrollSnaps(axis, alignment, containerRect, slideRects, slidesToScroll);
|
|
1065
|
+
const contentSize = -arrayLast(snaps) + arrayLast(slideSizesWithGaps);
|
|
1066
|
+
const { snapsContained, scrollContainLimit } = ScrollContain(viewSize, contentSize, snapsAligned, containScroll, pixelTolerance);
|
|
1067
|
+
const scrollSnaps = containSnaps ? snapsContained : snapsAligned;
|
|
1068
|
+
const { limit } = ScrollLimit(contentSize, scrollSnaps, loop);
|
|
1069
|
+
const index = Counter(arrayLastIndex(scrollSnaps), startIndex, loop);
|
|
1070
|
+
const indexPrevious = index.clone();
|
|
1071
|
+
const slideIndexes = arrayKeys(slides);
|
|
1072
|
+
const update = ({ dragHandler, scrollBody, scrollBounds, options: { loop } }) => {
|
|
1073
|
+
if (!loop) scrollBounds.constrain(dragHandler.pointerDown());
|
|
1074
|
+
scrollBody.seek();
|
|
1075
|
+
};
|
|
1076
|
+
const render = ({ scrollBody, translate, location, offsetLocation, previousLocation, scrollLooper, slideLooper, dragHandler, animation, eventHandler, scrollBounds, options: { loop } }, alpha) => {
|
|
1077
|
+
const shouldSettle = scrollBody.settled();
|
|
1078
|
+
const withinBounds = !scrollBounds.shouldConstrain();
|
|
1079
|
+
const hasSettled = loop ? shouldSettle : shouldSettle && withinBounds;
|
|
1080
|
+
const hasSettledAndIdle = hasSettled && !dragHandler.pointerDown();
|
|
1081
|
+
if (hasSettledAndIdle) animation.stop();
|
|
1082
|
+
const interpolatedLocation = location.get() * alpha + previousLocation.get() * (1 - alpha);
|
|
1083
|
+
offsetLocation.set(interpolatedLocation);
|
|
1084
|
+
if (loop) {
|
|
1085
|
+
scrollLooper.loop(scrollBody.direction());
|
|
1086
|
+
slideLooper.loop();
|
|
1087
|
+
}
|
|
1088
|
+
translate.to(offsetLocation.get());
|
|
1089
|
+
if (hasSettledAndIdle) eventHandler.emit("settle");
|
|
1090
|
+
if (!hasSettled) eventHandler.emit("scroll");
|
|
1091
|
+
};
|
|
1092
|
+
const animation = Animations(ownerDocument, ownerWindow, () => update(engine), (alpha) => render(engine, alpha));
|
|
1093
|
+
const friction = .68;
|
|
1094
|
+
const startLocation = scrollSnaps[index.get()];
|
|
1095
|
+
const location = Vector1D(startLocation);
|
|
1096
|
+
const previousLocation = Vector1D(startLocation);
|
|
1097
|
+
const offsetLocation = Vector1D(startLocation);
|
|
1098
|
+
const target = Vector1D(startLocation);
|
|
1099
|
+
const scrollBody = ScrollBody(location, offsetLocation, previousLocation, target, duration, friction);
|
|
1100
|
+
const scrollTarget = ScrollTarget(loop, scrollSnaps, contentSize, limit, target);
|
|
1101
|
+
const scrollTo = ScrollTo(animation, index, indexPrevious, scrollBody, scrollTarget, target, eventHandler);
|
|
1102
|
+
const scrollProgress = ScrollProgress(limit);
|
|
1103
|
+
const eventStore = EventStore();
|
|
1104
|
+
const slidesInView = SlidesInView(container, slides, eventHandler, inViewThreshold);
|
|
1105
|
+
const { slideRegistry } = SlideRegistry(containSnaps, containScroll, scrollSnaps, scrollContainLimit, slidesToScroll, slideIndexes);
|
|
1106
|
+
const slideFocus = SlideFocus(root, slides, slideRegistry, scrollTo, scrollBody, eventStore, eventHandler, watchFocus);
|
|
1107
|
+
const engine = {
|
|
1108
|
+
ownerDocument,
|
|
1109
|
+
ownerWindow,
|
|
1110
|
+
eventHandler,
|
|
1111
|
+
containerRect,
|
|
1112
|
+
slideRects,
|
|
1113
|
+
animation,
|
|
1114
|
+
axis,
|
|
1115
|
+
dragHandler: DragHandler(axis, root, ownerDocument, ownerWindow, target, DragTracker(axis, ownerWindow), location, animation, scrollTo, scrollBody, scrollTarget, index, eventHandler, percentOfView, dragFree, dragThreshold, skipSnaps, friction, watchDrag),
|
|
1116
|
+
eventStore,
|
|
1117
|
+
percentOfView,
|
|
1118
|
+
index,
|
|
1119
|
+
indexPrevious,
|
|
1120
|
+
limit,
|
|
1121
|
+
location,
|
|
1122
|
+
offsetLocation,
|
|
1123
|
+
previousLocation,
|
|
1124
|
+
options,
|
|
1125
|
+
resizeHandler: ResizeHandler(container, eventHandler, ownerWindow, slides, axis, watchResize, nodeRects),
|
|
1126
|
+
scrollBody,
|
|
1127
|
+
scrollBounds: ScrollBounds(limit, offsetLocation, target, scrollBody, percentOfView),
|
|
1128
|
+
scrollLooper: ScrollLooper(contentSize, limit, offsetLocation, [
|
|
1129
|
+
location,
|
|
1130
|
+
offsetLocation,
|
|
1131
|
+
previousLocation,
|
|
1132
|
+
target
|
|
818
1133
|
]),
|
|
819
|
-
scrollProgress
|
|
820
|
-
scrollSnapList:
|
|
821
|
-
scrollSnaps
|
|
822
|
-
scrollTarget
|
|
823
|
-
scrollTo
|
|
824
|
-
slideLooper:
|
|
825
|
-
slideFocus
|
|
826
|
-
slidesHandler:
|
|
827
|
-
slidesInView
|
|
828
|
-
slideIndexes
|
|
829
|
-
slideRegistry
|
|
830
|
-
slidesToScroll
|
|
831
|
-
target
|
|
832
|
-
translate:
|
|
1134
|
+
scrollProgress,
|
|
1135
|
+
scrollSnapList: scrollSnaps.map(scrollProgress.get),
|
|
1136
|
+
scrollSnaps,
|
|
1137
|
+
scrollTarget,
|
|
1138
|
+
scrollTo,
|
|
1139
|
+
slideLooper: SlideLooper(axis, viewSize, contentSize, slideSizes, slideSizesWithGaps, snaps, scrollSnaps, offsetLocation, slides),
|
|
1140
|
+
slideFocus,
|
|
1141
|
+
slidesHandler: SlidesHandler(container, eventHandler, watchSlides),
|
|
1142
|
+
slidesInView,
|
|
1143
|
+
slideIndexes,
|
|
1144
|
+
slideRegistry,
|
|
1145
|
+
slidesToScroll,
|
|
1146
|
+
target,
|
|
1147
|
+
translate: Translate(axis, container)
|
|
833
1148
|
};
|
|
834
|
-
return
|
|
1149
|
+
return engine;
|
|
835
1150
|
}
|
|
836
|
-
function
|
|
837
|
-
let
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
return
|
|
852
|
-
}
|
|
853
|
-
function
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
1151
|
+
function EventHandler() {
|
|
1152
|
+
let listeners = {};
|
|
1153
|
+
let api;
|
|
1154
|
+
function init(emblaApi) {
|
|
1155
|
+
api = emblaApi;
|
|
1156
|
+
}
|
|
1157
|
+
function getListeners(evt) {
|
|
1158
|
+
return listeners[evt] || [];
|
|
1159
|
+
}
|
|
1160
|
+
function emit(evt) {
|
|
1161
|
+
getListeners(evt).forEach((e) => e(api, evt));
|
|
1162
|
+
return self;
|
|
1163
|
+
}
|
|
1164
|
+
function on(evt, cb) {
|
|
1165
|
+
listeners[evt] = getListeners(evt).concat([cb]);
|
|
1166
|
+
return self;
|
|
1167
|
+
}
|
|
1168
|
+
function off(evt, cb) {
|
|
1169
|
+
listeners[evt] = getListeners(evt).filter((e) => e !== cb);
|
|
1170
|
+
return self;
|
|
1171
|
+
}
|
|
1172
|
+
function clear() {
|
|
1173
|
+
listeners = {};
|
|
1174
|
+
}
|
|
1175
|
+
const self = {
|
|
1176
|
+
init,
|
|
1177
|
+
emit,
|
|
1178
|
+
off,
|
|
1179
|
+
on,
|
|
1180
|
+
clear
|
|
862
1181
|
};
|
|
863
|
-
return
|
|
1182
|
+
return self;
|
|
864
1183
|
}
|
|
865
|
-
var
|
|
1184
|
+
var defaultOptions = {
|
|
866
1185
|
align: "center",
|
|
867
1186
|
axis: "x",
|
|
868
1187
|
container: null,
|
|
@@ -872,145 +1191,201 @@ var le = {
|
|
|
872
1191
|
slidesToScroll: 1,
|
|
873
1192
|
inViewThreshold: 0,
|
|
874
1193
|
breakpoints: {},
|
|
875
|
-
dragFree:
|
|
1194
|
+
dragFree: false,
|
|
876
1195
|
dragThreshold: 10,
|
|
877
|
-
loop:
|
|
878
|
-
skipSnaps:
|
|
1196
|
+
loop: false,
|
|
1197
|
+
skipSnaps: false,
|
|
879
1198
|
duration: 25,
|
|
880
1199
|
startIndex: 0,
|
|
881
|
-
active:
|
|
882
|
-
watchDrag:
|
|
883
|
-
watchResize:
|
|
884
|
-
watchSlides:
|
|
885
|
-
watchFocus:
|
|
1200
|
+
active: true,
|
|
1201
|
+
watchDrag: true,
|
|
1202
|
+
watchResize: true,
|
|
1203
|
+
watchSlides: true,
|
|
1204
|
+
watchFocus: true
|
|
886
1205
|
};
|
|
887
|
-
function
|
|
888
|
-
function
|
|
889
|
-
return
|
|
1206
|
+
function OptionsHandler(ownerWindow) {
|
|
1207
|
+
function mergeOptions(optionsA, optionsB) {
|
|
1208
|
+
return objectsMergeDeep(optionsA, optionsB || {});
|
|
890
1209
|
}
|
|
891
|
-
function
|
|
892
|
-
|
|
893
|
-
return
|
|
1210
|
+
function optionsAtMedia(options) {
|
|
1211
|
+
const optionsAtMedia = options.breakpoints || {};
|
|
1212
|
+
return mergeOptions(options, objectKeys(optionsAtMedia).filter((media) => ownerWindow.matchMedia(media).matches).map((media) => optionsAtMedia[media]).reduce((a, mediaOption) => mergeOptions(a, mediaOption), {}));
|
|
894
1213
|
}
|
|
895
|
-
function
|
|
896
|
-
return
|
|
1214
|
+
function optionsMediaQueries(optionsList) {
|
|
1215
|
+
return optionsList.map((options) => objectKeys(options.breakpoints || {})).reduce((acc, mediaQueries) => acc.concat(mediaQueries), []).map(ownerWindow.matchMedia);
|
|
897
1216
|
}
|
|
898
1217
|
return {
|
|
899
|
-
mergeOptions
|
|
900
|
-
optionsAtMedia
|
|
901
|
-
optionsMediaQueries
|
|
1218
|
+
mergeOptions,
|
|
1219
|
+
optionsAtMedia,
|
|
1220
|
+
optionsMediaQueries
|
|
902
1221
|
};
|
|
903
1222
|
}
|
|
904
|
-
function
|
|
905
|
-
let
|
|
906
|
-
function
|
|
907
|
-
|
|
1223
|
+
function PluginsHandler(optionsHandler) {
|
|
1224
|
+
let activePlugins = [];
|
|
1225
|
+
function init(emblaApi, plugins) {
|
|
1226
|
+
activePlugins = plugins.filter(({ options }) => optionsHandler.optionsAtMedia(options).active !== false);
|
|
1227
|
+
activePlugins.forEach((plugin) => plugin.init(emblaApi, optionsHandler));
|
|
1228
|
+
return plugins.reduce((map, plugin) => Object.assign(map, { [plugin.name]: plugin }), {});
|
|
908
1229
|
}
|
|
909
|
-
function
|
|
910
|
-
|
|
1230
|
+
function destroy() {
|
|
1231
|
+
activePlugins = activePlugins.filter((plugin) => plugin.destroy());
|
|
911
1232
|
}
|
|
912
1233
|
return {
|
|
913
|
-
init
|
|
914
|
-
destroy
|
|
1234
|
+
init,
|
|
1235
|
+
destroy
|
|
915
1236
|
};
|
|
916
1237
|
}
|
|
917
|
-
function
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
}
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
}
|
|
966
|
-
function
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
}
|
|
972
|
-
function
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
}
|
|
984
|
-
function
|
|
985
|
-
return
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1238
|
+
function EmblaCarousel(root, userOptions, userPlugins) {
|
|
1239
|
+
const ownerDocument = root.ownerDocument;
|
|
1240
|
+
const ownerWindow = ownerDocument.defaultView;
|
|
1241
|
+
const optionsHandler = OptionsHandler(ownerWindow);
|
|
1242
|
+
const pluginsHandler = PluginsHandler(optionsHandler);
|
|
1243
|
+
const mediaHandlers = EventStore();
|
|
1244
|
+
const eventHandler = EventHandler();
|
|
1245
|
+
const { mergeOptions, optionsAtMedia, optionsMediaQueries } = optionsHandler;
|
|
1246
|
+
const { on, off, emit } = eventHandler;
|
|
1247
|
+
const reInit = reActivate;
|
|
1248
|
+
let destroyed = false;
|
|
1249
|
+
let engine;
|
|
1250
|
+
let optionsBase = mergeOptions(defaultOptions, EmblaCarousel.globalOptions);
|
|
1251
|
+
let options = mergeOptions(optionsBase);
|
|
1252
|
+
let pluginList = [];
|
|
1253
|
+
let pluginApis;
|
|
1254
|
+
let container;
|
|
1255
|
+
let slides;
|
|
1256
|
+
function storeElements() {
|
|
1257
|
+
const { container: userContainer, slides: userSlides } = options;
|
|
1258
|
+
container = (isString(userContainer) ? root.querySelector(userContainer) : userContainer) || root.children[0];
|
|
1259
|
+
const customSlides = isString(userSlides) ? container.querySelectorAll(userSlides) : userSlides;
|
|
1260
|
+
slides = [].slice.call(customSlides || container.children);
|
|
1261
|
+
}
|
|
1262
|
+
function createEngine(options) {
|
|
1263
|
+
const engine = Engine(root, container, slides, ownerDocument, ownerWindow, options, eventHandler);
|
|
1264
|
+
if (options.loop && !engine.slideLooper.canLoop()) return createEngine(Object.assign({}, options, { loop: false }));
|
|
1265
|
+
return engine;
|
|
1266
|
+
}
|
|
1267
|
+
function activate(withOptions, withPlugins) {
|
|
1268
|
+
if (destroyed) return;
|
|
1269
|
+
optionsBase = mergeOptions(optionsBase, withOptions);
|
|
1270
|
+
options = optionsAtMedia(optionsBase);
|
|
1271
|
+
pluginList = withPlugins || pluginList;
|
|
1272
|
+
storeElements();
|
|
1273
|
+
engine = createEngine(options);
|
|
1274
|
+
optionsMediaQueries([optionsBase, ...pluginList.map(({ options }) => options)]).forEach((query) => mediaHandlers.add(query, "change", reActivate));
|
|
1275
|
+
if (!options.active) return;
|
|
1276
|
+
engine.translate.to(engine.location.get());
|
|
1277
|
+
engine.animation.init();
|
|
1278
|
+
engine.slidesInView.init();
|
|
1279
|
+
engine.slideFocus.init(self);
|
|
1280
|
+
engine.eventHandler.init(self);
|
|
1281
|
+
engine.resizeHandler.init(self);
|
|
1282
|
+
engine.slidesHandler.init(self);
|
|
1283
|
+
if (engine.options.loop) engine.slideLooper.loop();
|
|
1284
|
+
if (container.offsetParent && slides.length) engine.dragHandler.init(self);
|
|
1285
|
+
pluginApis = pluginsHandler.init(self, pluginList);
|
|
1286
|
+
}
|
|
1287
|
+
function reActivate(withOptions, withPlugins) {
|
|
1288
|
+
const startIndex = selectedScrollSnap();
|
|
1289
|
+
deActivate();
|
|
1290
|
+
activate(mergeOptions({ startIndex }, withOptions), withPlugins);
|
|
1291
|
+
eventHandler.emit("reInit");
|
|
1292
|
+
}
|
|
1293
|
+
function deActivate() {
|
|
1294
|
+
engine.dragHandler.destroy();
|
|
1295
|
+
engine.eventStore.clear();
|
|
1296
|
+
engine.translate.clear();
|
|
1297
|
+
engine.slideLooper.clear();
|
|
1298
|
+
engine.resizeHandler.destroy();
|
|
1299
|
+
engine.slidesHandler.destroy();
|
|
1300
|
+
engine.slidesInView.destroy();
|
|
1301
|
+
engine.animation.destroy();
|
|
1302
|
+
pluginsHandler.destroy();
|
|
1303
|
+
mediaHandlers.clear();
|
|
1304
|
+
}
|
|
1305
|
+
function destroy() {
|
|
1306
|
+
if (destroyed) return;
|
|
1307
|
+
destroyed = true;
|
|
1308
|
+
mediaHandlers.clear();
|
|
1309
|
+
deActivate();
|
|
1310
|
+
eventHandler.emit("destroy");
|
|
1311
|
+
eventHandler.clear();
|
|
1312
|
+
}
|
|
1313
|
+
function scrollTo(index, jump, direction) {
|
|
1314
|
+
if (!options.active || destroyed) return;
|
|
1315
|
+
engine.scrollBody.useBaseFriction().useDuration(jump === true ? 0 : options.duration);
|
|
1316
|
+
engine.scrollTo.index(index, direction || 0);
|
|
1317
|
+
}
|
|
1318
|
+
function scrollNext(jump) {
|
|
1319
|
+
scrollTo(engine.index.add(1).get(), jump, -1);
|
|
1320
|
+
}
|
|
1321
|
+
function scrollPrev(jump) {
|
|
1322
|
+
scrollTo(engine.index.add(-1).get(), jump, 1);
|
|
1323
|
+
}
|
|
1324
|
+
function canScrollNext() {
|
|
1325
|
+
return engine.index.add(1).get() !== selectedScrollSnap();
|
|
1326
|
+
}
|
|
1327
|
+
function canScrollPrev() {
|
|
1328
|
+
return engine.index.add(-1).get() !== selectedScrollSnap();
|
|
1329
|
+
}
|
|
1330
|
+
function scrollSnapList() {
|
|
1331
|
+
return engine.scrollSnapList;
|
|
1332
|
+
}
|
|
1333
|
+
function scrollProgress() {
|
|
1334
|
+
return engine.scrollProgress.get(engine.offsetLocation.get());
|
|
1335
|
+
}
|
|
1336
|
+
function selectedScrollSnap() {
|
|
1337
|
+
return engine.index.get();
|
|
1338
|
+
}
|
|
1339
|
+
function previousScrollSnap() {
|
|
1340
|
+
return engine.indexPrevious.get();
|
|
1341
|
+
}
|
|
1342
|
+
function slidesInView() {
|
|
1343
|
+
return engine.slidesInView.get();
|
|
1344
|
+
}
|
|
1345
|
+
function slidesNotInView() {
|
|
1346
|
+
return engine.slidesInView.get(false);
|
|
1347
|
+
}
|
|
1348
|
+
function plugins() {
|
|
1349
|
+
return pluginApis;
|
|
1350
|
+
}
|
|
1351
|
+
function internalEngine() {
|
|
1352
|
+
return engine;
|
|
1353
|
+
}
|
|
1354
|
+
function rootNode() {
|
|
1355
|
+
return root;
|
|
1356
|
+
}
|
|
1357
|
+
function containerNode() {
|
|
1358
|
+
return container;
|
|
1359
|
+
}
|
|
1360
|
+
function slideNodes() {
|
|
1361
|
+
return slides;
|
|
1362
|
+
}
|
|
1363
|
+
const self = {
|
|
1364
|
+
canScrollNext,
|
|
1365
|
+
canScrollPrev,
|
|
1366
|
+
containerNode,
|
|
1367
|
+
internalEngine,
|
|
1368
|
+
destroy,
|
|
1369
|
+
off,
|
|
1370
|
+
on,
|
|
1371
|
+
emit,
|
|
1372
|
+
plugins,
|
|
1373
|
+
previousScrollSnap,
|
|
1374
|
+
reInit,
|
|
1375
|
+
rootNode,
|
|
1376
|
+
scrollNext,
|
|
1377
|
+
scrollPrev,
|
|
1378
|
+
scrollProgress,
|
|
1379
|
+
scrollSnapList,
|
|
1380
|
+
scrollTo,
|
|
1381
|
+
selectedScrollSnap,
|
|
1382
|
+
slideNodes,
|
|
1383
|
+
slidesInView,
|
|
1384
|
+
slidesNotInView
|
|
1012
1385
|
};
|
|
1013
|
-
|
|
1386
|
+
activate(userOptions, userPlugins);
|
|
1387
|
+
setTimeout(() => eventHandler.emit("init"), 0);
|
|
1388
|
+
return self;
|
|
1014
1389
|
}
|
|
1015
|
-
|
|
1016
|
-
export {
|
|
1390
|
+
EmblaCarousel.globalOptions = void 0;
|
|
1391
|
+
export { EmblaCarousel as default };
|