@uniweb/runtime 1.5.2 → 1.5.3
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/ssr.js +4 -6
- package/dist/ssr.js.map +1 -1
- package/package.json +3 -3
- package/src/sticky-top.js +4 -7
- package/src/under-header.js +15 -6
package/dist/ssr.js
CHANGED
|
@@ -436,13 +436,11 @@ function areaWrapperProps(region, transitions, layers, sticky = null) {
|
|
|
436
436
|
if (!style) return null;
|
|
437
437
|
return sticky ? { style, "data-uw-sticky": "area" } : { style };
|
|
438
438
|
}
|
|
439
|
-
const
|
|
440
|
-
const MEASURED_HEADER_HEIGHT = "--uw-header-measured";
|
|
439
|
+
const DECLARED_HEADER_HEIGHT = "--uw-header-declared";
|
|
441
440
|
function headerOverlay(page) {
|
|
442
441
|
const first = page?.getBodyBlocks?.()?.[0];
|
|
443
|
-
if (!first?.
|
|
444
|
-
const header = page.getLayoutAreas
|
|
445
|
-
if (!Array.isArray(header) || header.length === 0) return null;
|
|
442
|
+
if (!first?.liesUnderHeader?.()) return null;
|
|
443
|
+
const header = page.getLayoutAreas().header;
|
|
446
444
|
const heights = header.map((block) => block?.height).filter(Boolean);
|
|
447
445
|
const height = heights.length === 0 ? "0px" : heights.length === 1 ? heights[0] : `calc(${heights.join(" + ")})`;
|
|
448
446
|
return { height };
|
|
@@ -459,7 +457,7 @@ function headerAreaProps(wrapper, overlay) {
|
|
|
459
457
|
}
|
|
460
458
|
function underHeaderProps(overlay) {
|
|
461
459
|
return {
|
|
462
|
-
style: { [
|
|
460
|
+
style: { [DECLARED_HEADER_HEIGHT]: overlay.height },
|
|
463
461
|
"data-uw-under-header": ""
|
|
464
462
|
};
|
|
465
463
|
}
|