@zubra/runtime 5.10.3 → 5.12.0

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.
@@ -848,7 +848,12 @@ function filledSignal(filled, name) {
848
848
  * <zb-if test={hasFooter}><footer><zb-slot name="footer"></zb-slot></footer></zb-if>
849
849
  */
850
850
  export function hasSlot(name = 'default') {
851
- return filledSignal(hooks('hasSlot').filled, name);
851
+ const component = hooks('hasSlot');
852
+ const filled = filledSignal(component.filled, name);
853
+ // The server rendered with this slot filled (`data-zb-filled`): start from that, so hydrating
854
+ // keeps the markup it wrapped around the slot. The slot's own content takes over once bound.
855
+ if (component.host?.getAttribute('data-zb-filled')?.split(' ').includes(name)) filled.set(true);
856
+ return filled;
852
857
  }
853
858
 
854
859
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zubra/runtime",
3
- "version": "5.10.3",
3
+ "version": "5.12.0",
4
4
  "description": "Browser runtime for Zubra compiled components, built on the TC39 Signals API",
5
5
  "license": "ISC",
6
6
  "repository": {
package/src/element.js CHANGED
@@ -876,7 +876,12 @@ function filledSignal(filled, name) {
876
876
  * <zb-if test={hasFooter}><footer><zb-slot name="footer"></zb-slot></footer></zb-if>
877
877
  */
878
878
  export function hasSlot(name = 'default') {
879
- return filledSignal(hooks('hasSlot').filled, name);
879
+ const component = hooks('hasSlot');
880
+ const filled = filledSignal(component.filled, name);
881
+ // The server rendered with this slot filled (`data-zb-filled`): start from that, so hydrating
882
+ // keeps the markup it wrapped around the slot. The slot's own content takes over once bound.
883
+ if (component.host?.getAttribute('data-zb-filled')?.split(' ').includes(name)) filled.set(true);
884
+ return filled;
880
885
  }
881
886
 
882
887
  /**