|
| 1 | +diff --git a/node_modules/downshift/dist/downshift.cjs.js b/node_modules/downshift/dist/downshift.cjs.js |
| 2 | +index d8f532e..ed79cf4 100644 |
| 3 | +--- a/node_modules/downshift/dist/downshift.cjs.js |
| 4 | ++++ b/node_modules/downshift/dist/downshift.cjs.js |
| 5 | +@@ -8,7 +8,8 @@ var _inheritsLoose = require('@babel/runtime/helpers/inheritsLoose'); |
| 6 | + var PropTypes = require('prop-types'); |
| 7 | + var React = require('react'); |
| 8 | + var reactIs = require('react-is'); |
| 9 | +-var computeScrollIntoView = require('compute-scroll-into-view'); |
| 10 | ++var _csiv = require('compute-scroll-into-view'); |
| 11 | ++var computeScrollIntoView = _csiv; |
| 12 | + var tslib = require('tslib'); |
| 13 | + |
| 14 | + var idCounter = 0; |
| 15 | +@@ -35,7 +36,20 @@ function scrollIntoView(node, menuNode) { |
| 16 | + if (!node) { |
| 17 | + return; |
| 18 | + } |
| 19 | +- var actions = computeScrollIntoView.compute(node, { |
| 20 | ++ // Defensively resolve the compute function across any webpack ESM/CJS interop shape: |
| 21 | ++ // v3 named export: { compute: fn }, v2 default function export: fn, |
| 22 | ++ // webpack harmony namespace: { default: { compute: fn } } or { default: fn } |
| 23 | ++ var computeFn = |
| 24 | ++ (computeScrollIntoView && typeof computeScrollIntoView.compute === 'function' && computeScrollIntoView.compute) || |
| 25 | ++ (computeScrollIntoView && computeScrollIntoView.default && typeof computeScrollIntoView.default.compute === 'function' && computeScrollIntoView.default.compute) || |
| 26 | ++ (computeScrollIntoView && typeof computeScrollIntoView.default === 'function' && computeScrollIntoView.default) || |
| 27 | ++ (typeof computeScrollIntoView === 'function' && computeScrollIntoView); |
| 28 | ++ if (typeof computeFn !== 'function') { |
| 29 | ++ // Native fallback – keeps the UI functional even if interop fails |
| 30 | ++ node.scrollIntoView && node.scrollIntoView({ block: 'nearest', inline: 'nearest' }); |
| 31 | ++ return; |
| 32 | ++ } |
| 33 | ++ var actions = computeFn(node, { |
| 34 | + boundary: menuNode, |
| 35 | + block: 'nearest', |
| 36 | + scrollMode: 'if-needed' |
| 37 | +diff --git a/node_modules/downshift/dist/downshift.esm.js b/node_modules/downshift/dist/downshift.esm.js |
| 38 | +index 22d454e..ffb397d 100644 |
| 39 | +--- a/node_modules/downshift/dist/downshift.esm.js |
| 40 | ++++ b/node_modules/downshift/dist/downshift.esm.js |
| 41 | +@@ -4,9 +4,16 @@ import _inheritsLoose from '@babel/runtime/helpers/esm/inheritsLoose'; |
| 42 | + import PropTypes from 'prop-types'; |
| 43 | + import React, { cloneElement, Component, useRef, useEffect, useLayoutEffect, useCallback, useReducer, useMemo } from 'react'; |
| 44 | + import { isForwardRef } from 'react-is'; |
| 45 | +-import { compute } from 'compute-scroll-into-view'; |
| 46 | ++import * as _csivm from 'compute-scroll-into-view'; |
| 47 | + import { __assign } from 'tslib'; |
| 48 | + |
| 49 | ++// Defensively resolve compute across any webpack ESM/CJS interop shape |
| 50 | ++var _compute = |
| 51 | ++ (typeof _csivm.compute === 'function' && _csivm.compute) || |
| 52 | ++ (_csivm.default && typeof _csivm.default.compute === 'function' && _csivm.default.compute) || |
| 53 | ++ (typeof _csivm.default === 'function' && _csivm.default) || |
| 54 | ++ (typeof _csivm === 'function' && _csivm); |
| 55 | ++ |
| 56 | + var idCounter = 0; |
| 57 | + |
| 58 | + /** |
| 59 | +@@ -31,7 +38,11 @@ function scrollIntoView(node, menuNode) { |
| 60 | + if (!node) { |
| 61 | + return; |
| 62 | + } |
| 63 | +- var actions = compute(node, { |
| 64 | ++ if (typeof _compute !== 'function') { |
| 65 | ++ node.scrollIntoView && node.scrollIntoView({ block: 'nearest', inline: 'nearest' }); |
| 66 | ++ return; |
| 67 | ++ } |
| 68 | ++ var actions = _compute(node, { |
| 69 | + boundary: menuNode, |
| 70 | + block: 'nearest', |
| 71 | + scrollMode: 'if-needed' |
0 commit comments