@uniweb/core 1.6.5 → 1.6.6

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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/src/block.js +18 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniweb/core",
3
- "version": "1.6.5",
3
+ "version": "1.6.6",
4
4
  "description": "Core classes for the Uniweb platform - Uniweb, Website, Page, Block",
5
5
  "type": "module",
6
6
  "exports": {
@@ -54,7 +54,7 @@
54
54
  },
55
55
  "dependencies": {
56
56
  "@uniweb/semantic-parser": "~1.13.2",
57
- "@uniweb/theming": "~1.2.1"
57
+ "@uniweb/theming": "~1.3.0"
58
58
  },
59
59
  "scripts": {
60
60
  "test": "vitest run"
package/src/block.js CHANGED
@@ -108,7 +108,7 @@ export default class Block {
108
108
  // publishes the envelope. Either name is an ordinary param now.
109
109
  const {
110
110
  theme: rawTheme, background: rawBg, grid: gridParam, vars: varsParam, fetch: fetchParam,
111
- sticky: stickyParam,
111
+ sticky: stickyParam, underHeader: underHeaderParam,
112
112
  ...componentParams
113
113
  } = blockConfig
114
114
  this.properties = componentParams
@@ -123,6 +123,14 @@ export default class Block {
123
123
  // How far below the top it stays — its type's `top`, a CSS length; null is the very top.
124
124
  this.stickyTop = null
125
125
 
126
+ // Whether the header lies over the section when it opens a page — what the author wrote
127
+ // (`true` or `false`), else its type's `underHeader` from `meta.js`, which `initComponent`
128
+ // reads. The runtime lays the header's box over it (`under-header.js`, 2026-11-06).
129
+ this.underHeaderSetting = typeof underHeaderParam === 'boolean' ? underHeaderParam : null
130
+ this.underHeader = this.underHeaderSetting ?? false
131
+ // A header type's height before the browser measures it — its `meta.js` `height`, a CSS length.
132
+ this.height = null
133
+
126
134
  // The section's theme: `theme.yml`'s own keys scoped to the section — `colors`,
127
135
  // `contexts`, `vars` — plus `mode`, the color context it pins. `theme: dark` is the
128
136
  // shorthand for `{ mode: dark }`, and a token written beside `mode` applies to the section
@@ -544,6 +552,10 @@ export default class Block {
544
552
  this.sticky = this.stickySetting ?? sticky.default
545
553
  this.stickyTop = sticky.top
546
554
 
555
+ // The type's `underHeader` and `height` — the author's `underHeader` wins.
556
+ this.underHeader = this.underHeaderSetting ?? meta.underHeader === true
557
+ this.height = typeof meta.height === 'string' && meta.height.trim() ? meta.height.trim() : null
558
+
547
559
  return this.Component
548
560
  }
549
561
 
@@ -639,7 +651,7 @@ export default class Block {
639
651
  * Get information about this block for cross-component communication.
640
652
  * Other components (like NavBar) can use this to adapt their behavior.
641
653
  *
642
- * @returns {Object} Block info: { type, theme, state, context }
654
+ * @returns {Object} Block info: { type, theme, contextOverrides, state, context, underHeader }
643
655
  */
644
656
  getBlockInfo() {
645
657
  return {
@@ -647,7 +659,10 @@ export default class Block {
647
659
  theme: this.themeName,
648
660
  contextOverrides: this.contextOverrides,
649
661
  state: this.state,
650
- context: this.context
662
+ context: this.context,
663
+ // Whether the header lies over this section when it opens a page: a header reads it on its
664
+ // next block, the page's first section, to paint itself see-through.
665
+ underHeader: this.underHeader
651
666
  }
652
667
  }
653
668