laif-ds 0.2.20 → 0.2.22
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/dist/_virtual/index.js +5 -3
- package/dist/_virtual/index3.js +2 -5
- package/dist/_virtual/index4.js +3 -5
- package/dist/_virtual/index6.js +5 -2
- package/dist/_virtual/index7.js +2 -2
- package/dist/components/ui/app-select.js +92 -109
- package/dist/components/ui/app-stepper.js +212 -0
- package/dist/components/ui/gantt/constants/DimensionsSettings.js +6 -6
- package/dist/components/ui/gantt/constants/DragStepOptions.js +9 -9
- package/dist/components/ui/message-input.js +23 -23
- package/dist/components/ui/sidebar.js +1 -1
- package/dist/components/ui/stepper.js +387 -0
- package/dist/index.d.ts +55 -6
- package/dist/index.js +30 -28
- package/dist/lib/audio-utils.js +2 -2
- package/dist/node_modules/@date-fns/tz/date/index.js +2 -7
- package/dist/node_modules/@date-fns/tz/date/mini.js +32 -27
- package/dist/node_modules/@date-fns/tz/tzName/index.js +12 -0
- package/dist/node_modules/@date-fns/tz/tzOffset/index.js +11 -12
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +137 -139
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +238 -235
- package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +70 -69
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +88 -83
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +70 -69
- package/dist/node_modules/@lexical/clipboard/LexicalClipboard.prod.js +13 -13
- package/dist/node_modules/@lexical/code/LexicalCode.prod.js +3 -3
- package/dist/node_modules/@lexical/dragon/LexicalDragon.prod.js +2 -2
- package/dist/node_modules/@lexical/history/LexicalHistory.prod.js +9 -9
- package/dist/node_modules/@lexical/html/LexicalHtml.prod.js +6 -6
- package/dist/node_modules/@lexical/list/LexicalList.prod.js +48 -48
- package/dist/node_modules/@lexical/markdown/LexicalMarkdown.prod.js +29 -29
- package/dist/node_modules/@lexical/react/LexicalCheckListPlugin.prod.js +1 -1
- package/dist/node_modules/@lexical/react/LexicalClearEditorPlugin.prod.js +2 -2
- package/dist/node_modules/@lexical/react/LexicalComposer.prod.js +10 -10
- package/dist/node_modules/@lexical/react/LexicalComposerContext.prod.js +2 -2
- package/dist/node_modules/@lexical/react/LexicalContentEditable.prod.js +17 -17
- package/dist/node_modules/@lexical/react/LexicalErrorBoundary.prod.js +4 -4
- package/dist/node_modules/@lexical/react/LexicalHistoryPlugin.prod.js +4 -4
- package/dist/node_modules/@lexical/react/LexicalListPlugin.prod.js +5 -5
- package/dist/node_modules/@lexical/react/LexicalOnChangePlugin.prod.js +4 -4
- package/dist/node_modules/@lexical/react/LexicalRichTextPlugin.prod.js +20 -20
- package/dist/node_modules/@lexical/react/useLexicalEditable.prod.js +7 -7
- package/dist/node_modules/@lexical/rich-text/LexicalRichText.prod.js +43 -43
- package/dist/node_modules/@lexical/table/LexicalTable.prod.js +16 -16
- package/dist/node_modules/@lexical/utils/LexicalUtils.prod.js +3 -3
- package/dist/node_modules/@radix-ui/react-accordion/dist/index.js +24 -25
- package/dist/node_modules/@radix-ui/react-alert-dialog/dist/index.js +22 -23
- package/dist/node_modules/@radix-ui/react-avatar/dist/index.js +28 -29
- package/dist/node_modules/@radix-ui/react-checkbox/dist/index.js +1 -2
- package/dist/node_modules/@radix-ui/react-context-menu/dist/index.js +49 -50
- package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.js +22 -23
- package/dist/node_modules/@radix-ui/react-hover-card/dist/index.js +6 -7
- package/dist/node_modules/@radix-ui/react-menubar/dist/index.js +31 -32
- package/dist/node_modules/@radix-ui/react-navigation-menu/dist/index.js +56 -57
- package/dist/node_modules/@radix-ui/react-popover/dist/index.js +6 -7
- package/dist/node_modules/@radix-ui/react-popper/dist/index.js +43 -42
- package/dist/node_modules/@radix-ui/react-presence/dist/index.js +1 -1
- package/dist/node_modules/@radix-ui/react-progress/dist/index.js +20 -21
- package/dist/node_modules/@radix-ui/react-radio-group/dist/index.js +12 -13
- package/dist/node_modules/@radix-ui/react-scroll-area/dist/index.js +7 -8
- package/dist/node_modules/@radix-ui/react-select/dist/index.js +19 -20
- package/dist/node_modules/@radix-ui/react-slider/dist/index.js +39 -40
- package/dist/node_modules/@radix-ui/react-switch/dist/index.js +12 -13
- package/dist/node_modules/@radix-ui/react-tabs/dist/index.js +13 -14
- package/dist/node_modules/@radix-ui/react-toggle-group/dist/index.js +20 -21
- package/dist/node_modules/@radix-ui/react-tooltip/dist/index.js +8 -9
- package/dist/node_modules/@radix-ui/react-use-is-hydrated/dist/index.js +1 -1
- package/dist/node_modules/@reduxjs/toolkit/dist/redux-toolkit.modern.js +183 -175
- package/dist/node_modules/@shikijs/core/dist/index.js +195 -175
- package/dist/node_modules/@shikijs/langs/dist/asciidoc.js +2 -2
- package/dist/node_modules/@shikijs/langs/dist/cobol.js +1 -1
- package/dist/node_modules/@shikijs/langs/dist/erlang.js +5 -3
- package/dist/node_modules/@shikijs/langs/dist/fsharp.js +1 -1
- package/dist/node_modules/@shikijs/langs/dist/gdscript.js +1 -1
- package/dist/node_modules/@shikijs/langs/dist/go.js +1 -1
- package/dist/node_modules/@shikijs/langs/dist/haxe.js +1 -1
- package/dist/node_modules/@shikijs/langs/dist/julia.js +1 -1
- package/dist/node_modules/@shikijs/langs/dist/latex.js +1 -1
- package/dist/node_modules/@shikijs/langs/dist/lean.js +1 -1
- package/dist/node_modules/@shikijs/langs/dist/markdown.js +1 -1
- package/dist/node_modules/@shikijs/langs/dist/marko.js +5 -5
- package/dist/node_modules/@shikijs/langs/dist/mermaid.js +1 -1
- package/dist/node_modules/@shikijs/langs/dist/nextflow.js +1 -1
- package/dist/node_modules/@shikijs/langs/dist/purescript.js +1 -1
- package/dist/node_modules/@shikijs/langs/dist/r.js +1 -1
- package/dist/node_modules/@shikijs/langs/dist/sql.js +1 -1
- package/dist/node_modules/@shikijs/langs/dist/swift.js +2 -2
- package/dist/node_modules/@shikijs/langs/dist/templ.js +1 -1
- package/dist/node_modules/@shikijs/langs/dist/tex.js +1 -1
- package/dist/node_modules/@shikijs/langs/dist/vue-vine.js +21 -0
- package/dist/node_modules/@shikijs/langs/dist/vue.js +1 -1
- package/dist/node_modules/@shikijs/langs/dist/zig.js +1 -1
- package/dist/node_modules/@shikijs/themes/dist/andromeeda.js +1 -1
- package/dist/node_modules/@shikijs/themes/dist/catppuccin-frappe.js +1 -1
- package/dist/node_modules/@shikijs/themes/dist/catppuccin-latte.js +1 -1
- package/dist/node_modules/@shikijs/themes/dist/catppuccin-macchiato.js +1 -1
- package/dist/node_modules/@shikijs/themes/dist/catppuccin-mocha.js +1 -1
- package/dist/node_modules/@shikijs/themes/dist/gruvbox-dark-hard.js +1 -1
- package/dist/node_modules/@shikijs/themes/dist/gruvbox-dark-medium.js +1 -1
- package/dist/node_modules/@shikijs/themes/dist/gruvbox-dark-soft.js +1 -1
- package/dist/node_modules/@shikijs/themes/dist/gruvbox-light-hard.js +1 -1
- package/dist/node_modules/@shikijs/themes/dist/gruvbox-light-medium.js +1 -1
- package/dist/node_modules/@shikijs/themes/dist/gruvbox-light-soft.js +1 -1
- package/dist/node_modules/@tanstack/virtual-core/dist/esm/index.js +215 -208
- package/dist/node_modules/@tanstack/virtual-core/dist/esm/utils.js +1 -1
- package/dist/node_modules/aria-hidden/dist/es2015/index.js +1 -1
- package/dist/node_modules/classnames/index.js +2 -2
- package/dist/node_modules/cmdk/dist/index.js +2 -2
- package/dist/node_modules/d3-interpolate/src/rgb.js +2 -2
- package/dist/node_modules/dayjs/dayjs.min.js +14 -14
- package/dist/node_modules/dayjs/locale/it.js +4 -4
- package/dist/node_modules/dayjs/plugin/isoWeek.js +4 -4
- package/dist/node_modules/dayjs/plugin/localizedFormat.js +10 -10
- package/dist/node_modules/decimal.js-light/decimal.js +2 -2
- package/dist/node_modules/es-toolkit/dist/_internal/isUnsafeProperty.js +2 -2
- package/dist/node_modules/es-toolkit/dist/array/flatten.js +2 -2
- package/dist/node_modules/es-toolkit/dist/array/uniqBy.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/_internal/compareValues.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/_internal/getSymbols.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/_internal/getTag.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/_internal/isDeepKey.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/_internal/isIndex.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/_internal/isIterateeCall.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/_internal/isKey.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/_internal/tags.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/_internal/toKey.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/array/orderBy.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/array/sortBy.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/array/uniqBy.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/function/debounce.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/function/throttle.js +14 -15
- package/dist/node_modules/es-toolkit/dist/compat/math/range.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/object/cloneDeep.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/object/cloneDeepWith.js +11 -11
- package/dist/node_modules/es-toolkit/dist/compat/object/get.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/object/has.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/object/property.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isArguments.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isArrayLike.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isArrayLikeObject.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isMatch.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isMatchWith.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isObject.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isObjectLike.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isSymbol.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/predicate/matches.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/predicate/matchesProperty.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/util/eq.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/util/iteratee.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/util/toFinite.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/util/toNumber.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/util/toPath.js +2 -2
- package/dist/node_modules/es-toolkit/dist/function/debounce.js +15 -15
- package/dist/node_modules/es-toolkit/dist/function/identity.js +2 -2
- package/dist/node_modules/es-toolkit/dist/function/noop.js +2 -10
- package/dist/node_modules/es-toolkit/dist/object/cloneDeep.js +2 -2
- package/dist/node_modules/es-toolkit/dist/object/cloneDeepWith.js +3 -3
- package/dist/node_modules/es-toolkit/dist/predicate/isLength.js +2 -2
- package/dist/node_modules/es-toolkit/dist/predicate/isPrimitive.js +2 -2
- package/dist/node_modules/es-toolkit/dist/predicate/isTypedArray.js +2 -2
- package/dist/node_modules/eventemitter3/index.js +1 -1
- package/dist/node_modules/eventemitter3/index2.js +3 -3
- package/dist/node_modules/immer/dist/immer.js +213 -216
- package/dist/node_modules/lexical/Lexical.prod.js +212 -212
- package/dist/node_modules/lodash/_baseCreate.js +2 -2
- package/dist/node_modules/lodash/_cloneBuffer.js +2 -2
- package/dist/node_modules/lodash/_defineProperty.js +2 -2
- package/dist/node_modules/lodash/_isMasked.js +2 -2
- package/dist/node_modules/lodash/_nodeUtil.js +4 -4
- package/dist/node_modules/lodash/isArguments.js +2 -2
- package/dist/node_modules/lodash/isBuffer.js +2 -2
- package/dist/node_modules/lodash/lodash.js +16 -16
- package/dist/node_modules/prismjs/components/prism-cpp.js +2 -2
- package/dist/node_modules/prismjs/components/prism-java.js +2 -2
- package/dist/node_modules/prismjs/components/prism-rust.js +2 -2
- package/dist/node_modules/prismjs/components/prism-typescript.js +2 -2
- package/dist/node_modules/prismjs/prism.js +8 -8
- package/dist/node_modules/react-day-picker/dist/esm/DayPicker.js +183 -164
- package/dist/node_modules/react-day-picker/dist/esm/classes/DateLib.js +14 -14
- package/dist/node_modules/react-day-picker/dist/esm/components/Chevron.js +10 -7
- package/dist/node_modules/react-day-picker/dist/esm/formatters/index.js +6 -6
- package/dist/node_modules/react-day-picker/dist/esm/helpers/createGetModifiers.js +30 -30
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getBroadcastWeeksInMonth.js +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDays.js +5 -5
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getInitialMonth.js +9 -9
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getWeeks.js +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getYearOptions.js +11 -11
- package/dist/node_modules/react-day-picker/dist/esm/helpers/startOfBroadcastWeek.js +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/labels/index.js +12 -12
- package/dist/node_modules/react-day-picker/dist/esm/useAnimation.js +19 -19
- package/dist/node_modules/react-day-picker/dist/esm/useCalendar.js +9 -9
- package/dist/node_modules/react-day-picker/dist/esm/utils/addToRange.js +10 -10
- package/dist/node_modules/react-hook-form/dist/index.esm.js +150 -117
- package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.js +48 -48
- package/dist/node_modules/react-remove-scroll/dist/es2015/UI.js +9 -9
- package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +43 -39
- package/dist/node_modules/react-resizable-panels/dist/react-resizable-panels.browser.js +95 -94
- package/dist/node_modules/react-window/dist/index.esm.js +2 -2
- package/dist/node_modules/recharts/es6/animation/AnimationManager.js +14 -14
- package/dist/node_modules/recharts/es6/animation/JavascriptAnimate.js +49 -0
- package/dist/node_modules/recharts/es6/animation/createDefaultAnimationManager.js +9 -0
- package/dist/node_modules/recharts/es6/animation/useAnimationManager.js +12 -0
- package/dist/node_modules/recharts/es6/component/Cursor.js +5 -5
- package/dist/node_modules/recharts/es6/component/DefaultLegendContent.js +55 -58
- package/dist/node_modules/recharts/es6/component/Legend.js +32 -27
- package/dist/node_modules/recharts/es6/component/ResponsiveContainer.js +44 -40
- package/dist/node_modules/recharts/es6/context/chartLayoutContext.js +15 -23
- package/dist/node_modules/recharts/es6/context/useTooltipAxis.js +8 -7
- package/dist/node_modules/recharts/es6/shape/Curve.js +10 -10
- package/dist/node_modules/recharts/es6/shape/Rectangle.js +136 -99
- package/dist/node_modules/recharts/es6/shape/Symbols.js +55 -53
- package/dist/node_modules/recharts/es6/state/legendSlice.js +5 -4
- package/dist/node_modules/recharts/es6/state/selectors/axisSelectors.js +352 -307
- package/dist/node_modules/recharts/es6/state/selectors/brushSelectors.js +9 -9
- package/dist/node_modules/recharts/es6/state/selectors/combiners/combineDisplayedStackedData.js +26 -0
- package/dist/node_modules/recharts/es6/state/selectors/combiners/combineTooltipPayload.js +117 -0
- package/dist/node_modules/recharts/es6/state/selectors/dataSelectors.js +4 -4
- package/dist/node_modules/recharts/es6/state/selectors/legendSelectors.js +10 -4
- package/dist/node_modules/recharts/es6/state/selectors/polarAxisSelectors.js +33 -32
- package/dist/node_modules/recharts/es6/state/selectors/selectChartOffsetInternal.js +108 -0
- package/dist/node_modules/recharts/es6/state/selectors/selectTooltipAxis.js +13 -0
- package/dist/node_modules/recharts/es6/state/selectors/selectTooltipAxisId.js +5 -0
- package/dist/node_modules/recharts/es6/state/selectors/selectTooltipAxisType.js +9 -0
- package/dist/node_modules/recharts/es6/state/selectors/selectors.js +40 -143
- package/dist/node_modules/recharts/es6/state/selectors/tooltipSelectors.js +68 -63
- package/dist/node_modules/recharts/es6/state/types/StackedGraphicalItem.js +7 -0
- package/dist/node_modules/recharts/es6/util/ChartUtils.js +58 -57
- package/dist/node_modules/recharts/es6/util/DataUtils.js +34 -26
- package/dist/node_modules/recharts/es6/util/Events.js +1 -1
- package/dist/node_modules/recharts/es6/util/ReactUtils.js +20 -15
- package/dist/node_modules/recharts/es6/util/excludeEventProps.js +11 -0
- package/dist/node_modules/recharts/es6/util/getSliced.js +7 -0
- package/dist/node_modules/recharts/es6/util/scale/getNiceTickValues.js +44 -44
- package/dist/node_modules/recharts/es6/util/stacks/getStackSeriesIdentifier.js +7 -0
- package/dist/node_modules/recharts/es6/util/svgPropertiesNoEvents.js +328 -0
- package/dist/node_modules/recharts/es6/util/types.js +22 -332
- package/dist/node_modules/recharts/es6/util/useAnimationId.js +10 -0
- package/dist/node_modules/recharts/es6/util/useElementOffset.js +20 -16
- package/dist/node_modules/remeda/dist/hasAtLeast-F1Oj_xBB.js +9 -0
- package/dist/node_modules/remeda/dist/lazyDataLastImpl-BDhrIOwR.js +8 -0
- package/dist/node_modules/remeda/dist/omit-HZOiLuMO.js +19 -0
- package/dist/node_modules/remeda/dist/purry-DH9cw9sy.js +11 -0
- package/dist/node_modules/shiki/dist/langs.js +225 -220
- package/dist/node_modules/shiki/dist/themes.js +60 -60
- package/dist/node_modules/sonner/dist/index.js +309 -305
- package/dist/node_modules/style-to-object/cjs/index.js +1 -1
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +169 -168
- package/dist/node_modules/unified/lib/callable-instance.js +2 -2
- package/dist/node_modules/unified/lib/index.js +1 -1
- package/dist/node_modules/unist-util-is/lib/index.js +2 -2
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js +2 -2
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +2 -2
- package/dist/node_modules/vaul/dist/index.js +1 -1
- package/dist/node_modules/vfile-message/lib/index.js +1 -1
- package/dist/styles.v3.css +1 -1
- package/package.json +3 -2
- package/dist/_virtual/isEqual.js +0 -8
- package/dist/_virtual/isEqual2.js +0 -5
- package/dist/_virtual/isEqualWith.js +0 -5
- package/dist/_virtual/isPlainObject.js +0 -5
- package/dist/_virtual/noop.js +0 -5
- package/dist/node_modules/cmdk/node_modules/@radix-ui/react-dialog/dist/index.js +0 -255
- package/dist/node_modules/cmdk/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +0 -128
- package/dist/node_modules/cmdk/node_modules/@radix-ui/react-focus-scope/dist/index.js +0 -137
- package/dist/node_modules/cmdk/node_modules/@radix-ui/react-portal/dist/index.js +0 -16
- package/dist/node_modules/cmdk/node_modules/@radix-ui/react-primitive/dist/index.js +0 -37
- package/dist/node_modules/cmdk/node_modules/@radix-ui/react-slot/dist/index.js +0 -50
- package/dist/node_modules/es-toolkit/compat/isEqual.js +0 -9
- package/dist/node_modules/es-toolkit/dist/predicate/isEqual.js +0 -18
- package/dist/node_modules/es-toolkit/dist/predicate/isEqualWith.js +0 -139
- package/dist/node_modules/es-toolkit/dist/predicate/isPlainObject.js +0 -18
- package/dist/node_modules/recharts/es6/animation/Animate.js +0 -270
- package/dist/node_modules/recharts/es6/state/selectors/selectChartOffset.js +0 -98
- package/dist/node_modules/remeda/dist/chunk-AIG3BDKO.js +0 -9
- package/dist/node_modules/remeda/dist/chunk-D6FCK2GA.js +0 -8
- package/dist/node_modules/remeda/dist/chunk-KI5X74E2.js +0 -19
- package/dist/node_modules/remeda/dist/chunk-WIMGWYZL.js +0 -11
- package/dist/node_modules/vaul/node_modules/@radix-ui/react-dialog/dist/index.js +0 -258
- package/dist/node_modules/vaul/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +0 -128
- package/dist/node_modules/vaul/node_modules/@radix-ui/react-focus-scope/dist/index.js +0 -137
- package/dist/node_modules/vaul/node_modules/@radix-ui/react-portal/dist/index.js +0 -16
- package/dist/node_modules/vaul/node_modules/@radix-ui/react-primitive/dist/index.js +0 -37
- package/dist/node_modules/vaul/node_modules/@radix-ui/react-slot/dist/index.js +0 -50
|
@@ -1,96 +1,96 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { memo as f, notUndefined as v, approxEqual as M, debounce as
|
|
2
|
+
import { memo as f, notUndefined as v, approxEqual as M, debounce as z } from "./utils.js";
|
|
3
3
|
const b = (r) => {
|
|
4
|
-
const { offsetWidth:
|
|
5
|
-
return { width:
|
|
6
|
-
},
|
|
7
|
-
const
|
|
8
|
-
for (let
|
|
9
|
-
s.push(
|
|
4
|
+
const { offsetWidth: a, offsetHeight: e } = r;
|
|
5
|
+
return { width: a, height: e };
|
|
6
|
+
}, w = (r) => r, I = (r) => {
|
|
7
|
+
const a = Math.max(r.startIndex - r.overscan, 0), e = Math.min(r.endIndex + r.overscan, r.count - 1), s = [];
|
|
8
|
+
for (let t = a; t <= e; t++)
|
|
9
|
+
s.push(t);
|
|
10
10
|
return s;
|
|
11
|
-
},
|
|
12
|
-
const
|
|
13
|
-
if (!
|
|
11
|
+
}, A = (r, a) => {
|
|
12
|
+
const e = r.scrollElement;
|
|
13
|
+
if (!e)
|
|
14
14
|
return;
|
|
15
15
|
const s = r.targetWindow;
|
|
16
16
|
if (!s)
|
|
17
17
|
return;
|
|
18
|
-
const
|
|
19
|
-
const { width: o, height:
|
|
20
|
-
|
|
18
|
+
const t = (n) => {
|
|
19
|
+
const { width: o, height: h } = n;
|
|
20
|
+
a({ width: Math.round(o), height: Math.round(h) });
|
|
21
21
|
};
|
|
22
|
-
if (
|
|
22
|
+
if (t(b(e)), !s.ResizeObserver)
|
|
23
23
|
return () => {
|
|
24
24
|
};
|
|
25
25
|
const i = new s.ResizeObserver((n) => {
|
|
26
26
|
const o = () => {
|
|
27
|
-
const
|
|
28
|
-
if (
|
|
29
|
-
const c =
|
|
27
|
+
const h = n[0];
|
|
28
|
+
if (h?.borderBoxSize) {
|
|
29
|
+
const c = h.borderBoxSize[0];
|
|
30
30
|
if (c) {
|
|
31
|
-
|
|
31
|
+
t({ width: c.inlineSize, height: c.blockSize });
|
|
32
32
|
return;
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
|
|
35
|
+
t(b(e));
|
|
36
36
|
};
|
|
37
37
|
r.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(o) : o();
|
|
38
38
|
});
|
|
39
|
-
return i.observe(
|
|
40
|
-
i.unobserve(
|
|
39
|
+
return i.observe(e, { box: "border-box" }), () => {
|
|
40
|
+
i.unobserve(e);
|
|
41
41
|
};
|
|
42
|
-
},
|
|
42
|
+
}, E = {
|
|
43
43
|
passive: !0
|
|
44
|
-
},
|
|
45
|
-
const
|
|
46
|
-
if (!
|
|
44
|
+
}, S = typeof window > "u" ? !0 : "onscrollend" in window, F = (r, a) => {
|
|
45
|
+
const e = r.scrollElement;
|
|
46
|
+
if (!e)
|
|
47
47
|
return;
|
|
48
48
|
const s = r.targetWindow;
|
|
49
49
|
if (!s)
|
|
50
50
|
return;
|
|
51
|
-
let
|
|
52
|
-
const i = r.options.useScrollendEvent &&
|
|
53
|
-
} :
|
|
51
|
+
let t = 0;
|
|
52
|
+
const i = r.options.useScrollendEvent && S ? () => {
|
|
53
|
+
} : z(
|
|
54
54
|
s,
|
|
55
55
|
() => {
|
|
56
|
-
|
|
56
|
+
a(t, !1);
|
|
57
57
|
},
|
|
58
58
|
r.options.isScrollingResetDelay
|
|
59
59
|
), n = (l) => () => {
|
|
60
|
-
const { horizontal:
|
|
61
|
-
|
|
62
|
-
}, o = n(!0),
|
|
63
|
-
|
|
64
|
-
const c = r.options.useScrollendEvent &&
|
|
65
|
-
return c &&
|
|
66
|
-
|
|
60
|
+
const { horizontal: d, isRtl: u } = r.options;
|
|
61
|
+
t = d ? e.scrollLeft * (u && -1 || 1) : e.scrollTop, i(), a(t, l);
|
|
62
|
+
}, o = n(!0), h = n(!1);
|
|
63
|
+
h(), e.addEventListener("scroll", o, E);
|
|
64
|
+
const c = r.options.useScrollendEvent && S;
|
|
65
|
+
return c && e.addEventListener("scrollend", h, E), () => {
|
|
66
|
+
e.removeEventListener("scroll", o), c && e.removeEventListener("scrollend", h);
|
|
67
67
|
};
|
|
68
|
-
}, C = (r,
|
|
69
|
-
if (
|
|
70
|
-
const s =
|
|
68
|
+
}, C = (r, a, e) => {
|
|
69
|
+
if (a?.borderBoxSize) {
|
|
70
|
+
const s = a.borderBoxSize[0];
|
|
71
71
|
if (s)
|
|
72
72
|
return Math.round(
|
|
73
|
-
s[
|
|
73
|
+
s[e.options.horizontal ? "inlineSize" : "blockSize"]
|
|
74
74
|
);
|
|
75
75
|
}
|
|
76
|
-
return r[
|
|
77
|
-
},
|
|
78
|
-
adjustments:
|
|
79
|
-
behavior:
|
|
76
|
+
return r[e.options.horizontal ? "offsetWidth" : "offsetHeight"];
|
|
77
|
+
}, N = (r, {
|
|
78
|
+
adjustments: a = 0,
|
|
79
|
+
behavior: e
|
|
80
80
|
}, s) => {
|
|
81
|
-
var
|
|
82
|
-
const n = r +
|
|
83
|
-
(i = (
|
|
81
|
+
var t, i;
|
|
82
|
+
const n = r + a;
|
|
83
|
+
(i = (t = s.scrollElement) == null ? void 0 : t.scrollTo) == null || i.call(t, {
|
|
84
84
|
[s.options.horizontal ? "left" : "top"]: n,
|
|
85
|
-
behavior:
|
|
85
|
+
behavior: e
|
|
86
86
|
});
|
|
87
87
|
};
|
|
88
|
-
class
|
|
89
|
-
constructor(
|
|
90
|
-
this.unsubs = [], this.scrollElement = null, this.targetWindow = null, this.isScrolling = !1, this.
|
|
91
|
-
let
|
|
92
|
-
const s = () =>
|
|
93
|
-
|
|
88
|
+
class W {
|
|
89
|
+
constructor(a) {
|
|
90
|
+
this.unsubs = [], this.scrollElement = null, this.targetWindow = null, this.isScrolling = !1, this.measurementsCache = [], this.itemSizeCache = /* @__PURE__ */ new Map(), this.pendingMeasuredCacheIndexes = [], this.scrollRect = null, this.scrollOffset = null, this.scrollDirection = null, this.scrollAdjustments = 0, this.elementsCache = /* @__PURE__ */ new Map(), this.observer = /* @__PURE__ */ (() => {
|
|
91
|
+
let e = null;
|
|
92
|
+
const s = () => e || (!this.targetWindow || !this.targetWindow.ResizeObserver ? null : e = new this.targetWindow.ResizeObserver((t) => {
|
|
93
|
+
t.forEach((i) => {
|
|
94
94
|
const n = () => {
|
|
95
95
|
this._measureElement(i.target, i);
|
|
96
96
|
};
|
|
@@ -99,21 +99,21 @@ class N {
|
|
|
99
99
|
}));
|
|
100
100
|
return {
|
|
101
101
|
disconnect: () => {
|
|
102
|
-
var
|
|
103
|
-
(
|
|
102
|
+
var t;
|
|
103
|
+
(t = s()) == null || t.disconnect(), e = null;
|
|
104
104
|
},
|
|
105
|
-
observe: (
|
|
105
|
+
observe: (t) => {
|
|
106
106
|
var i;
|
|
107
|
-
return (i = s()) == null ? void 0 : i.observe(
|
|
107
|
+
return (i = s()) == null ? void 0 : i.observe(t, { box: "border-box" });
|
|
108
108
|
},
|
|
109
|
-
unobserve: (
|
|
109
|
+
unobserve: (t) => {
|
|
110
110
|
var i;
|
|
111
|
-
return (i = s()) == null ? void 0 : i.unobserve(
|
|
111
|
+
return (i = s()) == null ? void 0 : i.unobserve(t);
|
|
112
112
|
}
|
|
113
113
|
};
|
|
114
|
-
})(), this.range = null, this.setOptions = (
|
|
115
|
-
Object.entries(
|
|
116
|
-
typeof
|
|
114
|
+
})(), this.range = null, this.setOptions = (e) => {
|
|
115
|
+
Object.entries(e).forEach(([s, t]) => {
|
|
116
|
+
typeof t > "u" && delete e[s];
|
|
117
117
|
}), this.options = {
|
|
118
118
|
debug: !1,
|
|
119
119
|
initialOffset: 0,
|
|
@@ -123,8 +123,8 @@ class N {
|
|
|
123
123
|
scrollPaddingStart: 0,
|
|
124
124
|
scrollPaddingEnd: 0,
|
|
125
125
|
horizontal: !1,
|
|
126
|
-
getItemKey:
|
|
127
|
-
rangeExtractor:
|
|
126
|
+
getItemKey: w,
|
|
127
|
+
rangeExtractor: I,
|
|
128
128
|
onChange: () => {
|
|
129
129
|
},
|
|
130
130
|
measureElement: C,
|
|
@@ -139,19 +139,19 @@ class N {
|
|
|
139
139
|
isRtl: !1,
|
|
140
140
|
useScrollendEvent: !1,
|
|
141
141
|
useAnimationFrameWithResizeObserver: !1,
|
|
142
|
-
...
|
|
142
|
+
...e
|
|
143
143
|
};
|
|
144
|
-
}, this.notify = (
|
|
145
|
-
var s,
|
|
146
|
-
(
|
|
144
|
+
}, this.notify = (e) => {
|
|
145
|
+
var s, t;
|
|
146
|
+
(t = (s = this.options).onChange) == null || t.call(s, this, e);
|
|
147
147
|
}, this.maybeNotify = f(
|
|
148
148
|
() => (this.calculateRange(), [
|
|
149
149
|
this.isScrolling,
|
|
150
150
|
this.range ? this.range.startIndex : null,
|
|
151
151
|
this.range ? this.range.endIndex : null
|
|
152
152
|
]),
|
|
153
|
-
(
|
|
154
|
-
this.notify(
|
|
153
|
+
(e) => {
|
|
154
|
+
this.notify(e);
|
|
155
155
|
},
|
|
156
156
|
{
|
|
157
157
|
key: process.env.NODE_ENV !== "production" && "maybeNotify",
|
|
@@ -163,42 +163,42 @@ class N {
|
|
|
163
163
|
]
|
|
164
164
|
}
|
|
165
165
|
), this.cleanup = () => {
|
|
166
|
-
this.unsubs.filter(Boolean).forEach((
|
|
166
|
+
this.unsubs.filter(Boolean).forEach((e) => e()), this.unsubs = [], this.observer.disconnect(), this.scrollElement = null, this.targetWindow = null;
|
|
167
167
|
}, this._didMount = () => () => {
|
|
168
168
|
this.cleanup();
|
|
169
169
|
}, this._willUpdate = () => {
|
|
170
|
-
var
|
|
170
|
+
var e;
|
|
171
171
|
const s = this.options.enabled ? this.options.getScrollElement() : null;
|
|
172
172
|
if (this.scrollElement !== s) {
|
|
173
173
|
if (this.cleanup(), !s) {
|
|
174
174
|
this.maybeNotify();
|
|
175
175
|
return;
|
|
176
176
|
}
|
|
177
|
-
this.scrollElement = s, this.scrollElement && "ownerDocument" in this.scrollElement ? this.targetWindow = this.scrollElement.ownerDocument.defaultView : this.targetWindow = ((
|
|
178
|
-
this.observer.observe(
|
|
177
|
+
this.scrollElement = s, this.scrollElement && "ownerDocument" in this.scrollElement ? this.targetWindow = this.scrollElement.ownerDocument.defaultView : this.targetWindow = ((e = this.scrollElement) == null ? void 0 : e.window) ?? null, this.elementsCache.forEach((t) => {
|
|
178
|
+
this.observer.observe(t);
|
|
179
179
|
}), this._scrollToOffset(this.getScrollOffset(), {
|
|
180
180
|
adjustments: void 0,
|
|
181
181
|
behavior: void 0
|
|
182
182
|
}), this.unsubs.push(
|
|
183
|
-
this.options.observeElementRect(this, (
|
|
184
|
-
this.scrollRect =
|
|
183
|
+
this.options.observeElementRect(this, (t) => {
|
|
184
|
+
this.scrollRect = t, this.maybeNotify();
|
|
185
185
|
})
|
|
186
186
|
), this.unsubs.push(
|
|
187
|
-
this.options.observeElementOffset(this, (
|
|
188
|
-
this.scrollAdjustments = 0, this.scrollDirection = i ? this.getScrollOffset() <
|
|
187
|
+
this.options.observeElementOffset(this, (t, i) => {
|
|
188
|
+
this.scrollAdjustments = 0, this.scrollDirection = i ? this.getScrollOffset() < t ? "forward" : "backward" : null, this.scrollOffset = t, this.isScrolling = i, this.maybeNotify();
|
|
189
189
|
})
|
|
190
190
|
);
|
|
191
191
|
}
|
|
192
|
-
}, this.getSize = () => this.options.enabled ? (this.scrollRect = this.scrollRect ?? this.options.initialRect, this.scrollRect[this.options.horizontal ? "width" : "height"]) : (this.scrollRect = null, 0), this.getScrollOffset = () => this.options.enabled ? (this.scrollOffset = this.scrollOffset ?? (typeof this.options.initialOffset == "function" ? this.options.initialOffset() : this.options.initialOffset), this.scrollOffset) : (this.scrollOffset = null, 0), this.getFurthestMeasurement = (
|
|
193
|
-
const
|
|
192
|
+
}, this.getSize = () => this.options.enabled ? (this.scrollRect = this.scrollRect ?? this.options.initialRect, this.scrollRect[this.options.horizontal ? "width" : "height"]) : (this.scrollRect = null, 0), this.getScrollOffset = () => this.options.enabled ? (this.scrollOffset = this.scrollOffset ?? (typeof this.options.initialOffset == "function" ? this.options.initialOffset() : this.options.initialOffset), this.scrollOffset) : (this.scrollOffset = null, 0), this.getFurthestMeasurement = (e, s) => {
|
|
193
|
+
const t = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
|
|
194
194
|
for (let n = s - 1; n >= 0; n--) {
|
|
195
|
-
const o =
|
|
196
|
-
if (
|
|
195
|
+
const o = e[n];
|
|
196
|
+
if (t.has(o.lane))
|
|
197
197
|
continue;
|
|
198
|
-
const
|
|
198
|
+
const h = i.get(
|
|
199
199
|
o.lane
|
|
200
200
|
);
|
|
201
|
-
if (
|
|
201
|
+
if (h == null || o.end > h.end ? i.set(o.lane, o) : o.end < h.end && t.set(o.lane, !0), t.size === this.options.lanes)
|
|
202
202
|
break;
|
|
203
203
|
}
|
|
204
204
|
return i.size === this.options.lanes ? Array.from(i.values()).sort((n, o) => n.end === o.end ? n.index - o.index : n.end - o.end)[0] : void 0;
|
|
@@ -210,10 +210,10 @@ class N {
|
|
|
210
210
|
this.options.getItemKey,
|
|
211
211
|
this.options.enabled
|
|
212
212
|
],
|
|
213
|
-
(
|
|
214
|
-
count:
|
|
213
|
+
(e, s, t, i, n) => (this.pendingMeasuredCacheIndexes = [], {
|
|
214
|
+
count: e,
|
|
215
215
|
paddingStart: s,
|
|
216
|
-
scrollMargin:
|
|
216
|
+
scrollMargin: t,
|
|
217
217
|
getItemKey: i,
|
|
218
218
|
enabled: n
|
|
219
219
|
}),
|
|
@@ -222,24 +222,24 @@ class N {
|
|
|
222
222
|
}
|
|
223
223
|
), this.getMeasurements = f(
|
|
224
224
|
() => [this.getMeasurementOptions(), this.itemSizeCache],
|
|
225
|
-
({ count:
|
|
225
|
+
({ count: e, paddingStart: s, scrollMargin: t, getItemKey: i, enabled: n }, o) => {
|
|
226
226
|
if (!n)
|
|
227
227
|
return this.measurementsCache = [], this.itemSizeCache.clear(), [];
|
|
228
228
|
this.measurementsCache.length === 0 && (this.measurementsCache = this.options.initialMeasurementsCache, this.measurementsCache.forEach((l) => {
|
|
229
229
|
this.itemSizeCache.set(l.key, l.size);
|
|
230
230
|
}));
|
|
231
|
-
const
|
|
231
|
+
const h = this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0;
|
|
232
232
|
this.pendingMeasuredCacheIndexes = [];
|
|
233
|
-
const c = this.measurementsCache.slice(0,
|
|
234
|
-
for (let l =
|
|
235
|
-
const
|
|
233
|
+
const c = this.measurementsCache.slice(0, h);
|
|
234
|
+
for (let l = h; l < e; l++) {
|
|
235
|
+
const d = i(l), u = this.options.lanes === 1 ? c[l - 1] : this.getFurthestMeasurement(c, l), g = u ? u.end + this.options.gap : s + t, m = o.get(d), p = typeof m == "number" ? m : this.options.estimateSize(l), O = g + p, y = u ? u.lane : l % this.options.lanes;
|
|
236
236
|
c[l] = {
|
|
237
237
|
index: l,
|
|
238
|
-
start:
|
|
238
|
+
start: g,
|
|
239
239
|
size: p,
|
|
240
240
|
end: O,
|
|
241
|
-
key:
|
|
242
|
-
lane:
|
|
241
|
+
key: d,
|
|
242
|
+
lane: y
|
|
243
243
|
};
|
|
244
244
|
}
|
|
245
245
|
return this.measurementsCache = c, c;
|
|
@@ -255,10 +255,10 @@ class N {
|
|
|
255
255
|
this.getScrollOffset(),
|
|
256
256
|
this.options.lanes
|
|
257
257
|
],
|
|
258
|
-
(
|
|
259
|
-
measurements:
|
|
258
|
+
(e, s, t, i) => this.range = e.length > 0 && s > 0 ? R({
|
|
259
|
+
measurements: e,
|
|
260
260
|
outerSize: s,
|
|
261
|
-
scrollOffset:
|
|
261
|
+
scrollOffset: t,
|
|
262
262
|
lanes: i
|
|
263
263
|
}) : null,
|
|
264
264
|
{
|
|
@@ -267,144 +267,151 @@ class N {
|
|
|
267
267
|
}
|
|
268
268
|
), this.getVirtualIndexes = f(
|
|
269
269
|
() => {
|
|
270
|
-
let
|
|
271
|
-
const
|
|
272
|
-
return
|
|
270
|
+
let e = null, s = null;
|
|
271
|
+
const t = this.calculateRange();
|
|
272
|
+
return t && (e = t.startIndex, s = t.endIndex), this.maybeNotify.updateDeps([this.isScrolling, e, s]), [
|
|
273
273
|
this.options.rangeExtractor,
|
|
274
274
|
this.options.overscan,
|
|
275
275
|
this.options.count,
|
|
276
|
-
|
|
276
|
+
e,
|
|
277
277
|
s
|
|
278
278
|
];
|
|
279
279
|
},
|
|
280
|
-
(
|
|
280
|
+
(e, s, t, i, n) => i === null || n === null ? [] : e({
|
|
281
281
|
startIndex: i,
|
|
282
282
|
endIndex: n,
|
|
283
283
|
overscan: s,
|
|
284
|
-
count:
|
|
284
|
+
count: t
|
|
285
285
|
}),
|
|
286
286
|
{
|
|
287
287
|
key: process.env.NODE_ENV !== "production" && "getVirtualIndexes",
|
|
288
288
|
debug: () => this.options.debug
|
|
289
289
|
}
|
|
290
|
-
), this.indexFromElement = (
|
|
291
|
-
const s = this.options.indexAttribute,
|
|
292
|
-
return
|
|
290
|
+
), this.indexFromElement = (e) => {
|
|
291
|
+
const s = this.options.indexAttribute, t = e.getAttribute(s);
|
|
292
|
+
return t ? parseInt(t, 10) : (console.warn(
|
|
293
293
|
`Missing attribute name '${s}={index}' on measured element.`
|
|
294
294
|
), -1);
|
|
295
|
-
}, this._measureElement = (
|
|
296
|
-
const
|
|
295
|
+
}, this._measureElement = (e, s) => {
|
|
296
|
+
const t = this.indexFromElement(e), i = this.measurementsCache[t];
|
|
297
297
|
if (!i)
|
|
298
298
|
return;
|
|
299
299
|
const n = i.key, o = this.elementsCache.get(n);
|
|
300
|
-
o !==
|
|
301
|
-
}, this.resizeItem = (
|
|
302
|
-
const
|
|
303
|
-
if (!
|
|
300
|
+
o !== e && (o && this.observer.unobserve(o), this.observer.observe(e), this.elementsCache.set(n, e)), e.isConnected && this.resizeItem(t, this.options.measureElement(e, s, this));
|
|
301
|
+
}, this.resizeItem = (e, s) => {
|
|
302
|
+
const t = this.measurementsCache[e];
|
|
303
|
+
if (!t)
|
|
304
304
|
return;
|
|
305
|
-
const i = this.itemSizeCache.get(
|
|
306
|
-
n !== 0 && ((this.shouldAdjustScrollPositionOnItemSizeChange !== void 0 ? this.shouldAdjustScrollPositionOnItemSizeChange(
|
|
305
|
+
const i = this.itemSizeCache.get(t.key) ?? t.size, n = s - i;
|
|
306
|
+
n !== 0 && ((this.shouldAdjustScrollPositionOnItemSizeChange !== void 0 ? this.shouldAdjustScrollPositionOnItemSizeChange(t, n, this) : t.start < this.getScrollOffset() + this.scrollAdjustments) && (process.env.NODE_ENV !== "production" && this.options.debug && console.info("correction", n), this._scrollToOffset(this.getScrollOffset(), {
|
|
307
307
|
adjustments: this.scrollAdjustments += n,
|
|
308
308
|
behavior: void 0
|
|
309
|
-
})), this.pendingMeasuredCacheIndexes.push(
|
|
310
|
-
}, this.measureElement = (
|
|
311
|
-
if (!
|
|
312
|
-
this.elementsCache.forEach((s,
|
|
313
|
-
s.isConnected || (this.observer.unobserve(s), this.elementsCache.delete(
|
|
309
|
+
})), this.pendingMeasuredCacheIndexes.push(t.index), this.itemSizeCache = new Map(this.itemSizeCache.set(t.key, s)), this.notify(!1));
|
|
310
|
+
}, this.measureElement = (e) => {
|
|
311
|
+
if (!e) {
|
|
312
|
+
this.elementsCache.forEach((s, t) => {
|
|
313
|
+
s.isConnected || (this.observer.unobserve(s), this.elementsCache.delete(t));
|
|
314
314
|
});
|
|
315
315
|
return;
|
|
316
316
|
}
|
|
317
|
-
this._measureElement(
|
|
317
|
+
this._measureElement(e, void 0);
|
|
318
318
|
}, this.getVirtualItems = f(
|
|
319
319
|
() => [this.getVirtualIndexes(), this.getMeasurements()],
|
|
320
|
-
(
|
|
321
|
-
const
|
|
322
|
-
for (let i = 0, n =
|
|
323
|
-
const o =
|
|
324
|
-
|
|
320
|
+
(e, s) => {
|
|
321
|
+
const t = [];
|
|
322
|
+
for (let i = 0, n = e.length; i < n; i++) {
|
|
323
|
+
const o = e[i], h = s[o];
|
|
324
|
+
t.push(h);
|
|
325
325
|
}
|
|
326
|
-
return
|
|
326
|
+
return t;
|
|
327
327
|
},
|
|
328
328
|
{
|
|
329
329
|
key: process.env.NODE_ENV !== "production" && "getVirtualItems",
|
|
330
330
|
debug: () => this.options.debug
|
|
331
331
|
}
|
|
332
|
-
), this.getVirtualItemForOffset = (
|
|
332
|
+
), this.getVirtualItemForOffset = (e) => {
|
|
333
333
|
const s = this.getMeasurements();
|
|
334
334
|
if (s.length !== 0)
|
|
335
335
|
return v(
|
|
336
|
-
s[
|
|
336
|
+
s[x(
|
|
337
337
|
0,
|
|
338
338
|
s.length - 1,
|
|
339
|
-
(
|
|
340
|
-
|
|
339
|
+
(t) => v(s[t]).start,
|
|
340
|
+
e
|
|
341
341
|
)]
|
|
342
342
|
);
|
|
343
|
-
}, this.getOffsetForAlignment = (
|
|
343
|
+
}, this.getOffsetForAlignment = (e, s, t = 0) => {
|
|
344
344
|
const i = this.getSize(), n = this.getScrollOffset();
|
|
345
|
-
s === "auto" && (s =
|
|
346
|
-
const o = this.getTotalSize() - i;
|
|
347
|
-
return Math.max(Math.min(o,
|
|
348
|
-
}, this.getOffsetForIndex = (
|
|
349
|
-
|
|
350
|
-
const
|
|
351
|
-
if (!
|
|
345
|
+
s === "auto" && (s = e >= n + i ? "end" : "start"), s === "center" ? e += (t - i) / 2 : s === "end" && (e -= i);
|
|
346
|
+
const o = this.getTotalSize() + this.options.scrollMargin - i;
|
|
347
|
+
return Math.max(Math.min(o, e), 0);
|
|
348
|
+
}, this.getOffsetForIndex = (e, s = "auto") => {
|
|
349
|
+
e = Math.max(0, Math.min(e, this.options.count - 1));
|
|
350
|
+
const t = this.measurementsCache[e];
|
|
351
|
+
if (!t)
|
|
352
352
|
return;
|
|
353
353
|
const i = this.getSize(), n = this.getScrollOffset();
|
|
354
354
|
if (s === "auto")
|
|
355
|
-
if (
|
|
355
|
+
if (t.end >= n + i - this.options.scrollPaddingEnd)
|
|
356
356
|
s = "end";
|
|
357
|
-
else if (
|
|
357
|
+
else if (t.start <= n + this.options.scrollPaddingStart)
|
|
358
358
|
s = "start";
|
|
359
359
|
else
|
|
360
360
|
return [n, s];
|
|
361
|
-
const o = s === "end" ?
|
|
361
|
+
const o = s === "end" ? t.end + this.options.scrollPaddingEnd : t.start - this.options.scrollPaddingStart;
|
|
362
362
|
return [
|
|
363
|
-
this.getOffsetForAlignment(o, s,
|
|
363
|
+
this.getOffsetForAlignment(o, s, t.size),
|
|
364
364
|
s
|
|
365
365
|
];
|
|
366
|
-
}, this.isDynamicMode = () => this.elementsCache.size > 0, this.
|
|
367
|
-
|
|
368
|
-
}, this.scrollToOffset = (t, { align: s = "start", behavior: e } = {}) => {
|
|
369
|
-
this.cancelScrollToIndex(), e === "smooth" && this.isDynamicMode() && console.warn(
|
|
366
|
+
}, this.isDynamicMode = () => this.elementsCache.size > 0, this.scrollToOffset = (e, { align: s = "start", behavior: t } = {}) => {
|
|
367
|
+
t === "smooth" && this.isDynamicMode() && console.warn(
|
|
370
368
|
"The `smooth` scroll behavior is not fully supported with dynamic size."
|
|
371
|
-
), this._scrollToOffset(this.getOffsetForAlignment(
|
|
369
|
+
), this._scrollToOffset(this.getOffsetForAlignment(e, s), {
|
|
372
370
|
adjustments: void 0,
|
|
373
|
-
behavior:
|
|
371
|
+
behavior: t
|
|
374
372
|
});
|
|
375
|
-
}, this.scrollToIndex = (
|
|
376
|
-
t
|
|
373
|
+
}, this.scrollToIndex = (e, { align: s = "auto", behavior: t } = {}) => {
|
|
374
|
+
t === "smooth" && this.isDynamicMode() && console.warn(
|
|
377
375
|
"The `smooth` scroll behavior is not fully supported with dynamic size."
|
|
378
|
-
);
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
if (
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
376
|
+
), e = Math.max(0, Math.min(e, this.options.count - 1));
|
|
377
|
+
let i = 0;
|
|
378
|
+
const n = 10, o = (c) => {
|
|
379
|
+
if (!this.targetWindow) return;
|
|
380
|
+
const l = this.getOffsetForIndex(e, c);
|
|
381
|
+
if (!l) {
|
|
382
|
+
console.warn("Failed to get offset for index:", e);
|
|
383
|
+
return;
|
|
384
|
+
}
|
|
385
|
+
const [d, u] = l;
|
|
386
|
+
this._scrollToOffset(d, { adjustments: void 0, behavior: t }), this.targetWindow.requestAnimationFrame(() => {
|
|
387
|
+
const g = this.getScrollOffset(), m = this.getOffsetForIndex(e, u);
|
|
388
|
+
if (!m) {
|
|
389
|
+
console.warn("Failed to get offset for index:", e);
|
|
390
|
+
return;
|
|
391
|
+
}
|
|
392
|
+
M(m[0], g) || h(u);
|
|
393
|
+
});
|
|
394
|
+
}, h = (c) => {
|
|
395
|
+
this.targetWindow && (i++, i < n ? (process.env.NODE_ENV !== "production" && this.options.debug && console.info("Schedule retry", i, n), this.targetWindow.requestAnimationFrame(() => o(c))) : console.warn(
|
|
396
|
+
`Failed to scroll to index ${e} after ${n} attempts.`
|
|
397
|
+
));
|
|
398
|
+
};
|
|
399
|
+
o(s);
|
|
400
|
+
}, this.scrollBy = (e, { behavior: s } = {}) => {
|
|
401
|
+
s === "smooth" && this.isDynamicMode() && console.warn(
|
|
395
402
|
"The `smooth` scroll behavior is not fully supported with dynamic size."
|
|
396
|
-
), this._scrollToOffset(this.getScrollOffset() +
|
|
403
|
+
), this._scrollToOffset(this.getScrollOffset() + e, {
|
|
397
404
|
adjustments: void 0,
|
|
398
405
|
behavior: s
|
|
399
406
|
});
|
|
400
407
|
}, this.getTotalSize = () => {
|
|
401
|
-
var
|
|
408
|
+
var e;
|
|
402
409
|
const s = this.getMeasurements();
|
|
403
|
-
let
|
|
410
|
+
let t;
|
|
404
411
|
if (s.length === 0)
|
|
405
|
-
|
|
412
|
+
t = this.options.paddingStart;
|
|
406
413
|
else if (this.options.lanes === 1)
|
|
407
|
-
|
|
414
|
+
t = ((e = s[s.length - 1]) == null ? void 0 : e.end) ?? 0;
|
|
408
415
|
else {
|
|
409
416
|
const i = Array(this.options.lanes).fill(null);
|
|
410
417
|
let n = s.length - 1;
|
|
@@ -412,80 +419,80 @@ class N {
|
|
|
412
419
|
const o = s[n];
|
|
413
420
|
i[o.lane] === null && (i[o.lane] = o.end), n--;
|
|
414
421
|
}
|
|
415
|
-
|
|
422
|
+
t = Math.max(...i.filter((o) => o !== null));
|
|
416
423
|
}
|
|
417
424
|
return Math.max(
|
|
418
|
-
|
|
425
|
+
t - this.options.scrollMargin + this.options.paddingEnd,
|
|
419
426
|
0
|
|
420
427
|
);
|
|
421
|
-
}, this._scrollToOffset = (
|
|
428
|
+
}, this._scrollToOffset = (e, {
|
|
422
429
|
adjustments: s,
|
|
423
|
-
behavior:
|
|
430
|
+
behavior: t
|
|
424
431
|
}) => {
|
|
425
|
-
this.options.scrollToFn(
|
|
432
|
+
this.options.scrollToFn(e, { behavior: t, adjustments: s }, this);
|
|
426
433
|
}, this.measure = () => {
|
|
427
434
|
this.itemSizeCache = /* @__PURE__ */ new Map(), this.notify(!1);
|
|
428
|
-
}, this.setOptions(
|
|
435
|
+
}, this.setOptions(a);
|
|
429
436
|
}
|
|
430
437
|
}
|
|
431
|
-
const
|
|
432
|
-
for (; r <=
|
|
433
|
-
const
|
|
438
|
+
const x = (r, a, e, s) => {
|
|
439
|
+
for (; r <= a; ) {
|
|
440
|
+
const t = (r + a) / 2 | 0, i = e(t);
|
|
434
441
|
if (i < s)
|
|
435
|
-
r =
|
|
442
|
+
r = t + 1;
|
|
436
443
|
else if (i > s)
|
|
437
|
-
|
|
444
|
+
a = t - 1;
|
|
438
445
|
else
|
|
439
|
-
return
|
|
446
|
+
return t;
|
|
440
447
|
}
|
|
441
448
|
return r > 0 ? r - 1 : 0;
|
|
442
449
|
};
|
|
443
|
-
function
|
|
450
|
+
function R({
|
|
444
451
|
measurements: r,
|
|
445
|
-
outerSize:
|
|
446
|
-
scrollOffset:
|
|
452
|
+
outerSize: a,
|
|
453
|
+
scrollOffset: e,
|
|
447
454
|
lanes: s
|
|
448
455
|
}) {
|
|
449
|
-
const
|
|
456
|
+
const t = r.length - 1, i = (h) => r[h].start;
|
|
450
457
|
if (r.length <= s)
|
|
451
458
|
return {
|
|
452
459
|
startIndex: 0,
|
|
453
|
-
endIndex:
|
|
460
|
+
endIndex: t
|
|
454
461
|
};
|
|
455
|
-
let n =
|
|
462
|
+
let n = x(
|
|
456
463
|
0,
|
|
457
|
-
|
|
464
|
+
t,
|
|
458
465
|
i,
|
|
459
|
-
|
|
466
|
+
e
|
|
460
467
|
), o = n;
|
|
461
468
|
if (s === 1)
|
|
462
|
-
for (; o <
|
|
469
|
+
for (; o < t && r[o].end < e + a; )
|
|
463
470
|
o++;
|
|
464
471
|
else if (s > 1) {
|
|
465
|
-
const
|
|
466
|
-
for (; o <
|
|
472
|
+
const h = Array(s).fill(0);
|
|
473
|
+
for (; o < t && h.some((l) => l < e + a); ) {
|
|
467
474
|
const l = r[o];
|
|
468
|
-
|
|
475
|
+
h[l.lane] = l.end, o++;
|
|
469
476
|
}
|
|
470
|
-
const c = Array(s).fill(
|
|
471
|
-
for (; n >= 0 && c.some((l) => l >=
|
|
477
|
+
const c = Array(s).fill(e + a);
|
|
478
|
+
for (; n >= 0 && c.some((l) => l >= e); ) {
|
|
472
479
|
const l = r[n];
|
|
473
480
|
c[l.lane] = l.start, n--;
|
|
474
481
|
}
|
|
475
|
-
n = Math.max(0, n - n % s), o = Math.min(
|
|
482
|
+
n = Math.max(0, n - n % s), o = Math.min(t, o + (s - 1 - o % s));
|
|
476
483
|
}
|
|
477
484
|
return { startIndex: n, endIndex: o };
|
|
478
485
|
}
|
|
479
486
|
export {
|
|
480
|
-
|
|
487
|
+
W as Virtualizer,
|
|
481
488
|
M as approxEqual,
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
489
|
+
z as debounce,
|
|
490
|
+
w as defaultKeyExtractor,
|
|
491
|
+
I as defaultRangeExtractor,
|
|
492
|
+
N as elementScroll,
|
|
486
493
|
C as measureElement,
|
|
487
494
|
f as memo,
|
|
488
495
|
v as notUndefined,
|
|
489
|
-
|
|
490
|
-
|
|
496
|
+
F as observeElementOffset,
|
|
497
|
+
A as observeElementRect
|
|
491
498
|
};
|