@uniweb/runtime 1.5.1 → 1.5.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/ssr.js CHANGED
@@ -450,6 +450,13 @@ function headerOverlay(page) {
450
450
  function overlayBoxProps(props) {
451
451
  return { ...props || {}, style: { ...props?.style || {}, height: 0, minHeight: 0 }, "data-uw-header": "over" };
452
452
  }
453
+ function headerAreaProps(wrapper, overlay) {
454
+ const { viewTransitionName, ...style } = wrapper?.style || {};
455
+ const inner = viewTransitionName ? { style: { viewTransitionName } } : null;
456
+ const base = { ...wrapper || {}, style };
457
+ if (overlay) return { outer: overlayBoxProps(base), inner };
458
+ return { outer: Object.keys(style).length ? base : { ...base, style: { display: "contents" } }, inner };
459
+ }
453
460
  function underHeaderProps(overlay) {
454
461
  return {
455
462
  style: { [HEADER_HEIGHT]: `var(${MEASURED_HEADER_HEIGHT}, ${overlay.height})` },
@@ -642,8 +649,11 @@ function renderLayout(page, website) {
642
649
  const layers = resolveLayoutLayers(areaNames, layoutMeta?.layers, sticky);
643
650
  const overlay = headerOverlay(page);
644
651
  const wrapArea = (name, element) => {
645
- let props = areaWrapperProps(name, transitions, layers, RemoteLayout ? sticky[name] : null);
646
- if (overlay && RemoteLayout && name === "header") props = overlayBoxProps(props);
652
+ const props = areaWrapperProps(name, transitions, layers, RemoteLayout ? sticky[name] : null);
653
+ if (RemoteLayout && name === "header") {
654
+ const { outer, inner } = headerAreaProps(props, overlay);
655
+ return React.createElement("div", outer, inner ? React.createElement("div", inner, element) : element);
656
+ }
647
657
  return props ? React.createElement("div", props, element) : element;
648
658
  };
649
659
  const bodyElement = bodyBlocks ? wrapArea("body", renderBlocks(bodyBlocks, { stickySelf: "section" })) : null;