@bigbinary/neeto-site-blocks 1.6.1 → 1.6.2
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/index.cjs.js +19 -11
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +18 -10
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5,8 +5,8 @@ import _extends$2 from '@babel/runtime/helpers/extends';
|
|
|
5
5
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
6
6
|
import _defineProperty$1 from '@babel/runtime/helpers/defineProperty';
|
|
7
7
|
import { isNotPresent, isNotEmpty } from '@bigbinary/neeto-cist';
|
|
8
|
-
import _taggedTemplateLiteral from '@babel/runtime/helpers/taggedTemplateLiteral';
|
|
9
8
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
9
|
+
import _taggedTemplateLiteral from '@babel/runtime/helpers/taggedTemplateLiteral';
|
|
10
10
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
11
11
|
import { useFrame } from 'react-frame-component';
|
|
12
12
|
import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
|
|
@@ -14203,20 +14203,27 @@ var DropdownWrapper = styled.div(function (_ref) {
|
|
|
14203
14203
|
var index = _ref.index,
|
|
14204
14204
|
height = _ref.height,
|
|
14205
14205
|
totalLength = _ref.totalLength;
|
|
14206
|
+
var _useState = useState(0),
|
|
14207
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
14208
|
+
cumulativeWidth = _useState2[0],
|
|
14209
|
+
setCumulativeWidth = _useState2[1];
|
|
14206
14210
|
var _useFrame = useFrame(),
|
|
14207
14211
|
iframeDocument = _useFrame.document;
|
|
14208
14212
|
var _useBreakpoints = useBreakpoints$1(),
|
|
14209
14213
|
currentSize = _useBreakpoints.currentSize;
|
|
14210
14214
|
|
|
14211
14215
|
// Calculate cumulative width of dropdowns with buffer
|
|
14212
|
-
|
|
14213
|
-
|
|
14214
|
-
var
|
|
14215
|
-
|
|
14216
|
-
|
|
14216
|
+
useEffect(function () {
|
|
14217
|
+
var cumulativeWidth = 0;
|
|
14218
|
+
for (var i = totalLength - 1; i > index; i--) {
|
|
14219
|
+
var dropdown = (iframeDocument !== null && iframeDocument !== void 0 ? iframeDocument : document).getElementById("dropdown-".concat(i));
|
|
14220
|
+
if (dropdown) {
|
|
14221
|
+
cumulativeWidth += dropdown.offsetWidth + 15; // buffer width
|
|
14222
|
+
}
|
|
14217
14223
|
}
|
|
14218
|
-
}
|
|
14219
14224
|
|
|
14225
|
+
setCumulativeWidth(cumulativeWidth);
|
|
14226
|
+
}, []);
|
|
14220
14227
|
var isLargeScreen = currentSize === "desktop" || currentSize === "largeDesktop";
|
|
14221
14228
|
return isLargeScreen ? {
|
|
14222
14229
|
right: cumulativeWidth,
|
|
@@ -15818,9 +15825,9 @@ var useBreakpoints = function useBreakpoints(breakpointOverrides) {
|
|
|
15818
15825
|
var _useFrame = useFrame(),
|
|
15819
15826
|
iframeWindow = _useFrame.window;
|
|
15820
15827
|
var getSnapshot = function getSnapshot() {
|
|
15821
|
-
return getCurrentSize(iframeWindow !== null && iframeWindow !== void 0 ? iframeWindow : window, breakpointOverrides);
|
|
15828
|
+
return typeof window !== "undefined" ? getCurrentSize(iframeWindow !== null && iframeWindow !== void 0 ? iframeWindow : window, breakpointOverrides) : getCurrentSize({}, breakpointOverrides);
|
|
15822
15829
|
};
|
|
15823
|
-
var currentSize = useSyncExternalStore(subscribe, getSnapshot);
|
|
15830
|
+
var currentSize = useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
|
|
15824
15831
|
return {
|
|
15825
15832
|
currentSize: currentSize,
|
|
15826
15833
|
isSize: equals(currentSize)
|
|
@@ -41819,13 +41826,14 @@ var HeaderWithDropdownLinks = function HeaderWithDropdownLinks(_ref) {
|
|
|
41819
41826
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
41820
41827
|
ref: headerIntersectorRef
|
|
41821
41828
|
}), /*#__PURE__*/React__default.createElement("div", {
|
|
41829
|
+
className: "relative z-10",
|
|
41822
41830
|
ref: headerRef
|
|
41823
41831
|
}, /*#__PURE__*/React__default.createElement(BlockWrapper, {
|
|
41824
41832
|
id: id,
|
|
41825
41833
|
design: design.body,
|
|
41826
41834
|
nestedClassName: baseClasses,
|
|
41827
41835
|
nestedComponent: StyledWrapper,
|
|
41828
|
-
className: classnames(
|
|
41836
|
+
className: classnames({
|
|
41829
41837
|
"neeto-site-sticky-header": position === "sticky",
|
|
41830
41838
|
"neeto-site-sticky-header--scroll": !isHeadingWrapperVisible
|
|
41831
41839
|
}, className)
|